@riil-frontend/component-topology 7.0.0-dev.12 → 7.0.0-dev.14
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 +1 -1
- package/es/core/editor/components/Toolbar/buttons.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/es/core/hooks/usePolling.js +1 -6
- package/es/core/hooks/useTopoEdit.js +3 -1
- package/es/core/models/Alarm.js +12 -24
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/utils/linkUtils.js +0 -3
- package/es/core/store/models/topoMod.js +7 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/es/networkTopo/getTopoData.js +16 -27
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +1 -3
- package/lib/core/editor/components/Toolbar/buttons.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -3
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/lib/core/hooks/usePolling.js +1 -6
- package/lib/core/hooks/useTopoEdit.js +3 -1
- package/lib/core/models/Alarm.js +12 -24
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/utils/linkUtils.js +0 -5
- package/lib/core/store/models/topoMod.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/lib/networkTopo/getTopoData.js +16 -28
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +1 -4
- package/package.json +2 -2
@@ -6,7 +6,6 @@ exports.__esModule = true;
|
|
6
6
|
exports.buildTopoLinkData = buildTopoLinkData;
|
7
7
|
exports.getInterfaceObject = exports.compatibleWith = void 0;
|
8
8
|
exports.getLinksDetail = getLinksDetail;
|
9
|
-
exports.isAggLink = isAggLink;
|
10
9
|
exports.isCrucialLink = isCrucialLink;
|
11
10
|
exports.isExitLink = isExitLink;
|
12
11
|
exports.mergeLinksData = mergeLinksData;
|
@@ -57,10 +56,6 @@ function isExitLink(link) {
|
|
57
56
|
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes['destination_id']);
|
58
57
|
}
|
59
58
|
|
60
|
-
function isAggLink(link) {
|
61
|
-
return link.attributes["network_link.connect_type"] === "agg";
|
62
|
-
}
|
63
|
-
|
64
59
|
var getInterfaceObject = /*#__PURE__*/function () {
|
65
60
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(codes) {
|
66
61
|
var query, promises, result, ifDoc;
|
@@ -629,17 +629,20 @@ function _default(topoApp) {
|
|
629
629
|
|
630
630
|
case 4:
|
631
631
|
topoPermission = _context11.sent;
|
632
|
-
|
632
|
+
|
633
|
+
_rlog["default"].debug('查询拓扑权限', topoPermission);
|
634
|
+
|
635
|
+
_context11.next = 11;
|
633
636
|
break;
|
634
637
|
|
635
|
-
case
|
636
|
-
_context11.prev =
|
638
|
+
case 8:
|
639
|
+
_context11.prev = 8;
|
637
640
|
_context11.t0 = _context11["catch"](1);
|
638
641
|
|
639
642
|
_rlog["default"].error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
|
640
643
|
|
641
644
|
|
642
|
-
case
|
645
|
+
case 11:
|
643
646
|
if (update !== false) {
|
644
647
|
_this8.update({
|
645
648
|
topoPermission: topoPermission
|
@@ -648,12 +651,12 @@ function _default(topoApp) {
|
|
648
651
|
|
649
652
|
return _context11.abrupt("return", topoPermission);
|
650
653
|
|
651
|
-
case
|
654
|
+
case 13:
|
652
655
|
case "end":
|
653
656
|
return _context11.stop();
|
654
657
|
}
|
655
658
|
}
|
656
|
-
}, _callee11, null, [[1,
|
659
|
+
}, _callee11, null, [[1, 8]]);
|
657
660
|
}))();
|
658
661
|
}
|
659
662
|
};
|
package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -13,8 +13,6 @@ var _table = _interopRequireDefault(require("@alifd/next/lib/table"));
|
|
13
13
|
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
15
15
|
|
16
|
-
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
17
|
-
|
18
16
|
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
19
17
|
|
20
18
|
var _react = _interopRequireDefault(require("react"));
|
@@ -75,30 +73,34 @@ function EventsCard(props) {
|
|
75
73
|
title: (0, _moment["default"])(value).format('YYYY-MM-DD HH:mm:ss')
|
76
74
|
}, (0, _moment["default"])(value).format('YYYY-MM-DD HH:mm:ss'));
|
77
75
|
}
|
78
|
-
}
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
76
|
+
} // 临时屏蔽告警操作列,后续版本按权限显示 2023-3-6 20:23:45
|
77
|
+
// {
|
78
|
+
// title: '操作',
|
79
|
+
// dataIndex: 'status',
|
80
|
+
// key: 'status',
|
81
|
+
// width: 64,
|
82
|
+
// cell: (status, index, record) => {
|
83
|
+
// if (record.type === 'alarm') {
|
84
|
+
// return status === 'toDeal' ? (
|
85
|
+
// <Button
|
86
|
+
// text
|
87
|
+
// type="primary"
|
88
|
+
// onClick={() => alarmRiskOperation(record.type, record.params)}
|
89
|
+
// >
|
90
|
+
// 受理
|
91
|
+
// </Button>
|
92
|
+
// ) : (
|
93
|
+
// <Button disabled text type="primary">
|
94
|
+
// 已受理
|
95
|
+
// </Button>
|
96
|
+
// );
|
97
|
+
// } else {
|
98
|
+
// // return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
|
99
|
+
// return '';
|
100
|
+
// }
|
101
|
+
// },
|
102
|
+
// },
|
103
|
+
]; // 告警/风险 操作 (受理)
|
102
104
|
|
103
105
|
function alarmRiskOperation(_x, _x2) {
|
104
106
|
return _alarmRiskOperation.apply(this, arguments);
|
@@ -15,8 +15,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
15
15
|
|
16
16
|
var _linkUtils = require("../core/models/utils/linkUtils");
|
17
17
|
|
18
|
-
var _services = require("../core/services");
|
19
|
-
|
20
18
|
var _resourcePermissionUtil = require("./utils/resourcePermissionUtil");
|
21
19
|
|
22
20
|
// import "./utils/__tests__/resourcePermissionUtil.test";
|
@@ -32,7 +30,7 @@ function addLinkData(_x, _x2) {
|
|
32
30
|
|
33
31
|
function _addLinkData() {
|
34
32
|
_addLinkData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(oldLinks, nodes) {
|
35
|
-
var links;
|
33
|
+
var links, networkLinks, otherLinks;
|
36
34
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
37
35
|
while (1) {
|
38
36
|
switch (_context.prev = _context.next) {
|
@@ -48,18 +46,24 @@ function _addLinkData() {
|
|
48
46
|
}
|
49
47
|
|
50
48
|
return true;
|
51
|
-
});
|
49
|
+
}); // 如果是网络链路,补充详情信息
|
50
|
+
|
52
51
|
_context.next = 3;
|
53
|
-
return (0, _linkUtils.getLinksDetail)(links
|
52
|
+
return (0, _linkUtils.getLinksDetail)(links.filter(function (link) {
|
53
|
+
return !link.ciType;
|
54
|
+
}), nodes);
|
54
55
|
|
55
56
|
case 3:
|
56
|
-
|
57
|
+
networkLinks = _context.sent;
|
58
|
+
otherLinks = links.filter(function (link) {
|
59
|
+
return !!link.ciType;
|
60
|
+
});
|
57
61
|
return _context.abrupt("return", {
|
58
|
-
links:
|
62
|
+
links: [].concat(networkLinks, otherLinks),
|
59
63
|
linkGroups: []
|
60
64
|
});
|
61
65
|
|
62
|
-
case
|
66
|
+
case 6:
|
63
67
|
case "end":
|
64
68
|
return _context.stop();
|
65
69
|
}
|
@@ -88,7 +92,7 @@ function buildData(_x3) {
|
|
88
92
|
|
89
93
|
function _buildData() {
|
90
94
|
_buildData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(data) {
|
91
|
-
var newData, nodes, _yield$Promise$all,
|
95
|
+
var newData, nodes, _yield$Promise$all, linkData;
|
92
96
|
|
93
97
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
94
98
|
while (1) {
|
@@ -105,34 +109,18 @@ function _buildData() {
|
|
105
109
|
});
|
106
110
|
});
|
107
111
|
_context2.next = 4;
|
108
|
-
return Promise.all([
|
109
|
-
(0, _services.queryCisByIds)(nodes.map(function (node) {
|
110
|
-
return node.id;
|
111
|
-
})), addLinkData(data.links || [], nodes)]);
|
112
|
+
return Promise.all([addLinkData(data.links || [], nodes)]);
|
112
113
|
|
113
114
|
case 4:
|
114
115
|
_yield$Promise$all = _context2.sent;
|
115
|
-
|
116
|
-
linkData = _yield$Promise$all[1];
|
117
|
-
nodes = nodes.map(function (node) {
|
118
|
-
var _node$attributes$find;
|
119
|
-
|
120
|
-
return (0, _extends2["default"])({}, node, {
|
121
|
-
ipAddress: Array.isArray(node.attributes) ? (_node$attributes$find = node.attributes.find(function (item) {
|
122
|
-
return item.code === 'ipAddress';
|
123
|
-
})) === null || _node$attributes$find === void 0 ? void 0 : _node$attributes$find.value : null,
|
124
|
-
attributes: nodeCis.find(function (ci) {
|
125
|
-
return ci.id === node.id;
|
126
|
-
}).attributes
|
127
|
-
});
|
128
|
-
});
|
116
|
+
linkData = _yield$Promise$all[0];
|
129
117
|
newData = (0, _extends2["default"])({}, newData, {
|
130
118
|
nodes: nodes
|
131
119
|
}, linkData);
|
132
120
|
newData = (0, _resourcePermissionUtil.addTopoDataResourcePermission)(newData);
|
133
121
|
return _context2.abrupt("return", newData);
|
134
122
|
|
135
|
-
case
|
123
|
+
case 9:
|
136
124
|
case "end":
|
137
125
|
return _context2.stop();
|
138
126
|
}
|
@@ -17,8 +17,6 @@ var _dialog = _interopRequireDefault(require("@alifd/next/lib/dialog"));
|
|
17
17
|
|
18
18
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
19
19
|
|
20
|
-
var _linkUtils = require("../../../core/models/utils/linkUtils");
|
21
|
-
|
22
20
|
var _link = _interopRequireDefault(require("../../services/link"));
|
23
21
|
|
24
22
|
var _resourcePermissionUtil = require("../../utils/resourcePermissionUtil");
|
@@ -64,8 +62,7 @@ var _default = function _default(_ref) {
|
|
64
62
|
switch (_context.prev = _context.next) {
|
65
63
|
case 0:
|
66
64
|
id = link.id;
|
67
|
-
isGroup = false;
|
68
|
-
|
65
|
+
isGroup = false;
|
69
66
|
_context.next = 4;
|
70
67
|
return _link["default"].deleteLink(id);
|
71
68
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "7.0.0-dev.
|
3
|
+
"version": "7.0.0-dev.14",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.14/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|