Moves the MQTT types to models
This commit is contained in:
@@ -20,3 +20,20 @@ export type LogData = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type WebSocketJsonMsg = AnglesData | LogData;
|
export type WebSocketJsonMsg = AnglesData | LogData;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
@@ -11,23 +11,7 @@
|
|||||||
import Collapsible from '$lib/components/Collapsible.svelte';
|
import Collapsible from '$lib/components/Collapsible.svelte';
|
||||||
import MQTT from '~icons/tabler/topology-star-3';
|
import MQTT from '~icons/tabler/topology-star-3';
|
||||||
import Client from '~icons/tabler/robot';
|
import Client from '~icons/tabler/robot';
|
||||||
|
import type { MQTTSettings, MQTTStatus } from '$lib/models';
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
let mqttSettings: MQTTSettings;
|
let mqttSettings: MQTTSettings;
|
||||||
let mqttStatus: MQTTStatus;
|
let mqttStatus: MQTTStatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user