From ced576feba3a9caa39371fe611952f23b97fa8d1 Mon Sep 17 00:00:00 2001 From: Nelson Chan <3271800+chakflying@users.noreply.github.com> Date: Tue, 8 Aug 2023 03:00:40 +0800 Subject: [PATCH] Feat: Show elapsed time in HeartbeatBar (#3219) * Feat: Show elapsed time in HeartbeatBar * Chore: Fix lint * Feat: Fix calculation & improve efficiency * Fix: Fix getting tolerance in statusPage * Chore: Improve comments & apply suggestions * Optional elapsed time --------- Co-authored-by: Louis Lam --- src/components/HeartbeatBar.vue | 107 +++++++++++++++++++++++-- src/components/PublicGroupList.vue | 2 +- src/components/settings/Appearance.vue | 47 +++++++++++ src/lang/en.json | 3 + src/mixins/theme.js | 10 +++ 5 files changed, 162 insertions(+), 7 deletions(-) diff --git a/src/components/HeartbeatBar.vue b/src/components/HeartbeatBar.vue index 1f19180f..8323f7cf 100644 --- a/src/components/HeartbeatBar.vue +++ b/src/components/HeartbeatBar.vue @@ -5,15 +5,24 @@ v-for="(beat, index) in shortBeatList" :key="index" class="beat" - :class="{ 'empty' : (beat === 0), 'down' : (beat.status === 0), 'pending' : (beat.status === 2), 'maintenance' : (beat.status === 3) }" + :class="{ 'empty': (beat === 0), 'down': (beat.status === 0), 'pending': (beat.status === 2), 'maintenance': (beat.status === 3) }" :style="beatStyle" :title="getBeatTitle(beat)" /> +
+
{{ timeSinceFirstBeat }} ago
+
+
{{ timeSinceLastBeat }}
+