Fix issues with critical alerts breaking the simulation
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user