feat(ui): show when each alert last fired
This commit is contained in:
1 parent
c6afe1eaf6
commit
e2dd83546d
2 files changed
+88
-79
No files matched your search
@@ -6,6 +6,7 @@ import { RouterLink } from "vue-router";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import { ago } from "@/lib/format";
|
||||
import { groupBySeverity, type AlertSeverity, type OperatorAlert } from "./alerts";
|
||||
import { useAlerts } from "./use-alerts";
|
||||
|
||||
@@ -62,7 +63,15 @@ function failedDeliveries(alert: OperatorAlert): number {
|
||||
:class="alert.link && 'group'"
|
||||
@click="alert.link && (open = false)"
|
||||
>
|
||||
<span class="text-sm font-medium group-hover:underline">{{ alert.title }}</span>
|
||||
<span class="flex flex-wrap items-baseline gap-x-2">
|
||||
<span class="text-sm font-medium group-hover:underline">{{ alert.title }}</span>
|
||||
<time
|
||||
class="shrink-0 text-xs whitespace-nowrap text-fg-subtle"
|
||||
:datetime="alert.last_seen"
|
||||
:title="new Date(alert.last_seen).toLocaleString()"
|
||||
>{{ ago(alert.last_seen) }}</time
|
||||
>
|
||||
</span>
|
||||
<span v-if="alert.body" class="text-xs text-fg-subtle">{{ alert.body }}</span>
|
||||
<span v-if="failedDeliveries(alert)" class="text-xs text-warn">Webhook delivery failed.</span>
|
||||
</component>
|
||||
|
||||
Reference in new issue
Block a user