Skip to content

Commit 3cf4f8e

Browse files
committed
feat: add alert color for outofdate graph
1 parent 0fa3c29 commit 3cf4f8e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

frontend/src/components/TimeStamp.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ const updated_time = useUpdatedTime()
55
</script>
66

77
<template>
8-
<div v-if="updated_time" class="time-stamp">
8+
<div
9+
v-if="updated_time"
10+
:class="new Date() - updated_time > 1000 * 60 ? 'old-alert' : ''"
11+
class="time-stamp"
12+
>
913
<i-ep:refresh class="time-stamp-icon" /><span class="time-stamp-text">{{
1014
updated_time.toLocaleTimeString()
1115
}}</span>
@@ -14,6 +18,7 @@ const updated_time = useUpdatedTime()
1418

1519
<style lang="css" scoped>
1620
.time-stamp {
21+
color: whitesmoke;
1722
font-weight: 600;
1823
background-color: rgb(255, 157, 87);
1924
padding: 2px 4px;
@@ -30,4 +35,12 @@ const updated_time = useUpdatedTime()
3035
.dark .time-stamp {
3136
background-color: chocolate;
3237
}
38+
39+
.old-alert {
40+
background-color: rgb(227, 38, 38);
41+
}
42+
43+
.dark .old-alert {
44+
background-color: rgb(188, 18, 18);
45+
}
3346
</style>

0 commit comments

Comments
 (0)