From 84d87c7b4f8d3c2ff5788d300784286f3fa0a475 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 23 Dec 2025 12:36:04 +0000 Subject: [PATCH] Polish: Fix type errors in App and Node Tables --- frontend-modern/src/App.tsx | 20 ++----------------- .../Settings/ConfiguredNodeTables.tsx | 15 +++++++------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx index d2c66552f..de6a44d02 100644 --- a/frontend-modern/src/App.tsx +++ b/frontend-modern/src/App.tsx @@ -522,15 +522,7 @@ function App() { // Parse security data to get hideLocalLogin, oidcEnabled, etc. if (securityRes.ok) { const securityData = await securityRes.json(); - setSecurityStatus({ - hasAuthentication: securityData.hasAuthentication || false, - oidcEnabled: securityData.oidcEnabled, - oidcIssuer: securityData.oidcIssuer, - oidcClientId: securityData.oidcClientId, - oidcEnvOverrides: securityData.oidcEnvOverrides, - hideLocalLogin: securityData.hideLocalLogin, - deprecatedDisableAuth: securityData.deprecatedDisableAuth, - }); + setSecurityStatus(securityData as SecurityStatus); } setHasAuth(true); // Force showing login instead of setup setNeedsAuth(true); @@ -546,15 +538,7 @@ function App() { logger.debug('[App] Security status fetched', securityData); // Store full security status for Login component - setSecurityStatus({ - hasAuthentication: securityData.hasAuthentication || false, - oidcEnabled: securityData.oidcEnabled, - oidcIssuer: securityData.oidcIssuer, - oidcClientId: securityData.oidcClientId, - oidcEnvOverrides: securityData.oidcEnvOverrides, - hideLocalLogin: securityData.hideLocalLogin, - deprecatedDisableAuth: securityData.deprecatedDisableAuth, - }); + setSecurityStatus(securityData as SecurityStatus); // Detect legacy DISABLE_AUTH flag (now ignored) so we can surface a warning if (securityData.deprecatedDisableAuth === true) { diff --git a/frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx b/frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx index 01148eab8..ab2dfb33e 100644 --- a/frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx +++ b/frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx @@ -1,5 +1,6 @@ import { Component, For, Show, createMemo } from 'solid-js'; import type { NodeConfig } from '@/types/nodes'; +import type { Node, PBSInstance, PMGInstance, Host } from '@/types/api'; import { Card } from '@/components/shared/Card'; type NodeConfigWithStatus = NodeConfig & { @@ -28,8 +29,8 @@ interface HostAgentInfo { interface PveNodesTableProps { nodes: NodeConfigWithStatus[]; - stateNodes: { instance: string; status?: string; connectionHealth?: string }[]; - stateHosts?: HostAgentInfo[]; + stateNodes: Node[]; + stateHosts?: Host[]; globalTemperatureMonitoringEnabled?: boolean; temperatureTransports?: TemperatureTransportInfo | null; onTestConnection: (nodeId: string) => void; @@ -111,7 +112,7 @@ const resolveTemperatureTransport = ( node: NodeConfigWithStatus, info: TemperatureTransportInfo | null | undefined, globalEnabled: boolean, - hostAgent?: HostAgentInfo, + hostAgent?: Host, ): TemperatureTransportBadge => { const monitoringEnabled = isTemperatureMonitoringEnabled(node, globalEnabled); const normalizedTransport = (node.temperatureTransport || '').toLowerCase(); @@ -291,8 +292,8 @@ const resolvePveStatusMeta = ( // Helper to find matching host agent for a node by hostname matching const findMatchingHostAgent = ( nodeName: string, - hosts: HostAgentInfo[] | undefined, -): HostAgentInfo | undefined => { + hosts: Host[] | undefined, +): Host | undefined => { if (!hosts || hosts.length === 0) return undefined; const nodeNameLower = nodeName.toLowerCase().trim(); return hosts.find((h) => h.hostname.toLowerCase().trim() === nodeNameLower); @@ -559,7 +560,7 @@ export const PveNodesTable: Component = (props) => { interface PbsNodesTableProps { nodes: NodeConfigWithStatus[]; - statePbs: { name: string; status?: string; connectionHealth?: string }[]; + statePbs: PBSInstance[]; globalTemperatureMonitoringEnabled?: boolean; onTestConnection: (nodeId: string) => void; onEdit: (node: NodeConfigWithStatus) => void; @@ -755,7 +756,7 @@ export const PbsNodesTable: Component = (props) => { interface PmgNodesTableProps { nodes: NodeConfigWithStatus[]; - statePmg: { name: string; status?: string; connectionHealth?: string }[]; + statePmg: PMGInstance[]; globalTemperatureMonitoringEnabled?: boolean; onTestConnection: (nodeId: string) => void; onEdit: (node: NodeConfigWithStatus) => void;