From 8abf2d810666c360320cc25808167d08963bb9be Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Fri, 20 Oct 2023 19:30:25 -0600 Subject: [PATCH] ui(server): fix defaultValue not being used with VariableBox select --- resources/scripts/api/server/types.d.ts | 2 +- .../components/server/startup/VariableBox.tsx | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/resources/scripts/api/server/types.d.ts b/resources/scripts/api/server/types.d.ts index 0816d7e81..c4a01e921 100644 --- a/resources/scripts/api/server/types.d.ts +++ b/resources/scripts/api/server/types.d.ts @@ -23,7 +23,7 @@ export interface ServerEggVariable { description: string; envVariable: string; defaultValue: string; - serverValue: string; + serverValue: string | null; isEditable: boolean; rules: string[]; } diff --git a/resources/scripts/components/server/startup/VariableBox.tsx b/resources/scripts/components/server/startup/VariableBox.tsx index ad73615c6..ba3a4fe47 100644 --- a/resources/scripts/components/server/startup/VariableBox.tsx +++ b/resources/scripts/components/server/startup/VariableBox.tsx @@ -5,7 +5,6 @@ import { usePermissions } from '@/plugins/usePermissions'; import InputSpinner from '@/components/elements/InputSpinner'; import Input from '@/components/elements/Input'; import Switch from '@/components/elements/Switch'; -import tw from 'twin.macro'; import { debounce } from 'debounce'; import updateStartupVariable from '@/api/server/updateStartupVariable'; import useFlash from '@/plugins/useFlash'; @@ -61,15 +60,15 @@ const VariableBox = ({ variable }: Props) => { return ( +

{!variable.isEditable && ( - Read Only + Read Only )} {variable.name}

} > - + {useSwitch ? ( <> @@ -97,7 +96,7 @@ const VariableBox = ({ variable }: Props) => {