UI: add create machine suggestion
This commit is contained in:
@@ -59,7 +59,8 @@ export function CreateMachine() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div class="px-1">
|
<div class="flex w-full justify-center">
|
||||||
|
<div class="mt-4 w-full max-w-3xl self-stretch px-2">
|
||||||
<span class="px-2">Create new Machine</span>
|
<span class="px-2">Create new Machine</span>
|
||||||
<Form onSubmit={handleSubmit}>
|
<Form onSubmit={handleSubmit}>
|
||||||
<Field
|
<Field
|
||||||
@@ -101,8 +102,9 @@ export function CreateMachine() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Field>
|
</Field>
|
||||||
|
<div class="mt-12 flex justify-end">
|
||||||
<button
|
<button
|
||||||
class="btn btn-error float-right"
|
class="btn btn-primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
classList={{
|
classList={{
|
||||||
"btn-disabled": formStore.submitting,
|
"btn-disabled": formStore.submitting,
|
||||||
@@ -111,7 +113,8 @@ export function CreateMachine() {
|
|||||||
<Switch
|
<Switch
|
||||||
fallback={
|
fallback={
|
||||||
<>
|
<>
|
||||||
<span class="loading loading-spinner loading-sm"></span>Creating
|
<span class="loading loading-spinner loading-sm"></span>
|
||||||
|
Creating
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -120,7 +123,9 @@ export function CreateMachine() {
|
|||||||
</Match>
|
</Match>
|
||||||
</Switch>
|
</Switch>
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,17 @@ export const MachineListView: Component = () => {
|
|||||||
nixOnlyMachines()?.length === 0
|
nixOnlyMachines()?.length === 0
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
No machines found
|
<div class="mt-8 flex w-full flex-col items-center justify-center gap-2">
|
||||||
|
<span class="text-lg text-neutral">
|
||||||
|
No machines defined yet. Click below to define one.
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
class="btn btn-square btn-ghost size-28 overflow-hidden p-2"
|
||||||
|
onClick={() => navigate("/machines/create")}
|
||||||
|
>
|
||||||
|
<span class="material-icons text-6xl font-light">add</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={!inventoryQuery.isLoading}>
|
<Match when={!inventoryQuery.isLoading}>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user