feat(webui): global-config settings tab + /api/global-config
Adds a '全局配置' Settings tab that edits config/snowluma.json — the rkey fallback-server list and the deployment-wide musicSignUrl — backed by a new bearer-gated GET/POST /api/global-config (load/saveGlobalSettings, then oneBotManager.reloadGlobalSettings to hot-apply to live instances). The panel reuses the established settings-panel idiom (Input/Button/Label, debounced auto-save, flash); rkey servers are an inline add/remove list with client-side http(s) validation hints. It deliberately does not reconcile inputs from the server's normalized response (would erase a half-typed URL); a load-failure shows an error+retry, and the save toast says '无效项已忽略' when the server would drop an entry. Removes the now-dead per-UIN musicSignUrl form (moved to global in Phase 2). Phase 3 of the global-settings split (nav grouping is Phase 4).
This commit is contained in:
9 files changed
+283
-22
No files matched your search
@@ -62,7 +62,6 @@ export function normalizeOneBotConfig(raw: unknown): OneBotConfig {
|
||||
wsServers: list(nets.wsServers) as unknown as OneBotConfig['networks']['wsServers'],
|
||||
wsClients: list(nets.wsClients) as unknown as OneBotConfig['networks']['wsClients'],
|
||||
},
|
||||
musicSignUrl: typeof cfg.musicSignUrl === 'string' ? cfg.musicSignUrl : undefined,
|
||||
statusCommand: normalizeStatusCommand(cfg.statusCommand),
|
||||
notifications: normalizeNotifications(cfg.notifications),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user