Procházet zdrojové kódy

Remove custom nodegroup from displaying (#4301)

Feroze Mohideen před 2 roky
rodič
revize
800225bc08

+ 7 - 1
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/tabs/GPUResources.tsx

@@ -33,6 +33,11 @@ const GPUResources: React.FC<Props> = ({ index, cluster }) => {
       (ng) => ng.nodeGroupType === "CUSTOM"
     );
   }, [cluster]);
+
+  const clusterIsUpdating = useMemo(() => {
+    return cluster.contract.condition === "";
+  }, [cluster]);
+
   return (
     <>
       <Spacer y={1} />
@@ -46,6 +51,7 @@ const GPUResources: React.FC<Props> = ({ index, cluster }) => {
                 size="small"
                 color="primary"
                 checked={value.enabled.value}
+                disabled={clusterIsUpdating}
                 onChange={() => {
                   if (!canEnableGPU) {
                     setClusterModalVisible(true);
@@ -128,7 +134,7 @@ const GPUResources: React.FC<Props> = ({ index, cluster }) => {
           />
         </>
       )} */}
-      {cluster.contract.condition === "" && !canEnableGPU && (
+      {clusterIsUpdating && (
         <CheckItemContainer>
           <CheckItemTop>
             <Loading offset="0px" width="20px" height="20px" />

+ 1 - 2
dashboard/src/main/home/infrastructure-dashboard/shared/NodeGroups.tsx

@@ -29,8 +29,7 @@ const NodeGroups: React.FC<Props> = ({ availableMachineTypes }) => {
       return {
         nodeGroup: ng,
         idx,
-        isIncluded:
-          ng.nodeGroupType === "APPLICATION" || ng.nodeGroupType === "CUSTOM",
+        isIncluded: ng.nodeGroupType === "APPLICATION",
       };
     });
     return dng;