fix: add worker ux when only DO cluster

This commit is contained in:
jialin
2026-01-08 09:26:55 +08:00
parent d35bd16543
commit ba4f277863
12 changed files with 55 additions and 38 deletions
@@ -69,15 +69,29 @@ const useAddWorker = (props: {
item.provider !== ProviderValueMap.Docker
};
})
.filter((item) => item.state === ClusterStatusValueMap.Ready);
.filter(
(item) =>
item.state === ClusterStatusValueMap.Ready &&
item.provider === ProviderValueMap.Docker
);
}, [clusterList]);
/**
* Add Worker only for Docker clusters, for k8s and digitalocean do something in the cluster list page.
* @param clusterList
* @param includeDigitalOcean
* @returns
*/
const checkDefaultCluster = (
clusterList: Global.BaseOption<number, ClusterListItem>[]
clusterList: Global.BaseOption<number, ClusterListItem>[],
includeDigitalOcean?: boolean
) => {
// select default and ready cluster first, digitalocean no READY state
let currentData = clusterList.find(
(item) => item.is_default && item.state === ClusterStatusValueMap.Ready
(item) =>
item.is_default &&
item.state === ClusterStatusValueMap.Ready &&
item.provider === ProviderValueMap.Docker
);
if (!currentData) {