fix: using select handler for provider hint

This commit is contained in:
jialin
2026-05-27 17:10:15 +08:00
committed by jialin
parent 11cf1329c8
commit 3497590d2e
3 changed files with 45 additions and 37 deletions
+2 -11
View File
@@ -97,14 +97,10 @@ const GPUService: React.FC = () => {
fetchClusterList({ page: -1 });
}, []);
// GPU Service today is Kubernetes-only — Docker / cloud clusters
// can't host the CRDs. Filter so the page reflects scheduling
// reality even when the caller owns non-K8s clusters.
const k8sClusterList = useMemo(
() => clusterList.filter((c) => c.provider === ProviderValueMap.Kubernetes),
const hasK8sCluster = useMemo(
() => clusterList.some((c) => c.provider === ProviderValueMap.Kubernetes),
[clusterList]
);
const hasK8sCluster = k8sClusterList.length > 0;
const handleModalOk = async (data: FormData) => {
try {
@@ -157,11 +153,6 @@ const GPUService: React.FC = () => {
const renderEmpty = (type?: string) => {
if (type !== 'Table') return;
// No K8s cluster the caller can schedule on — replace the "no
// instances" empty state with a cluster-bootstrap prompt. The
// "Add cluster" CTA is reserved for callers who can actually
// create one (platform admin / Org owner); members see the
// explanation without a misleading button.
if (!clusterLoading && !hasK8sCluster) {
return (
<NoResult