mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-12-16 05:09:50 +01:00
chore: lint apply
This commit is contained in:
@@ -37,7 +37,7 @@ export default {
|
||||
avgRespTime: NaN,
|
||||
percentageGood: NaN,
|
||||
status: false,
|
||||
statusMessage: false
|
||||
statusMessage: false,
|
||||
}),
|
||||
created() {
|
||||
const updateInterval = parseInt(this.item.updateInterval, 10) || 0;
|
||||
@@ -48,13 +48,16 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
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) => {
|
||||
// Apply filtering by groups, if defined
|
||||
if (this.item.groups) {
|
||||
response = response?.filter((job) => {
|
||||
return this.item.groups.includes(job.group) === true;
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// Initialise counts, avg times
|
||||
@@ -67,7 +70,7 @@ export default {
|
||||
response.forEach((job) => {
|
||||
if (job.results[job.results.length - 1].success === true) {
|
||||
this.up++;
|
||||
};
|
||||
}
|
||||
|
||||
if (!this.item.hideaverages) {
|
||||
// Update array of average times
|
||||
@@ -76,7 +79,7 @@ export default {
|
||||
job.results.forEach((res) => {
|
||||
totalduration += parseInt(res.duration, 10) / 1000000;
|
||||
rescounter++;
|
||||
})
|
||||
});
|
||||
|
||||
totalrestime += totalduration;
|
||||
totalresults += rescounter;
|
||||
@@ -84,8 +87,7 @@ export default {
|
||||
totalrestime = 0;
|
||||
totalresults = 1;
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// Rest are down
|
||||
this.down = this.total - this.up;
|
||||
@@ -114,10 +116,8 @@ export default {
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user