From 20c906c8cc594022608855d020326dd25c96cbcb Mon Sep 17 00:00:00 2001 From: NanamiAdmin Date: Thu, 30 Apr 2026 18:54:36 +0800 Subject: [PATCH] fix(settings): fill support for additional configuration options --- handlers/settings.go | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/handlers/settings.go b/handlers/settings.go index 85a754e..604dfb6 100644 --- a/handlers/settings.go +++ b/handlers/settings.go @@ -115,6 +115,50 @@ func SetSettingsHandler(w http.ResponseWriter, r *http.Request) { if v, ok := value.(float64); ok { global.CurrentConfig.ListenPort = fmt.Sprintf("%d", int(v)) } + case "FrpcPath": + if v, ok := value.(string); ok { + global.CurrentConfig.FrpcPath = v + } + case "InstancePath": + if v, ok := value.(string); ok { + global.CurrentConfig.InstancePath = v + } + case "Debug": + if v, ok := value.(bool); ok { + global.CurrentConfig.Debug = v + } + case "Watchdog.Enabled": + if v, ok := value.(bool); ok { + global.CurrentConfig.Watchdog.Enabled = v + } + case "Watchdog.Port": + if v, ok := value.(float64); ok { + global.CurrentConfig.Watchdog.Port = int(v) + } + case "Notification.Enabled": + if v, ok := value.(bool); ok { + global.CurrentConfig.Notification.Enabled = v + } + case "Notification.Method": + if v, ok := value.(string); ok { + global.CurrentConfig.Notification.Method = v + } + case "Webhook.Method": + if v, ok := value.(string); ok { + global.CurrentConfig.Webhook.Method = v + } + case "Webhook.URL": + if v, ok := value.(string); ok { + global.CurrentConfig.Webhook.URL = v + } + case "Webhook.Headers": + if v, ok := value.(string); ok { + global.CurrentConfig.Webhook.Headers = v + } + case "Webhook.Body": + if v, ok := value.(string); ok { + global.CurrentConfig.Webhook.Body = v + } default: postLog.Warning(fmt.Sprintf("[SetSettingsHandler] Unknown setting key: %s", key)) }