mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 15:33:17 +01:00
refactor: Fix indent
This commit is contained in:
parent
9a5f245440
commit
2b9d3e99d3
@ -1,22 +1,22 @@
|
|||||||
export const helper = {
|
export const helper = {
|
||||||
methods: {
|
methods: {
|
||||||
generatePrettyTimeAgo(t) {
|
generatePrettyTimeAgo(t) {
|
||||||
let differenceInMs = new Date().getTime() - new Date(t).getTime();
|
let differenceInMs = new Date().getTime() - new Date(t).getTime();
|
||||||
if (differenceInMs > 3*86400000) { // If it was more than 3 days ago, we'll display the number of days ago
|
if (differenceInMs > 3 * 86400000) { // If it was more than 3 days ago, we'll display the number of days ago
|
||||||
let days = (differenceInMs / 86400000).toFixed(0);
|
let days = (differenceInMs / 86400000).toFixed(0);
|
||||||
return days + " day" + (days !== "1" ? "s" : "") + " ago";
|
return days + " day" + (days !== "1" ? "s" : "") + " ago";
|
||||||
}
|
}
|
||||||
if (differenceInMs > 3600000) { // If it was more than 1h ago, display the number of hours ago
|
if (differenceInMs > 3600000) { // If it was more than 1h ago, display the number of hours ago
|
||||||
let hours = (differenceInMs / 3600000).toFixed(0);
|
let hours = (differenceInMs / 3600000).toFixed(0);
|
||||||
return hours + " hour" + (hours !== "1" ? "s" : "") + " ago";
|
return hours + " hour" + (hours !== "1" ? "s" : "") + " ago";
|
||||||
}
|
}
|
||||||
if (differenceInMs > 60000) {
|
if (differenceInMs > 60000) {
|
||||||
let minutes = (differenceInMs / 60000).toFixed(0);
|
let minutes = (differenceInMs / 60000).toFixed(0);
|
||||||
return minutes + " minute" + (minutes !== "1" ? "s" : "") + " ago";
|
return minutes + " minute" + (minutes !== "1" ? "s" : "") + " ago";
|
||||||
}
|
}
|
||||||
let seconds = (differenceInMs / 1000).toFixed(0);
|
let seconds = (differenceInMs / 1000).toFixed(0);
|
||||||
return seconds + " second" + (seconds !== "1" ? "s" : "") + " ago";
|
return seconds + " second" + (seconds !== "1" ? "s" : "") + " ago";
|
||||||
},
|
},
|
||||||
generatePrettyTimeDifference(start, end) {
|
generatePrettyTimeDifference(start, end) {
|
||||||
let minutes = Math.ceil((new Date(start) - new Date(end)) / 1000 / 60);
|
let minutes = Math.ceil((new Date(start) - new Date(end)) / 1000 / 60);
|
||||||
return minutes + (minutes === 1 ? ' minute' : ' minutes');
|
return minutes + (minutes === 1 ? ' minute' : ' minutes');
|
||||||
@ -31,5 +31,5 @@ export const helper = {
|
|||||||
let ss = ((date.getSeconds()) < 10 ? "0" : "") + "" + (date.getSeconds());
|
let ss = ((date.getSeconds()) < 10 ? "0" : "") + "" + (date.getSeconds());
|
||||||
return YYYY + "-" + MM + "-" + DD + " " + hh + ":" + mm + ":" + ss;
|
return YYYY + "-" + MM + "-" + DD + " " + hh + ":" + mm + ":" + ss;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<Loading v-if="!retrievedData" class="h-64 w-64 px-4 my-24" />
|
<Loading v-if="!retrievedData" class="h-64 w-64 px-4 my-24"/>
|
||||||
<slot v-else>
|
<slot v-else>
|
||||||
<Endpoints
|
<Endpoints
|
||||||
:endpointStatuses="endpointStatuses"
|
:endpointStatuses="endpointStatuses"
|
||||||
:showStatusOnHover="true"
|
:showStatusOnHover="true"
|
||||||
@showTooltip="showTooltip"
|
@showTooltip="showTooltip"
|
||||||
@toggleShowAverageResponseTime="toggleShowAverageResponseTime" :showAverageResponseTime="showAverageResponseTime"
|
@toggleShowAverageResponseTime="toggleShowAverageResponseTime"
|
||||||
|
:showAverageResponseTime="showAverageResponseTime"
|
||||||
/>
|
/>
|
||||||
<Pagination @page="changePage"/>
|
<Pagination @page="changePage"/>
|
||||||
</slot>
|
</slot>
|
||||||
|
Loading…
Reference in New Issue
Block a user