Skip to content

Commit

Permalink
fix: TS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Paloma-Sanchez committed Dec 31, 2024
1 parent ef3a958 commit f5bf432
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions src/assemblies/modals/advanced/ConfigurationChecker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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() {
Expand All @@ -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`]) {
Expand All @@ -138,8 +155,8 @@ export default {
// --> EVENT LISTENERS <--
onLoad() {
store.$settingsNetwork.checkAllRecords();
}
}
},
},
};
</script>

Expand Down

0 comments on commit f5bf432

Please sign in to comment.