diff --git a/apps/daas/src/views/notification/NotificationRecordDrawer.vue b/apps/daas/src/views/notification/NotificationRecordDrawer.vue index 21fff3a40..e537488e4 100644 --- a/apps/daas/src/views/notification/NotificationRecordDrawer.vue +++ b/apps/daas/src/views/notification/NotificationRecordDrawer.vue @@ -5,6 +5,7 @@ import { type NotificationRecordDetail, } from '@tap/api/src/core/notification' import { getTaskById } from '@tap/api/src/core/task' +import { ErrorMessage } from '@tap/business/src/components/error-message' import { getAlarmKeyMap } from '@tap/business/src/shared/alarm' import { ALARM_LEVEL_MAP } from '@tap/business/src/shared/const' import dayjs from 'dayjs' @@ -45,6 +46,22 @@ const open = computed({ const fmt = (time?: string) => time ? dayjs(time).format('YYYY-MM-DD HH:mm:ss') : '-' +const summaryMessage = (message?: string) => { + if (!message) return '' + const lines = message.split(/\r?\n/) + const firstFrameIdx = lines.findIndex((line) => /^\s*at\s+\S/.test(line)) + const headerLines = ( + firstFrameIdx > 0 ? lines.slice(0, firstFrameIdx) : [lines[0]] + ) + .map((line) => line.trim()) + .filter(Boolean) + return headerLines.join(' ').replaceAll(/\s*;\s*/g, '; ') +} + +function showFailureDetail(message: string) { + ErrorMessage(message, summaryMessage(message)) +} + const STATUS_TYPES: Record = { SUCCESS: 'success', FAILED: 'danger', @@ -270,12 +287,29 @@ function goAlarm() { min-width="160" >