From ed269a9906613a026e61bc82ba012c0bfcda283c Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Mon, 22 Apr 2024 21:27:43 +0200 Subject: [PATCH 1/3] Removes duplicate config --- lib/framework/ESP32SvelteKit.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/framework/ESP32SvelteKit.cpp b/lib/framework/ESP32SvelteKit.cpp index 7c780a8c..1648455c 100644 --- a/lib/framework/ESP32SvelteKit.cpp +++ b/lib/framework/ESP32SvelteKit.cpp @@ -110,9 +110,6 @@ void ESP32SvelteKit::begin() // request->redirect(url.c_str()); } }); #endif -#ifdef SERVE_CONFIG_FILES - _server->serveStatic("/config/", ESPFS, "/config/"); -#endif // Serve static resources from /config/ if set by platformio.ini #if SERVE_CONFIG_FILES From ffcd9b738d08c90ed83a9e8052e78b138335aa3b Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Tue, 23 Apr 2024 21:51:33 +0200 Subject: [PATCH 2/3] Moves models --- interface/src/lib/types/models.ts | 17 +++++++++++++++++ .../src/routes/connections/mqtt/MQTT.svelte | 18 +----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/interface/src/lib/types/models.ts b/interface/src/lib/types/models.ts index e4035996..fe617cdd 100644 --- a/interface/src/lib/types/models.ts +++ b/interface/src/lib/types/models.ts @@ -111,3 +111,20 @@ export type StaticSystemInformation = { }; export type SystemInformation = Analytics & StaticSystemInformation; + +export type MQTTStatus = { + enabled: boolean; + connected: boolean; + client_id: string; + last_error: string; +}; + +export type MQTTSettings = { + enabled: boolean; + uri: string; + username: string; + password: string; + client_id: string; + keep_alive: number; + clean_session: boolean; +}; \ No newline at end of file diff --git a/interface/src/routes/connections/mqtt/MQTT.svelte b/interface/src/routes/connections/mqtt/MQTT.svelte index 30b66eff..8ee55d07 100644 --- a/interface/src/routes/connections/mqtt/MQTT.svelte +++ b/interface/src/routes/connections/mqtt/MQTT.svelte @@ -11,23 +11,7 @@ import Collapsible from '$lib/components/Collapsible.svelte'; import MQTT from '~icons/tabler/topology-star-3'; import Client from '~icons/tabler/robot'; - - type MQTTStatus = { - enabled: boolean; - connected: boolean; - client_id: string; - last_error: string; - }; - - type MQTTSettings = { - enabled: boolean; - uri: string; - username: string; - password: string; - client_id: string; - keep_alive: number; - clean_session: boolean; - }; + import type { MQTTSettings, MQTTStatus } from '$lib/types/models'; let mqttSettings: MQTTSettings; let mqttStatus: MQTTStatus; From 3bdffbd726f4cc7c945da569f198c81b4bee0020 Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Tue, 23 Apr 2024 21:52:13 +0200 Subject: [PATCH 3/3] Removes duplicate request --- interface/src/routes/wifi/sta/Wifi.svelte | 6 ------ 1 file changed, 6 deletions(-) diff --git a/interface/src/routes/wifi/sta/Wifi.svelte b/interface/src/routes/wifi/sta/Wifi.svelte index a5542b07..cdf44b5c 100644 --- a/interface/src/routes/wifi/sta/Wifi.svelte +++ b/interface/src/routes/wifi/sta/Wifi.svelte @@ -107,12 +107,6 @@ onDestroy(() => clearInterval(interval)); - onMount(() => { - if (!$page.data.features.security || $user.admin) { - getWifiSettings(); - } - }); - async function postWiFiSettings(data: WifiSettings) { try { const response = await fetch('/rest/wifiSettings', {