fix: init cluster id when deploy model

This commit is contained in:
jialin
2025-12-03 19:18:07 +08:00
parent d8f1e95e1a
commit 7355be9e3a
9 changed files with 38 additions and 28 deletions
@@ -177,9 +177,9 @@ const AddModal: React.FC<AddModalProps> = (props) => {
};
const initClusterId = (): number => {
const cluster_id = clusterList?.find(
(item) => item.state === ClusterStatusValueMap.Ready
)?.value;
const cluster_id =
clusterList?.find((item) => item.state === ClusterStatusValueMap.Ready)
?.value || clusterList?.[0]?.value;
return cluster_id as number;
};
@@ -443,7 +443,7 @@ const AddModal: FC<AddModalProps> = (props) => {
}
const cluster_id =
clusterList?.find((item) => item.state === ClusterStatusValueMap.Ready)
?.value || '';
?.value || clusterList?.[0]?.value;
return cluster_id;
};