lib/values: fix submodule definition merging

This commit is contained in:
Johannes Kirschbauer
2024-12-06 19:53:34 +01:00
parent 388455038a
commit cc1eaf53ae
4 changed files with 84 additions and 28 deletions

View File

@@ -40,7 +40,7 @@ export const MachineListItem = (props: MachineListItemProps) => {
}
if (!info?.deploy?.targetHost) {
toast.error(
"Machine does not have a target host. Specify where the machine should be deployed."
"Machine does not have a target host. Specify where the machine should be deployed.",
);
return;
}
@@ -63,7 +63,7 @@ export const MachineListItem = (props: MachineListItemProps) => {
loading: "Installing...",
success: "Installed",
error: "Failed to install",
}
},
);
setInstalling(false);
};
@@ -80,7 +80,7 @@ export const MachineListItem = (props: MachineListItemProps) => {
}
if (!info?.deploy.targetHost) {
toast.error(
"Machine does not have a target host. Specify where the machine should be deployed."
"Machine does not have a target host. Specify where the machine should be deployed.",
);
return;
}
@@ -101,7 +101,7 @@ export const MachineListItem = (props: MachineListItemProps) => {
loading: "Updating...",
success: "Updated",
error: "Failed to update",
}
},
);
setUpdating(false);
};

View File

@@ -65,7 +65,7 @@ const InstallMachine = (props: InstallMachineProps) => {
}
const loading_toast = toast.loading(
"Installing machine. Grab coffee (15min)..."
"Installing machine. Grab coffee (15min)...",
);
const r = await callApi("install_machine", {
opts: {
@@ -248,13 +248,13 @@ const MachineForm = (props: MachineDetailsProps) => {
...values.machine,
// TODO: Remove this workaround
tags: Array.from(
values.machine.tags || props.initialData.machine.tags || []
values.machine.tags || props.initialData.machine.tags || [],
),
},
});
if (machine_response.status === "error") {
toast.error(
`Failed to set machine: ${machine_response.errors[0].message}`
`Failed to set machine: ${machine_response.errors[0].message}`,
);
}
if (machine_response.status === "success") {
@@ -455,7 +455,7 @@ const MachineForm = (props: MachineDetailsProps) => {
// disabled={!online()}
onClick={() => {
const modal = document.getElementById(
"install_modal"
"install_modal",
) as HTMLDialogElement | null;
modal?.showModal();
}}
@@ -561,7 +561,7 @@ function WifiModule(props: MachineWifiProps) {
});
const [nets, setNets] = createSignal<1[]>(
new Array(props.initialData.length || 1).fill(1)
new Array(props.initialData.length || 1).fill(1),
);
const handleSubmit = async (values: WifiForm) => {
@@ -572,7 +572,7 @@ function WifiModule(props: MachineWifiProps) {
...acc,
[curr.ssid || ""]: { ssid: curr.ssid, password: curr.password },
}),
{}
{},
);
console.log("submitting", values, networks);