From cb758a48492bdea54880c01494cf31403b504b3a Mon Sep 17 00:00:00 2001 From: DavHau Date: Tue, 13 May 2025 17:24:28 +0700 Subject: [PATCH] GUI: fix target IP not always shown --- .../webview-ui/app/src/routes/machines/details.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/webview-ui/app/src/routes/machines/details.tsx b/pkgs/webview-ui/app/src/routes/machines/details.tsx index 28f54f6f4..45e4b4f04 100644 --- a/pkgs/webview-ui/app/src/routes/machines/details.tsx +++ b/pkgs/webview-ui/app/src/routes/machines/details.tsx @@ -78,7 +78,6 @@ function sleep(ms: number) { } interface InstallMachineProps { name?: string; - targetHost?: string | null; machine: MachineData; } const InstallMachine = (props: InstallMachineProps) => { @@ -104,7 +103,7 @@ const InstallMachine = (props: InstallMachineProps) => { if (!curr_uri) { return; } - if (!props.name || !props.targetHost) { + if (!props.name) { return; } @@ -266,7 +265,7 @@ const InstallMachine = (props: InstallMachineProps) => { }} initial={ getValue(formStore, "1") || { - target: props.targetHost || "", + target: props.machine.machine.deploy?.targetHost || "", report: false, } } @@ -405,6 +404,9 @@ const MachineForm = (props: MachineDetailsProps) => { ), }, }); + queryClient.invalidateQueries({ + queryKey: [activeURI(), "machine", machineName(), "get_machine_details"], + }); return null; }; @@ -661,11 +663,7 @@ const MachineForm = (props: MachineDetailsProps) => { handleClose={() => setInstallModalOpen(false)} class="min-w-[600px]" > - + );