diff --git a/src/lib/components/data/machine/EditMachine.svelte b/src/lib/components/data/machine/EditMachine.svelte
index 899fe57..79afb3d 100644
--- a/src/lib/components/data/machine/EditMachine.svelte
+++ b/src/lib/components/data/machine/EditMachine.svelte
@@ -8,12 +8,17 @@
import * as Form from '$lib/components/form';
- import type { Machine } from '$lib/api';
+ import { User, type Machine } from '$lib/api';
+ import Label from '$lib/components/ui/label/label.svelte';
+ import SelectUser from '../user/SelectUser.svelte';
+ import { writable } from 'svelte/store';
export let machine: Machine;
+ export let users: User[] | undefined;
const schema = z.object({
- name: z.string()
+ name: z.string(),
+ assigned_user: z.string()
});
const form = superForm(defaults(zod(schema)), {
@@ -30,9 +35,11 @@
const { constraints, form: formData } = form;
- formData.set({ name: machine.givenName || '' });
+ function reset() {
+ formData.set({ name: machine.givenName || '', assigned_user: machine.user?.name || '' });
+ }
- function reset() {}
+ reset();
@@ -45,13 +52,20 @@
Edit machine
-
+
Given name
+
+
+
+ Assigned user
+
+
+
diff --git a/src/lib/components/data/machine/MachineActions.svelte b/src/lib/components/data/machine/MachineActions.svelte
index 6f689ad..148ca6c 100644
--- a/src/lib/components/data/machine/MachineActions.svelte
+++ b/src/lib/components/data/machine/MachineActions.svelte
@@ -7,13 +7,15 @@
import Telescope from 'lucide-svelte/icons/telescope';
import Trash from 'lucide-svelte/icons/trash-2';
- import type { Machine } from '$lib/api';
+ import type { Machine, User } from '$lib/api';
import DeleteMachine from './DeleteMachine.svelte';
import EditMachine from './EditMachine.svelte';
import ExpireSession from './ExpireSession.svelte';
+ import { isExpired } from '$lib/utils/time';
export let machine: Machine;
+ export let users: User[] | undefined;
const dispatch = createEventDispatcher<{ close: undefined; focus: undefined }>();
@@ -37,7 +39,7 @@
-
+