mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-25 01:13:40 +01:00
parent
4d0f3b6997
commit
3f961a7408
@ -25,23 +25,16 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {helper} from "@/mixins/helper";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Endpoints',
|
name: 'Endpoints',
|
||||||
props: {
|
props: {
|
||||||
event: Event,
|
event: Event,
|
||||||
result: Object
|
result: Object
|
||||||
},
|
},
|
||||||
|
mixins: [helper],
|
||||||
methods: {
|
methods: {
|
||||||
prettifyTimestamp(timestamp) {
|
|
||||||
let date = new Date(timestamp);
|
|
||||||
let YYYY = date.getFullYear();
|
|
||||||
let MM = ((date.getMonth() + 1) < 10 ? "0" : "") + "" + (date.getMonth() + 1);
|
|
||||||
let DD = ((date.getDate()) < 10 ? "0" : "") + "" + (date.getDate());
|
|
||||||
let hh = ((date.getHours()) < 10 ? "0" : "") + "" + (date.getHours());
|
|
||||||
let mm = ((date.getMinutes()) < 10 ? "0" : "") + "" + (date.getMinutes());
|
|
||||||
let ss = ((date.getSeconds()) < 10 ? "0" : "") + "" + (date.getSeconds());
|
|
||||||
return YYYY + "-" + MM + "-" + DD + " " + hh + ":" + mm + ":" + ss;
|
|
||||||
},
|
|
||||||
htmlEntities(s) {
|
htmlEntities(s) {
|
||||||
return String(s)
|
return String(s)
|
||||||
.replace(/&/g, '&')
|
.replace(/&/g, '&')
|
||||||
|
@ -16,5 +16,15 @@ export const helper = {
|
|||||||
}
|
}
|
||||||
return (differenceInMs / 1000).toFixed(0) + " seconds ago";
|
return (differenceInMs / 1000).toFixed(0) + " seconds ago";
|
||||||
},
|
},
|
||||||
|
prettifyTimestamp(timestamp) {
|
||||||
|
let date = new Date(timestamp);
|
||||||
|
let YYYY = date.getFullYear();
|
||||||
|
let MM = ((date.getMonth() + 1) < 10 ? "0" : "") + "" + (date.getMonth() + 1);
|
||||||
|
let DD = ((date.getDate()) < 10 ? "0" : "") + "" + (date.getDate());
|
||||||
|
let hh = ((date.getHours()) < 10 ? "0" : "") + "" + (date.getHours());
|
||||||
|
let mm = ((date.getMinutes()) < 10 ? "0" : "") + "" + (date.getMinutes());
|
||||||
|
let ss = ((date.getSeconds()) < 10 ? "0" : "") + "" + (date.getSeconds());
|
||||||
|
return YYYY + "-" + MM + "-" + DD + " " + hh + ":" + mm + ":" + ss;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<div class="flex mt-1 text-sm text-gray-400">
|
<div class="flex mt-1 text-sm text-gray-400">
|
||||||
<div class="flex-1 text-left pl-10">
|
<div class="flex-1 text-left pl-10">
|
||||||
{{ new Date(event.timestamp).toISOString() }}
|
{{ prettifyTimestamp(event.timestamp) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1 text-right">
|
<div class="flex-1 text-right">
|
||||||
{{ event.fancyTimeAgo }}
|
{{ event.fancyTimeAgo }}
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user