@@ -14,7 +14,7 @@ import (
1414var initialSettingItems []model.SettingItem
1515
1616func initSettings () {
17- initialSettings ()
17+ InitialSettings ()
1818 // check deprecated
1919 settings , err := db .GetSettingItems ()
2020 if err != nil {
@@ -58,7 +58,7 @@ func isActive(key string) bool {
5858 return false
5959}
6060
61- func initialSettings () {
61+ func InitialSettings () []model. SettingItem {
6262 var token string
6363 if flags .Dev {
6464 token = "dev_token"
@@ -105,6 +105,7 @@ func initialSettings() {
105105 {Key : conf .VideoAutoplay , Value : "true" , Type : conf .TypeBool , Group : model .PREVIEW },
106106 // global settings
107107 {Key : conf .HideFiles , Value : "/\\ /README.md/i" , Type : conf .TypeText , Group : model .GLOBAL },
108+ {Key : "package_download" , Value : "true" , Type : conf .TypeBool , Group : model .GLOBAL },
108109 {Key : conf .GlobalReadme , Value : "This is global readme" , Type : conf .TypeText , Group : model .GLOBAL },
109110 {Key : conf .CustomizeHead , Type : conf .TypeText , Group : model .GLOBAL , Flag : model .PRIVATE },
110111 {Key : conf .CustomizeBody , Type : conf .TypeText , Group : model .GLOBAL , Flag : model .PRIVATE },
@@ -119,6 +120,11 @@ func initialSettings() {
119120 {Key : conf .Token , Value : token , Type : conf .TypeString , Group : model .SINGLE , Flag : model .PRIVATE },
120121 }
121122 if flags .Dev {
122- initialSettingItems = append (initialSettingItems , model.SettingItem {Key : "test_deprecated" , Value : "test_value" , Type : conf .TypeString , Flag : model .DEPRECATED })
123+ initialSettingItems = append (initialSettingItems , []model.SettingItem {
124+ {Key : "test_deprecated" , Value : "test_value" , Type : conf .TypeString , Flag : model .DEPRECATED },
125+ {Key : "test_options" , Value : "a" , Type : conf .TypeSelect , Options : "a,b,c" },
126+ {Key : "test_help" , Type : conf .TypeString , Help : "this is a help message" },
127+ }... )
123128 }
129+ return initialSettingItems
124130}
0 commit comments