webapp: create interface for MqttConfig

This commit is contained in:
Thomas Basler 2022-10-17 19:59:11 +02:00
parent c735fb8c3c
commit a9a6a40eb8
2 changed files with 22 additions and 20 deletions

View File

@ -0,0 +1,20 @@
export interface MqttConfig {
mqtt_enabled: boolean,
mqtt_hostname: string,
mqtt_port: number,
mqtt_username: string,
mqtt_password: string,
mqtt_topic: string,
mqtt_publish_interval: number,
mqtt_retain: boolean,
mqtt_tls: boolean,
mqtt_root_ca_cert: string,
mqtt_lwt_topic: string,
mqtt_lwt_online: string,
mqtt_lwt_offline: string,
mqtt_hass_enabled: boolean,
mqtt_hass_expire: boolean,
mqtt_hass_retain: boolean,
mqtt_hass_topic: string,
mqtt_hass_individualpanels: boolean
}

View File

@ -228,6 +228,7 @@
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import BootstrapAlert from "@/components/BootstrapAlert.vue"; import BootstrapAlert from "@/components/BootstrapAlert.vue";
import type { MqttConfig } from "@/types/MqttConfig";
export default defineComponent({ export default defineComponent({
components: { components: {
@ -236,26 +237,7 @@ export default defineComponent({
data() { data() {
return { return {
dataLoading: true, dataLoading: true,
mqttConfigList: { mqttConfigList: {} as MqttConfig,
mqtt_enabled: false,
mqtt_hostname: "",
mqtt_port: 0,
mqtt_username: "",
mqtt_password: "",
mqtt_topic: "",
mqtt_publish_interval: 0,
mqtt_retain: false,
mqtt_tls: false,
mqtt_root_ca_cert: "",
mqtt_lwt_topic: "",
mqtt_lwt_online: "",
mqtt_lwt_offline: "",
mqtt_hass_enabled: false,
mqtt_hass_expire: false,
mqtt_hass_retain: false,
mqtt_hass_topic: "",
mqtt_hass_individualpanels: false
},
alertMessage: "", alertMessage: "",
alertType: "info", alertType: "info",
showAlert: false, showAlert: false,