From ffcd9b738d08c90ed83a9e8052e78b138335aa3b Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Tue, 23 Apr 2024 21:51:33 +0200 Subject: [PATCH] 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;