fix(swarm): restore getSwarmNodes original error behavior

getSwarmNodes was changed to return [] on error, but the existing
SwarmMonitorCard checks `if (!nodes)` to detect failures. Since ![]
is false, the error state was silently skipped, breaking the Overview
tab for users without Docker Swarm initialized.

Reverted to return undefined on error (original behavior) so the
existing Overview tab error handling continues to work. The Containers
tab already handles nodes === undefined explicitly.
This commit is contained in:
Claude
2026-02-09 06:39:27 +00:00
parent bb02de690b
commit 1d96c4d534

View File

@@ -371,11 +371,7 @@ export const getSwarmNodes = async (serverId?: string) => {
if (stderr) {
console.error(`Error: ${stderr}`);
return [];
}
if (!stdout.trim()) {
return [];
return;
}
const nodesArray = stdout
@@ -385,7 +381,6 @@ export const getSwarmNodes = async (serverId?: string) => {
return nodesArray;
} catch (error) {
console.error("getSwarmNodes error:", error);
return [];
}
};