diff --git a/src/backend/database/routes/ssh.ts b/src/backend/database/routes/ssh.ts index 4eb2c322..1cb5728d 100644 --- a/src/backend/database/routes/ssh.ts +++ b/src/backend/database/routes/ssh.ts @@ -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; diff --git a/src/ui/Desktop/Apps/Host Manager/HostManagerEditor.tsx b/src/ui/Desktop/Apps/Host Manager/HostManagerEditor.tsx index 518369bd..b5eff4da 100644 --- a/src/ui/Desktop/Apps/Host Manager/HostManagerEditor.tsx +++ b/src/ui/Desktop/Apps/Host Manager/HostManagerEditor.tsx @@ -210,16 +210,6 @@ export function HostManagerEditor({ .default([]), enableFileManager: z.boolean().default(true), defaultPath: z.string().optional(), - statsConfig: z - .object({ - enabled: z.boolean().default(true), - displayItems: z.object({ - cpu: z.boolean().default(true), - memory: z.boolean().default(true), - disk: z.boolean().default(true), - }), - }) - .optional(), }) .superRefine((data, ctx) => { if (data.authType === "password") { @@ -302,14 +292,6 @@ export function HostManagerEditor({ enableFileManager: true, defaultPath: "/", tunnelConnections: [], - statsConfig: { - enabled: true, - displayItems: { - cpu: true, - memory: true, - disk: true, - }, - }, }, }); @@ -366,14 +348,6 @@ export function HostManagerEditor({ enableFileManager: Boolean(cleanedHost.enableFileManager), defaultPath: cleanedHost.defaultPath || "/", tunnelConnections: cleanedHost.tunnelConnections || [], - statsConfig: cleanedHost.statsConfig - ? typeof cleanedHost.statsConfig === "string" - ? JSON.parse(cleanedHost.statsConfig) - : cleanedHost.statsConfig - : { - enabled: true, - displayItems: { cpu: true, memory: true, disk: true }, - }, }; if (defaultAuthType === "password") { @@ -409,10 +383,6 @@ export function HostManagerEditor({ enableFileManager: true, defaultPath: "/", tunnelConnections: [], - statsConfig: { - enabled: true, - displayItems: { cpu: true, memory: true, disk: true }, - }, }; form.reset(defaultFormData); @@ -451,12 +421,6 @@ export function HostManagerEditor({ enableFileManager: Boolean(data.enableFileManager), defaultPath: data.defaultPath || "/", tunnelConnections: data.tunnelConnections || [], - statsConfig: JSON.stringify( - data.statsConfig || { - enabled: true, - displayItems: { cpu: true, memory: true, disk: true }, - }, - ), }; submitData.credentialId = null;