change settings

pull/548/head
微凉 2021-11-12 19:39:01 +08:00
parent 98c017730f
commit 2c675ae909
3 changed files with 34 additions and 7 deletions

View File

@ -119,63 +119,75 @@ func initSettings() {
Key: "title",
Value: "Alist",
Description: "title",
Type: "string",
Group: model.PUBLIC,
},
{
Key: "password",
Value: "alist",
Description: "password",
Type: "string",
Group: model.PRIVATE,
},
{
Key: "logo",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "logo",
Type: "string",
Group: model.PUBLIC,
},
{
Key: "favicon",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "favicon",
Type: "string",
Group: model.PUBLIC,
},
{
Key: "icon color",
Value: "teal.300",
Description: "icon's color",
Type: "string",
Group: model.PUBLIC,
},
{
Key: "text types",
Value: "txt,htm,html,xml,java,properties,sql,js,md,json,conf,ini,vue,php,py,bat,gitignore,yml,go,sh,c,cpp,h,hpp",
Type: "string",
Description: "text type extensions",
},
{
Key: "readme file",
Value: "hide",
Description: "hide readme file? (show/hide)",
Key: "hide readme file",
Value: "true",
Type: "bool",
Description: "hide readme file? ",
},
{
Key: "music cover",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "music cover image",
Type: "string",
Group: model.PUBLIC,
},
{
Key: "site beian",
Description: "chinese beian info",
Type: "string",
Group: model.PUBLIC,
},
{
Key: "home readme url",
Description: "when have multiple, the readme file to show",
Type: "string",
Group: model.PUBLIC,
},
{
Key: "markdown theme",
Value: "vuepress",
Key: "markdown theme",
Value: "vuepress",
Description: "default | github | vuepress",
Group: model.PUBLIC,
Group: model.PUBLIC,
Type: "select",
Values: "default,github,vuepress",
},
}
for _, v := range settings {

View File

@ -67,6 +67,20 @@ func (a AliDrive) Preview(path string, account *model.Account) (interface{}, err
func (a AliDrive) Items() []Item {
return []Item{
{
Name: "order_by",
Label: "order_by",
Type: "select",
Values: "name,size,updated_at,created_at",
Required: false,
},
{
Name: "order_direction",
Label: "order_direction",
Type: "select",
Values: "ASC,DESC",
Required: false,
},
{
Name: "refresh_token",
Label: "refresh token",

View File

@ -14,8 +14,9 @@ type SettingItem struct {
Key string `json:"key" gorm:"primaryKey" validate:"required"`
Value string `json:"value"`
Description string `json:"description"`
//Type string `json:"type"`
Type string `json:"type"`
Group int `json:"group"`
Values string `json:"values"`
}
func SaveSettings(items []SettingItem) error {