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", Key: "title",
Value: "Alist", Value: "Alist",
Description: "title", Description: "title",
Type: "string",
Group: model.PUBLIC, Group: model.PUBLIC,
}, },
{ {
Key: "password", Key: "password",
Value: "alist", Value: "alist",
Description: "password", Description: "password",
Type: "string",
Group: model.PRIVATE, Group: model.PRIVATE,
}, },
{ {
Key: "logo", Key: "logo",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png", Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "logo", Description: "logo",
Type: "string",
Group: model.PUBLIC, Group: model.PUBLIC,
}, },
{ {
Key: "favicon", Key: "favicon",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png", Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "favicon", Description: "favicon",
Type: "string",
Group: model.PUBLIC, Group: model.PUBLIC,
}, },
{ {
Key: "icon color", Key: "icon color",
Value: "teal.300", Value: "teal.300",
Description: "icon's color", Description: "icon's color",
Type: "string",
Group: model.PUBLIC, Group: model.PUBLIC,
}, },
{ {
Key: "text types", 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", 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", Description: "text type extensions",
}, },
{ {
Key: "readme file", Key: "hide readme file",
Value: "hide", Value: "true",
Description: "hide readme file? (show/hide)", Type: "bool",
Description: "hide readme file? ",
}, },
{ {
Key: "music cover", Key: "music cover",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png", Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "music cover image", Description: "music cover image",
Type: "string",
Group: model.PUBLIC, Group: model.PUBLIC,
}, },
{ {
Key: "site beian", Key: "site beian",
Description: "chinese beian info", Description: "chinese beian info",
Type: "string",
Group: model.PUBLIC, Group: model.PUBLIC,
}, },
{ {
Key: "home readme url", Key: "home readme url",
Description: "when have multiple, the readme file to show", Description: "when have multiple, the readme file to show",
Type: "string",
Group: model.PUBLIC, Group: model.PUBLIC,
}, },
{ {
Key: "markdown theme", Key: "markdown theme",
Value: "vuepress", Value: "vuepress",
Description: "default | github | vuepress", Description: "default | github | vuepress",
Group: model.PUBLIC, Group: model.PUBLIC,
Type: "select",
Values: "default,github,vuepress",
}, },
} }
for _, v := range settings { 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 { func (a AliDrive) Items() []Item {
return []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", Name: "refresh_token",
Label: "refresh token", Label: "refresh token",

View File

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