diff --git a/package.json b/package.json
index 067d673b..a00b4d4c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "n9e-fe",
- "version": "5.0.0-ga-03",
+ "version": "5.0.0-ga-04",
"scripts": {
"dev": "vite --port 8765 --host",
"preinstall": "sh beforeinstall.sh",
diff --git a/src/pages/dashboard/chartGroup.tsx b/src/pages/dashboard/chartGroup.tsx
index eae71828..e235fc17 100644
--- a/src/pages/dashboard/chartGroup.tsx
+++ b/src/pages/dashboard/chartGroup.tsx
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useContext, useCallback, ReactElement, RefObject } from 'react';
-import { Button, Collapse, Modal, Menu, Dropdown, Divider, Popover, Checkbox } from 'antd';
+import { Button, Collapse, Modal, Menu, Dropdown, Divider, Popover, Checkbox, Tooltip } from 'antd';
import { Responsive, WidthProvider } from 'react-grid-layout';
const ResponsiveReactGridLayout = WidthProvider(Responsive);
const { Panel } = Collapse;
@@ -527,7 +527,11 @@ export default function ChartGroup(props: Props) {
legend: legend,
step,
range,
- title: name,
+ title: (
+
+ {name}
+
+ ),
promqls,
legendTitleFormats,
}}
diff --git a/src/pages/event/detail.tsx b/src/pages/event/detail.tsx
index e5138080..5d356beb 100644
--- a/src/pages/event/detail.tsx
+++ b/src/pages/event/detail.tsx
@@ -2,7 +2,7 @@ import PageLayout from '@/components/pageLayout';
import React, { useEffect, useState } from 'react';
import { useHistory, useParams } from 'react-router';
import { getAlertEventsById, getHistoryEventsById } from '@/services/warning';
-import { Button, Card, Col, Row, Space, Spin, Tag, Typography } from 'antd';
+import { Button, Card, Col, message, Row, Space, Spin, Tag, Typography } from 'antd';
import { priorityColor } from '@/utils/constant';
import './detail.less';
import moment from 'moment';
@@ -56,7 +56,7 @@ const EventDetailPage: React.FC = () => {
label: '事件标签',
key: 'tags',
render(tags) {
- return tags.map((tag) => {tag});
+ return tags ? tags.map((tag) => {tag}) : '';
},
},
{ label: '对象备注', key: 'target_note' },
@@ -124,20 +124,22 @@ const EventDetailPage: React.FC = () => {
label: '告警接收组',
key: 'notify_groups_obj',
render(groups) {
- return groups.map((group) => {group.name});
+ return groups ? groups.map((group) => {group.name}) : '';
},
},
{
label: '回调地址',
key: 'callbacks',
render(callbacks) {
- return callbacks.map((callback) => (
-
-
- {callback}
-
-
- ));
+ return callbacks
+ ? callbacks.map((callback) => (
+
+
+ {callback}
+
+
+ ))
+ : '';
},
},
{
@@ -174,14 +176,16 @@ const EventDetailPage: React.FC = () => {
type='primary'
onClick={() => {
history.push('/alert-mutes/add', {
- tags: eventDetail.tags.map((tag) => {
- const [key, value] = tag.split('=');
- return {
- func: '==',
- key,
- value,
- };
- }),
+ tags: eventDetail.tags
+ ? eventDetail.tags.map((tag) => {
+ const [key, value] = tag.split('=');
+ return {
+ func: '==',
+ key,
+ value,
+ };
+ })
+ : [],
});
}}
>
@@ -190,11 +194,15 @@ const EventDetailPage: React.FC = () => {
{!isHistory && (