fix: proxmox stats tab reads its switch from plugin host settings

This commit is contained in:
LukeGus committed 2026-09-30 17:48:37 -05:00
1 parent ba05b6a610
commit 69b1b9805b
2 files changed
+55 -5

No files matched your search

@@ -42,8 +42,12 @@ interface HostConfig {
name: string;
ip: string;
username: string;
enableProxmoxStats?: boolean;
proxmoxStatsConfig?: string | ProxmoxStatsConfig | null;
pluginSettings?: {
proxmox?: {
enableProxmoxStats?: boolean;
proxmoxStatsConfig?: string | ProxmoxStatsConfig | null;
};
};
authType?: string;
port?: number;
[key: string]: unknown;
@@ -115,9 +119,10 @@ function ProxmoxStatsInner({
null,
);
const proxmoxSettings = currentHostConfig?.pluginSettings?.proxmox;
const statsConfig = React.useMemo(
() => parseProxmoxStatsConfig(currentHostConfig?.proxmoxStatsConfig),
[currentHostConfig?.proxmoxStatsConfig],
() => parseProxmoxStatsConfig(proxmoxSettings?.proxmoxStatsConfig),
[proxmoxSettings?.proxmoxStatsConfig],
);
React.useEffect(() => {
@@ -162,7 +167,7 @@ function ProxmoxStatsInner({
});
}, []);
const notEnabled = currentHostConfig?.enableProxmoxStats !== true;
const notEnabled = proxmoxSettings?.enableProxmoxStats !== true;
const stopPollingRef = React.useRef<(() => void) | null>(null);
const fetchSnapshot = React.useCallback(async (): Promise<void> => {