@riil-frontend/component-topology 12.1.0-dev.8 → 12.1.0-dev.9
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 +6 -6
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
- package/es/core/models/Alarm.js +14 -15
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +51 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
- package/es/utils/topoData.js +1 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +1 -1
- package/lib/core/models/Alarm.js +14 -15
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +52 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
- package/lib/utils/topoData.js +1 -1
- package/package.json +2 -2
@@ -32,8 +32,8 @@ function AlarmListItem(props) {
|
|
32
32
|
// 传入参数
|
33
33
|
var topo = props.topo,
|
34
34
|
alarmInfo = props.alarmInfo,
|
35
|
-
onClick = props.onClick;
|
36
|
-
|
35
|
+
onClick = props.onClick; // console.log("AlarmListPanel", topo, alarmInfo);
|
36
|
+
|
37
37
|
return /*#__PURE__*/React.createElement(_List.Item, {
|
38
38
|
className: styles.AlarmListItem,
|
39
39
|
media: /*#__PURE__*/React.createElement(_Icon, {
|
@@ -7,7 +7,7 @@ import React, { useState, useMemo } from 'react';
|
|
7
7
|
import LayoutSettings from "./components/LayoutSettings";
|
8
8
|
import WidgetBox from "../WidgetBox";
|
9
9
|
import DropdownButton from "../components/DropdownButton";
|
10
|
-
import { isGroup, isLayer } from "../../../../../../utils/htElementDataUtil";
|
10
|
+
import { isGroup, isLayer, isNode } from "../../../../../../utils/htElementDataUtil";
|
11
11
|
|
12
12
|
function Layout(props) {
|
13
13
|
var topo = props.topo,
|
@@ -147,7 +147,7 @@ function isLayoutEnabled(props) {
|
|
147
147
|
} //中心节点布局,选中一个节点不是分层的情况下,按钮亮起
|
148
148
|
|
149
149
|
|
150
|
-
if (topoShowType !== 'layers' && selection.length === 1) {
|
150
|
+
if (topoShowType !== 'layers' && selection.length === 1 && (isNode(selection[0]) || isGroup(selection[0]))) {
|
151
151
|
return true;
|
152
152
|
}
|
153
153
|
|
package/es/core/models/Alarm.js
CHANGED
@@ -459,14 +459,14 @@ var Alarm = /*#__PURE__*/function () {
|
|
459
459
|
console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
460
460
|
|
461
461
|
if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
|
462
|
-
_context8.next =
|
462
|
+
_context8.next = 25;
|
463
463
|
break;
|
464
464
|
}
|
465
465
|
|
466
466
|
sendAl = [];
|
467
467
|
idsList = [].concat(nodeIdsList, linkIdsList);
|
468
|
-
operations = [];
|
469
|
-
|
468
|
+
operations = []; // console.log('idsList---------', idsList)
|
469
|
+
|
470
470
|
idsList.forEach(function (idItem) {
|
471
471
|
if (idItem.operation === null) {
|
472
472
|
operations.push(idItem.ciId);
|
@@ -492,22 +492,21 @@ var Alarm = /*#__PURE__*/function () {
|
|
492
492
|
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
493
493
|
sendAl.push(obj);
|
494
494
|
}
|
495
|
-
});
|
496
|
-
console.log("before-combAlarmData", sendAl, idsList);
|
495
|
+
}); // console.log("before-combAlarmData", sendAl, idsList);
|
497
496
|
|
498
497
|
if (!(sendAl.length > 0)) {
|
499
|
-
_context8.next =
|
498
|
+
_context8.next = 25;
|
500
499
|
break;
|
501
500
|
}
|
502
501
|
|
503
502
|
rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
|
504
|
-
_context8.prev =
|
505
|
-
_context8.next =
|
503
|
+
_context8.prev = 13;
|
504
|
+
_context8.next = 16;
|
506
505
|
return alarmDispatchers.combAlarmData({
|
507
506
|
alarmdata: sendAl
|
508
507
|
});
|
509
508
|
|
510
|
-
case
|
509
|
+
case 16:
|
511
510
|
_yield$alarmDispatche2 = _context8.sent;
|
512
511
|
eqFlag = _yield$alarmDispatche2.eqFlag;
|
513
512
|
alarmlist = _yield$alarmDispatche2.alarmlist;
|
@@ -528,19 +527,19 @@ var Alarm = /*#__PURE__*/function () {
|
|
528
527
|
}
|
529
528
|
}
|
530
529
|
|
531
|
-
_context8.next =
|
530
|
+
_context8.next = 25;
|
532
531
|
break;
|
533
532
|
|
534
|
-
case
|
535
|
-
_context8.prev =
|
536
|
-
_context8.t0 = _context8["catch"](
|
533
|
+
case 22:
|
534
|
+
_context8.prev = 22;
|
535
|
+
_context8.t0 = _context8["catch"](13);
|
537
536
|
rlog.error('告警发送异常', _context8.t0);
|
538
537
|
|
539
|
-
case
|
538
|
+
case 25:
|
540
539
|
case "end":
|
541
540
|
return _context8.stop();
|
542
541
|
}
|
543
|
-
}, _callee8, this, [[
|
542
|
+
}, _callee8, this, [[13, 22]]);
|
544
543
|
}));
|
545
544
|
|
546
545
|
function handleAlarmEvent(_x6) {
|
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "12.1.0-dev.
|
27
|
+
var version = typeof "12.1.0-dev.9" === 'string' ? "12.1.0-dev.9" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -9,32 +9,70 @@ import BlockBox from "./BlockBox";
|
|
9
9
|
import Link from "../../../../../../../components/Link";
|
10
10
|
import service from "../../../../../../services/overview";
|
11
11
|
import styles from "./index.module.scss";
|
12
|
+
import { getHistory } from '@riil-frontend/component-topology-utils';
|
12
13
|
|
13
14
|
function formatUrl(url) {
|
14
|
-
|
15
|
+
var _window, _window$location;
|
16
|
+
|
17
|
+
console.log(url);
|
18
|
+
var prefix = '/default/pagecenter';
|
19
|
+
|
20
|
+
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) {
|
21
|
+
return url.split(prefix)[1];
|
22
|
+
} else {
|
23
|
+
return url;
|
24
|
+
}
|
15
25
|
}
|
16
26
|
|
17
27
|
function EventsCard(props) {
|
18
28
|
var alarmRiskList = props.alarmRiskList,
|
19
29
|
closeDetailDrawer = props.closeDetailDrawer,
|
20
|
-
onHandleAlarm = props.onHandleAlarm;
|
30
|
+
onHandleAlarm = props.onHandleAlarm;
|
31
|
+
|
32
|
+
var jumpTo = function jumpTo(url) {
|
33
|
+
closeDetailDrawer();
|
34
|
+
|
35
|
+
if (topo.viewProps.jumpto) {
|
36
|
+
topo.viewProps.jumpto(url);
|
37
|
+
} else {
|
38
|
+
getHistory().push(formatUrl(url));
|
39
|
+
}
|
40
|
+
}; // 告警table列配置
|
41
|
+
|
21
42
|
|
22
43
|
var columns = [{
|
23
44
|
title: "描述",
|
24
45
|
dataIndex: "title",
|
25
46
|
key: "title",
|
26
47
|
cell: function cell(value, index, record) {
|
27
|
-
return
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
48
|
+
return (
|
49
|
+
/*#__PURE__*/
|
50
|
+
// <div
|
51
|
+
// className={styles["alarm-title"]}
|
52
|
+
// title={value}
|
53
|
+
// onClick={closeDetailDrawer}
|
54
|
+
// >
|
55
|
+
// <Icon
|
56
|
+
// type={record.icon}
|
57
|
+
// size="xs"
|
58
|
+
// className={`${styles["alarm-color-icon"]} ${record.className}`}
|
59
|
+
// />
|
60
|
+
// <Link to={formatUrl(record.link)}>{value}</Link>
|
61
|
+
// </div>
|
62
|
+
React.createElement("div", {
|
63
|
+
className: styles['alarm-title'],
|
64
|
+
title: value,
|
65
|
+
onClick: function onClick() {
|
66
|
+
jumpTo(record.link);
|
67
|
+
}
|
68
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
69
|
+
type: record.icon,
|
70
|
+
size: "xs",
|
71
|
+
className: styles['alarm-color-icon'] + " " + record.className
|
72
|
+
}), /*#__PURE__*/React.createElement("span", {
|
73
|
+
className: styles.link
|
74
|
+
}, value))
|
75
|
+
);
|
38
76
|
}
|
39
77
|
}, {
|
40
78
|
title: "时间",
|
package/es/utils/topoData.js
CHANGED
@@ -190,7 +190,7 @@ function buildGlobal(_ref2) {
|
|
190
190
|
// 是否可编辑----控制[编辑]按钮
|
191
191
|
moveable: true,
|
192
192
|
// 节点是否可移动
|
193
|
-
toggleGroupByDblClick:
|
193
|
+
toggleGroupByDblClick: false
|
194
194
|
}, (result === null || result === void 0 ? void 0 : (_result$global2 = result.global) === null || _result$global2 === void 0 ? void 0 : _result$global2.control) || {}, (result === null || result === void 0 ? void 0 : (_result$customGlobal = result.customGlobal) === null || _result$customGlobal === void 0 ? void 0 : _result$customGlobal.control) || {}),
|
195
195
|
topoDisplayConfig: _extends({
|
196
196
|
// alarmSwitch: (result.global || {}).alarmSwitch ?? true,
|
@@ -50,8 +50,8 @@ function AlarmListItem(props) {
|
|
50
50
|
// 传入参数
|
51
51
|
var topo = props.topo,
|
52
52
|
alarmInfo = props.alarmInfo,
|
53
|
-
onClick = props.onClick;
|
54
|
-
|
53
|
+
onClick = props.onClick; // console.log("AlarmListPanel", topo, alarmInfo);
|
54
|
+
|
55
55
|
return /*#__PURE__*/_react["default"].createElement(_list["default"].Item, {
|
56
56
|
className: _indexModule["default"].AlarmListItem,
|
57
57
|
media: /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
@@ -162,7 +162,7 @@ function isLayoutEnabled(props) {
|
|
162
162
|
} //中心节点布局,选中一个节点不是分层的情况下,按钮亮起
|
163
163
|
|
164
164
|
|
165
|
-
if (topoShowType !== 'layers' && selection.length === 1) {
|
165
|
+
if (topoShowType !== 'layers' && selection.length === 1 && ((0, _htElementDataUtil.isNode)(selection[0]) || (0, _htElementDataUtil.isGroup)(selection[0]))) {
|
166
166
|
return true;
|
167
167
|
}
|
168
168
|
|
package/lib/core/models/Alarm.js
CHANGED
@@ -481,14 +481,14 @@ var Alarm = /*#__PURE__*/function () {
|
|
481
481
|
console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
482
482
|
|
483
483
|
if (!((0, _utils.isAvailableArray)(alertData) && (0, _utils.isAvailableArray)(resIdsList))) {
|
484
|
-
_context8.next =
|
484
|
+
_context8.next = 25;
|
485
485
|
break;
|
486
486
|
}
|
487
487
|
|
488
488
|
sendAl = [];
|
489
489
|
idsList = [].concat(nodeIdsList, linkIdsList);
|
490
|
-
operations = [];
|
491
|
-
|
490
|
+
operations = []; // console.log('idsList---------', idsList)
|
491
|
+
|
492
492
|
idsList.forEach(function (idItem) {
|
493
493
|
if (idItem.operation === null) {
|
494
494
|
operations.push(idItem.ciId);
|
@@ -514,23 +514,22 @@ var Alarm = /*#__PURE__*/function () {
|
|
514
514
|
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
515
515
|
sendAl.push(obj);
|
516
516
|
}
|
517
|
-
});
|
518
|
-
console.log("before-combAlarmData", sendAl, idsList);
|
517
|
+
}); // console.log("before-combAlarmData", sendAl, idsList);
|
519
518
|
|
520
519
|
if (!(sendAl.length > 0)) {
|
521
|
-
_context8.next =
|
520
|
+
_context8.next = 25;
|
522
521
|
break;
|
523
522
|
}
|
524
523
|
|
525
524
|
_componentTopologyUtils.rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
|
526
525
|
|
527
|
-
_context8.prev =
|
528
|
-
_context8.next =
|
526
|
+
_context8.prev = 13;
|
527
|
+
_context8.next = 16;
|
529
528
|
return alarmDispatchers.combAlarmData({
|
530
529
|
alarmdata: sendAl
|
531
530
|
});
|
532
531
|
|
533
|
-
case
|
532
|
+
case 16:
|
534
533
|
_yield$alarmDispatche2 = _context8.sent;
|
535
534
|
eqFlag = _yield$alarmDispatche2.eqFlag;
|
536
535
|
alarmlist = _yield$alarmDispatche2.alarmlist;
|
@@ -551,20 +550,20 @@ var Alarm = /*#__PURE__*/function () {
|
|
551
550
|
}
|
552
551
|
}
|
553
552
|
|
554
|
-
_context8.next =
|
553
|
+
_context8.next = 25;
|
555
554
|
break;
|
556
555
|
|
557
|
-
case
|
558
|
-
_context8.prev =
|
559
|
-
_context8.t0 = _context8["catch"](
|
556
|
+
case 22:
|
557
|
+
_context8.prev = 22;
|
558
|
+
_context8.t0 = _context8["catch"](13);
|
560
559
|
|
561
560
|
_componentTopologyUtils.rlog.error('告警发送异常', _context8.t0);
|
562
561
|
|
563
|
-
case
|
562
|
+
case 25:
|
564
563
|
case "end":
|
565
564
|
return _context8.stop();
|
566
565
|
}
|
567
|
-
}, _callee8, this, [[
|
566
|
+
}, _callee8, this, [[13, 22]]);
|
568
567
|
}));
|
569
568
|
|
570
569
|
function handleAlarmEvent(_x6) {
|
@@ -54,7 +54,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
54
54
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "12.1.0-dev.
|
57
|
+
var version = typeof "12.1.0-dev.9" === 'string' ? "12.1.0-dev.9" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -27,31 +27,70 @@ var _overview = _interopRequireDefault(require("../../../../../../services/overv
|
|
27
27
|
|
28
28
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
29
29
|
|
30
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
31
|
+
|
30
32
|
function formatUrl(url) {
|
31
|
-
|
33
|
+
var _window, _window$location;
|
34
|
+
|
35
|
+
console.log(url);
|
36
|
+
var prefix = '/default/pagecenter';
|
37
|
+
|
38
|
+
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) {
|
39
|
+
return url.split(prefix)[1];
|
40
|
+
} else {
|
41
|
+
return url;
|
42
|
+
}
|
32
43
|
}
|
33
44
|
|
34
45
|
function EventsCard(props) {
|
35
46
|
var alarmRiskList = props.alarmRiskList,
|
36
47
|
closeDetailDrawer = props.closeDetailDrawer,
|
37
|
-
onHandleAlarm = props.onHandleAlarm;
|
48
|
+
onHandleAlarm = props.onHandleAlarm;
|
49
|
+
|
50
|
+
var jumpTo = function jumpTo(url) {
|
51
|
+
closeDetailDrawer();
|
52
|
+
|
53
|
+
if (topo.viewProps.jumpto) {
|
54
|
+
topo.viewProps.jumpto(url);
|
55
|
+
} else {
|
56
|
+
(0, _componentTopologyUtils.getHistory)().push(formatUrl(url));
|
57
|
+
}
|
58
|
+
}; // 告警table列配置
|
59
|
+
|
38
60
|
|
39
61
|
var columns = [{
|
40
62
|
title: "描述",
|
41
63
|
dataIndex: "title",
|
42
64
|
key: "title",
|
43
65
|
cell: function cell(value, index, record) {
|
44
|
-
return
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
66
|
+
return (
|
67
|
+
/*#__PURE__*/
|
68
|
+
// <div
|
69
|
+
// className={styles["alarm-title"]}
|
70
|
+
// title={value}
|
71
|
+
// onClick={closeDetailDrawer}
|
72
|
+
// >
|
73
|
+
// <Icon
|
74
|
+
// type={record.icon}
|
75
|
+
// size="xs"
|
76
|
+
// className={`${styles["alarm-color-icon"]} ${record.className}`}
|
77
|
+
// />
|
78
|
+
// <Link to={formatUrl(record.link)}>{value}</Link>
|
79
|
+
// </div>
|
80
|
+
_react["default"].createElement("div", {
|
81
|
+
className: _indexModule["default"]['alarm-title'],
|
82
|
+
title: value,
|
83
|
+
onClick: function onClick() {
|
84
|
+
jumpTo(record.link);
|
85
|
+
}
|
86
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
87
|
+
type: record.icon,
|
88
|
+
size: "xs",
|
89
|
+
className: _indexModule["default"]['alarm-color-icon'] + " " + record.className
|
90
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
91
|
+
className: _indexModule["default"].link
|
92
|
+
}, value))
|
93
|
+
);
|
55
94
|
}
|
56
95
|
}, {
|
57
96
|
title: "时间",
|
package/lib/utils/topoData.js
CHANGED
@@ -231,7 +231,7 @@ function buildGlobal(_ref2) {
|
|
231
231
|
// 是否可编辑----控制[编辑]按钮
|
232
232
|
moveable: true,
|
233
233
|
// 节点是否可移动
|
234
|
-
toggleGroupByDblClick:
|
234
|
+
toggleGroupByDblClick: false
|
235
235
|
}, (result === null || result === void 0 ? void 0 : (_result$global2 = result.global) === null || _result$global2 === void 0 ? void 0 : _result$global2.control) || {}, (result === null || result === void 0 ? void 0 : (_result$customGlobal = result.customGlobal) === null || _result$customGlobal === void 0 ? void 0 : _result$customGlobal.control) || {}),
|
236
236
|
topoDisplayConfig: (0, _extends2["default"])({
|
237
237
|
// alarmSwitch: (result.global || {}).alarmSwitch ?? true,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "12.1.0-dev.
|
3
|
+
"version": "12.1.0-dev.9",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -123,6 +123,6 @@
|
|
123
123
|
"access": "public"
|
124
124
|
},
|
125
125
|
"license": "MIT",
|
126
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@12.1.0-dev.
|
126
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@12.1.0-dev.9/build/index.html",
|
127
127
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
128
128
|
}
|