feat: set default cluster

This commit is contained in:
jialin
2025-12-23 20:54:16 +08:00
parent 530e8f7537
commit 1b661bb8cd
17 changed files with 102 additions and 14 deletions
@@ -191,6 +191,10 @@ const AddModal: React.FC<AddModalProps> = (props) => {
};
const initClusterId = (): number => {
const defaultCluster = clusterList?.find((item) => item.is_default);
if (defaultCluster) {
return defaultCluster.value;
}
const cluster_id =
clusterList?.find((item) => item.state === ClusterStatusValueMap.Ready)
?.value || clusterList?.[0]?.value;