Browse Source

Fix GPU relation to autoscaling (#4106)

sdess09 2 years ago
parent
commit
d8b7e2dc5f

+ 35 - 37
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/tabs/Resources.tsx

@@ -335,44 +335,42 @@ const Resources: React.FC<ResourcesProps> = ({
               {...register(`app.services.${index}.instances.value`)}
             />
             <Spacer y={1} />
-            {!service.gpu.enabled.value && (
-              <>
-                <Text>
-                  Autoscaling
-                  <a
-                    href="https://docs.porter.run/configure/autoscaling"
-                    target="_blank"
-                    rel="noreferrer"
+            <>
+              <Text>
+                Autoscaling
+                <a
+                  href="https://docs.porter.run/configure/autoscaling"
+                  target="_blank"
+                  rel="noreferrer"
+                >
+                  &nbsp;(?)
+                </a>
+              </Text>
+              <Spacer y={0.5} />
+              <Controller
+                name={`app.services.${index}.config.autoscaling.enabled`}
+                control={control}
+                render={({ field: { value, onChange } }) => (
+                  <Checkbox
+                    checked={value.value}
+                    toggleChecked={() => {
+                      onChange({
+                        ...value,
+                        value: !value.value,
+                      });
+                    }}
+                    disabled={value.readOnly}
+                    disabledTooltip={
+                      "You may only edit this field in your porter.yaml."
+                    }
                   >
-                    &nbsp;(?)
-                  </a>
-                </Text>
-                <Spacer y={0.5} />
-                <Controller
-                  name={`app.services.${index}.config.autoscaling.enabled`}
-                  control={control}
-                  render={({ field: { value, onChange } }) => (
-                    <Checkbox
-                      checked={value.value}
-                      toggleChecked={() => {
-                        onChange({
-                          ...value,
-                          value: !value.value,
-                        });
-                      }}
-                      disabled={value.readOnly}
-                      disabledTooltip={
-                        "You may only edit this field in your porter.yaml."
-                      }
-                    >
-                      <Text color="helper">
-                        Enable autoscaling (overrides instances)
-                      </Text>
-                    </Checkbox>
-                  )}
-                />
-              </>
-            )}
+                    <Text color="helper">
+                      Enable autoscaling (overrides instances)
+                    </Text>
+                  </Checkbox>
+                )}
+              />
+            </>
             {autoscalingEnabled.value && (
               <>
                 <Spacer y={1} />