chore: change fs get and list resp
This commit is contained in:
@ -12,6 +12,7 @@ import (
|
||||
var initialSettingItems = []model.SettingItem{
|
||||
// site settings
|
||||
{Key: "version", Value: conf.Version, Type: conf.TypeString, Group: model.SITE, Flag: model.READONLY},
|
||||
{Key: "base_url", Value: "", Type: conf.TypeString, Group: model.SITE},
|
||||
{Key: "site_title", Value: "AList", Type: conf.TypeString, Group: model.SITE},
|
||||
{Key: "site_logo", Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.SITE},
|
||||
{Key: "favicon", Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.SITE},
|
||||
|
@ -5,8 +5,15 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func GetByKey(key string) string {
|
||||
return db.GetSettingsMap()[key]
|
||||
func GetByKey(key string, defaultValue ...string) string {
|
||||
val, ok := db.GetSettingsMap()[key]
|
||||
if !ok {
|
||||
if len(defaultValue) > 0 {
|
||||
return defaultValue[0]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
func GetIntSetting(key string, defaultVal int) int {
|
||||
|
Reference in New Issue
Block a user