fix: complete statsConfig field support across all API routes

- Add statsConfig to POST /db/host (create) route
- Add statsConfig to all GET routes for consistent API responses
- Remove incorrect statsConfig schema from HostManagerEditor
- statsConfig is now only managed by Server page layout editor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-10-09 09:25:36 +08:00
parent 8e022f0f1c
commit 8c20d41072
2 changed files with 3 additions and 36 deletions

View File

@@ -233,6 +233,7 @@ router.post(
enableFileManager,
defaultPath,
tunnelConnections,
statsConfig,
} = hostData;
if (
!isNonEmptyString(userId) ||
@@ -268,6 +269,7 @@ router.post(
: null,
enableFileManager: enableFileManager ? 1 : 0,
defaultPath: defaultPath || null,
statsConfig: statsConfig || null,
};
if (effectiveAuthType === "password") {
@@ -322,6 +324,7 @@ router.post(
? JSON.parse(createdHost.tunnelConnections)
: [],
enableFileManager: !!createdHost.enableFileManager,
statsConfig: createdHost.statsConfig || undefined,
};
const resolvedHost = (await resolveHostCredentials(baseHost)) || baseHost;