@riil-frontend/component-topology 2.15.22 → 2.15.25
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/index.css +1 -1
- package/build/index.js +14 -14
- package/es/core/components/AlarmListPanel/index.js +17 -35
- package/es/core/components/TopoView/topoView.js +2 -0
- package/es/core/components/titlebar/TitleBar.js +3 -3
- package/es/core/models/Alarm.js +30 -51
- package/es/core/models/AttributeMetricDisplay.js +76 -55
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +1 -1
- package/es/core/viewer/components/plugins/BaseInfo/index.js +58 -79
- package/es/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +31 -29
- package/es/style.js +1 -0
- package/es/topoCenter/components/TopoView.js +7 -6
- package/lib/core/components/AlarmListPanel/index.js +19 -36
- package/lib/core/components/TopoView/topoView.js +2 -0
- package/lib/core/components/titlebar/TitleBar.js +2 -2
- package/lib/core/models/Alarm.js +30 -51
- package/lib/core/models/AttributeMetricDisplay.js +76 -55
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +1 -1
- package/lib/core/viewer/components/plugins/BaseInfo/index.js +58 -79
- package/lib/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +33 -28
- package/lib/style.js +1 -0
- package/lib/topoCenter/components/TopoView.js +5 -4
- package/package.json +4 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _Dialog from "@alifd/next/es/dialog";
|
|
2
1
|
import _List from "@alifd/next/es/list";
|
|
3
2
|
import React, { useState, useEffect } from "react";
|
|
4
3
|
import AlarmListItem from "./components/AlarmListItem";
|
|
@@ -6,23 +5,22 @@ import { Link } from "react-router-dom";
|
|
|
6
5
|
import NoDataPage from "@riil-frontend/component-no-data-page";
|
|
7
6
|
import styles from "./index.module.scss";
|
|
8
7
|
import { alarmListDemo } from "./mocks";
|
|
8
|
+
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
9
9
|
|
|
10
10
|
function AlarmListPanel(props, ref) {
|
|
11
11
|
// 传入参数
|
|
12
12
|
var topo = props.topo,
|
|
13
13
|
target = props.toolBarRef,
|
|
14
|
+
titleBarRef = props.titleBarRef,
|
|
14
15
|
visible = props.visible;
|
|
15
|
-
var alarm = topo.alarm;
|
|
16
16
|
|
|
17
17
|
var _useState = useState([]),
|
|
18
18
|
alarmList = _useState[0],
|
|
19
19
|
setAlarmList = _useState[1];
|
|
20
20
|
|
|
21
|
-
var _topo$store$useModel = topo.store.useModel(
|
|
21
|
+
var _topo$store$useModel = topo.store.useModel("topoAlarm"),
|
|
22
22
|
alarmState = _topo$store$useModel[0],
|
|
23
|
-
alarmDispatchers = _topo$store$useModel[1];
|
|
24
|
-
// const{ alarmPanelIsOpen } = store.getState().topoMod;
|
|
25
|
-
|
|
23
|
+
alarmDispatchers = _topo$store$useModel[1];
|
|
26
24
|
|
|
27
25
|
var alarmData = alarmState.alarmData,
|
|
28
26
|
alarmPanelIsOpen = alarmState.alarmPanelIsOpen,
|
|
@@ -34,42 +32,19 @@ function AlarmListPanel(props, ref) {
|
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
useEffect(function () {
|
|
37
|
-
// console.log(
|
|
38
|
-
// "AlarmListPanel-useEffect",
|
|
39
|
-
// topo,
|
|
40
|
-
// alarmPanelIsOpen,
|
|
41
|
-
// alarmIsOpened,
|
|
42
|
-
// alarmData,
|
|
43
|
-
// alarmList
|
|
44
|
-
// );
|
|
45
35
|
if (alarmData) {
|
|
46
36
|
var _alarmData$slice;
|
|
47
37
|
|
|
48
|
-
topo.alarm.switchAlarmPopPanel(alarmIsOpened &&
|
|
49
|
-
|
|
38
|
+
rlog.debug("AlarmListPanel-useEffect", alarmIsOpened); // topo.alarm.switchAlarmPopPanel(alarmIsOpened && alarmData?.length > 0);
|
|
39
|
+
|
|
40
|
+
setAlarmList((_alarmData$slice = alarmData === null || alarmData === void 0 ? void 0 : alarmData.slice(0, 10)) !== null && _alarmData$slice !== void 0 ? _alarmData$slice : []);
|
|
50
41
|
} else {
|
|
51
42
|
setAlarmList([]);
|
|
52
43
|
}
|
|
53
44
|
}, [alarmData]);
|
|
54
|
-
return /*#__PURE__*/React.createElement(
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
55
46
|
className: styles.AlarmListPanel,
|
|
56
|
-
id: "AlarmListPanel"
|
|
57
|
-
align: false,
|
|
58
|
-
top: 100,
|
|
59
|
-
overlayProps: {
|
|
60
|
-
style: {
|
|
61
|
-
right: 15,
|
|
62
|
-
top: 100
|
|
63
|
-
},
|
|
64
|
-
target: {
|
|
65
|
-
target: target
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
onClose: onClose,
|
|
69
|
-
hasMask: false,
|
|
70
|
-
closeMode: "close",
|
|
71
|
-
visible: alarmPanelIsOpen,
|
|
72
|
-
footer: false
|
|
47
|
+
id: "AlarmListPanel"
|
|
73
48
|
}, /*#__PURE__*/React.createElement(_List, {
|
|
74
49
|
header: /*#__PURE__*/React.createElement("div", {
|
|
75
50
|
style: {
|
|
@@ -80,7 +55,14 @@ function AlarmListPanel(props, ref) {
|
|
|
80
55
|
}, "\u5173\u8054\u544A\u8B66\u4FE1\u606F"), /*#__PURE__*/React.createElement(Link, {
|
|
81
56
|
className: styles.listTitleLink,
|
|
82
57
|
to: "/default/alarmCenter/alarmList"
|
|
83
|
-
}, "\u67E5\u770B\u6240\u6709\u544A\u8B66")
|
|
58
|
+
}, "\u67E5\u770B\u6240\u6709\u544A\u8B66"), /*#__PURE__*/React.createElement("a", {
|
|
59
|
+
role: "button",
|
|
60
|
+
"aria-label": "\u5173\u95ED",
|
|
61
|
+
className: "next-dialog-close",
|
|
62
|
+
onClick: onClose
|
|
63
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
64
|
+
className: "next-icon next-icon-close next-medium next-dialog-close-icon"
|
|
65
|
+
}))),
|
|
84
66
|
dataSource: alarmList,
|
|
85
67
|
emptyContent: /*#__PURE__*/React.createElement(NoDataPage, {
|
|
86
68
|
className: styles.emptyContent,
|
|
@@ -64,6 +64,7 @@ var TopoView = function TopoView(props) {
|
|
|
64
64
|
tData = _useState[0],
|
|
65
65
|
setTData = _useState[1];
|
|
66
66
|
|
|
67
|
+
var titleBarRef = useRef();
|
|
67
68
|
var topoEdit = useTopoEdit({
|
|
68
69
|
topo: topo,
|
|
69
70
|
topoId: topoId,
|
|
@@ -264,6 +265,7 @@ var TopoView = function TopoView(props) {
|
|
|
264
265
|
}), isEditMode && /*#__PURE__*/React.createElement(EditorPlugin, {
|
|
265
266
|
topo: topo,
|
|
266
267
|
topoEdit: topoEdit,
|
|
268
|
+
titleBarRef: titleBarRef,
|
|
267
269
|
topoContext: {
|
|
268
270
|
urlParams: urlParams
|
|
269
271
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["topo", "render", "viewerProps"];
|
|
4
|
-
import React, { useState, useEffect, useRef, useCallback } from
|
|
4
|
+
import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
5
5
|
import PropTypes from "prop-types";
|
|
6
6
|
import TopoViewerTitleBar from "../../viewer/components/titlebar/TopoViewerTitleBar";
|
|
7
7
|
import TopoEditorTitleBar from "../../editor/components/titlebar/TopoEditorTitleBar";
|
|
@@ -14,11 +14,11 @@ function TitleBar(props) {
|
|
|
14
14
|
|
|
15
15
|
var store = topo.store;
|
|
16
16
|
|
|
17
|
-
var _store$useModel = store.useModel(
|
|
17
|
+
var _store$useModel = store.useModel("topoMod"),
|
|
18
18
|
topoState = _store$useModel[0];
|
|
19
19
|
|
|
20
20
|
var viewState = topoState.viewState;
|
|
21
|
-
var isEditMode = viewState ===
|
|
21
|
+
var isEditMode = viewState === "edit";
|
|
22
22
|
|
|
23
23
|
if (render) {
|
|
24
24
|
return render({
|
package/es/core/models/Alarm.js
CHANGED
|
@@ -216,12 +216,13 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
216
216
|
while (1) {
|
|
217
217
|
switch (_context3.prev = _context3.next) {
|
|
218
218
|
case 0:
|
|
219
|
-
|
|
219
|
+
console.log("switchAlarmPopPanel", flag);
|
|
220
|
+
topoDispatchers = this.topo.store.getModelDispatchers("topoAlarm");
|
|
220
221
|
topoDispatchers.update({
|
|
221
222
|
alarmPanelIsOpen: flag
|
|
222
223
|
});
|
|
223
224
|
|
|
224
|
-
case
|
|
225
|
+
case 3:
|
|
225
226
|
case "end":
|
|
226
227
|
return _context3.stop();
|
|
227
228
|
}
|
|
@@ -360,35 +361,13 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
360
361
|
* 打开\关闭告警列表弹窗
|
|
361
362
|
*
|
|
362
363
|
*/
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
370
|
-
while (1) {
|
|
371
|
-
switch (_context6.prev = _context6.next) {
|
|
372
|
-
case 0:
|
|
373
|
-
console.log("switchAlarmPopPanel", flag);
|
|
374
|
-
this.updateState({
|
|
375
|
-
alarmPanelIsOpen: flag
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
case 2:
|
|
379
|
-
case "end":
|
|
380
|
-
return _context6.stop();
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}, _callee6, this);
|
|
384
|
-
}));
|
|
364
|
+
// async switchAlarmPopPanel(flag) {
|
|
365
|
+
// console.log("switchAlarmPopPanel", flag);
|
|
366
|
+
// this.updateState({
|
|
367
|
+
// alarmPanelIsOpen: flag,
|
|
368
|
+
// });
|
|
369
|
+
// }
|
|
385
370
|
|
|
386
|
-
function switchAlarmPopPanel(_x5) {
|
|
387
|
-
return _switchAlarmPopPanel2.apply(this, arguments);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
return switchAlarmPopPanel;
|
|
391
|
-
}()
|
|
392
371
|
/**
|
|
393
372
|
* 当资源变化时,需要刷新。
|
|
394
373
|
*/
|
|
@@ -397,22 +376,22 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
397
376
|
_proto.restart =
|
|
398
377
|
/*#__PURE__*/
|
|
399
378
|
function () {
|
|
400
|
-
var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
379
|
+
var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
401
380
|
var id;
|
|
402
|
-
return _regeneratorRuntime.wrap(function
|
|
381
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
403
382
|
while (1) {
|
|
404
|
-
switch (
|
|
383
|
+
switch (_context6.prev = _context6.next) {
|
|
405
384
|
case 0:
|
|
406
385
|
id = this.currentTopoId;
|
|
407
|
-
|
|
386
|
+
_context6.next = 3;
|
|
408
387
|
return this.openTopoAlarm(id);
|
|
409
388
|
|
|
410
389
|
case 3:
|
|
411
390
|
case "end":
|
|
412
|
-
return
|
|
391
|
+
return _context6.stop();
|
|
413
392
|
}
|
|
414
393
|
}
|
|
415
|
-
},
|
|
394
|
+
}, _callee6, this);
|
|
416
395
|
}));
|
|
417
396
|
|
|
418
397
|
function restart() {
|
|
@@ -430,12 +409,12 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
430
409
|
_proto.getAlarmByEE =
|
|
431
410
|
/*#__PURE__*/
|
|
432
411
|
function () {
|
|
433
|
-
var _getAlarmByEE = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
412
|
+
var _getAlarmByEE = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(alertData) {
|
|
434
413
|
var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist;
|
|
435
414
|
|
|
436
|
-
return _regeneratorRuntime.wrap(function
|
|
415
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
437
416
|
while (1) {
|
|
438
|
-
switch (
|
|
417
|
+
switch (_context7.prev = _context7.next) {
|
|
439
418
|
case 0:
|
|
440
419
|
_this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
|
|
441
420
|
resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
|
|
@@ -445,7 +424,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
445
424
|
console.log("getAlarmByEE-接收到推送的原始告警信息", alertData);
|
|
446
425
|
|
|
447
426
|
if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
|
|
448
|
-
|
|
427
|
+
_context7.next = 25;
|
|
449
428
|
break;
|
|
450
429
|
}
|
|
451
430
|
|
|
@@ -478,19 +457,19 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
478
457
|
}); // rlog.debug("before-combAlarmData", al, bizState);
|
|
479
458
|
|
|
480
459
|
if (!(sendAl.length > 0)) {
|
|
481
|
-
|
|
460
|
+
_context7.next = 25;
|
|
482
461
|
break;
|
|
483
462
|
}
|
|
484
463
|
|
|
485
464
|
rlog.debug("过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl", alarmIsOpened, sendAl);
|
|
486
|
-
|
|
487
|
-
|
|
465
|
+
_context7.prev = 13;
|
|
466
|
+
_context7.next = 16;
|
|
488
467
|
return alarmDispatchers.combAlarmData({
|
|
489
468
|
alarmdata: sendAl
|
|
490
469
|
});
|
|
491
470
|
|
|
492
471
|
case 16:
|
|
493
|
-
_yield$alarmDispatche =
|
|
472
|
+
_yield$alarmDispatche = _context7.sent;
|
|
494
473
|
eqFlag = _yield$alarmDispatche.eqFlag;
|
|
495
474
|
alarmlist = _yield$alarmDispatche.alarmlist;
|
|
496
475
|
|
|
@@ -499,23 +478,23 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
499
478
|
this.hmGetTopoAlarm();
|
|
500
479
|
}
|
|
501
480
|
|
|
502
|
-
|
|
481
|
+
_context7.next = 25;
|
|
503
482
|
break;
|
|
504
483
|
|
|
505
484
|
case 22:
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
rlog.error("告警发送异常",
|
|
485
|
+
_context7.prev = 22;
|
|
486
|
+
_context7.t0 = _context7["catch"](13);
|
|
487
|
+
rlog.error("告警发送异常", _context7.t0);
|
|
509
488
|
|
|
510
489
|
case 25:
|
|
511
490
|
case "end":
|
|
512
|
-
return
|
|
491
|
+
return _context7.stop();
|
|
513
492
|
}
|
|
514
493
|
}
|
|
515
|
-
},
|
|
494
|
+
}, _callee7, this, [[13, 22]]);
|
|
516
495
|
}));
|
|
517
496
|
|
|
518
|
-
function getAlarmByEE(
|
|
497
|
+
function getAlarmByEE(_x5) {
|
|
519
498
|
return _getAlarmByEE.apply(this, arguments);
|
|
520
499
|
}
|
|
521
500
|
|
|
@@ -24,7 +24,12 @@ function filterUnExistedFields(fields, ciTypeMeta) {
|
|
|
24
24
|
return fields.filter(function (item) {
|
|
25
25
|
return isFieldExisted(item, ciTypeMeta);
|
|
26
26
|
});
|
|
27
|
-
}
|
|
27
|
+
} // 无权限不显示标注、悬浮框
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var filterByPermission = function filterByPermission(resource, items) {
|
|
31
|
+
return resource.operation ? items : [];
|
|
32
|
+
};
|
|
28
33
|
/**
|
|
29
34
|
* 资源标注、悬浮框数据
|
|
30
35
|
*/
|
|
@@ -152,6 +157,31 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
152
157
|
tips: []
|
|
153
158
|
};
|
|
154
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* 查询需要查询数据的连线
|
|
162
|
+
* @param {*} data
|
|
163
|
+
* @returns
|
|
164
|
+
*/
|
|
165
|
+
;
|
|
166
|
+
|
|
167
|
+
_proto.getEdges = function getEdges(data) {
|
|
168
|
+
// 获得图上业务节点、业务连线
|
|
169
|
+
var _ref2 = data || this.topo.dataModel.getData(),
|
|
170
|
+
links = _ref2.links,
|
|
171
|
+
linkGroups = _ref2.linkGroups;
|
|
172
|
+
|
|
173
|
+
return [].concat(links.map(function (link) {
|
|
174
|
+
return _extends({}, link, {
|
|
175
|
+
type: 'edge'
|
|
176
|
+
});
|
|
177
|
+
}), linkGroups.map(function (link) {
|
|
178
|
+
return _extends({}, link, {
|
|
179
|
+
type: 'edgeGroup'
|
|
180
|
+
});
|
|
181
|
+
})).filter(function (link) {
|
|
182
|
+
return link.ciType === 'network_link';
|
|
183
|
+
});
|
|
184
|
+
}
|
|
155
185
|
/**
|
|
156
186
|
* 获取资源的标注、悬浮框配置,只包含属性和指标字段。无权限的资源无配置
|
|
157
187
|
*
|
|
@@ -165,15 +195,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
165
195
|
var _this = this;
|
|
166
196
|
|
|
167
197
|
// 获得图上业务节点、业务连线
|
|
168
|
-
var
|
|
169
|
-
nodes =
|
|
170
|
-
links = _ref2.links,
|
|
171
|
-
linkGroups = _ref2.linkGroups; // 无权限不显示标注、悬浮框
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
var filterByPermission = function filterByPermission(resource, items) {
|
|
175
|
-
return resource.operation ? items : [];
|
|
176
|
-
};
|
|
198
|
+
var _ref3 = data || this.topo.dataModel.getData(),
|
|
199
|
+
nodes = _ref3.nodes;
|
|
177
200
|
|
|
178
201
|
return [].concat(nodes.filter(function (node) {
|
|
179
202
|
return !!node.ciType;
|
|
@@ -189,29 +212,13 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
189
212
|
tags: filterByPermission(node, ciTypeConfig.tags),
|
|
190
213
|
tips: filterByPermission(node, ciTypeConfig.tips)
|
|
191
214
|
};
|
|
192
|
-
}),
|
|
193
|
-
return link.ciType === 'network_link';
|
|
194
|
-
}).map(function (link) {
|
|
215
|
+
}), this.getEdges().map(function (link) {
|
|
195
216
|
var ciType = link.ciType;
|
|
196
217
|
|
|
197
218
|
var ciTypeConfig = _this.getNetworkLinkConfig(link, config);
|
|
198
219
|
|
|
199
220
|
return {
|
|
200
|
-
type:
|
|
201
|
-
id: link.id,
|
|
202
|
-
ciType: ciType,
|
|
203
|
-
tags: filterByPermission(link, ciTypeConfig.tags),
|
|
204
|
-
tips: filterByPermission(link, ciTypeConfig.tips)
|
|
205
|
-
};
|
|
206
|
-
}), linkGroups.filter(function (link) {
|
|
207
|
-
return link.ciType === 'network_link';
|
|
208
|
-
}).map(function (link) {
|
|
209
|
-
var ciType = link.ciType;
|
|
210
|
-
|
|
211
|
-
var ciTypeConfig = _this.getNetworkLinkConfig(link, config);
|
|
212
|
-
|
|
213
|
-
return {
|
|
214
|
-
type: 'edgeGroup',
|
|
221
|
+
type: link.type,
|
|
215
222
|
id: link.id,
|
|
216
223
|
ciType: ciType,
|
|
217
224
|
tags: filterByPermission(link, ciTypeConfig.tags),
|
|
@@ -226,6 +233,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
226
233
|
|
|
227
234
|
return this.getResourceTagTipConfig().map(function (ciConfig) {
|
|
228
235
|
var fields = {
|
|
236
|
+
ciType: ciConfig.ciType,
|
|
237
|
+
type: ciConfig.type,
|
|
229
238
|
id: ciConfig.id,
|
|
230
239
|
attributes: [],
|
|
231
240
|
metrics: []
|
|
@@ -314,9 +323,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
314
323
|
|
|
315
324
|
_proto.updateNodesNameVisible = function updateNodesNameVisible() {
|
|
316
325
|
var dm = this.topo.getDataModel();
|
|
317
|
-
this.getNodesNameVisible().forEach(function (
|
|
318
|
-
var id =
|
|
319
|
-
visible =
|
|
326
|
+
this.getNodesNameVisible().forEach(function (_ref4) {
|
|
327
|
+
var id = _ref4.id,
|
|
328
|
+
visible = _ref4.visible;
|
|
320
329
|
dm.getDataByTag(id).a('isShowName', visible);
|
|
321
330
|
});
|
|
322
331
|
}
|
|
@@ -333,14 +342,14 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
333
342
|
var _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
334
343
|
var _this4 = this;
|
|
335
344
|
|
|
336
|
-
var
|
|
345
|
+
var topo, _topo$store$getState$, resIdsList, nodeIdsList, codes, param, linkAdapter, result;
|
|
337
346
|
|
|
338
347
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
339
348
|
while (1) {
|
|
340
349
|
switch (_context.prev = _context.next) {
|
|
341
350
|
case 0:
|
|
342
351
|
linkAdapter = function _linkAdapter(data) {
|
|
343
|
-
var link =
|
|
352
|
+
var link = topo.dataModel.getDataById(data.id);
|
|
344
353
|
|
|
345
354
|
if (!link) {
|
|
346
355
|
return data;
|
|
@@ -353,9 +362,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
353
362
|
});
|
|
354
363
|
};
|
|
355
364
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
365
|
+
topo = this.topo;
|
|
366
|
+
_topo$store$getState$ = topo.store.getState().topoBizMod.resAndMetrics, resIdsList = _topo$store$getState$.resIdsList, nodeIdsList = _topo$store$getState$.nodeIdsList; // rlog.debug('根据ci的id获取属性的值-getCiArrByIds', resIdsList, metrics);
|
|
367
|
+
// 无资源,不查询
|
|
359
368
|
|
|
360
369
|
if (resIdsList.length) {
|
|
361
370
|
_context.next = 5;
|
|
@@ -370,14 +379,17 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
370
379
|
|
|
371
380
|
case 7:
|
|
372
381
|
// 需要查询的指标列表
|
|
373
|
-
codes = this.getResourceMetricCodes();
|
|
374
|
-
// return [];
|
|
375
|
-
// }
|
|
376
|
-
|
|
382
|
+
codes = this.getResourceMetricCodes();
|
|
377
383
|
param = {
|
|
378
384
|
ciId: nodeIdsList,
|
|
379
385
|
codes: codes,
|
|
380
|
-
|
|
386
|
+
// 过滤掉不需要查询的
|
|
387
|
+
relationId: this.getEdges().map(function (edge) {
|
|
388
|
+
return {
|
|
389
|
+
ciId: edge.id,
|
|
390
|
+
operation: edge.operation
|
|
391
|
+
};
|
|
392
|
+
})
|
|
381
393
|
};
|
|
382
394
|
/**
|
|
383
395
|
* 链路属性适配
|
|
@@ -511,20 +523,29 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
511
523
|
attributeMap = ciData.attributeMap;
|
|
512
524
|
ciRefAttributeMap[id] = [];
|
|
513
525
|
|
|
514
|
-
_this5.topo.ciTyeCache.getCiType(ciType)
|
|
515
|
-
return !!attributeMeta.refCi;
|
|
516
|
-
}).forEach(function (attributeMeta) {
|
|
517
|
-
var refId = attributeMap[attributeMeta.code];
|
|
526
|
+
var ciTypeMeta = _this5.topo.ciTyeCache.getCiType(ciType);
|
|
518
527
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
528
|
+
if (ciTypeMeta) {
|
|
529
|
+
ciTypeMeta.attributes.filter(function (attributeMeta) {
|
|
530
|
+
return !!attributeMeta.refCi;
|
|
531
|
+
}).forEach(function (attributeMeta) {
|
|
532
|
+
var refId = attributeMap[attributeMeta.code];
|
|
533
|
+
|
|
534
|
+
if (refId && !refIdMap[refId]) {
|
|
535
|
+
refIdMap[refId] = true;
|
|
536
|
+
}
|
|
522
537
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
538
|
+
ciRefAttributeMap[id].push({
|
|
539
|
+
attrCode: attributeMeta.code,
|
|
540
|
+
id: refId
|
|
541
|
+
});
|
|
526
542
|
});
|
|
527
|
-
}
|
|
543
|
+
} else {
|
|
544
|
+
rlog.warn('推送属性指标数据:未查询到ciType', {
|
|
545
|
+
ciData: ciData,
|
|
546
|
+
ciType: ciType
|
|
547
|
+
});
|
|
548
|
+
}
|
|
528
549
|
});
|
|
529
550
|
refIds = Object.keys(refIdMap);
|
|
530
551
|
|
|
@@ -659,9 +680,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
659
680
|
var _this6 = this;
|
|
660
681
|
|
|
661
682
|
// 查询没有关联链路的连线组及对应子链路列表
|
|
662
|
-
var _this$topo$store$
|
|
663
|
-
links = _this$topo$store$
|
|
664
|
-
linkGroups = _this$topo$store$
|
|
683
|
+
var _this$topo$store$getM = this.topo.store.getModelState('topoMod').data,
|
|
684
|
+
links = _this$topo$store$getM.links,
|
|
685
|
+
linkGroups = _this$topo$store$getM.linkGroups;
|
|
665
686
|
|
|
666
687
|
var getLinkUId = function getLinkUId(link) {
|
|
667
688
|
return [link.source, link.target].sort().join('-');
|
|
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
22
22
|
|
|
23
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.25" === 'string' ? "2.15.25" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|