From f5bf43286a20d31ebb56f1d7ea947955ce62b856 Mon Sep 17 00:00:00 2001 From: Paloma Date: Tue, 31 Dec 2024 15:56:35 -0300 Subject: [PATCH] fix: TS fixes --- .../modals/advanced/ConfigurationChecker.vue | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/assemblies/modals/advanced/ConfigurationChecker.vue b/src/assemblies/modals/advanced/ConfigurationChecker.vue index 5702a79..541c55d 100644 --- a/src/assemblies/modals/advanced/ConfigurationChecker.vue +++ b/src/assemblies/modals/advanced/ConfigurationChecker.vue @@ -55,18 +55,34 @@ import AdvancedNetworkCheckBlock from "@/components/advanced/network/AdvancedNet // STORE import store from "@/store"; +// ENUM +enum Block { + Dns = "dns", + Ip = "ip", + Port = "port", +} + +// INTERFACE +interface CheckRow { + description: string; + status: string; +} + +// TYPES +type CheckList = CheckRow[]; + export default { name: "ConfigurationChecker", components: { - AdvancedNetworkCheckBlock + AdvancedNetworkCheckBlock, }, props: { visibility: { type: Boolean, - default: false - } + default: false, + }, }, emits: ["close", "proceed"], @@ -83,15 +99,15 @@ export default { }, dnsStatus() { - return this.getGlobalStatus("dns", this.dnsCheckList); + return this.getGlobalStatus(Block.Dns, this.dnsCheckList); }, portStatus() { - return this.getGlobalStatus("port", this.portCheckList); + return this.getGlobalStatus(Block.Port, this.portCheckList); }, ipStatus() { - return this.getGlobalStatus("ip", this.ipCheckList); + return this.getGlobalStatus(Block.Ip, this.ipCheckList); }, dnsCheckList() { @@ -104,14 +120,15 @@ export default { ipCheckList() { return store.$settingsNetwork.getIpCheck() || []; - } + }, }, watch: {}, methods: { // --> HELPERS <-- - getGlobalStatus(block: string, checkList) { + getGlobalStatus(block: Block, checkList: CheckList) { + console.log("checklist", checkList); let checkListStatus = ""; if (this.states[`${block}Loading`]) { @@ -138,8 +155,8 @@ export default { // --> EVENT LISTENERS <-- onLoad() { store.$settingsNetwork.checkAllRecords(); - } - } + }, + }, };