2
0
Эх сурвалжийг харах

round max RAM to 100 (#3699)

Co-authored-by: Trevor Shim <trevorshim@Trevors-MacBook-Air.local>
sunguroku 2 жил өмнө
parent
commit
19684442ff

+ 5 - 4
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/ServiceContainer.tsx

@@ -47,10 +47,11 @@ const ServiceContainer: React.FC<ServiceProps> = ({
     AWS_INSTANCE_LIMITS["t3"]["medium"]["vCPU"] * UPPER_BOUND
   ); //default is set to a t3 medium
   const [maxRAM, setMaxRAM] = useState(
+    // round to 100
     Math.round(
       convert(AWS_INSTANCE_LIMITS["t3"]["medium"]["RAM"], "GiB").to("MB") *
-      UPPER_BOUND
-    )
+      UPPER_BOUND / 100 
+    ) * 100
   ); //default is set to a t3 medium
   const context = useContext(Context);
 
@@ -139,8 +140,8 @@ const ServiceContainer: React.FC<ServiceProps> = ({
             setMaxCPU(Math.fround(largestInstanceType.vCPUs * UPPER_BOUND));
             setMaxRAM(
               Math.round(
-                convert(largestInstanceType.RAM, "GiB").to("MB") * UPPER_BOUND
-              )
+                convert(largestInstanceType.RAM, "GiB").to("MB") * UPPER_BOUND / 100
+              ) * 100
             );
           }
         })