@riil-frontend/component-topology 12.0.0-dev.8 → 12.1.0-dev.1
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 +14 -14
- package/es/components/TemplateButton/index.module.scss +1 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +58 -3
- package/es/core/components/TopoView/topoView.js +5 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +5 -12
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -10
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
- package/es/core/editor/utils/copyElementUtil.js +12 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -30
- package/es/core/hooks/useAlarm.js +131 -81
- package/es/core/hooks/useCmpLinkAlarm.js +153 -0
- package/es/core/hooks/useEventData.js +1 -2
- package/es/core/hooks/useGraphAlarmDisplay.js +91 -56
- package/es/core/hooks/useResourceConfig.js +1 -3
- package/es/core/hooks/useTopoEdit.js +51 -58
- package/es/core/models/Alarm.js +69 -142
- package/es/core/models/AttributeMetricDisplay.js +14 -5
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiCache.d.ts +1 -1
- package/es/core/models/cache/CiCache.js +3 -3
- package/es/core/models/cache/CiTypeCache.js +4 -0
- package/es/core/models/topoData.js +0 -1
- package/es/core/models/utils/linkUtils.js +20 -13
- package/es/core/services/index.js +1 -1
- package/es/core/services/topo/basic.js +2 -2
- package/es/core/store/models/topoConfig.js +7 -10
- package/es/core/store/models/topoMod.js +81 -134
- package/es/core/utils/edgeUtil.js +8 -0
- package/es/core/utils/metricUtil.js +8 -4
- package/es/core/utils/showGraphManageStatusUtil.js +3 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/es/networkTopo/components/TopoView.js +6 -11
- package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/es/networkTopo/services/topo/basic.js +3 -3
- package/es/networkTopo/store/topoCenter.js +260 -223
- package/es/style.js +1 -1
- package/es/utils/ResourceConfigUtil.js +3 -36
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +155 -0
- package/es/utils/topoData.js +4 -2
- package/lib/components/TemplateButton/index.module.scss +1 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
- package/lib/core/components/TopoView/topoView.js +5 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
- package/lib/core/editor/utils/copyElementUtil.js +15 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -31
- package/lib/core/hooks/useAlarm.js +130 -79
- package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
- package/lib/core/hooks/useEventData.js +1 -2
- package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
- package/lib/core/hooks/useResourceConfig.js +1 -3
- package/lib/core/hooks/useTopoEdit.js +50 -57
- package/lib/core/models/Alarm.js +69 -144
- package/lib/core/models/AttributeMetricDisplay.js +16 -4
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiCache.d.ts +1 -1
- package/lib/core/models/cache/CiCache.js +3 -3
- package/lib/core/models/cache/CiTypeCache.js +4 -0
- package/lib/core/models/topoData.js +0 -1
- package/lib/core/models/utils/linkUtils.js +21 -13
- package/lib/core/services/index.js +1 -1
- package/lib/core/services/topo/basic.js +2 -2
- package/lib/core/store/models/topoConfig.js +7 -10
- package/lib/core/store/models/topoMod.js +81 -134
- package/lib/core/utils/edgeUtil.js +10 -0
- package/lib/core/utils/metricUtil.js +8 -4
- package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/lib/networkTopo/components/TopoView.js +5 -14
- package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/lib/networkTopo/services/topo/basic.js +3 -3
- package/lib/networkTopo/store/topoCenter.js +262 -225
- package/lib/style.js +1 -1
- package/lib/utils/ResourceConfigUtil.js +3 -38
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +168 -0
- package/lib/utils/topoData.js +4 -2
- package/package.json +3 -3
@@ -34,7 +34,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
34
34
|
while (1) switch (_context.prev = _context.next) {
|
35
35
|
case 0:
|
36
36
|
if (!isAppTopo) {
|
37
|
-
_context.next =
|
37
|
+
_context.next = 10;
|
38
38
|
break;
|
39
39
|
}
|
40
40
|
|
@@ -49,27 +49,29 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
49
49
|
alarmList = _yield$resourceOvervi2.alarms;
|
50
50
|
alarmList = ((_alarmList = alarmList) === null || _alarmList === void 0 ? void 0 : _alarmList.map(function (item) {
|
51
51
|
return {
|
52
|
-
|
53
|
-
|
52
|
+
alarmInfo: item,
|
53
|
+
type: "alarm",
|
54
|
+
icon: "gaojing-3",
|
54
55
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
55
56
|
title: "[" + item.alertObject + "] " + item.alertTitle,
|
56
|
-
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
57
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + encodeURI(encodeURI(item.alertObject)) + "&ruleId=" + item.ruleId,
|
57
58
|
time: item.createTime,
|
58
59
|
status: item.status,
|
59
60
|
params: [{
|
60
61
|
alertId: item.alertId,
|
61
|
-
status:
|
62
|
+
status: "dealing",
|
62
63
|
userId: userId,
|
63
64
|
isBaseAlert: false
|
64
65
|
}]
|
65
66
|
};
|
66
67
|
})) || [];
|
68
|
+
console.log("setAlarmRiskList", alarmList);
|
67
69
|
setAlarmRiskList(alarmList);
|
68
|
-
_context.next =
|
70
|
+
_context.next = 25;
|
69
71
|
break;
|
70
72
|
|
71
|
-
case
|
72
|
-
_context.next =
|
73
|
+
case 10:
|
74
|
+
_context.next = 12;
|
73
75
|
return alarmService.getAlarmByIds([id].concat(childrenIds), {
|
74
76
|
alertStatusList: ['toDeal', 'woDealing', 'dealing'],
|
75
77
|
// toDeal: 待处理, dealing:处理中
|
@@ -79,7 +81,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
79
81
|
sortOrder: 'asc'
|
80
82
|
});
|
81
83
|
|
82
|
-
case
|
84
|
+
case 12:
|
83
85
|
_yield$alarmService$g2 = _context.sent;
|
84
86
|
_alarmList2 = _yield$alarmService$g2.datas;
|
85
87
|
// 2022-07-16 后端不支持多列排序,暂通过前端实现,按创建时间倒序
|
@@ -88,28 +90,28 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
88
90
|
});
|
89
91
|
_alarmList2 = _alarmList2.map(function (item) {
|
90
92
|
return {
|
91
|
-
type:
|
92
|
-
icon:
|
93
|
+
type: "alarm",
|
94
|
+
icon: "gaojing-3",
|
93
95
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
94
96
|
title: "" + item.alertObject + item.alertTitle,
|
95
|
-
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
97
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + encodeURI(encodeURI(item.alertObject)) + "&ruleId=" + item.ruleId,
|
96
98
|
time: item.createTime,
|
97
99
|
status: item.status,
|
98
100
|
params: [{
|
99
101
|
alertId: item.alertId,
|
100
|
-
status:
|
102
|
+
status: "dealing",
|
101
103
|
userId: userId,
|
102
104
|
isBaseAlert: false
|
103
105
|
}]
|
104
106
|
};
|
105
107
|
}); // fix NEWITOM-33635【南昌大学】网络拓扑上双击设备拉开的抽屉中无法看到风险
|
106
108
|
|
107
|
-
_context.next =
|
109
|
+
_context.next = 18;
|
108
110
|
return service.queryAllComponentsByCiId(id);
|
109
111
|
|
110
|
-
case
|
112
|
+
case 18:
|
111
113
|
AllComponentsByCiId = _context.sent;
|
112
|
-
_context.next =
|
114
|
+
_context.next = 21;
|
113
115
|
return service.getRiskByIds({
|
114
116
|
ciIdList: [id].concat(childrenIds, AllComponentsByCiId.map(function (item) {
|
115
117
|
return item.id;
|
@@ -119,7 +121,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
119
121
|
pageSize: 10000
|
120
122
|
});
|
121
123
|
|
122
|
-
case
|
124
|
+
case 21:
|
123
125
|
_yield$service$getRis2 = _context.sent;
|
124
126
|
riskList = _yield$service$getRis2.content;
|
125
127
|
riskList = riskList.map(function (item) {
|
@@ -135,7 +137,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
135
137
|
|
136
138
|
setAlarmRiskList([].concat(_alarmList2, riskList));
|
137
139
|
|
138
|
-
case
|
140
|
+
case 25:
|
139
141
|
case "end":
|
140
142
|
return _context.stop();
|
141
143
|
}
|
@@ -8,8 +8,10 @@ export default function ViewerPlugin(props) {
|
|
8
8
|
var topo = props.topo,
|
9
9
|
viewerProps = props.viewerProps;
|
10
10
|
var store = topo.store;
|
11
|
+
var alarmInfoDoc = viewerProps.alarmInfoDoc;
|
11
12
|
useAlarm({
|
12
|
-
topo: topo
|
13
|
+
topo: topo,
|
14
|
+
alarmInfoDoc: alarmInfoDoc
|
13
15
|
});
|
14
16
|
useManageStatus({
|
15
17
|
topo: topo
|
@@ -5,11 +5,7 @@ import useEventData from "../../../../hooks/useEventData";
|
|
5
5
|
|
6
6
|
function AlarmButton(props) {
|
7
7
|
var topo = props.topo;
|
8
|
-
|
9
|
-
var _topo$store$useModel = topo.store.useModel("topoAlarm"),
|
10
|
-
alarmState = _topo$store$useModel[0],
|
11
|
-
alarmDispatchers = _topo$store$useModel[1];
|
12
|
-
|
8
|
+
var alarmState = topo.store.useModelState("topoAlarm");
|
13
9
|
var alarmPanelIsOpen = alarmState.alarmPanelIsOpen;
|
14
10
|
var alarmData = useEventData({
|
15
11
|
topo: topo
|
@@ -2,7 +2,7 @@ import _Loading from "@alifd/next/es/loading";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
4
4
|
var _excluded = ["topo", "viewerProps", "titleBar", "nodataPage", "notfoundPageProps", "noPermissionPageProps"];
|
5
|
-
import React
|
5
|
+
import React from "react";
|
6
6
|
import NodataPage from "@riil-frontend/component-topology-common/es/components/NoDataPage/index";
|
7
7
|
import BasicTopoView from "../../core/components/TopoView";
|
8
8
|
import topoPermissonUtil from "../../utils/topoPermissionUtil";
|
@@ -11,8 +11,8 @@ import TopoNoPermission from "./TopoNoPermission";
|
|
11
11
|
import styles from "../../components/index.module.scss";
|
12
12
|
import useLinkDynamicStyle from "../hooks/useLinkDynamicStyle";
|
13
13
|
import useRelateTopo from "../hooks/viewer/useRelateTopo";
|
14
|
-
import useEdgeFlow from "../hooks/viewer/useEdgeFlow";
|
15
|
-
|
14
|
+
import useEdgeFlow from "../hooks/viewer/useEdgeFlow"; // import useEdgeExpand from "../hooks/useEdgeExpand";
|
15
|
+
|
16
16
|
/**
|
17
17
|
* 拓扑组件。变化无权限、无数据显示
|
18
18
|
*/
|
@@ -36,10 +36,8 @@ function NetworkTopologyCore(props) {
|
|
36
36
|
});
|
37
37
|
useEdgeFlow({
|
38
38
|
topo: topo
|
39
|
-
});
|
40
|
-
|
41
|
-
topo: topo
|
42
|
-
});
|
39
|
+
}); // useEdgeExpand({ topo })
|
40
|
+
|
43
41
|
var relateTopo = useRelateTopo({
|
44
42
|
topo: topo
|
45
43
|
});
|
@@ -68,10 +66,7 @@ function NetworkTopologyCore(props) {
|
|
68
66
|
});
|
69
67
|
} else if (!topoId) {
|
70
68
|
return null;
|
71
|
-
}
|
72
|
-
// return null;
|
73
|
-
// }
|
74
|
-
|
69
|
+
}
|
75
70
|
|
76
71
|
if (!loading) {
|
77
72
|
// 加载完成后
|
@@ -15,9 +15,8 @@ export default function useEdgeExpand(props) {
|
|
15
15
|
data = e.data;
|
16
16
|
|
17
17
|
if (data instanceof ht.Group && property === 'expanded') {
|
18
|
-
updateEdgeExpanded(topo)
|
19
|
-
setTimeout(function () {
|
20
|
-
updateEdgeExpanded(topo);
|
18
|
+
// updateEdgeExpanded(topo)
|
19
|
+
setTimeout(function () {// updateEdgeExpanded(topo)
|
21
20
|
}, 100);
|
22
21
|
}
|
23
22
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
4
|
-
var _excluded = ["groups", "resources"
|
4
|
+
var _excluded = ["groups", "resources"];
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
6
6
|
import { request } from '@riil-frontend/component-topology-utils';
|
7
7
|
import { rlog } from '@riil-frontend/component-topology-utils';
|
@@ -463,11 +463,11 @@ export default _extends({
|
|
463
463
|
*/
|
464
464
|
bindResourceToTopo: function bindResourceToTopo(id, config) {
|
465
465
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
466
|
-
var groups, resources,
|
466
|
+
var groups, resources, otherConfig, newGroups, obj;
|
467
467
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
468
468
|
while (1) switch (_context14.prev = _context14.next) {
|
469
469
|
case 0:
|
470
|
-
groups = config.groups, resources = config.resources,
|
470
|
+
groups = config.groups, resources = config.resources, otherConfig = _objectWithoutPropertiesLoose(config, _excluded);
|
471
471
|
newGroups = Array.isArray(groups) ? groups : [];
|
472
472
|
|
473
473
|
if (resources) {
|