Skip to content

Commit 0b78bf4

Browse files
committed
Fix(alarm): TAP-11387 harden alarm monitor display
Handle source heartbeat idle alarm records that may not map to an existing DAG node or known frontend alarm dictionaries. Guard node alarm aggregation and fall back to raw alarm level and status values when labels are missing. Refs: TAP-11387
1 parent eb05561 commit 0b78bf4

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

packages/dag/src/components/monitor/components/Alert.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default {
122122
const alarmList = this.alarmData?.alarmList || []
123123
const totals = alarmList.length
124124
alarmList.forEach((el) => {
125-
if (el.nodeId) {
125+
if (el.nodeId && nodeMap[el.nodeId]) {
126126
nodeMap[el.nodeId].num++
127127
}
128128
})
@@ -161,9 +161,11 @@ export default {
161161
}
162162
return (
163163
data.map((t) => {
164-
t.levelLabel = ALARM_LEVEL_MAP[t.level].text
165-
t.levelType = ALARM_LEVEL_MAP[t.level].type
166-
t.statusLabel = ALARM_STATUS_MAP[t.status].text
164+
const level = ALARM_LEVEL_MAP[t.level] || {}
165+
const status = ALARM_STATUS_MAP[t.status] || {}
166+
t.levelLabel = level.text || t.level
167+
t.levelType = level.type
168+
t.statusLabel = status.text || t.status
167169
return t
168170
}) || []
169171
)
@@ -185,9 +187,11 @@ export default {
185187
}
186188
this.list =
187189
data.map((t) => {
188-
t.levelLabel = ALARM_LEVEL_MAP[t.level].text
189-
t.levelType = ALARM_LEVEL_MAP[t.level].type
190-
t.statusLabel = ALARM_STATUS_MAP[t.status].text
190+
const level = ALARM_LEVEL_MAP[t.level] || {}
191+
const status = ALARM_STATUS_MAP[t.status] || {}
192+
t.levelLabel = level.text || t.level
193+
t.levelType = level.type
194+
t.statusLabel = status.text || t.status
191195
return t
192196
}) || []
193197
},

packages/types/src/daas-components.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ declare module 'vue' {
109109
ILucideChevronsRight: typeof import('~icons/lucide/chevrons-right')['default']
110110
ILucideCircleAlert: typeof import('~icons/lucide/circle-alert')['default']
111111
ILucideCircleCheck: typeof import('~icons/lucide/circle-check')['default']
112-
ILucideCircleInfo: typeof import('~icons/lucide/circle-info')['default']
113112
ILucideCircleX: typeof import('~icons/lucide/circle-x')['default']
114113
ILucideClock: typeof import('~icons/lucide/clock')['default']
115114
ILucideCloudUpload: typeof import('~icons/lucide/cloud-upload')['default']
@@ -143,7 +142,6 @@ declare module 'vue' {
143142
ILucideLink2: typeof import('~icons/lucide/link2')['default']
144143
ILucideList: typeof import('~icons/lucide/list')['default']
145144
ILucideLoader: typeof import('~icons/lucide/loader')['default']
146-
ILucideLoader2: typeof import('~icons/lucide/loader2')['default']
147145
ILucideMemoryStick: typeof import('~icons/lucide/memory-stick')['default']
148146
ILucideMinus: typeof import('~icons/lucide/minus')['default']
149147
ILucideMonitor: typeof import('~icons/lucide/monitor')['default']
@@ -323,7 +321,6 @@ declare global {
323321
const ILucideChevronsRight: typeof import('~icons/lucide/chevrons-right')['default']
324322
const ILucideCircleAlert: typeof import('~icons/lucide/circle-alert')['default']
325323
const ILucideCircleCheck: typeof import('~icons/lucide/circle-check')['default']
326-
const ILucideCircleInfo: typeof import('~icons/lucide/circle-info')['default']
327324
const ILucideCircleX: typeof import('~icons/lucide/circle-x')['default']
328325
const ILucideClock: typeof import('~icons/lucide/clock')['default']
329326
const ILucideCloudUpload: typeof import('~icons/lucide/cloud-upload')['default']
@@ -357,7 +354,6 @@ declare global {
357354
const ILucideLink2: typeof import('~icons/lucide/link2')['default']
358355
const ILucideList: typeof import('~icons/lucide/list')['default']
359356
const ILucideLoader: typeof import('~icons/lucide/loader')['default']
360-
const ILucideLoader2: typeof import('~icons/lucide/loader2')['default']
361357
const ILucideMemoryStick: typeof import('~icons/lucide/memory-stick')['default']
362358
const ILucideMinus: typeof import('~icons/lucide/minus')['default']
363359
const ILucideMonitor: typeof import('~icons/lucide/monitor')['default']

0 commit comments

Comments
 (0)