Fix issues with critical alerts breaking the simulation

This commit is contained in:
voltsrage
2026-06-25 02:06:35 +08:00
parent df6fbed401
commit 09a84f34ba
29 changed files with 196 additions and 155 deletions
+4 -4
View File
@@ -11,8 +11,8 @@ export const useAlertStore = defineStore('alerts', () => {
const bannerAlerts = ref([])
const pollSeeded = ref(false)
const openAlerts = computed(() => alerts.value.filter(a => a.status === 'Open'))
const criticalAlerts = computed(() => alerts.value.filter(a => a.severity === 'Critical'))
const openAlerts = computed(() => alerts.value.filter(a => a.status === 'OPEN'))
const criticalAlerts = computed(() => alerts.value.filter(a => a.severity === 'CRITICAL'))
function mergeBannerAlerts(newAlerts) {
const existingIds = new Set(bannerAlerts.value.map(alert => alert.id))
@@ -85,7 +85,7 @@ export const useAlertStore = defineStore('alerts', () => {
const updated = await alertsApi.acknowledgeAlert(alertId, note || undefined)
const alert = alerts.value.find(a => a.id === alertId)
if (alert) {
alert.status = updated.status ?? 'Acknowledged'
alert.status = updated.status ?? 'ACKNOWLEDGED'
alert.acknowledgedBy = updated.acknowledgedBy ?? alert.acknowledgedBy
alert.acknowledgedAt = updated.acknowledgedAt ?? alert.acknowledgedAt
}
@@ -96,7 +96,7 @@ export const useAlertStore = defineStore('alerts', () => {
async function resolve(alertId) {
await alertsApi.resolveAlert(alertId)
const alert = alerts.value.find(a => a.id === alertId)
if (alert) alert.status = 'Resolved'
if (alert) alert.status = 'RESOLVED'
dismissBannerAlert(alertId)
}