diff --git a/daemon/web/src/lib/components/ConfigForm.svelte b/daemon/web/src/lib/components/ConfigForm.svelte index 7f5a898..69a119f 100644 --- a/daemon/web/src/lib/components/ConfigForm.svelte +++ b/daemon/web/src/lib/components/ConfigForm.svelte @@ -11,6 +11,7 @@ type WifiNetwork, } from '../utils.svelte'; import Modal from './Modal.svelte'; + import ExpandableInput from './ExpandableInput.svelte'; let { shown = $bindable() }: { shown: boolean } = $props(); let config = $state(null); @@ -27,15 +28,12 @@ let scanning = $state(false); let scanResults = $state([]); let dnsServersInput = $state(''); - let webdavExpanded = $state(false); - let webdavUrlInput = $state(null); async function load_config() { try { loading = true; config = await get_config(); dnsServersInput = config.dns_servers ? config.dns_servers.join(', ') : ''; - webdavExpanded = config.webdav.url.trim() !== ''; message = ''; messageType = null; poll_wifi_status(); @@ -215,95 +213,90 @@

Notification Settings

-
- - -

- Test button below uses the saved configuration URL, not the input above -

-
-
- + {#if testMessage}
- Sending... - {:else} - - - - Send Test Notification + {testMessage} +
{/if} - - {#if testMessage} -
- {testMessage} -
- {/if} -
+ -
-
- Enabled Notification Types +
+
+ Enabled Notification Types +
+
+ + +
+
+ + +
-
- - -
-
- - -
-
+
@@ -355,53 +348,15 @@ .qmdl and .ndjson files are uploaded in the background to the WebDAV server.

-
- { - webdavExpanded = e.currentTarget.checked; - if (webdavExpanded) { - setTimeout(() => webdavUrlInput?.focus(), 0); - } else { - if (config) config.webdav.url = ''; - } - }} - class="h-4 w-4 text-rayhunter-blue focus:ring-rayhunter-blue border-gray-300 rounded-sm" - /> - -
- - {#if webdavExpanded} -
- - { - if (config && config.webdav.url.trim() === '') { - webdavExpanded = false; - } - }} - placeholder="https://dav.example.com/rayhunter/" - class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-hidden focus:ring-2 focus:ring-rayhunter-blue" - /> -

- Files are uploaded via HTTP PUT under this base URL. No folders are - created, and folders in this base URL are assumed to exist already. -

-
- +
{#if config.device === 'orbic' || config.device === 'moxee' || config.device === 'tmobile' || config.device === 'wingtech'} diff --git a/daemon/web/src/lib/components/ExpandableInput.svelte b/daemon/web/src/lib/components/ExpandableInput.svelte new file mode 100644 index 0000000..1781c81 --- /dev/null +++ b/daemon/web/src/lib/components/ExpandableInput.svelte @@ -0,0 +1,78 @@ + + +
+ + +
+ +{#if expanded} +
+ + + {#if inputHelp} +

+ {inputHelp} +

+ {/if} +
+ + {@render children?.()} +{/if}