feat: Introduce a new monitoring and configuration dashboard with backend API for autopool management and S2A integration.
This commit is contained in:
@@ -39,6 +39,9 @@ type Config struct {
|
||||
DefaultProxy string `json:"default_proxy"`
|
||||
TeamRegProxy string `json:"team_reg_proxy"` // Team 注册使用的代理
|
||||
|
||||
// 授权方式配置
|
||||
AuthMethod string `json:"auth_method"` // "api" 或 "browser"
|
||||
|
||||
// 自动化配置
|
||||
AutoPauseOnExpired bool `json:"auto_pause_on_expired"`
|
||||
AccountsPath string `json:"accounts_path"`
|
||||
@@ -181,6 +184,11 @@ func InitFromDB() *Config {
|
||||
if v, _ := configDB.GetConfig("site_name"); v != "" {
|
||||
cfg.SiteName = v
|
||||
}
|
||||
if v, _ := configDB.GetConfig("auth_method"); v != "" {
|
||||
cfg.AuthMethod = v
|
||||
} else {
|
||||
cfg.AuthMethod = "browser" // 默认使用浏览器模式
|
||||
}
|
||||
|
||||
Global = cfg
|
||||
return cfg
|
||||
@@ -222,6 +230,10 @@ func SaveToDB() error {
|
||||
configDB.SetConfig("site_name", cfg.SiteName)
|
||||
}
|
||||
|
||||
if cfg.AuthMethod != "" {
|
||||
configDB.SetConfig("auth_method", cfg.AuthMethod)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user