chore: lint apply

This commit is contained in:
Bastien Wirtz
2025-11-15 15:47:36 +01:00
parent 8d82c77630
commit d1356c3e6a

View File

@@ -37,7 +37,7 @@ export default {
avgRespTime: NaN, avgRespTime: NaN,
percentageGood: NaN, percentageGood: NaN,
status: false, status: false,
statusMessage: false statusMessage: false,
}), }),
created() { created() {
const updateInterval = parseInt(this.item.updateInterval, 10) || 0; const updateInterval = parseInt(this.item.updateInterval, 10) || 0;
@@ -48,13 +48,16 @@ export default {
}, },
methods: { methods: {
fetchStatus: async function () { fetchStatus: async function () {
this.fetch("/api/v1/endpoints/statuses", { method: "GET", cache: "no-cache" }) this.fetch("/api/v1/endpoints/statuses", {
method: "GET",
cache: "no-cache",
})
.then((response) => { .then((response) => {
// Apply filtering by groups, if defined // Apply filtering by groups, if defined
if (this.item.groups) { if (this.item.groups) {
response = response?.filter((job) => { response = response?.filter((job) => {
return this.item.groups.includes(job.group) === true; return this.item.groups.includes(job.group) === true;
}) });
} }
// Initialise counts, avg times // Initialise counts, avg times
@@ -67,7 +70,7 @@ export default {
response.forEach((job) => { response.forEach((job) => {
if (job.results[job.results.length - 1].success === true) { if (job.results[job.results.length - 1].success === true) {
this.up++; this.up++;
}; }
if (!this.item.hideaverages) { if (!this.item.hideaverages) {
// Update array of average times // Update array of average times
@@ -76,7 +79,7 @@ export default {
job.results.forEach((res) => { job.results.forEach((res) => {
totalduration += parseInt(res.duration, 10) / 1000000; totalduration += parseInt(res.duration, 10) / 1000000;
rescounter++; rescounter++;
}) });
totalrestime += totalduration; totalrestime += totalduration;
totalresults += rescounter; totalresults += rescounter;
@@ -84,8 +87,7 @@ export default {
totalrestime = 0; totalrestime = 0;
totalresults = 1; totalresults = 1;
} }
});
})
// Rest are down // Rest are down
this.down = this.total - this.up; this.down = this.total - this.up;
@@ -114,10 +116,8 @@ export default {
.catch((e) => { .catch((e) => {
console.error(e); console.error(e);
}); });
}, },
}, },
}; };
</script> </script>