🎨 Format and simplify controls

This commit is contained in:
Rune Harlyk
2026-01-02 22:35:04 +01:00
committed by nikguin04
parent a6b5b0881a
commit 0ef55bcc7e
25 changed files with 6424 additions and 5981 deletions
+6 -4
View File
@@ -36,7 +36,7 @@
import { KnownNetworkItem } from '$lib/platform_shared/websocket_message'
import { WifiSettings, type WifiStatus } from '$lib/platform_shared/rest_message'
let networkEditable: KnownNetworkItem = $state( KnownNetworkItem.create() )
let networkEditable: KnownNetworkItem = $state(KnownNetworkItem.create())
let static_ip_config = $state(false)
@@ -84,15 +84,17 @@
return wifiSettings
}
let unsub_obj: (() => void) | undefined = undefined;
let unsub_obj: (() => void) | undefined = undefined
onMount(() => {
unsub_obj = socket.on<WifiSettings>(WifiSettings, data => {
wifiSettings = data
dndNetworkList = wifiSettings.wifiNetworks
})
})
onDestroy(() => { if (unsub_obj) unsub_obj() } )
onDestroy(() => {
if (unsub_obj) unsub_obj()
})
async function postWiFiSettings(data: WifiSettings) {
const result = await api.post<WifiSettings>('/api/wifi/sta/settings', data)
if (result.isErr()) {