@riil-frontend/component-topology 7.0.0-dev.1 → 7.0.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/1.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +13 -13
- package/es/core/components/TopoView/topoView.js +15 -20
- package/es/core/components/titlebar/index.js +2 -1
- package/es/core/editor/components/EditorPlugin.js +1 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +2 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/es/core/hooks/useTopoEdit.js +131 -169
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +3 -3
- package/es/core/store/coreModels.js +2 -0
- package/es/core/store/models/selection.js +3 -1
- package/es/core/store/models/topoConfig.js +7 -5
- package/es/core/store/models/topoMod.js +1 -1
- package/es/core/store/models/viewer/resourceDetail.js +31 -0
- package/es/core/utils/saveSerialize.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -5
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +72 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +136 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +9 -16
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +119 -117
- package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
- package/es/networkTopo/getTopoData.js +2 -3
- package/es/networkTopo/store/topoCenter.js +27 -4
- package/es/style.js +22 -22
- package/lib/core/components/TopoView/topoView.js +15 -21
- package/lib/core/components/titlebar/index.js +5 -1
- package/lib/core/editor/components/EditorPlugin.js +1 -3
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +2 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/lib/core/hooks/useTopoEdit.js +131 -169
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +7 -11
- package/lib/core/store/coreModels.js +3 -0
- package/lib/core/store/models/selection.js +3 -1
- package/lib/core/store/models/topoConfig.js +7 -5
- package/lib/core/store/models/topoMod.js +1 -1
- package/lib/core/store/models/viewer/resourceDetail.js +40 -0
- package/lib/core/utils/saveSerialize.js +1 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +71 -46
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +156 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +9 -16
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +119 -117
- package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
- package/lib/networkTopo/getTopoData.js +3 -5
- package/lib/networkTopo/store/topoCenter.js +27 -4
- package/lib/style.js +22 -22
- package/package.json +2 -2
- package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
- package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "7.0.0-dev.
|
26
|
+
var version = typeof "7.0.0-dev.10" === 'string' ? "7.0.0-dev.10" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import
|
4
|
+
import { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
|
5
5
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
6
6
|
export function getLayoutId(layout) {
|
7
7
|
if (!layout || typeof layout === "string") {
|
@@ -33,12 +33,12 @@ export function saveTopo(_x) {
|
|
33
33
|
|
34
34
|
function _saveTopo() {
|
35
35
|
_saveTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
36
|
-
var topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
|
36
|
+
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
|
37
37
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
38
38
|
while (1) {
|
39
39
|
switch (_context.prev = _context.next) {
|
40
40
|
case 0:
|
41
|
-
topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, exportLinkIdList = data.exportLinkIdList, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
41
|
+
topoService = data.topoService, topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, exportLinkIdList = data.exportLinkIdList, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
42
42
|
rlog.debug("saveTopo", data); // 保存布局
|
43
43
|
|
44
44
|
if (!(template && layout)) {
|
@@ -11,6 +11,7 @@ import selection from "./models/selection"; // 显示模式
|
|
11
11
|
|
12
12
|
import topoAlarm from "./models/topoAlarm";
|
13
13
|
import displayConfig from "./models/displayConfig";
|
14
|
+
import resourceDetail from "./models/viewer/resourceDetail";
|
14
15
|
import topoBaseInfoOverview from "./models/topoBaseInfoOverview";
|
15
16
|
import lock from "./models/viewer/lock";
|
16
17
|
export default {
|
@@ -26,6 +27,7 @@ export default {
|
|
26
27
|
// 显示模式
|
27
28
|
topoAlarm: topoAlarm,
|
28
29
|
displayConfig: displayConfig,
|
30
|
+
resourceDetail: resourceDetail,
|
29
31
|
topoBaseInfoOverview: topoBaseInfoOverview,
|
30
32
|
lock: lock
|
31
33
|
};
|
@@ -177,7 +177,7 @@ export default function (topoApp) {
|
|
177
177
|
switch (_context.prev = _context.next) {
|
178
178
|
case 0:
|
179
179
|
_context.next = 2;
|
180
|
-
return
|
180
|
+
return topoApp.serverApi.getConditions(topoApp.id);
|
181
181
|
|
182
182
|
case 2:
|
183
183
|
data = _context.sent;
|
@@ -325,7 +325,7 @@ export default function (topoApp) {
|
|
325
325
|
}); // rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
|
326
326
|
|
327
327
|
_context4.next = 5;
|
328
|
-
return
|
328
|
+
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList);
|
329
329
|
|
330
330
|
case 5:
|
331
331
|
data = _context4.sent;
|
@@ -391,7 +391,7 @@ export default function (topoApp) {
|
|
391
391
|
};
|
392
392
|
rlog.debug('saveGlobalConfig', config);
|
393
393
|
_context5.next = 5;
|
394
|
-
return
|
394
|
+
return topoApp.serverApi.saveTopoSettings(topoApp.id, config);
|
395
395
|
|
396
396
|
case 5:
|
397
397
|
case "end":
|
@@ -414,7 +414,9 @@ export default function (topoApp) {
|
|
414
414
|
case 0:
|
415
415
|
currentBackground = topoApp.store.getModelState("background").current;
|
416
416
|
_context6.next = 3;
|
417
|
-
return _saveTopo(_extends({
|
417
|
+
return _saveTopo(_extends({
|
418
|
+
topoService: topoApp.serverApi
|
419
|
+
}, data, {
|
418
420
|
viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
|
419
421
|
template: state.topoMod.type,
|
420
422
|
// 背景图
|
@@ -442,7 +444,7 @@ export default function (topoApp) {
|
|
442
444
|
case 0:
|
443
445
|
topoId = data.id, ciIdList = data.ciIdList;
|
444
446
|
_context7.next = 3;
|
445
|
-
return
|
447
|
+
return topoApp.serverApi.addToBlocklist(topoId, ciIdList);
|
446
448
|
|
447
449
|
case 3:
|
448
450
|
case "end":
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* 资源概览
|
5
|
+
*/
|
6
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
7
|
+
export default {
|
8
|
+
// 定义 model 的初始 state
|
9
|
+
state: {
|
10
|
+
visible: false,
|
11
|
+
id: null // 资源id
|
12
|
+
|
13
|
+
},
|
14
|
+
// 定义改变该模型状态的纯函数
|
15
|
+
reducers: {
|
16
|
+
update: function update(prevState, payload) {
|
17
|
+
return _extends({}, prevState, payload);
|
18
|
+
},
|
19
|
+
reset: function reset(prevState, payload) {
|
20
|
+
return {
|
21
|
+
visible: false,
|
22
|
+
id: null // 资源id
|
23
|
+
|
24
|
+
};
|
25
|
+
}
|
26
|
+
},
|
27
|
+
// 定义处理该模型副作用的函数
|
28
|
+
effects: function effects(dispatch) {
|
29
|
+
return {};
|
30
|
+
}
|
31
|
+
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
-
|
3
|
+
|
4
4
|
/**
|
5
5
|
* 增加保存拓扑序列化数据方法,以便于拓扑中心和业务拓扑使用
|
6
6
|
*
|
7
7
|
* @param {*} topo
|
8
8
|
*/
|
9
|
-
|
10
9
|
export default function saveSerialize(_x) {
|
11
10
|
return _saveSerialize.apply(this, arguments);
|
12
11
|
}
|
@@ -21,7 +20,7 @@ function _saveSerialize() {
|
|
21
20
|
topoId = topo.getId();
|
22
21
|
serialize = topo.getHtTopo().serialize();
|
23
22
|
_context.next = 4;
|
24
|
-
return
|
23
|
+
return topo.serverApi.saveSerializeData(topoId, serialize);
|
25
24
|
|
26
25
|
case 4:
|
27
26
|
case "end":
|
@@ -11,10 +11,7 @@ export default function ResourceDetail(props) {
|
|
11
11
|
var topo = props.topo,
|
12
12
|
userId = props.userId,
|
13
13
|
activeData = props.activeData,
|
14
|
-
resourceData = props.resourceData;
|
15
|
-
// <Tab.Item title="网络信息表" key="3">网络信息表</Tab.Item>
|
16
|
-
// <Tab.Item title="Web工作台" key="4">Web工作台</Tab.Item> */}
|
17
|
-
|
14
|
+
resourceData = props.resourceData;
|
18
15
|
var tabBodys = [{
|
19
16
|
title: '资源概览',
|
20
17
|
content: /*#__PURE__*/React.createElement(ResourceOverview, _extends({}, props, activeData, {
|
@@ -33,7 +30,7 @@ export default function ResourceDetail(props) {
|
|
33
30
|
data: resourceData,
|
34
31
|
topo: topo
|
35
32
|
}),
|
36
|
-
visible:
|
33
|
+
visible: resourceData.type === 'node' && !!((_topo$viewProps = topo.viewProps) !== null && _topo$viewProps !== void 0 && (_topo$viewProps$topoC = _topo$viewProps.topoContext) !== null && _topo$viewProps$topoC !== void 0 && _topo$viewProps$topoC.isNetworkTopo)
|
37
34
|
}].filter(function (item) {
|
38
35
|
return item.visible !== false;
|
39
36
|
});
|
@@ -4,19 +4,16 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
5
5
|
import { TopoEvent } from '@riil-frontend/component-topology-graph';
|
6
6
|
import PropTypes from 'prop-types';
|
7
|
-
import React, { useEffect,
|
8
|
-
import Tab from "../../../../../components/FullheightTab";
|
7
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
9
8
|
import service from "../../../../services/overview";
|
10
|
-
import ClusterMemberTable from "./components/ClusterMemberTable";
|
11
9
|
import Title from "./components/DrawerTitle";
|
12
|
-
import ResourceOverview from "./components/ResourceOverview";
|
13
|
-
import WebConsole from "./components/WebConsole/WebConsoleContainer";
|
14
10
|
import styles from "./index.module.scss";
|
15
11
|
import ResourceDetail from "./ResourceDetail"; // 基本信息
|
16
12
|
|
17
13
|
function ResourceDetailDrawer(props) {
|
18
14
|
var topo = props.topo,
|
19
|
-
canShow = props.canShow
|
15
|
+
canShow = props.canShow,
|
16
|
+
viewerProps = props.viewerProps;
|
20
17
|
|
21
18
|
var _topo$store$useModel = topo.store.useModel('topoBaseInfoOverview'),
|
22
19
|
topoState = _topo$store$useModel[0],
|
@@ -29,26 +26,35 @@ function ResourceDetailDrawer(props) {
|
|
29
26
|
var _topo$store$useModelS2 = topo.store.useModelState("lock"),
|
30
27
|
lock = _topo$store$useModelS2.lock;
|
31
28
|
|
32
|
-
var
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
var
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
29
|
+
var _topo$store$useModel2 = topo.store.useModel('resourceDetail'),
|
30
|
+
resourceDetailState = _topo$store$useModel2[0],
|
31
|
+
resourceDetailDispatchers = _topo$store$useModel2[1];
|
32
|
+
|
33
|
+
var visible = resourceDetailState.visible,
|
34
|
+
id = resourceDetailState.id;
|
35
|
+
var resourceData = topo.dataModel.useDataById(id);
|
36
|
+
var activeData = useMemo(function () {
|
37
|
+
return resourceData ? {
|
38
|
+
id: resourceData.id,
|
39
|
+
name: resourceData.name,
|
40
|
+
type: resourceData.type === 'node' ? 'node' : 'link',
|
41
|
+
// 类型: node、link
|
42
|
+
ciType: resourceData.ciType,
|
43
|
+
ciName: resourceData.ciName
|
44
|
+
} : {
|
45
|
+
id: '',
|
46
|
+
name: '',
|
47
|
+
type: '',
|
48
|
+
// 类型: node、link
|
49
|
+
ciType: '',
|
50
|
+
ciName: ''
|
51
|
+
};
|
52
|
+
}, [resourceData]);
|
53
|
+
|
54
|
+
var _useState = useState(''),
|
55
|
+
userId = _useState[0],
|
56
|
+
setUserId = _useState[1];
|
57
|
+
|
52
58
|
useEffect(function () {
|
53
59
|
var notifier = topo.view.topoClient.notifier;
|
54
60
|
notifier.on(TopoEvent.EVENT_DOUBLE_CLICK, openOverview);
|
@@ -62,10 +68,17 @@ function ResourceDetailDrawer(props) {
|
|
62
68
|
metricCodes: []
|
63
69
|
});
|
64
70
|
};
|
65
|
-
}, [lock]);
|
71
|
+
}, [lock]);
|
72
|
+
useEffect(function () {
|
73
|
+
return function () {
|
74
|
+
resourceDetailDispatchers.reset();
|
75
|
+
};
|
76
|
+
}, []); // 解决切换拓扑图隐藏概览
|
66
77
|
|
67
78
|
useEffect(function () {
|
68
|
-
|
79
|
+
resourceDetailDispatchers.update({
|
80
|
+
visible: false
|
81
|
+
}); // TODO 其他数据重置
|
69
82
|
}, [topoId]);
|
70
83
|
|
71
84
|
function getUser() {
|
@@ -164,28 +177,42 @@ function ResourceDetailDrawer(props) {
|
|
164
177
|
|
165
178
|
if (!canShow(htElement)) {
|
166
179
|
return;
|
167
|
-
}
|
180
|
+
} // 显示隐藏
|
168
181
|
|
169
|
-
setActiveData({
|
170
|
-
id: id,
|
171
|
-
name: name,
|
172
|
-
type: {
|
173
|
-
linkGroup: 'link',
|
174
|
-
group: 'node'
|
175
|
-
}[type] || type,
|
176
|
-
ciType: ciType,
|
177
|
-
ciName: ciName
|
178
|
-
}); // 显示隐藏
|
179
182
|
|
180
|
-
targetType === 'doubleClick'
|
183
|
+
if (targetType === 'doubleClick') {
|
184
|
+
resourceDetailDispatchers.update({
|
185
|
+
visible: true,
|
186
|
+
id: id
|
187
|
+
});
|
188
|
+
} else {
|
189
|
+
resourceDetailDispatchers.update({
|
190
|
+
id: id
|
191
|
+
});
|
192
|
+
} // userId
|
193
|
+
|
181
194
|
|
182
195
|
getUser();
|
183
196
|
}
|
184
197
|
|
185
198
|
var renderContent = function renderContent() {
|
186
|
-
|
199
|
+
// 支持自定义概览
|
200
|
+
var _ref = (viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.resourceDetailProps) || {},
|
201
|
+
getResourceDetail = _ref.getResourceDetail;
|
202
|
+
|
203
|
+
var ResourceDetailWidget;
|
204
|
+
|
205
|
+
if (getResourceDetail) {
|
206
|
+
ResourceDetailWidget = getResourceDetail(resourceData);
|
207
|
+
}
|
208
|
+
|
209
|
+
if (!ResourceDetailWidget) {
|
210
|
+
ResourceDetailWidget = ResourceDetail;
|
211
|
+
}
|
212
|
+
|
213
|
+
return /*#__PURE__*/React.createElement(ResourceDetailWidget, _extends({}, props, {
|
187
214
|
topo: topo,
|
188
|
-
userId:
|
215
|
+
userId: userId,
|
189
216
|
activeData: activeData,
|
190
217
|
resourceData: resourceData
|
191
218
|
}));
|
@@ -202,7 +229,9 @@ function ResourceDetailDrawer(props) {
|
|
202
229
|
width: 580,
|
203
230
|
hasMask: false,
|
204
231
|
onClose: function onClose() {
|
205
|
-
return
|
232
|
+
return resourceDetailDispatchers.update({
|
233
|
+
visible: false
|
234
|
+
});
|
206
235
|
}
|
207
236
|
}, visible && resourceData && renderContent()));
|
208
237
|
}
|
package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
import _Message from "@alifd/next/es/message";
|
2
|
+
import _Table from "@alifd/next/es/table";
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
4
|
+
import _Button from "@alifd/next/es/button";
|
5
|
+
import _Icon from "@alifd/next/es/icon";
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
7
|
+
import React from 'react';
|
8
|
+
import moment from 'moment';
|
9
|
+
import BlockBox from "./BlockBox";
|
10
|
+
import Link from "../../../../../../../components/Link";
|
11
|
+
import service from "../../../../../../services/overview";
|
12
|
+
import styles from "./index.module.scss"; // url 处理,UICBB 的地址需截取前缀
|
13
|
+
|
14
|
+
function formatUrl(url) {
|
15
|
+
var _window, _window$location;
|
16
|
+
|
17
|
+
var prefix = '/default/pagecenter';
|
18
|
+
|
19
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
20
|
+
return url.split(prefix)[1];
|
21
|
+
} else {
|
22
|
+
return url;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
function EventsCard(props) {
|
27
|
+
var alarmRiskList = props.alarmRiskList,
|
28
|
+
closeDetailDrawer = props.closeDetailDrawer,
|
29
|
+
onHandleAlarm = props.onHandleAlarm; // 告警table列配置
|
30
|
+
|
31
|
+
var columns = [{
|
32
|
+
title: '描述',
|
33
|
+
dataIndex: 'title',
|
34
|
+
key: 'title',
|
35
|
+
cell: function cell(value, index, record) {
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
37
|
+
className: styles['alarm-title'],
|
38
|
+
title: value,
|
39
|
+
onClick: closeDetailDrawer
|
40
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
41
|
+
type: record.icon,
|
42
|
+
size: "xs",
|
43
|
+
className: styles['alarm-color-icon'] + " " + record.className
|
44
|
+
}), /*#__PURE__*/React.createElement(Link, {
|
45
|
+
className: styles.link,
|
46
|
+
to: formatUrl(record.link)
|
47
|
+
}, value));
|
48
|
+
}
|
49
|
+
}, {
|
50
|
+
title: '时间',
|
51
|
+
dataIndex: 'time',
|
52
|
+
key: 'time',
|
53
|
+
width: 144,
|
54
|
+
cell: function cell(value, index, record) {
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
56
|
+
title: moment(value).format('YYYY-MM-DD HH:mm:ss')
|
57
|
+
}, moment(value).format('YYYY-MM-DD HH:mm:ss'));
|
58
|
+
}
|
59
|
+
}, {
|
60
|
+
title: '操作',
|
61
|
+
dataIndex: 'status',
|
62
|
+
key: 'status',
|
63
|
+
width: 64,
|
64
|
+
cell: function cell(status, index, record) {
|
65
|
+
if (record.type === 'alarm') {
|
66
|
+
return status === 'toDeal' ? /*#__PURE__*/React.createElement(_Button, {
|
67
|
+
text: true,
|
68
|
+
type: "primary",
|
69
|
+
onClick: function onClick() {
|
70
|
+
return alarmRiskOperation(record.type, record.params);
|
71
|
+
}
|
72
|
+
}, "\u53D7\u7406") : /*#__PURE__*/React.createElement(_Button, {
|
73
|
+
disabled: true,
|
74
|
+
text: true,
|
75
|
+
type: "primary"
|
76
|
+
}, "\u5DF2\u53D7\u7406");
|
77
|
+
} else {
|
78
|
+
// return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
|
79
|
+
return '';
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}]; // 告警/风险 操作 (受理)
|
83
|
+
|
84
|
+
function alarmRiskOperation(_x, _x2) {
|
85
|
+
return _alarmRiskOperation.apply(this, arguments);
|
86
|
+
}
|
87
|
+
|
88
|
+
function _alarmRiskOperation() {
|
89
|
+
_alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(type, params) {
|
90
|
+
var res;
|
91
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
92
|
+
while (1) {
|
93
|
+
switch (_context.prev = _context.next) {
|
94
|
+
case 0:
|
95
|
+
if (!(type === 'alarm')) {
|
96
|
+
_context.next = 6;
|
97
|
+
break;
|
98
|
+
}
|
99
|
+
|
100
|
+
_context.next = 3;
|
101
|
+
return service.handleAlarm(params);
|
102
|
+
|
103
|
+
case 3:
|
104
|
+
res = _context.sent;
|
105
|
+
|
106
|
+
_Message.success('受理成功');
|
107
|
+
|
108
|
+
onHandleAlarm();
|
109
|
+
|
110
|
+
case 6:
|
111
|
+
case "end":
|
112
|
+
return _context.stop();
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}, _callee);
|
116
|
+
}));
|
117
|
+
return _alarmRiskOperation.apply(this, arguments);
|
118
|
+
}
|
119
|
+
|
120
|
+
return /*#__PURE__*/React.createElement(BlockBox, {
|
121
|
+
headerTitle: "\u6700\u8FD1\u7684\u544A\u8B66\u548C\u98CE\u9669"
|
122
|
+
}, /*#__PURE__*/React.createElement("div", {
|
123
|
+
className: styles.alarm
|
124
|
+
}, /*#__PURE__*/React.createElement(_Table, {
|
125
|
+
hasBorder: false,
|
126
|
+
fixedHeader: true,
|
127
|
+
columns: columns,
|
128
|
+
maxBodyHeight: "auto",
|
129
|
+
dataSource: alarmRiskList,
|
130
|
+
emptyContent: /*#__PURE__*/React.createElement("div", {
|
131
|
+
className: styles['no-data']
|
132
|
+
}, "\u6682\u65E0\u6570\u636E")
|
133
|
+
})));
|
134
|
+
}
|
135
|
+
|
136
|
+
export default EventsCard;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import _Message from "@alifd/next/es/message";
|
2
|
-
import _Table from "@alifd/next/es/table";
|
3
2
|
import _extends from "@babel/runtime/helpers/extends";
|
4
3
|
import _Button from "@alifd/next/es/button";
|
5
4
|
import _Icon from "@alifd/next/es/icon";
|
@@ -28,7 +27,8 @@ import useCiAttrAndMetricData from "./useCiAttrAndMetricData";
|
|
28
27
|
import Configurator from "./components/Configurator";
|
29
28
|
import { formatMetric } from "../../../../../../models/attributeFormatter";
|
30
29
|
import LinkTopoCard from "./components/LinkTopo/LinkTopoCard";
|
31
|
-
import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog';
|
30
|
+
import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog';
|
31
|
+
import EventsCard from "./EventsCard"; // url 处理,UICBB 的地址需截取前缀
|
32
32
|
|
33
33
|
function formatUrl(url) {
|
34
34
|
var _window, _window$location;
|
@@ -943,18 +943,11 @@ export default function ResourceOverview(props) {
|
|
943
943
|
},
|
944
944
|
data: metric,
|
945
945
|
loading: metricInitLoading
|
946
|
-
})), /*#__PURE__*/React.createElement(
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
columns: columns,
|
954
|
-
maxBodyHeight: "auto",
|
955
|
-
dataSource: alarmRiskList,
|
956
|
-
emptyContent: /*#__PURE__*/React.createElement("div", {
|
957
|
-
className: styles['no-data']
|
958
|
-
}, "\u6682\u65E0\u6570\u636E")
|
959
|
-
}))));
|
946
|
+
})), /*#__PURE__*/React.createElement(EventsCard, {
|
947
|
+
alarmRiskList: alarmRiskList,
|
948
|
+
closeDetailDrawer: onClose,
|
949
|
+
onHandleAlarm: function onHandleAlarm() {
|
950
|
+
getAlarmRiskData(id);
|
951
|
+
}
|
952
|
+
}));
|
960
953
|
}
|
@@ -120,7 +120,7 @@ export default function ResourceOverviewMetric(props) {
|
|
120
120
|
padding: 0,
|
121
121
|
appendPadding: [2, 0],
|
122
122
|
smooth: true,
|
123
|
-
tooltip:
|
123
|
+
tooltip: true,
|
124
124
|
line: {
|
125
125
|
color: "l(0) 0:" + hexToRgb(rgbToHex(color).hex, 0.05).rgba + " 0.5:" + color + " 1:" + color,
|
126
126
|
size: 2
|