UI: fix type breakages
This commit is contained in:
@@ -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: {
|
||||
@@ -243,18 +243,18 @@ const MachineForm = (props: MachineDetailsProps) => {
|
||||
|
||||
const machine_response = await callApi("set_machine", {
|
||||
flake_url: curr_uri,
|
||||
machine_name: props.initialData.machine.name,
|
||||
machine_name: props.initialData.machine.name || "My machine",
|
||||
machine: {
|
||||
...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") {
|
||||
@@ -316,7 +316,7 @@ const MachineForm = (props: MachineDetailsProps) => {
|
||||
}
|
||||
>
|
||||
<div class="w-32 rounded-lg border p-2 bg-def-4 border-inv-3">
|
||||
<RndThumbnail name={machineName()} />
|
||||
<RndThumbnail name={machineName() || "M"} />
|
||||
</div>
|
||||
</div>
|
||||
</figure>
|
||||
@@ -342,7 +342,7 @@ const MachineForm = (props: MachineDetailsProps) => {
|
||||
{(tag) => (
|
||||
<label class="p-1">
|
||||
Tags
|
||||
<span class="mx-2 rounded-full px-3 py-1 bg-inv-4 fg-inv-1 w-fit">
|
||||
<span class="mx-2 w-fit rounded-full px-3 py-1 bg-inv-4 fg-inv-1">
|
||||
{tag}
|
||||
</span>
|
||||
</label>
|
||||
@@ -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);
|
||||
|
||||
@@ -84,7 +84,7 @@ export const MachineListView: Component = () => {
|
||||
</div>
|
||||
{/* <Show when={filter()}> */}
|
||||
<div class="my-1 flex w-full gap-2 p-2">
|
||||
<div class="h-6 w-6 p-1">
|
||||
<div class="size-6 p-1">
|
||||
<Icon icon="Filter" />
|
||||
</div>
|
||||
<For each={filter().tags.sort()}>
|
||||
|
||||
Reference in New Issue
Block a user