@riil-frontend/component-topology 11.0.35 → 11.0.38
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 +2 -2
- package/build/2.js +1 -1
- package/build/index.js +37 -29
- package/es/components/MultiResourceDrawer/index.js +8 -6
- package/es/components/ResourceList/ResourceSelect.js +8 -7
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/es/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/es/core/editor/components/BackgroundView/index.js +73 -54
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -5
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/es/core/hooks/usePolling.js +21 -13
- package/es/core/hooks/useResourceConfig.js +37 -21
- package/es/core/hooks/useTopoEdit.js +215 -147
- package/es/core/models/Alarm.js +104 -38
- package/es/core/models/AttributeMetricDisplay.js +36 -14
- package/es/core/models/TopoApp.js +197 -75
- package/es/core/models/TopoGraphView.js +20 -10
- package/es/core/models/cache/CiCache.js +12 -6
- package/es/core/models/cache/CiTypeCache.js +20 -10
- package/es/core/models/cache/DictCache.js +10 -6
- package/es/core/models/graph/Background.js +9 -6
- package/es/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/es/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/es/core/models/topoData.js +7 -5
- package/es/core/models/utils/linkUtils.js +8 -5
- package/es/core/services/cmdb/metric.js +7 -5
- package/es/core/services/cmdb.js +7 -5
- package/es/core/services/index.js +23 -9
- package/es/core/services/topo/tagtip.js +7 -5
- package/es/core/store/models/customIcon.js +11 -6
- package/es/core/utils/imageUtil.js +7 -5
- package/es/core/utils/saveSerialize.js +7 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +47 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +74 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +29 -24
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -26
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +15 -7
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/es/networkTopo/components/Link/hook.js +21 -14
- package/es/networkTopo/components/Link/index.js +32 -18
- package/es/networkTopo/components/Link/setting.js +8 -6
- package/es/networkTopo/getTopoData.js +23 -10
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/es/networkTopo/models/TopoCenter.js +24 -10
- package/es/networkTopo/services/cmdb.js +333 -233
- package/es/networkTopo/services/mdc.js +24 -15
- package/es/networkTopo/services/metric.js +16 -11
- package/es/networkTopo/services/model.js +412 -283
- package/es/networkTopo/utils/exportData.js +7 -5
- package/lib/components/MultiResourceDrawer/index.js +8 -6
- package/lib/components/ResourceList/ResourceSelect.js +8 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/lib/core/editor/components/BackgroundView/index.js +74 -55
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -4
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/lib/core/hooks/usePolling.js +21 -13
- package/lib/core/hooks/useResourceConfig.js +37 -21
- package/lib/core/hooks/useTopoEdit.js +215 -147
- package/lib/core/models/Alarm.js +104 -38
- package/lib/core/models/AttributeMetricDisplay.js +36 -14
- package/lib/core/models/TopoApp.js +197 -75
- package/lib/core/models/TopoGraphView.js +20 -10
- package/lib/core/models/cache/CiCache.js +12 -6
- package/lib/core/models/cache/CiTypeCache.js +20 -10
- package/lib/core/models/cache/DictCache.js +10 -6
- package/lib/core/models/graph/Background.js +9 -6
- package/lib/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/lib/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/lib/core/models/topoData.js +7 -4
- package/lib/core/models/utils/linkUtils.js +8 -4
- package/lib/core/services/cmdb/metric.js +7 -4
- package/lib/core/services/cmdb.js +7 -4
- package/lib/core/services/index.js +21 -8
- package/lib/core/services/topo/tagtip.js +7 -4
- package/lib/core/store/models/customIcon.js +11 -6
- package/lib/core/utils/imageUtil.js +7 -4
- package/lib/core/utils/saveSerialize.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -19
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +49 -36
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +73 -35
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +29 -24
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +14 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/lib/networkTopo/components/Link/hook.js +23 -15
- package/lib/networkTopo/components/Link/index.js +32 -18
- package/lib/networkTopo/components/Link/setting.js +8 -6
- package/lib/networkTopo/getTopoData.js +23 -10
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/lib/networkTopo/models/TopoCenter.js +24 -10
- package/lib/networkTopo/services/cmdb.js +336 -235
- package/lib/networkTopo/services/mdc.js +24 -14
- package/lib/networkTopo/services/metric.js +16 -10
- package/lib/networkTopo/services/model.js +414 -284
- package/lib/networkTopo/utils/exportData.js +7 -4
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +3 -3
@@ -22,8 +22,6 @@ var _overview = _interopRequireDefault(require("../../../../../../../services/ov
|
|
22
22
|
* @param {*} props
|
23
23
|
*/
|
24
24
|
var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
25
|
-
var _getAlarmRiskData;
|
26
|
-
|
27
25
|
var id = props.id,
|
28
26
|
isAppTopo = props.isAppTopo,
|
29
27
|
resourceOverviewProps = props.resourceOverviewProps,
|
@@ -36,14 +34,19 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
36
34
|
|
37
35
|
|
38
36
|
function getAlarmRiskData(_x) {
|
39
|
-
return
|
37
|
+
return _getAlarmRiskData.apply(this, arguments);
|
38
|
+
} // 轮询hooks
|
39
|
+
|
40
|
+
|
41
|
+
function _getAlarmRiskData() {
|
42
|
+
_getAlarmRiskData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
|
40
43
|
var _alarmList, _yield$resourceOvervi2, alarmList, _yield$alarmService$g2, _alarmList2, AllComponentsByCiId, _yield$service$getRis2, riskList;
|
41
44
|
|
42
45
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
43
46
|
while (1) switch (_context.prev = _context.next) {
|
44
47
|
case 0:
|
45
48
|
if (!isAppTopo) {
|
46
|
-
_context.next =
|
49
|
+
_context.next = 10;
|
47
50
|
break;
|
48
51
|
}
|
49
52
|
|
@@ -58,27 +61,29 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
58
61
|
alarmList = _yield$resourceOvervi2.alarms;
|
59
62
|
alarmList = ((_alarmList = alarmList) === null || _alarmList === void 0 ? void 0 : _alarmList.map(function (item) {
|
60
63
|
return {
|
61
|
-
|
62
|
-
|
64
|
+
alarmInfo: item,
|
65
|
+
type: "alarm",
|
66
|
+
icon: "gaojing-3",
|
63
67
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
64
68
|
title: "[" + item.alertObject + "] " + item.alertTitle,
|
65
|
-
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
69
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + encodeURI(encodeURI(item.alertObject)) + "&ruleId=" + item.ruleId,
|
66
70
|
time: item.createTime,
|
67
71
|
status: item.status,
|
68
72
|
params: [{
|
69
73
|
alertId: item.alertId,
|
70
|
-
status:
|
74
|
+
status: "dealing",
|
71
75
|
userId: userId,
|
72
76
|
isBaseAlert: false
|
73
77
|
}]
|
74
78
|
};
|
75
79
|
})) || [];
|
80
|
+
console.log("setAlarmRiskList", alarmList);
|
76
81
|
setAlarmRiskList(alarmList);
|
77
|
-
_context.next =
|
82
|
+
_context.next = 25;
|
78
83
|
break;
|
79
84
|
|
80
|
-
case
|
81
|
-
_context.next =
|
85
|
+
case 10:
|
86
|
+
_context.next = 12;
|
82
87
|
return _alarm["default"].getAlarmByIds([id].concat(childrenIds), {
|
83
88
|
alertStatusList: ['toDeal', 'woDealing', 'dealing'],
|
84
89
|
// toDeal: 待处理, dealing:处理中
|
@@ -88,7 +93,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
88
93
|
sortOrder: 'asc'
|
89
94
|
});
|
90
95
|
|
91
|
-
case
|
96
|
+
case 12:
|
92
97
|
_yield$alarmService$g2 = _context.sent;
|
93
98
|
_alarmList2 = _yield$alarmService$g2.datas;
|
94
99
|
// 2022-07-16 后端不支持多列排序,暂通过前端实现,按创建时间倒序
|
@@ -97,28 +102,28 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
97
102
|
});
|
98
103
|
_alarmList2 = _alarmList2.map(function (item) {
|
99
104
|
return {
|
100
|
-
type:
|
101
|
-
icon:
|
105
|
+
type: "alarm",
|
106
|
+
icon: "gaojing-3",
|
102
107
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
103
108
|
title: "" + item.alertObject + item.alertTitle,
|
104
|
-
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
109
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + encodeURI(encodeURI(item.alertObject)) + "&ruleId=" + item.ruleId,
|
105
110
|
time: item.createTime,
|
106
111
|
status: item.status,
|
107
112
|
params: [{
|
108
113
|
alertId: item.alertId,
|
109
|
-
status:
|
114
|
+
status: "dealing",
|
110
115
|
userId: userId,
|
111
116
|
isBaseAlert: false
|
112
117
|
}]
|
113
118
|
};
|
114
119
|
}); // fix NEWITOM-33635【南昌大学】网络拓扑上双击设备拉开的抽屉中无法看到风险
|
115
120
|
|
116
|
-
_context.next =
|
121
|
+
_context.next = 18;
|
117
122
|
return _overview["default"].queryAllComponentsByCiId(id);
|
118
123
|
|
119
|
-
case
|
124
|
+
case 18:
|
120
125
|
AllComponentsByCiId = _context.sent;
|
121
|
-
_context.next =
|
126
|
+
_context.next = 21;
|
122
127
|
return _overview["default"].getRiskByIds({
|
123
128
|
ciIdList: [id].concat(childrenIds, AllComponentsByCiId.map(function (item) {
|
124
129
|
return item.id;
|
@@ -128,7 +133,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
128
133
|
pageSize: 10000
|
129
134
|
});
|
130
135
|
|
131
|
-
case
|
136
|
+
case 21:
|
132
137
|
_yield$service$getRis2 = _context.sent;
|
133
138
|
riskList = _yield$service$getRis2.content;
|
134
139
|
riskList = riskList.map(function (item) {
|
@@ -144,14 +149,14 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
144
149
|
|
145
150
|
setAlarmRiskList([].concat(_alarmList2, riskList));
|
146
151
|
|
147
|
-
case
|
152
|
+
case 25:
|
148
153
|
case "end":
|
149
154
|
return _context.stop();
|
150
155
|
}
|
151
156
|
}, _callee);
|
152
|
-
}))
|
153
|
-
|
154
|
-
|
157
|
+
}));
|
158
|
+
return _getAlarmRiskData.apply(this, arguments);
|
159
|
+
}
|
155
160
|
|
156
161
|
var request = (0, _ahooks.useRequest)(getAlarmRiskData, {
|
157
162
|
pollingInterval: 1000 * 15,
|
@@ -20,8 +20,6 @@ var _getCiDisplayMetricModels = require("../../../getCiDisplayMetricModels");
|
|
20
20
|
* @param {*} props
|
21
21
|
*/
|
22
22
|
var useMetricModels = function useMetricModels(props) {
|
23
|
-
var _fetchData;
|
24
|
-
|
25
23
|
var _props$data = props.data,
|
26
24
|
type = _props$data.type,
|
27
25
|
id = _props$data.id,
|
@@ -41,7 +39,12 @@ var useMetricModels = function useMetricModels(props) {
|
|
41
39
|
setInitLoading = _useState2[1];
|
42
40
|
|
43
41
|
function fetchData() {
|
44
|
-
return
|
42
|
+
return _fetchData.apply(this, arguments);
|
43
|
+
} // 轮询hooks
|
44
|
+
|
45
|
+
|
46
|
+
function _fetchData() {
|
47
|
+
_fetchData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
45
48
|
var monitorMetrics, ciMonitorMetricModels, displayMetricModels, _metricCodes;
|
46
49
|
|
47
50
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
@@ -116,9 +119,9 @@ var useMetricModels = function useMetricModels(props) {
|
|
116
119
|
return _context.stop();
|
117
120
|
}
|
118
121
|
}, _callee);
|
119
|
-
}))
|
120
|
-
|
121
|
-
|
122
|
+
}));
|
123
|
+
return _fetchData.apply(this, arguments);
|
124
|
+
}
|
122
125
|
|
123
126
|
var request = (0, _ahooks.useRequest)(fetchData, {
|
124
127
|
pollingInterval: 1000 * 60,
|
@@ -19,44 +19,45 @@ var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-ut
|
|
19
19
|
|
20
20
|
var _react = require("react");
|
21
21
|
|
22
|
-
var _queryWebConsoleUrlById;
|
23
|
-
|
24
22
|
function queryWebConsoleUrlById(_x) {
|
25
|
-
return
|
23
|
+
return _queryWebConsoleUrlById.apply(this, arguments);
|
24
|
+
}
|
25
|
+
|
26
|
+
function _queryWebConsoleUrlById() {
|
27
|
+
_queryWebConsoleUrlById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
26
28
|
var _list, list;
|
27
29
|
|
28
|
-
return _regenerator["default"].wrap(function
|
29
|
-
while (1) switch (
|
30
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
31
|
+
while (1) switch (_context2.prev = _context2.next) {
|
30
32
|
case 0:
|
31
|
-
|
32
|
-
|
33
|
+
_context2.prev = 0;
|
34
|
+
_context2.next = 3;
|
33
35
|
return _topo["default"].resourceWebUrl.list([id]);
|
34
36
|
|
35
37
|
case 3:
|
36
|
-
list =
|
38
|
+
list = _context2.sent;
|
37
39
|
;
|
38
|
-
return
|
40
|
+
return _context2.abrupt("return", (_list = list[list.length - 1]) === null || _list === void 0 ? void 0 : _list.webUrl);
|
39
41
|
|
40
42
|
case 8:
|
41
|
-
|
42
|
-
|
43
|
+
_context2.prev = 8;
|
44
|
+
_context2.t0 = _context2["catch"](0);
|
43
45
|
|
44
|
-
_rlog["default"].error('资源web控制台.加载数据异常',
|
46
|
+
_rlog["default"].error('资源web控制台.加载数据异常', _context2.t0);
|
45
47
|
|
46
48
|
case 11:
|
47
|
-
return
|
49
|
+
return _context2.abrupt("return", null);
|
48
50
|
|
49
51
|
case 12:
|
50
52
|
case "end":
|
51
|
-
return
|
53
|
+
return _context2.stop();
|
52
54
|
}
|
53
|
-
},
|
54
|
-
}))
|
55
|
+
}, _callee2, null, [[0, 8]]);
|
56
|
+
}));
|
57
|
+
return _queryWebConsoleUrlById.apply(this, arguments);
|
55
58
|
}
|
56
59
|
|
57
60
|
function useWebConsole(props) {
|
58
|
-
var _save;
|
59
|
-
|
60
61
|
var ciId = props.ciId;
|
61
62
|
var ipv4Address = props.ipv4Address;
|
62
63
|
|
@@ -83,11 +84,15 @@ function useWebConsole(props) {
|
|
83
84
|
}, [ciId]); // 保存Web控制台url
|
84
85
|
|
85
86
|
function save(_x2) {
|
86
|
-
return
|
87
|
-
|
88
|
-
|
87
|
+
return _save.apply(this, arguments);
|
88
|
+
}
|
89
|
+
|
90
|
+
function _save() {
|
91
|
+
_save = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(newWebConsoleUrl) {
|
92
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
93
|
+
while (1) switch (_context.prev = _context.next) {
|
89
94
|
case 0:
|
90
|
-
|
95
|
+
_context.next = 2;
|
91
96
|
return _topo["default"].resourceWebUrl.save(ciId, newWebConsoleUrl || null);
|
92
97
|
|
93
98
|
case 2:
|
@@ -95,10 +100,11 @@ function useWebConsole(props) {
|
|
95
100
|
|
96
101
|
case 3:
|
97
102
|
case "end":
|
98
|
-
return
|
103
|
+
return _context.stop();
|
99
104
|
}
|
100
|
-
},
|
101
|
-
}))
|
105
|
+
}, _callee);
|
106
|
+
}));
|
107
|
+
return _save.apply(this, arguments);
|
102
108
|
}
|
103
109
|
|
104
110
|
return {
|
@@ -12,10 +12,12 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
12
12
|
|
13
13
|
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
14
14
|
|
15
|
-
var _queryCiMonitorMetricStrategys, _queryCiMonitorMetricCodes;
|
16
|
-
|
17
15
|
function queryCiMonitorMetricStrategys(_x) {
|
18
|
-
return
|
16
|
+
return _queryCiMonitorMetricStrategys.apply(this, arguments);
|
17
|
+
}
|
18
|
+
|
19
|
+
function _queryCiMonitorMetricStrategys() {
|
20
|
+
_queryCiMonitorMetricStrategys = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
|
19
21
|
var map, monitorMetrics;
|
20
22
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
21
23
|
while (1) switch (_context.prev = _context.next) {
|
@@ -35,11 +37,16 @@ function queryCiMonitorMetricStrategys(_x) {
|
|
35
37
|
return _context.stop();
|
36
38
|
}
|
37
39
|
}, _callee);
|
38
|
-
}))
|
40
|
+
}));
|
41
|
+
return _queryCiMonitorMetricStrategys.apply(this, arguments);
|
39
42
|
}
|
40
43
|
|
41
44
|
function queryCiMonitorMetricCodes(_x2) {
|
42
|
-
return
|
45
|
+
return _queryCiMonitorMetricCodes.apply(this, arguments);
|
46
|
+
}
|
47
|
+
|
48
|
+
function _queryCiMonitorMetricCodes() {
|
49
|
+
_queryCiMonitorMetricCodes = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
43
50
|
var arr;
|
44
51
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
45
52
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -58,5 +65,6 @@ function queryCiMonitorMetricCodes(_x2) {
|
|
58
65
|
return _context2.stop();
|
59
66
|
}
|
60
67
|
}, _callee2);
|
61
|
-
}))
|
68
|
+
}));
|
69
|
+
return _queryCiMonitorMetricCodes.apply(this, arguments);
|
62
70
|
}
|
@@ -18,14 +18,16 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19
19
|
|
20
20
|
function useUserId(props) {
|
21
|
-
var _fetchUserId;
|
22
|
-
|
23
21
|
var _useState = (0, _react.useState)(''),
|
24
22
|
userId = _useState[0],
|
25
23
|
setUserId = _useState[1];
|
26
24
|
|
27
25
|
function fetchUserId() {
|
28
|
-
return
|
26
|
+
return _fetchUserId.apply(this, arguments);
|
27
|
+
}
|
28
|
+
|
29
|
+
function _fetchUserId() {
|
30
|
+
_fetchUserId = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
29
31
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
30
32
|
while (1) switch (_context2.prev = _context2.next) {
|
31
33
|
case 0:
|
@@ -61,7 +63,8 @@ function useUserId(props) {
|
|
61
63
|
return _context2.stop();
|
62
64
|
}
|
63
65
|
}, _callee2);
|
64
|
-
}))
|
66
|
+
}));
|
67
|
+
return _fetchUserId.apply(this, arguments);
|
65
68
|
}
|
66
69
|
|
67
70
|
return {
|
@@ -30,8 +30,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
30
30
|
var FormItem = _form["default"].Item;
|
31
31
|
|
32
32
|
function ResourceWebControllUrlSettingDialog(props) {
|
33
|
-
var _ref;
|
34
|
-
|
35
33
|
var topo = props.topo;
|
36
34
|
var store = topo.store;
|
37
35
|
var resourceWebControllUrl = topo.pluginManager.pluginMap.resourceWebControllUrl;
|
@@ -56,8 +54,8 @@ function ResourceWebControllUrlSettingDialog(props) {
|
|
56
54
|
});
|
57
55
|
}, [url]);
|
58
56
|
|
59
|
-
var submit = function
|
60
|
-
|
57
|
+
var submit = /*#__PURE__*/function () {
|
58
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
61
59
|
var _yield$field$validate, errors, values;
|
62
60
|
|
63
61
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
@@ -84,8 +82,12 @@ function ResourceWebControllUrlSettingDialog(props) {
|
|
84
82
|
return _context.stop();
|
85
83
|
}
|
86
84
|
}, _callee);
|
87
|
-
}))
|
88
|
-
|
85
|
+
}));
|
86
|
+
|
87
|
+
return function submit() {
|
88
|
+
return _ref.apply(this, arguments);
|
89
|
+
};
|
90
|
+
}();
|
89
91
|
|
90
92
|
var renameIconForm = /*#__PURE__*/_react["default"].createElement(_form["default"], {
|
91
93
|
field: field,
|
@@ -5,12 +5,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports.useSubs = exports.useSave = void 0;
|
7
7
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
8
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
11
|
|
10
12
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
11
13
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
13
|
-
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
15
15
|
|
16
16
|
var _react = require("react");
|
@@ -23,8 +23,6 @@ var _utils = require("@riil-frontend/utils");
|
|
23
23
|
|
24
24
|
var _excluded = ["run"];
|
25
25
|
|
26
|
-
var _updateLink, _saveLink;
|
27
|
-
|
28
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
29
27
|
|
30
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -110,7 +108,11 @@ function buildCreateLinkParams(params, discoveryId) {
|
|
110
108
|
|
111
109
|
|
112
110
|
function updateLink(_x, _x2) {
|
113
|
-
return
|
111
|
+
return _updateLink.apply(this, arguments);
|
112
|
+
}
|
113
|
+
|
114
|
+
function _updateLink() {
|
115
|
+
_updateLink = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(oldLink, params) {
|
114
116
|
var result, src, dst, srcRelation, dstRelation, srcIsCurrentRelation, dstIsCurrentRelation, onlyChangeOneEnd, createResult;
|
115
117
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
116
118
|
while (1) switch (_context.prev = _context.next) {
|
@@ -171,11 +173,23 @@ function updateLink(_x, _x2) {
|
|
171
173
|
return _context.stop();
|
172
174
|
}
|
173
175
|
}, _callee);
|
174
|
-
}))
|
176
|
+
}));
|
177
|
+
return _updateLink.apply(this, arguments);
|
175
178
|
}
|
176
179
|
|
177
180
|
function saveLink(_x3) {
|
178
|
-
return
|
181
|
+
return _saveLink.apply(this, arguments);
|
182
|
+
}
|
183
|
+
/**
|
184
|
+
* 保存链路
|
185
|
+
* TODO 保存结构的解析未联调(全部保存成功、部分保存成功、全部保存失败回显效果)
|
186
|
+
* @param {*} cb 保存成功的回调
|
187
|
+
* @returns
|
188
|
+
*/
|
189
|
+
|
190
|
+
|
191
|
+
function _saveLink() {
|
192
|
+
_saveLink = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref2) {
|
179
193
|
var link, values, params, result, _params;
|
180
194
|
|
181
195
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
@@ -207,15 +221,9 @@ function saveLink(_x3) {
|
|
207
221
|
return _context2.stop();
|
208
222
|
}
|
209
223
|
}, _callee2);
|
210
|
-
}))
|
224
|
+
}));
|
225
|
+
return _saveLink.apply(this, arguments);
|
211
226
|
}
|
212
|
-
/**
|
213
|
-
* 保存链路
|
214
|
-
* TODO 保存结构的解析未联调(全部保存成功、部分保存成功、全部保存失败回显效果)
|
215
|
-
* @param {*} cb 保存成功的回调
|
216
|
-
* @returns
|
217
|
-
*/
|
218
|
-
|
219
227
|
|
220
228
|
var useSave = function useSave(_ref3) {
|
221
229
|
var cb = _ref3.cb;
|
@@ -34,8 +34,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
34
34
|
* 通过ref调用show方法来打开,编辑场景传入link对象
|
35
35
|
*/
|
36
36
|
var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
37
|
-
var _ref2, _ref3, _ref4, _ref5;
|
38
|
-
|
39
37
|
var topoContext = props.topoContext,
|
40
38
|
topo = props.topo;
|
41
39
|
var store = topo.store;
|
@@ -103,8 +101,8 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
103
101
|
}
|
104
102
|
}, [urlParams.showAddLink]); // 链路更新,通过资源重新获取链路信息通知HT来更新
|
105
103
|
|
106
|
-
var refreshLink = function
|
107
|
-
|
104
|
+
var refreshLink = /*#__PURE__*/function () {
|
105
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
108
106
|
var data;
|
109
107
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
110
108
|
while (1) switch (_context.prev = _context.next) {
|
@@ -126,11 +124,15 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
126
124
|
return _context.stop();
|
127
125
|
}
|
128
126
|
}, _callee);
|
129
|
-
}))
|
130
|
-
|
127
|
+
}));
|
128
|
+
|
129
|
+
return function refreshLink() {
|
130
|
+
return _ref2.apply(this, arguments);
|
131
|
+
};
|
132
|
+
}();
|
131
133
|
|
132
|
-
var getLink = function
|
133
|
-
|
134
|
+
var getLink = /*#__PURE__*/function () {
|
135
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
134
136
|
var data;
|
135
137
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
136
138
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -149,11 +151,15 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
149
151
|
return _context2.stop();
|
150
152
|
}
|
151
153
|
}, _callee2);
|
152
|
-
}))
|
153
|
-
};
|
154
|
+
}));
|
154
155
|
|
155
|
-
|
156
|
-
|
156
|
+
return function getLink(_x) {
|
157
|
+
return _ref3.apply(this, arguments);
|
158
|
+
};
|
159
|
+
}();
|
160
|
+
|
161
|
+
var updateTopo = (0, _react.useCallback)( /*#__PURE__*/function () {
|
162
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(data) {
|
157
163
|
var changed, isAdd, _data$result$2, oldId, id, linkData;
|
158
164
|
|
159
165
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
@@ -198,10 +204,14 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
198
204
|
return _context3.stop();
|
199
205
|
}
|
200
206
|
}, _callee3);
|
201
|
-
}))
|
202
|
-
|
203
|
-
|
204
|
-
|
207
|
+
}));
|
208
|
+
|
209
|
+
return function (_x2) {
|
210
|
+
return _ref4.apply(this, arguments);
|
211
|
+
};
|
212
|
+
}(), []);
|
213
|
+
var handleSaved = (0, _react.useCallback)( /*#__PURE__*/function () {
|
214
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data) {
|
205
215
|
var errorItems;
|
206
216
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
207
217
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -226,8 +236,12 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
226
236
|
return _context4.stop();
|
227
237
|
}
|
228
238
|
}, _callee4);
|
229
|
-
}))
|
230
|
-
|
239
|
+
}));
|
240
|
+
|
241
|
+
return function (_x3) {
|
242
|
+
return _ref5.apply(this, arguments);
|
243
|
+
};
|
244
|
+
}(), []);
|
231
245
|
return /*#__PURE__*/_react["default"].createElement(_drawer["default"], {
|
232
246
|
closeMode: ['close', 'esc'],
|
233
247
|
visible: visible,
|
@@ -66,8 +66,6 @@ var Title = function Title(_ref) {
|
|
66
66
|
|
67
67
|
|
68
68
|
var LinkSetting = function LinkSetting(_ref2) {
|
69
|
-
var _ref3;
|
70
|
-
|
71
69
|
var link = _ref2.link,
|
72
70
|
topoElements = _ref2.topoElements,
|
73
71
|
topo = _ref2.topo,
|
@@ -136,8 +134,8 @@ var LinkSetting = function LinkSetting(_ref2) {
|
|
136
134
|
return validatorErrors;
|
137
135
|
};
|
138
136
|
|
139
|
-
var onSave = function
|
140
|
-
|
137
|
+
var onSave = /*#__PURE__*/function () {
|
138
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
141
139
|
var values, _values$2, src, dst;
|
142
140
|
|
143
141
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
@@ -184,8 +182,12 @@ var LinkSetting = function LinkSetting(_ref2) {
|
|
184
182
|
return _context.stop();
|
185
183
|
}
|
186
184
|
}, _callee);
|
187
|
-
}))
|
188
|
-
|
185
|
+
}));
|
186
|
+
|
187
|
+
return function onSave() {
|
188
|
+
return _ref3.apply(this, arguments);
|
189
|
+
};
|
190
|
+
}();
|
189
191
|
|
190
192
|
var formProp = {
|
191
193
|
link: link,
|
@@ -17,8 +17,6 @@ var _linkUtils = require("../core/models/utils/linkUtils");
|
|
17
17
|
|
18
18
|
var _resourcePermissionUtil = require("./utils/resourcePermissionUtil");
|
19
19
|
|
20
|
-
var _addLinkData, _buildData, _getTopoData;
|
21
|
-
|
22
20
|
// import "./utils/__tests__/resourcePermissionUtil.test";
|
23
21
|
// 过滤掉无两端节点数据的链路
|
24
22
|
function filterLinkNoSourceTarget(data) {
|
@@ -77,7 +75,12 @@ function isNetworkLink(link) {
|
|
77
75
|
}
|
78
76
|
|
79
77
|
function addLinkData(_x) {
|
80
|
-
return
|
78
|
+
return _addLinkData.apply(this, arguments);
|
79
|
+
} // FIXME 业务拓扑不需要链路相关逻辑
|
80
|
+
|
81
|
+
|
82
|
+
function _addLinkData() {
|
83
|
+
_addLinkData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
81
84
|
var links, nodes, prevNetworkLinks, networkLinks, otherLinks;
|
82
85
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
83
86
|
while (1) switch (_context.prev = _context.next) {
|
@@ -106,12 +109,16 @@ function addLinkData(_x) {
|
|
106
109
|
return _context.stop();
|
107
110
|
}
|
108
111
|
}, _callee);
|
109
|
-
}))
|
110
|
-
|
111
|
-
|
112
|
+
}));
|
113
|
+
return _addLinkData.apply(this, arguments);
|
114
|
+
}
|
112
115
|
|
113
116
|
function buildData(_x2) {
|
114
|
-
return
|
117
|
+
return _buildData.apply(this, arguments);
|
118
|
+
}
|
119
|
+
|
120
|
+
function _buildData() {
|
121
|
+
_buildData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(oldData) {
|
115
122
|
var data;
|
116
123
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
117
124
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -128,11 +135,16 @@ function buildData(_x2) {
|
|
128
135
|
return _context2.stop();
|
129
136
|
}
|
130
137
|
}, _callee2);
|
131
|
-
}))
|
138
|
+
}));
|
139
|
+
return _buildData.apply(this, arguments);
|
132
140
|
}
|
133
141
|
|
134
142
|
function getTopoData(_x3, _x4) {
|
135
|
-
return
|
143
|
+
return _getTopoData.apply(this, arguments);
|
144
|
+
}
|
145
|
+
|
146
|
+
function _getTopoData() {
|
147
|
+
_getTopoData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id, topoService) {
|
136
148
|
var data;
|
137
149
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
138
150
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -164,5 +176,6 @@ function getTopoData(_x3, _x4) {
|
|
164
176
|
return _context3.stop();
|
165
177
|
}
|
166
178
|
}, _callee3);
|
167
|
-
}))
|
179
|
+
}));
|
180
|
+
return _getTopoData.apply(this, arguments);
|
168
181
|
}
|