2022-06-27 14:51:48 +08:00
|
|
|
package model
|
|
|
|
|
2022-06-27 15:51:02 +08:00
|
|
|
const (
|
2022-12-05 16:45:11 +08:00
|
|
|
SINGLE = iota
|
|
|
|
SITE
|
2022-06-27 15:51:02 +08:00
|
|
|
STYLE
|
|
|
|
PREVIEW
|
|
|
|
GLOBAL
|
2023-11-06 16:56:55 +08:00
|
|
|
OFFLINE_DOWNLOAD
|
2022-12-05 16:45:11 +08:00
|
|
|
INDEX
|
2023-03-02 17:55:33 +08:00
|
|
|
SSO
|
2023-12-31 13:46:13 +08:00
|
|
|
LDAP
|
2024-03-02 15:35:10 +08:00
|
|
|
S3
|
2024-12-10 20:17:46 +08:00
|
|
|
FTP
|
2025-02-16 12:22:11 +08:00
|
|
|
TRAFFIC
|
2022-06-27 15:51:02 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
PUBLIC = iota
|
|
|
|
PRIVATE
|
|
|
|
READONLY
|
|
|
|
DEPRECATED
|
|
|
|
)
|
|
|
|
|
2022-06-27 14:51:48 +08:00
|
|
|
type SettingItem struct {
|
2024-03-05 16:29:26 +08:00
|
|
|
Key string `json:"key" gorm:"primaryKey" binding:"required"` // unique key
|
|
|
|
Value string `json:"value"` // value
|
|
|
|
PreDefault string `json:"-" gorm:"-:all"` // deprecated value
|
|
|
|
Help string `json:"help"` // help message
|
|
|
|
Type string `json:"type"` // string, number, bool, select
|
|
|
|
Options string `json:"options"` // values for select
|
|
|
|
Group int `json:"group"` // use to group setting in frontend
|
|
|
|
Flag int `json:"flag"` // 0 = public, 1 = private, 2 = readonly, 3 = deprecated, etc.
|
2024-08-03 13:11:09 +08:00
|
|
|
Index uint `json:"index"`
|
2022-06-27 17:06:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s SettingItem) IsDeprecated() bool {
|
|
|
|
return s.Flag == DEPRECATED
|
2022-06-27 14:51:48 +08:00
|
|
|
}
|