Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions apps/daas/src/i18n/langs/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -2381,7 +2381,7 @@ export default {
'Data source protocol connection takes time',
daas_setting_setting_shujuyuanwanglu: 'Data source network connection time',
daas_setting_setting_renwudezengliang: 'Replication delay for tasks',
daas_setting_settingcenter_gaojingshezhi: 'Alert settings',
daas_setting_settingcenter_gaojingshezhi: 'Alert Settings',
packages_nodeDesign_custom_node_name_required: 'Please enter the node name',
packages_nodeDesign_message_save_ok: 'Save Successfully',
share_detail_title: 'Mining table details',
Expand Down Expand Up @@ -2785,9 +2785,9 @@ export default {
// TAP-13052 告警事件 / 通知记录 / 操作审计
page_title_ops_center: 'Operations',
page_title_message_center: 'Messages & Notifications',
page_title_alarm_notification: 'Alarms & Notifications',
page_title_alarm_events: 'Alarm Events',
page_title_notification_records: 'Notification Records',
page_title_alarm_notification: 'Alert Center',
page_title_alarm_events: 'Alerts',
page_title_notification_records: 'Notifications',
page_title_operation_audit: 'Audit Logs',
notification_modular_alarm: 'alarm event',
notification_operation_unread: 'marked as unread',
Expand All @@ -2796,6 +2796,7 @@ export default {
alarm_event_stats_severe: 'Critical/Emergency',
alarm_event_stats_today_new: 'New Today',
alarm_event_stats_today_recovered: 'Recovered Today',
alarm_event_status_all: 'All statuses',
alarm_event_object_type: 'Object Type',
alarm_object_type_TASK: 'Task',
alarm_object_type_NODE: 'Node',
Expand All @@ -2816,8 +2817,8 @@ export default {
alarm_event_close_hint:
'Closing only stops tracking this alarm; it does not mean the problem has recovered',
alarm_event_close_confirm:
'Closing stops tracking the selected alarms. It does not mean the problem has recovered, and it will be recorded in the operation audit. Close them?',
alarm_event_detail: 'Alarm Details',
'Closing stops tracking the selected alarms. It does not mean the problem has recovered, and it will be recorded in the audit logs. Close them?',
alarm_event_detail: 'Alert Details',
alarm_event_overview: 'Overview',
alarm_event_id: 'Alarm ID',
alarm_event_type: 'Alarm Type',
Expand All @@ -2836,7 +2837,7 @@ export default {
alarm_event_open_setting: 'Open Alarm Settings',
alarm_event_notification_overview: 'Notification Overview',
alarm_event_latest_notify: 'Last notified',
alarm_event_view_notifications: 'View notification records',
alarm_event_view_notifications: 'View Notifications',
delivery_channel_system: 'In-app message',
delivery_channel_email: 'Email',
delivery_channel_webhook: 'Webhook',
Expand Down Expand Up @@ -2889,7 +2890,7 @@ export default {
notification_record_detail: 'Notification Details',
notification_record_read_at: 'Read at',
notification_record_basic: 'Basic Information',
notification_record_view_alarm: 'View Alarm Event',
notification_record_view_alarm: 'View Alert',
notification_record_deliveries: 'Deliveries',
notification_record_no_delivery:
'No delivery details (historical record or no external channel)',
Expand All @@ -2903,7 +2904,7 @@ export default {
notification_bell_title: 'Unread ({0})',
notification_platform_license:
'License expires in {0} days, please renew in time',
notification_view_all_records: 'View all notification records',
notification_view_all_records: 'View All Notifications',
notification_setting_retired_tip:
'In-app system notifications are retired. Task errors, validation errors and Agent status are now notified by alarm rules; configure channels and recipients in Alarm Settings. Existing email notifications below still apply.',
// TAP-13018 审计日志
Expand Down
13 changes: 7 additions & 6 deletions apps/daas/src/i18n/langs/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -2631,8 +2631,8 @@ export default {
// TAP-13052 告警事件 / 通知记录 / 操作审计
page_title_ops_center: '运维中心',
page_title_message_center: '消息与通知',
page_title_alarm_notification: '告警与通知',
page_title_alarm_events: '告警事件',
page_title_alarm_notification: '告警中心',
page_title_alarm_events: '告警列表',
page_title_notification_records: '通知记录',
page_title_operation_audit: '审计日志',
notification_modular_alarm: '告警事件',
Expand All @@ -2642,6 +2642,7 @@ export default {
alarm_event_stats_severe: '严重/紧急',
alarm_event_stats_today_new: '今日新增',
alarm_event_stats_today_recovered: '今日已恢复',
alarm_event_status_all: '全部状态',
alarm_event_object_type: '对象类型',
alarm_object_type_TASK: '任务',
alarm_object_type_NODE: '节点',
Expand All @@ -2661,7 +2662,7 @@ export default {
alarm_event_go_task: '前往任务',
alarm_event_close_hint: '关闭只表示结束对该告警的跟踪,不代表问题已恢复',
alarm_event_close_confirm:
'关闭后将结束对所选告警的跟踪,不代表问题已恢复,且会记录到操作审计。确定关闭吗?',
'关闭后将结束对所选告警的跟踪,不代表问题已恢复,且会记录到审计日志。确定关闭吗?',
alarm_event_detail: '告警详情',
alarm_event_overview: '告警概览',
alarm_event_id: '告警 ID',
Expand All @@ -2681,7 +2682,7 @@ export default {
alarm_event_open_setting: '打开告警设置',
alarm_event_notification_overview: '通知概览',
alarm_event_latest_notify: '最近通知时间',
alarm_event_view_notifications: '查看全部通知记录',
alarm_event_view_notifications: '查看通知记录',
delivery_channel_system: '站内消息',
delivery_channel_email: '邮件',
delivery_channel_webhook: 'Webhook',
Expand Down Expand Up @@ -2730,7 +2731,7 @@ export default {
notification_record_detail: '通知详情',
notification_record_read_at: '读取时间',
notification_record_basic: '基本信息',
notification_record_view_alarm: '查看告警事件',
notification_record_view_alarm: '查看告警',
notification_record_deliveries: '发送明细',
notification_record_no_delivery:
'该通知没有发送明细(历史记录或未配置外部渠道)',
Expand All @@ -2743,7 +2744,7 @@ export default {
'邮件“成功”表示邮件服务器已接收,不代表收件人已打开;同一次发送的收件人共用同一结果,服务器明确拒收的地址会单独标记失败。',
notification_bell_title: '未读通知({0})',
notification_platform_license: 'License 还有 {0} 天到期,请及时续期',
notification_view_all_records: '查看全部通知记录',
notification_view_all_records: '查看全部通知',
notification_setting_retired_tip:
'站内系统通知已下线:任务异常、校验异常、Agent 状态等提醒统一由告警规则产生,请在告警设置中配置渠道与接收人;下方已配置的邮件提醒仍然生效。',
// TAP-13018 审计日志
Expand Down
15 changes: 8 additions & 7 deletions apps/daas/src/i18n/langs/zh-TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -2617,17 +2617,18 @@ export default {
// TAP-13052 告警事件 / 通知记录 / 操作审计
page_title_ops_center: '運維中心',
page_title_message_center: '訊息與通知',
page_title_alarm_notification: '告警與通知',
page_title_alarm_events: '告警事件',
page_title_alarm_notification: '告警中心',
page_title_alarm_events: '告警列表',
page_title_notification_records: '通知記錄',
page_title_operation_audit: '稽核日誌',
page_title_operation_audit: '審計日誌',
notification_modular_alarm: '告警事件',
notification_operation_unread: '標記為未讀',
notification_operation_close: '關閉了',
alarm_event_stats_alarming: '告警中',
alarm_event_stats_severe: '嚴重/緊急',
alarm_event_stats_today_new: '今日新增',
alarm_event_stats_today_recovered: '今日已恢復',
alarm_event_status_all: '全部狀態',
alarm_event_object_type: '對象類型',
alarm_object_type_TASK: '任務',
alarm_object_type_NODE: '節點',
Expand All @@ -2647,7 +2648,7 @@ export default {
alarm_event_go_task: '前往任務',
alarm_event_close_hint: '關閉只表示結束對該告警的追蹤,不代表問題已恢復',
alarm_event_close_confirm:
'關閉後將結束對所選告警的追蹤,不代表問題已恢復,且會記錄到操作審計。確定關閉嗎?',
'關閉後將結束對所選告警的追蹤,不代表問題已恢復,且會記錄到審計日誌。確定關閉嗎?',
alarm_event_detail: '告警詳情',
alarm_event_overview: '告警概覽',
alarm_event_id: '告警 ID',
Expand All @@ -2667,7 +2668,7 @@ export default {
alarm_event_open_setting: '打開告警設置',
alarm_event_notification_overview: '通知概覽',
alarm_event_latest_notify: '最近通知時間',
alarm_event_view_notifications: '查看全部通知記錄',
alarm_event_view_notifications: '查看通知記錄',
delivery_channel_system: '站內訊息',
delivery_channel_email: '郵件',
delivery_channel_webhook: 'Webhook',
Expand Down Expand Up @@ -2717,7 +2718,7 @@ export default {
notification_record_detail: '通知詳情',
notification_record_read_at: '讀取時間',
notification_record_basic: '基本資訊',
notification_record_view_alarm: '查看告警事件',
notification_record_view_alarm: '查看告警',
notification_record_deliveries: '發送明細',
notification_record_no_delivery:
'該通知沒有發送明細(歷史記錄或未配置外部渠道)',
Expand All @@ -2730,7 +2731,7 @@ export default {
'郵件「成功」表示郵件伺服器已接收,不代表收件人已開啟;同一次發送的收件人共用同一結果,伺服器明確拒收的地址會單獨標記失敗。',
notification_bell_title: '未讀通知({0})',
notification_platform_license: 'License 還有 {0} 天到期,請及時續期',
notification_view_all_records: '查看全部通知記錄',
notification_view_all_records: '查看全部通知',
notification_setting_retired_tip:
'站內系統通知已下線:任務異常、校驗異常、Agent 狀態等提醒統一由告警規則產生,請在告警設置中配置渠道與接收人;下方已配置的郵件提醒仍然生效。',
// TAP-13018 审计日志
Expand Down
12 changes: 12 additions & 0 deletions apps/daas/src/layouts/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface MenuItem {
code?: string
parent?: string
to?: { name: string }
openFirstChild?: boolean
}

interface MenuGroup {
Expand Down Expand Up @@ -130,6 +131,16 @@ const menuHandler = (name: string) => {
})
}

// 仅作容器的一级菜单展开时进入第一个可见子页面;已在其子页面内时只展开不跳转
const openHandler = (name: string) => {
const menu = menus.value.find((item) => item.name === name)
if (!menu?.openFirstChild || !menu.children) return
const visibleChildren = menu.children.filter((child) => !child.hidden)
if (visibleChildren.some((child) => child.name === activeMenu.value)) return
const first = visibleChildren[0]
if (first) menuHandler(first.name)
}

// Setup the component
onMounted(() => {
getMenus()
Expand All @@ -147,6 +158,7 @@ onMounted(() => {
:default-openeds="openedMenus"
:collapse-transition="false"
@select="menuHandler"
@open="openHandler"
>
<template v-for="menu in menusGroup.top" :key="menu.name">
<ElSubMenu
Expand Down
2 changes: 2 additions & 0 deletions apps/daas/src/router/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export const MENU = [
label: 'page_title_alarm_notification',
icon: 'notice-system-notice',
group: 'bottom',
// 告警中心仅作为菜单容器,展开时默认进入第一个可见子页面(通知记录)
openFirstChild: true,
children: [{ name: 'notificationRecords' }, { name: 'alarmEvents' }],
},
{
Expand Down
6 changes: 6 additions & 0 deletions apps/daas/src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,12 @@ export const routes = [
},
],
},
/* ---------- 告警中心(菜单容器,默认进入通知记录) ----------*/
{
path: '/alert-center',
name: 'alertCenter',
redirect: { name: 'notificationRecords' },
},
/* ---------- 通知模块(旧入口,重定向至 §4.1 新入口) ----------*/
{
path: '/notification',
Expand Down
3 changes: 3 additions & 0 deletions apps/daas/src/views/notification/AlarmEventDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const hasPermissionByCode = inject<(code: string) => boolean>(
)
const canViewNotifications =
hasPermissionByCode?.('v2_notification_record') ?? false
const canOpenAlarmSetting =
hasPermissionByCode?.('v2_alarm_settings_menu') ?? false

const loading = ref(false)
const detail = ref<AlarmEvent | null>(null)
Expand Down Expand Up @@ -195,6 +197,7 @@ function openNotifications() {
>{{ t('alarm_event_open_monitor') }}</el-button
>
<el-button
v-if="canOpenAlarmSetting"
text
type="primary"
@click="router.push({ name: 'alarmSetting' })"
Expand Down
3 changes: 3 additions & 0 deletions apps/daas/src/views/notification/AlarmEvents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ export default {
label: i18n.t('daas_notification_systemalarm_gaojingzhuangtai'),
key: 'status',
type: 'select-inner',
// 默认展示「全部状态」,明确列表同时包含告警中、已恢复和已关闭的告警
placeholder: i18n.t('alarm_event_status_all'),
items: [
{ label: i18n.t('alarm_event_status_all'), value: '' },
{
label: i18n.t('packages_business_shared_const_gaojingzhong'),
value: 'ING',
Expand Down
11 changes: 7 additions & 4 deletions apps/daas/src/views/notification/NotificationRecordDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,16 @@ function goAlarm() {
>
{{ t('alarm_event_go_task') }}
</el-button>
<!-- 无关联告警、历史记录或告警已清除时不展示无效跳转 -->
<el-button
v-if="canViewAlarm"
v-if="
canViewAlarm &&
!detail.legacy &&
!detail.alarmEventMissing &&
!noRelatedAlarm
"
text
type="primary"
:disabled="
detail.legacy || detail.alarmEventMissing || noRelatedAlarm
"
@click="goAlarm"
>
{{ t('notification_record_view_alarm') }}
Expand Down
12 changes: 6 additions & 6 deletions apps/daas/src/views/role/Role.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ElMessage } from 'element-plus'
import { computed, onMounted, reactive, ref } from 'vue'

import { useRoute, useRouter } from 'vue-router'
import { PERMISSION_TITLE_KEYS } from './permission-titles'

const { t } = useI18n()
const route = useRoute()
Expand All @@ -24,7 +25,6 @@ const MODULE_ICONS: Record<string, string> = {
v2_data_pipeline: 'migrate',
v2_advanced_features: 'vip-one',
'v2_data-server': 'apiServer_navbar',
'v2_ops-center': 'warning',
'v2_message-center': 'notice-system-notice',
'v2_system-management': 'setting',
}
Expand Down Expand Up @@ -430,9 +430,11 @@ const pageSort = [
},
],
},
// 与左侧菜单一致:告警中心下依次为通知记录、告警列表,不再单独显示运维中心
{
name: 'v2_ops-center',
name: 'v2_message-center',
children: [
{ name: 'v2_notification_record' },
{
name: 'v2_alarm_event',
buttons: [
Expand All @@ -445,10 +447,6 @@ const pageSort = [
},
],
},
{
name: 'v2_message-center',
children: [{ name: 'v2_notification_record' }],
},
{
name: 'v2_system-management',
children: [
Expand Down Expand Up @@ -690,6 +688,8 @@ function getPermission() {
return items.map((item) => {
const page = pageMap[item.name]
const menu = Object.assign({}, item, page)
const titleKey = PERMISSION_TITLE_KEYS[item.name]
if (titleKey) menu.description = t(titleKey)
if (menu.children) {
menu.children = pageMenu(menu.children)
}
Expand Down
8 changes: 8 additions & 0 deletions apps/daas/src/views/role/permission-titles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// 告警中心相关权限节点按左侧菜单名称展示和搜索:后端未提供这些权限描述的三语翻译,
// 仅替换显示名称,权限码与保存内容不变
export const PERMISSION_TITLE_KEYS: Record<string, string> = {
'v2_message-center': 'page_title_alarm_notification',
v2_notification_record: 'page_title_notification_records',
v2_alarm_event: 'page_title_alarm_events',
v2_audit_log: 'page_title_operation_audit',
}
Loading
Loading