Skip to content

Commit 69acc57

Browse files
committed
fix: save failed when creating new device
1 parent c9bc0c8 commit 69acc57

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

frontend/src/routes/device/new/+page.svelte

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,43 @@
55
import NetworkScan from '$lib/components/NetworkScan.svelte';
66
import { m } from '$lib/paraglide/messages';
77
import { permission, pocketbase } from '$lib/stores/pocketbase';
8-
import type { Device, Port } from '$lib/types/device';
8+
import type { Device, Group, Port } from '$lib/types/device';
99
import { faBinoculars, faWrench } from '@fortawesome/free-solid-svg-icons';
1010
import Fa from 'svelte-fa';
1111
import toast from 'svelte-french-toast';
1212
1313
let device: Device = {
14+
name: '',
15+
ip: '',
16+
mac: '',
17+
netmask: '',
18+
description: '',
19+
status: '',
20+
ports: [] as string[],
21+
link_open: '',
22+
ping_cmd: '',
23+
wake_cron: '',
24+
wake_cron_enabled: false,
25+
wake_cmd: '',
26+
wake_confirm: false,
27+
wake_timeout: 0,
28+
shutdown_cron: '',
29+
shutdown_cron_enabled: false,
30+
shutdown_cmd: '',
31+
shutdown_confirm: false,
32+
shutdown_timeout: 0,
33+
password: '',
34+
groups: [] as string[],
1435
expand: {
15-
ports: [] as Port[]
36+
ports: [] as Port[],
37+
groups: [] as Group[]
1638
},
17-
groups: [] as string[]
39+
created_by: '',
40+
sol_enabled: false,
41+
sol_auth: false,
42+
sol_user: '',
43+
sol_password: '',
44+
sol_port: 0
1845
} as Device;
1946
2047
$: if (Object.hasOwn($permission, 'create')) {

0 commit comments

Comments
 (0)