diff --git a/frontend/src/lib/components/DeviceCard.svelte b/frontend/src/lib/components/DeviceCard.svelte index 464a78ce..55fd175a 100644 --- a/frontend/src/lib/components/DeviceCard.svelte +++ b/frontend/src/lib/components/DeviceCard.svelte @@ -3,6 +3,8 @@ import DeviceCardNic from './DeviceCardNic.svelte'; import { scale } from 'svelte/transition'; import type { Device } from '$lib/types/device'; + import Fa from 'svelte-fa'; + import { faCircleArrowDown, faCircleArrowUp, faLock } from '@fortawesome/free-solid-svg-icons'; export let device: Device; @@ -30,7 +32,28 @@ -
+
+ {#if device.wake_cron_enabled} +
+ {device.wake_cron} +
+ {/if} + {#if device.shutdown_cron_enabled} +
+ {device.shutdown_cron} +
+ {/if} + {#if device.password} +
+ Password +
+ {/if} +
+
{formatDistance(parseISO(device.updated), now, { includeSeconds: true, diff --git a/frontend/src/lib/components/DeviceCardNic.svelte b/frontend/src/lib/components/DeviceCardNic.svelte index 09356f63..14b7fb65 100644 --- a/frontend/src/lib/components/DeviceCardNic.svelte +++ b/frontend/src/lib/components/DeviceCardNic.svelte @@ -53,37 +53,42 @@ } -
  • +
  • -
    - {#if device.status === 'offline'} - - {:else if device.status === 'online'} - - {:else if device.status === 'pending'} - - {:else} - - {/if} -
    + {#if device.status === 'offline'} + + {:else if device.status === 'online'} + + {:else if device.status === 'pending'} + + {:else} + + {/if}
    {device.ip}
    -
    {device.mac}
    -
    +
    {device.mac}
    +
    {#if device?.expand?.ports} {#each device?.expand?.ports as port} @@ -101,3 +106,9 @@
  • + + diff --git a/frontend/src/lib/components/DeviceForm.svelte b/frontend/src/lib/components/DeviceForm.svelte index ec0522c4..f9cd96fb 100644 --- a/frontend/src/lib/components/DeviceForm.svelte +++ b/frontend/src/lib/components/DeviceForm.svelte @@ -259,7 +259,12 @@
    @@ -327,7 +333,12 @@
    diff --git a/frontend/src/lib/components/DeviceFormPort.svelte b/frontend/src/lib/components/DeviceFormPort.svelte index 50125e2e..c46c1093 100644 --- a/frontend/src/lib/components/DeviceFormPort.svelte +++ b/frontend/src/lib/components/DeviceFormPort.svelte @@ -32,7 +32,7 @@ {#if device.expand.ports[index]} -
    +
    diff --git a/frontend/src/lib/components/Navbar.svelte b/frontend/src/lib/components/Navbar.svelte index 3925a34e..5eaad9d4 100644 --- a/frontend/src/lib/components/Navbar.svelte +++ b/frontend/src/lib/components/Navbar.svelte @@ -185,7 +185,7 @@
    {#if $pocketbase.authStore?.model !== null} - + New diff --git a/frontend/src/lib/components/NetworkScan.svelte b/frontend/src/lib/components/NetworkScan.svelte index 37e5c66c..b152151d 100644 --- a/frontend/src/lib/components/NetworkScan.svelte +++ b/frontend/src/lib/components/NetworkScan.svelte @@ -8,7 +8,8 @@ import { faMagnifyingGlass, faPlus, - faTriangleExclamation + faTriangleExclamation, + faX } from '@fortawesome/free-solid-svg-icons'; import type { SettingsPrivate } from '$lib/types/settings'; import type { ScanResponse, ScannedDevice } from '$lib/types/scan'; @@ -17,6 +18,7 @@ let saveErrTimeout: number; let scanErrMsg = ''; let scanErrTimeout: number; + let scanRange = ''; let scanRunning = false; let scanResponse: ScanResponse = { netmask: '', @@ -31,14 +33,22 @@ .getList(1, 1) .then((res) => { settingsPriv.set(res.items[0] as SettingsPrivate); + scanRange = $settingsPriv.scan_range; }); + } else { + scanRange = $settingsPriv.scan_range; } }); function saveSettings() { $pocketbase .collection('settings_private') - .update($settingsPriv.id, $settingsPriv) + .update($settingsPriv.id, { + scan_range: scanRange + }) + .then((res) => { + settingsPriv.set(res as SettingsPrivate); + }) .catch((err) => { clearTimeout(saveErrTimeout); saveErrTimeout = setTimeout(() => { @@ -126,14 +136,22 @@ class="input input-bordered join-item" type="text" placeholder="192.168.1.0/24" - bind:value={$settingsPriv.scan_range} + bind:value={scanRange} />
    - {#if scanRunning} + {#if !$settingsPriv.scan_range} + + {:else if scanRange !== $settingsPriv.scan_range} + + {:else if scanRunning}