GUI: fix target IP not always shown

This commit is contained in:
DavHau
2025-05-13 17:24:28 +07:00
parent c8ea42b522
commit cb758a4849

View File

@@ -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]"
>
<InstallMachine
name={machineName()}
targetHost={getValue(formStore, "machine.deploy.targetHost")}
machine={props.initialData}
/>
<InstallMachine name={machineName()} machine={props.initialData} />
</Modal>
</>
);