expose an option to generate hardware configuration during installation

This commit is contained in:
Jörg Thalheim
2024-11-05 13:22:05 +01:00
parent c9760e942e
commit 414c908717
4 changed files with 94 additions and 87 deletions

View File

@@ -76,12 +76,12 @@ const InstallMachine = (props: InstallMachineProps) => {
queryFn: async () => {
const curr = activeURI();
if (curr && props.name) {
const result = await callApi("show_machine_hardware_info", {
const result = await callApi("show_machine_hardware_config", {
clan_dir: curr,
machine_name: props.name,
});
if (result.status === "error") throw new Error("Failed to fetch data");
return result.data?.backend === "nixos-facter" || null;
return result.data === "NIXOS_FACTER" || null;
}
return null;
},
@@ -107,8 +107,8 @@ const InstallMachine = (props: InstallMachineProps) => {
},
machine: props.name,
target_host: props.targetHost,
password: "",
},
password: "",
});
toast.dismiss(loading_toast);
@@ -158,7 +158,7 @@ const InstallMachine = (props: InstallMachineProps) => {
machine: props.name,
keyfile: props.sshKey?.name,
target_host: props.targetHost,
backend: "nixos-facter",
backend: "NIXOS_FACTER",
},
});
toast.dismiss(loading_toast);