feat(settings): add LogsPath to GetSettingsHandler and SetSettingsHandler

This commit is contained in:
2026-05-22 17:36:31 +08:00
parent a2d1dada2c
commit 2aa601dd87
+7
View File
@@ -33,6 +33,8 @@ func GetSettingsHandler(w http.ResponseWriter, r *http.Request) {
value = global.CurrentConfig.FrpcPath
case "InstancePath":
value = global.CurrentConfig.InstancePath
case "LogsPath":
value = global.CurrentConfig.LogsPath
case "Debug":
value = global.CurrentConfig.Debug
case "Watchdog.Enabled":
@@ -64,6 +66,7 @@ func GetSettingsHandler(w http.ResponseWriter, r *http.Request) {
"ListenPort": global.CurrentConfig.ListenPort,
"FrpcPath": global.CurrentConfig.FrpcPath,
"InstancePath": global.CurrentConfig.InstancePath,
"LogsPath": global.CurrentConfig.LogsPath,
"Debug": global.CurrentConfig.Debug,
"Watchdog.Enabled": global.CurrentConfig.Watchdog.Enabled,
"Notification.Enabled": global.CurrentConfig.Notification.Enabled,
@@ -120,6 +123,10 @@ func SetSettingsHandler(w http.ResponseWriter, r *http.Request) {
if v, ok := value.(string); ok {
global.CurrentConfig.InstancePath = v
}
case "LogsPath":
if v, ok := value.(string); ok {
global.CurrentConfig.LogsPath = v
}
case "Debug":
if v, ok := value.(bool); ok {
global.CurrentConfig.Debug = v