mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-03 21:15:23 +02:00
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:
@@ -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 [];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user