Skip to content

Commit

Permalink
refactor: changed all var to let
Browse files Browse the repository at this point in the history
  • Loading branch information
amunchet committed Sep 16, 2023
1 parent c0538cf commit 8572c32
Show file tree
Hide file tree
Showing 17 changed files with 82 additions and 82 deletions.
4 changes: 2 additions & 2 deletions frontend/labyrinth/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default {
},
mounted: /* istanbul ignore next */ function () {
try {
var auth = this.$auth;
let auth = this.$auth;
if (window.location.href.indexOf("callback") == -1) {
Helper.apiCall("secure", "", auth)
.then(() => {})
Expand Down Expand Up @@ -171,7 +171,7 @@ export default {
}
},
created: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
try {
auth.handleAuthentication();
Expand Down
10 changes: 5 additions & 5 deletions frontend/labyrinth/src/components/CreateEditHost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export default {
},
methods: {
listIcons: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("icons", "", auth)
.then((res) => {
this.icons = res.map((x) => {
Expand All @@ -368,7 +368,7 @@ export default {
});
},
loadServices: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("services", "all", auth)
.then((res) => {
this.services = res.map((x) => {
Expand All @@ -383,7 +383,7 @@ export default {
});
},
loadMetrics: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("metrics", this.host.mac, auth)
.then((res) => {
this.metrics = res;
Expand All @@ -394,7 +394,7 @@ export default {
});
},
saveHost: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
var formData = new FormData();
if (this.$v.host.$invalid) {
Expand Down Expand Up @@ -428,7 +428,7 @@ export default {
},
deleteHost: /* istanbul ignore next */ function () {
var host = this.host;
var auth = this.$auth;
let auth = this.$auth;
this.$bvModal
.msgBoxConfirm("Are you sure you want to delete this host?")
.then((res) => {
Expand Down
8 changes: 4 additions & 4 deletions frontend/labyrinth/src/components/CreateEditSubnet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default {
},
methods: {
loadThemes: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("themes", "", auth)
.then((res) => {
this.themes = res;
Expand All @@ -163,7 +163,7 @@ export default {
},
listIcons: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("icons", "", auth)
.then((res) => {
this.icons = res.map((x) => {
Expand All @@ -185,7 +185,7 @@ export default {
);
return -1;
}
var auth = this.$auth;
let auth = this.$auth;
var formData = new FormData();
formData.append("data", JSON.stringify(this.subnet));
Helper.apiPost("subnet", "", "", auth, formData)
Expand All @@ -199,7 +199,7 @@ export default {
});
},
deleteSubnet: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
this.$bvModal
.msgBoxConfirm("Are you sure you want to delete this subnet?")
.then((res) => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/labyrinth/src/components/CustomDashboardsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
return url;
},
loadCustomDashboards: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("custom_dashboards", "", auth)
.then((res) => {
this.custom_dashboards = res.map((x) => {
Expand All @@ -141,7 +141,7 @@ export default {
});
},
loadData: /* istanbul ignore next */ async function (showLoading) {
var auth = this.$auth;
let auth = this.$auth;
var url = "";
if (showLoading) {
this.loading = true;
Expand Down
14 changes: 7 additions & 7 deletions frontend/labyrinth/src/components/GroupModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default {
},
methods: {
changeMonitor: /* istanbul ignore next */ function (status) {
var auth = this.$auth;
let auth = this.$auth;
var url =
"monitor/" +
this.selected_subnet.subnet +
Expand All @@ -122,7 +122,7 @@ export default {
});
},
changeGroupName: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
var url =
"name/" +
this.selected_subnet.subnet +
Expand All @@ -140,7 +140,7 @@ export default {
});
},
changeIcons: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
var url =
"icons/" +
this.selected_subnet.subnet +
Expand All @@ -158,7 +158,7 @@ export default {
});
},
addService: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
var url =
"add_service/" +
this.selected_subnet.subnet +
Expand All @@ -176,7 +176,7 @@ export default {
});
},
deleteService: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
var url =
"delete_service/" +
this.selected_subnet.subnet +
Expand All @@ -195,7 +195,7 @@ export default {
},
listIcons: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("icons", "", auth)
.then((res) => {
this.icons = res.map((x) => {
Expand All @@ -210,7 +210,7 @@ export default {
});
},
listServices: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("services", "all", auth)
.then((res) => {
this.services = res.map((x) => {
Expand Down
6 changes: 3 additions & 3 deletions frontend/labyrinth/src/components/HostMetric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default {
methods: {
formatDate: Helper.formatDate,
loadLatestMetric: /* istanbul ignore next */ function(){
var auth = this.$auth
let auth = this.$auth
this.loading = true
Helper.apiCall("metrics", this.data.ip + "/" + this.data.name + "/latest", auth).then(res=>{
this.latest_metric = res
Expand All @@ -149,7 +149,7 @@ export default {
})
},
deleteMetric: /* istanbul ignore next */ function(metric_id){
var auth = this.$auth
let auth = this.$auth
Helper.apiDelete("metrics", metric_id, auth).then(()=>{
this.loadLatestMetric()
}).catch(e=>{
Expand All @@ -163,7 +163,7 @@ export default {
this.loadLatestMetric()
var auth = this.$auth;
let auth = this.$auth;
this.loading = true;
this.display = false;
await Helper.apiCall(
Expand Down
2 changes: 1 addition & 1 deletion frontend/labyrinth/src/components/Service.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export default {
this.comment = "";
return;
}
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("redis", "get_comments/" + this.comment_name, auth)
.then((res) => {
this.comment = res;
Expand Down
16 changes: 8 additions & 8 deletions frontend/labyrinth/src/views/Alerts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default {
},
methods: {
sendTestEmail: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("alertmanager", "test", auth)
.then((res) => {
this.$store.commit("updateError", JSON.stringify(res));
Expand All @@ -156,7 +156,7 @@ export default {
});
},
resolveAlert: /* istanbul ignore next */ function (val) {
var auth = this.$auth;
let auth = this.$auth;
var formData = new FormData();
formData.append("data", JSON.stringify(val));
Helper.apiPost("alertmanager", "", "alert", auth, formData)
Expand All @@ -169,7 +169,7 @@ export default {
});
},
loadAlerts: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
this.active_alerts_loading = true;
Helper.apiCall("alertmanager", "alerts", auth)
.then((res) => {
Expand All @@ -181,7 +181,7 @@ export default {
});
},
restartAlertManager: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("alertmanager", "restart", auth)
.then((res) => {
this.$store.commit("updateError", res);
Expand All @@ -191,7 +191,7 @@ export default {
});
},
load: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
this.loading = true;
Helper.apiCall("alertmanager", "", auth)
.then((res) => {
Expand All @@ -204,7 +204,7 @@ export default {
});
},
loadSample: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
this.sample_loading = true;
Helper.apiCall("alertmanager", "alertmanager.sample", auth)
.then((res) => {
Expand All @@ -218,7 +218,7 @@ export default {
},
save: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
var formData = new FormData();
formData.append("data", this.file);
this.loading = true;
Expand Down Expand Up @@ -258,7 +258,7 @@ export default {
}
},
loadIframe: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("alertmanager", "pass", auth)
.then((res) => {
this.copyToClipboard(res);
Expand Down
8 changes: 4 additions & 4 deletions frontend/labyrinth/src/views/Checks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default {
},
methods: {
deleteService: /* istanbul ignore next */ function (name) {
var auth = this.$auth;
let auth = this.$auth;
this.$bvModal
.msgBoxConfirm("Confirm deleting service " + name + "?")
Expand All @@ -305,7 +305,7 @@ export default {
});
},
loadServices: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
this.servicesLoading = true;
Helper.apiCall("services", "all", auth)
.then((res) => {
Expand All @@ -318,7 +318,7 @@ export default {
});
},
loadMetrics: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
this.checksLoaded = false;
Helper.apiCall("metrics", "25", auth)
.then((res) => {
Expand All @@ -341,7 +341,7 @@ export default {
return -1;
}
var auth = this.$auth;
let auth = this.$auth;
var formData = new FormData();
formData.append("data", JSON.stringify(this.selected_service));
Helper.apiPost("service", "", "", auth, formData)
Expand Down
6 changes: 3 additions & 3 deletions frontend/labyrinth/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default {
});
},
loadThemes: /* istanbul ignore next */ function () {
var auth = this.$auth;
let auth = this.$auth;
Helper.apiCall("themes", "", auth)
.then((res) => {
this.themes = res;
Expand All @@ -337,7 +337,7 @@ export default {
});
},
onDrop: /* istanbul ignore next */ function (name) {
var auth = this.$auth;
let auth = this.$auth;
var url = this.dragged_ip;
if (name != "") {
url += "/" + name + "/";
Expand Down Expand Up @@ -387,7 +387,7 @@ export default {
return output;
},
loadData: /* istanbul ignore next */ async function (showLoading) {
var auth = this.$auth;
let auth = this.$auth;
var url = "";
if (showLoading) {
this.loading = true;
Expand Down
Loading

0 comments on commit 8572c32

Please sign in to comment.