@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
@@ -10,8 +10,6 @@ import service from "../../../../../../../services/overview";
|
|
10
10
|
*/
|
11
11
|
|
12
12
|
var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
13
|
-
var _getAlarmRiskData;
|
14
|
-
|
15
13
|
var id = props.id,
|
16
14
|
isAppTopo = props.isAppTopo,
|
17
15
|
resourceOverviewProps = props.resourceOverviewProps,
|
@@ -24,14 +22,19 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
24
22
|
|
25
23
|
|
26
24
|
function getAlarmRiskData(_x) {
|
27
|
-
return
|
25
|
+
return _getAlarmRiskData.apply(this, arguments);
|
26
|
+
} // 轮询hooks
|
27
|
+
|
28
|
+
|
29
|
+
function _getAlarmRiskData() {
|
30
|
+
_getAlarmRiskData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
28
31
|
var _alarmList, _yield$resourceOvervi2, alarmList, _yield$alarmService$g2, _alarmList2, AllComponentsByCiId, _yield$service$getRis2, riskList;
|
29
32
|
|
30
33
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
31
34
|
while (1) switch (_context.prev = _context.next) {
|
32
35
|
case 0:
|
33
36
|
if (!isAppTopo) {
|
34
|
-
_context.next =
|
37
|
+
_context.next = 10;
|
35
38
|
break;
|
36
39
|
}
|
37
40
|
|
@@ -46,27 +49,29 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
46
49
|
alarmList = _yield$resourceOvervi2.alarms;
|
47
50
|
alarmList = ((_alarmList = alarmList) === null || _alarmList === void 0 ? void 0 : _alarmList.map(function (item) {
|
48
51
|
return {
|
49
|
-
|
50
|
-
|
52
|
+
alarmInfo: item,
|
53
|
+
type: "alarm",
|
54
|
+
icon: "gaojing-3",
|
51
55
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
52
56
|
title: "[" + item.alertObject + "] " + item.alertTitle,
|
53
|
-
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,
|
54
58
|
time: item.createTime,
|
55
59
|
status: item.status,
|
56
60
|
params: [{
|
57
61
|
alertId: item.alertId,
|
58
|
-
status:
|
62
|
+
status: "dealing",
|
59
63
|
userId: userId,
|
60
64
|
isBaseAlert: false
|
61
65
|
}]
|
62
66
|
};
|
63
67
|
})) || [];
|
68
|
+
console.log("setAlarmRiskList", alarmList);
|
64
69
|
setAlarmRiskList(alarmList);
|
65
|
-
_context.next =
|
70
|
+
_context.next = 25;
|
66
71
|
break;
|
67
72
|
|
68
|
-
case
|
69
|
-
_context.next =
|
73
|
+
case 10:
|
74
|
+
_context.next = 12;
|
70
75
|
return alarmService.getAlarmByIds([id].concat(childrenIds), {
|
71
76
|
alertStatusList: ['toDeal', 'woDealing', 'dealing'],
|
72
77
|
// toDeal: 待处理, dealing:处理中
|
@@ -76,7 +81,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
76
81
|
sortOrder: 'asc'
|
77
82
|
});
|
78
83
|
|
79
|
-
case
|
84
|
+
case 12:
|
80
85
|
_yield$alarmService$g2 = _context.sent;
|
81
86
|
_alarmList2 = _yield$alarmService$g2.datas;
|
82
87
|
// 2022-07-16 后端不支持多列排序,暂通过前端实现,按创建时间倒序
|
@@ -85,28 +90,28 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
85
90
|
});
|
86
91
|
_alarmList2 = _alarmList2.map(function (item) {
|
87
92
|
return {
|
88
|
-
type:
|
89
|
-
icon:
|
93
|
+
type: "alarm",
|
94
|
+
icon: "gaojing-3",
|
90
95
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
91
96
|
title: "" + item.alertObject + item.alertTitle,
|
92
|
-
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,
|
93
98
|
time: item.createTime,
|
94
99
|
status: item.status,
|
95
100
|
params: [{
|
96
101
|
alertId: item.alertId,
|
97
|
-
status:
|
102
|
+
status: "dealing",
|
98
103
|
userId: userId,
|
99
104
|
isBaseAlert: false
|
100
105
|
}]
|
101
106
|
};
|
102
107
|
}); // fix NEWITOM-33635【南昌大学】网络拓扑上双击设备拉开的抽屉中无法看到风险
|
103
108
|
|
104
|
-
_context.next =
|
109
|
+
_context.next = 18;
|
105
110
|
return service.queryAllComponentsByCiId(id);
|
106
111
|
|
107
|
-
case
|
112
|
+
case 18:
|
108
113
|
AllComponentsByCiId = _context.sent;
|
109
|
-
_context.next =
|
114
|
+
_context.next = 21;
|
110
115
|
return service.getRiskByIds({
|
111
116
|
ciIdList: [id].concat(childrenIds, AllComponentsByCiId.map(function (item) {
|
112
117
|
return item.id;
|
@@ -116,7 +121,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
116
121
|
pageSize: 10000
|
117
122
|
});
|
118
123
|
|
119
|
-
case
|
124
|
+
case 21:
|
120
125
|
_yield$service$getRis2 = _context.sent;
|
121
126
|
riskList = _yield$service$getRis2.content;
|
122
127
|
riskList = riskList.map(function (item) {
|
@@ -132,14 +137,14 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
132
137
|
|
133
138
|
setAlarmRiskList([].concat(_alarmList2, riskList));
|
134
139
|
|
135
|
-
case
|
140
|
+
case 25:
|
136
141
|
case "end":
|
137
142
|
return _context.stop();
|
138
143
|
}
|
139
144
|
}, _callee);
|
140
|
-
}))
|
141
|
-
|
142
|
-
|
145
|
+
}));
|
146
|
+
return _getAlarmRiskData.apply(this, arguments);
|
147
|
+
}
|
143
148
|
|
144
149
|
var request = useRequest(getAlarmRiskData, {
|
145
150
|
pollingInterval: 1000 * 15,
|
@@ -9,8 +9,6 @@ import { queryCiMonitorMetricCodes } from "../../../getCiDisplayMetricModels";
|
|
9
9
|
*/
|
10
10
|
|
11
11
|
var useMetricModels = function useMetricModels(props) {
|
12
|
-
var _fetchData;
|
13
|
-
|
14
12
|
var _props$data = props.data,
|
15
13
|
type = _props$data.type,
|
16
14
|
id = _props$data.id,
|
@@ -30,7 +28,12 @@ var useMetricModels = function useMetricModels(props) {
|
|
30
28
|
setInitLoading = _useState2[1];
|
31
29
|
|
32
30
|
function fetchData() {
|
33
|
-
return
|
31
|
+
return _fetchData.apply(this, arguments);
|
32
|
+
} // 轮询hooks
|
33
|
+
|
34
|
+
|
35
|
+
function _fetchData() {
|
36
|
+
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
34
37
|
var monitorMetrics, ciMonitorMetricModels, displayMetricModels, _metricCodes;
|
35
38
|
|
36
39
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
@@ -105,9 +108,9 @@ var useMetricModels = function useMetricModels(props) {
|
|
105
108
|
return _context.stop();
|
106
109
|
}
|
107
110
|
}, _callee);
|
108
|
-
}))
|
109
|
-
|
110
|
-
|
111
|
+
}));
|
112
|
+
return _fetchData.apply(this, arguments);
|
113
|
+
}
|
111
114
|
|
112
115
|
var request = useRequest(fetchData, {
|
113
116
|
pollingInterval: 1000 * 60,
|
@@ -1,8 +1,5 @@
|
|
1
1
|
import _Message from "@alifd/next/es/message";
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
|
-
|
4
|
-
var _queryWebConsoleUrlById;
|
5
|
-
|
6
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
7
4
|
import { useRequest } from 'ahooks';
|
8
5
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
@@ -10,40 +7,43 @@ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
10
7
|
import { useEffect, useState } from 'react';
|
11
8
|
|
12
9
|
function queryWebConsoleUrlById(_x) {
|
13
|
-
return
|
10
|
+
return _queryWebConsoleUrlById.apply(this, arguments);
|
11
|
+
}
|
12
|
+
|
13
|
+
function _queryWebConsoleUrlById() {
|
14
|
+
_queryWebConsoleUrlById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
|
14
15
|
var _list, list;
|
15
16
|
|
16
|
-
return _regeneratorRuntime.wrap(function
|
17
|
-
while (1) switch (
|
17
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
18
|
+
while (1) switch (_context2.prev = _context2.next) {
|
18
19
|
case 0:
|
19
|
-
|
20
|
-
|
20
|
+
_context2.prev = 0;
|
21
|
+
_context2.next = 3;
|
21
22
|
return topoService.resourceWebUrl.list([id]);
|
22
23
|
|
23
24
|
case 3:
|
24
|
-
list =
|
25
|
+
list = _context2.sent;
|
25
26
|
;
|
26
|
-
return
|
27
|
+
return _context2.abrupt("return", (_list = list[list.length - 1]) === null || _list === void 0 ? void 0 : _list.webUrl);
|
27
28
|
|
28
29
|
case 8:
|
29
|
-
|
30
|
-
|
31
|
-
rlog.error('资源web控制台.加载数据异常',
|
30
|
+
_context2.prev = 8;
|
31
|
+
_context2.t0 = _context2["catch"](0);
|
32
|
+
rlog.error('资源web控制台.加载数据异常', _context2.t0);
|
32
33
|
|
33
34
|
case 11:
|
34
|
-
return
|
35
|
+
return _context2.abrupt("return", null);
|
35
36
|
|
36
37
|
case 12:
|
37
38
|
case "end":
|
38
|
-
return
|
39
|
+
return _context2.stop();
|
39
40
|
}
|
40
|
-
},
|
41
|
-
}))
|
41
|
+
}, _callee2, null, [[0, 8]]);
|
42
|
+
}));
|
43
|
+
return _queryWebConsoleUrlById.apply(this, arguments);
|
42
44
|
}
|
43
45
|
|
44
46
|
export default function useWebConsole(props) {
|
45
|
-
var _save;
|
46
|
-
|
47
47
|
var ciId = props.ciId;
|
48
48
|
var ipv4Address = props.ipv4Address;
|
49
49
|
|
@@ -70,11 +70,15 @@ export default function useWebConsole(props) {
|
|
70
70
|
}, [ciId]); // 保存Web控制台url
|
71
71
|
|
72
72
|
function save(_x2) {
|
73
|
-
return
|
74
|
-
|
75
|
-
|
73
|
+
return _save.apply(this, arguments);
|
74
|
+
}
|
75
|
+
|
76
|
+
function _save() {
|
77
|
+
_save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(newWebConsoleUrl) {
|
78
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
79
|
+
while (1) switch (_context.prev = _context.next) {
|
76
80
|
case 0:
|
77
|
-
|
81
|
+
_context.next = 2;
|
78
82
|
return topoService.resourceWebUrl.save(ciId, newWebConsoleUrl || null);
|
79
83
|
|
80
84
|
case 2:
|
@@ -82,10 +86,11 @@ export default function useWebConsole(props) {
|
|
82
86
|
|
83
87
|
case 3:
|
84
88
|
case "end":
|
85
|
-
return
|
89
|
+
return _context.stop();
|
86
90
|
}
|
87
|
-
},
|
88
|
-
}))
|
91
|
+
}, _callee);
|
92
|
+
}));
|
93
|
+
return _save.apply(this, arguments);
|
89
94
|
}
|
90
95
|
|
91
96
|
return {
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
-
|
3
|
-
var _queryCiMonitorMetricStrategys, _queryCiMonitorMetricCodes;
|
4
|
-
|
5
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
6
3
|
import { request } from '@riil-frontend/component-topology-utils';
|
7
4
|
export function queryCiMonitorMetricStrategys(_x) {
|
8
|
-
return
|
5
|
+
return _queryCiMonitorMetricStrategys.apply(this, arguments);
|
6
|
+
}
|
7
|
+
|
8
|
+
function _queryCiMonitorMetricStrategys() {
|
9
|
+
_queryCiMonitorMetricStrategys = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
9
10
|
var map, monitorMetrics;
|
10
11
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
11
12
|
while (1) switch (_context.prev = _context.next) {
|
@@ -25,10 +26,16 @@ export function queryCiMonitorMetricStrategys(_x) {
|
|
25
26
|
return _context.stop();
|
26
27
|
}
|
27
28
|
}, _callee);
|
28
|
-
}))
|
29
|
+
}));
|
30
|
+
return _queryCiMonitorMetricStrategys.apply(this, arguments);
|
29
31
|
}
|
32
|
+
|
30
33
|
export function queryCiMonitorMetricCodes(_x2) {
|
31
|
-
return
|
34
|
+
return _queryCiMonitorMetricCodes.apply(this, arguments);
|
35
|
+
}
|
36
|
+
|
37
|
+
function _queryCiMonitorMetricCodes() {
|
38
|
+
_queryCiMonitorMetricCodes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
|
32
39
|
var arr;
|
33
40
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
34
41
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -47,5 +54,6 @@ export function queryCiMonitorMetricCodes(_x2) {
|
|
47
54
|
return _context2.stop();
|
48
55
|
}
|
49
56
|
}, _callee2);
|
50
|
-
}))
|
57
|
+
}));
|
58
|
+
return _queryCiMonitorMetricCodes.apply(this, arguments);
|
51
59
|
}
|
@@ -4,14 +4,16 @@ import React, { useState } from 'react';
|
|
4
4
|
import service from "../../../../../services/overview";
|
5
5
|
|
6
6
|
function useUserId(props) {
|
7
|
-
var _fetchUserId;
|
8
|
-
|
9
7
|
var _useState = useState(''),
|
10
8
|
userId = _useState[0],
|
11
9
|
setUserId = _useState[1];
|
12
10
|
|
13
11
|
function fetchUserId() {
|
14
|
-
return
|
12
|
+
return _fetchUserId.apply(this, arguments);
|
13
|
+
}
|
14
|
+
|
15
|
+
function _fetchUserId() {
|
16
|
+
_fetchUserId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
15
17
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
16
18
|
while (1) switch (_context2.prev = _context2.next) {
|
17
19
|
case 0:
|
@@ -47,7 +49,8 @@ function useUserId(props) {
|
|
47
49
|
return _context2.stop();
|
48
50
|
}
|
49
51
|
}, _callee2);
|
50
|
-
}))
|
52
|
+
}));
|
53
|
+
return _fetchUserId.apply(this, arguments);
|
51
54
|
}
|
52
55
|
|
53
56
|
return {
|
@@ -9,8 +9,6 @@ import React, { useEffect } from 'react';
|
|
9
9
|
import styles from "./ResourceWebControllUrlSettingDialog.module.scss";
|
10
10
|
var FormItem = _Form.Item;
|
11
11
|
export default function ResourceWebControllUrlSettingDialog(props) {
|
12
|
-
var _ref;
|
13
|
-
|
14
12
|
var topo = props.topo;
|
15
13
|
var store = topo.store;
|
16
14
|
var resourceWebControllUrl = topo.pluginManager.pluginMap.resourceWebControllUrl;
|
@@ -35,8 +33,8 @@ export default function ResourceWebControllUrlSettingDialog(props) {
|
|
35
33
|
});
|
36
34
|
}, [url]);
|
37
35
|
|
38
|
-
var submit = function
|
39
|
-
|
36
|
+
var submit = /*#__PURE__*/function () {
|
37
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
40
38
|
var _yield$field$validate, errors, values;
|
41
39
|
|
42
40
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
@@ -63,8 +61,12 @@ export default function ResourceWebControllUrlSettingDialog(props) {
|
|
63
61
|
return _context.stop();
|
64
62
|
}
|
65
63
|
}, _callee);
|
66
|
-
}))
|
67
|
-
|
64
|
+
}));
|
65
|
+
|
66
|
+
return function submit() {
|
67
|
+
return _ref.apply(this, arguments);
|
68
|
+
};
|
69
|
+
}();
|
68
70
|
|
69
71
|
var renameIconForm = /*#__PURE__*/React.createElement(_Form, {
|
70
72
|
field: field,
|
@@ -2,9 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
4
4
|
var _excluded = ["run"];
|
5
|
-
|
6
|
-
var _updateLink, _saveLink;
|
7
|
-
|
8
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
9
6
|
import { useEffect, useState } from 'react';
|
10
7
|
import { useRequest } from 'ahooks';
|
@@ -90,7 +87,11 @@ function buildCreateLinkParams(params, discoveryId) {
|
|
90
87
|
|
91
88
|
|
92
89
|
function updateLink(_x, _x2) {
|
93
|
-
return
|
90
|
+
return _updateLink.apply(this, arguments);
|
91
|
+
}
|
92
|
+
|
93
|
+
function _updateLink() {
|
94
|
+
_updateLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(oldLink, params) {
|
94
95
|
var result, src, dst, srcRelation, dstRelation, srcIsCurrentRelation, dstIsCurrentRelation, onlyChangeOneEnd, createResult;
|
95
96
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
96
97
|
while (1) switch (_context.prev = _context.next) {
|
@@ -151,11 +152,23 @@ function updateLink(_x, _x2) {
|
|
151
152
|
return _context.stop();
|
152
153
|
}
|
153
154
|
}, _callee);
|
154
|
-
}))
|
155
|
+
}));
|
156
|
+
return _updateLink.apply(this, arguments);
|
155
157
|
}
|
156
158
|
|
157
159
|
function saveLink(_x3) {
|
158
|
-
return
|
160
|
+
return _saveLink.apply(this, arguments);
|
161
|
+
}
|
162
|
+
/**
|
163
|
+
* 保存链路
|
164
|
+
* TODO 保存结构的解析未联调(全部保存成功、部分保存成功、全部保存失败回显效果)
|
165
|
+
* @param {*} cb 保存成功的回调
|
166
|
+
* @returns
|
167
|
+
*/
|
168
|
+
|
169
|
+
|
170
|
+
function _saveLink() {
|
171
|
+
_saveLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
159
172
|
var link, values, params, result, _params;
|
160
173
|
|
161
174
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
@@ -187,15 +200,9 @@ function saveLink(_x3) {
|
|
187
200
|
return _context2.stop();
|
188
201
|
}
|
189
202
|
}, _callee2);
|
190
|
-
}))
|
203
|
+
}));
|
204
|
+
return _saveLink.apply(this, arguments);
|
191
205
|
}
|
192
|
-
/**
|
193
|
-
* 保存链路
|
194
|
-
* TODO 保存结构的解析未联调(全部保存成功、部分保存成功、全部保存失败回显效果)
|
195
|
-
* @param {*} cb 保存成功的回调
|
196
|
-
* @returns
|
197
|
-
*/
|
198
|
-
|
199
206
|
|
200
207
|
export var useSave = function useSave(_ref3) {
|
201
208
|
var cb = _ref3.cb;
|
@@ -14,8 +14,6 @@ import LinkSetting from "./setting";
|
|
14
14
|
*/
|
15
15
|
|
16
16
|
var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
17
|
-
var _ref2, _ref3, _ref4, _ref5;
|
18
|
-
|
19
17
|
var topoContext = props.topoContext,
|
20
18
|
topo = props.topo;
|
21
19
|
var store = topo.store;
|
@@ -83,8 +81,8 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
83
81
|
}
|
84
82
|
}, [urlParams.showAddLink]); // 链路更新,通过资源重新获取链路信息通知HT来更新
|
85
83
|
|
86
|
-
var refreshLink = function
|
87
|
-
|
84
|
+
var refreshLink = /*#__PURE__*/function () {
|
85
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
88
86
|
var data;
|
89
87
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
90
88
|
while (1) switch (_context.prev = _context.next) {
|
@@ -105,11 +103,15 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
105
103
|
return _context.stop();
|
106
104
|
}
|
107
105
|
}, _callee);
|
108
|
-
}))
|
109
|
-
|
106
|
+
}));
|
107
|
+
|
108
|
+
return function refreshLink() {
|
109
|
+
return _ref2.apply(this, arguments);
|
110
|
+
};
|
111
|
+
}();
|
110
112
|
|
111
|
-
var getLink = function
|
112
|
-
|
113
|
+
var getLink = /*#__PURE__*/function () {
|
114
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
|
113
115
|
var data;
|
114
116
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
115
117
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -128,11 +130,15 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
128
130
|
return _context2.stop();
|
129
131
|
}
|
130
132
|
}, _callee2);
|
131
|
-
}))
|
132
|
-
};
|
133
|
+
}));
|
133
134
|
|
134
|
-
|
135
|
-
|
135
|
+
return function getLink(_x) {
|
136
|
+
return _ref3.apply(this, arguments);
|
137
|
+
};
|
138
|
+
}();
|
139
|
+
|
140
|
+
var updateTopo = useCallback( /*#__PURE__*/function () {
|
141
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data) {
|
136
142
|
var changed, isAdd, _data$result$2, oldId, id, linkData;
|
137
143
|
|
138
144
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
@@ -177,10 +183,14 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
177
183
|
return _context3.stop();
|
178
184
|
}
|
179
185
|
}, _callee3);
|
180
|
-
}))
|
181
|
-
|
182
|
-
|
183
|
-
|
186
|
+
}));
|
187
|
+
|
188
|
+
return function (_x2) {
|
189
|
+
return _ref4.apply(this, arguments);
|
190
|
+
};
|
191
|
+
}(), []);
|
192
|
+
var handleSaved = useCallback( /*#__PURE__*/function () {
|
193
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
|
184
194
|
var errorItems;
|
185
195
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
186
196
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -205,8 +215,12 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
205
215
|
return _context4.stop();
|
206
216
|
}
|
207
217
|
}, _callee4);
|
208
|
-
}))
|
209
|
-
|
218
|
+
}));
|
219
|
+
|
220
|
+
return function (_x3) {
|
221
|
+
return _ref5.apply(this, arguments);
|
222
|
+
};
|
223
|
+
}(), []);
|
210
224
|
return /*#__PURE__*/React.createElement(_Drawer, {
|
211
225
|
closeMode: ['close', 'esc'],
|
212
226
|
visible: visible,
|
@@ -38,8 +38,6 @@ var Title = function Title(_ref) {
|
|
38
38
|
|
39
39
|
|
40
40
|
var LinkSetting = function LinkSetting(_ref2) {
|
41
|
-
var _ref3;
|
42
|
-
|
43
41
|
var link = _ref2.link,
|
44
42
|
topoElements = _ref2.topoElements,
|
45
43
|
topo = _ref2.topo,
|
@@ -108,8 +106,8 @@ var LinkSetting = function LinkSetting(_ref2) {
|
|
108
106
|
return validatorErrors;
|
109
107
|
};
|
110
108
|
|
111
|
-
var onSave = function
|
112
|
-
|
109
|
+
var onSave = /*#__PURE__*/function () {
|
110
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
113
111
|
var values, _values$2, src, dst;
|
114
112
|
|
115
113
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
@@ -156,8 +154,12 @@ var LinkSetting = function LinkSetting(_ref2) {
|
|
156
154
|
return _context.stop();
|
157
155
|
}
|
158
156
|
}, _callee);
|
159
|
-
}))
|
160
|
-
|
157
|
+
}));
|
158
|
+
|
159
|
+
return function onSave() {
|
160
|
+
return _ref3.apply(this, arguments);
|
161
|
+
};
|
162
|
+
}();
|
161
163
|
|
162
164
|
var formProp = {
|
163
165
|
link: link,
|
@@ -1,8 +1,5 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
-
|
4
|
-
var _addLinkData, _buildData, _getTopoData;
|
5
|
-
|
6
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
7
4
|
import { getLinksDetail } from "../core/models/utils/linkUtils";
|
8
5
|
import { addTopoDataResourcePermission } from "./utils/resourcePermissionUtil"; // import "./utils/__tests__/resourcePermissionUtil.test";
|
@@ -64,7 +61,11 @@ function isNetworkLink(link) {
|
|
64
61
|
}
|
65
62
|
|
66
63
|
export function addLinkData(_x) {
|
67
|
-
return
|
64
|
+
return _addLinkData.apply(this, arguments);
|
65
|
+
} // FIXME 业务拓扑不需要链路相关逻辑
|
66
|
+
|
67
|
+
function _addLinkData() {
|
68
|
+
_addLinkData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
68
69
|
var links, nodes, prevNetworkLinks, networkLinks, otherLinks;
|
69
70
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
70
71
|
while (1) switch (_context.prev = _context.next) {
|
@@ -93,11 +94,16 @@ export function addLinkData(_x) {
|
|
93
94
|
return _context.stop();
|
94
95
|
}
|
95
96
|
}, _callee);
|
96
|
-
}))
|
97
|
-
|
97
|
+
}));
|
98
|
+
return _addLinkData.apply(this, arguments);
|
99
|
+
}
|
98
100
|
|
99
101
|
export function buildData(_x2) {
|
100
|
-
return
|
102
|
+
return _buildData.apply(this, arguments);
|
103
|
+
}
|
104
|
+
|
105
|
+
function _buildData() {
|
106
|
+
_buildData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(oldData) {
|
101
107
|
var data;
|
102
108
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
103
109
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -114,10 +120,16 @@ export function buildData(_x2) {
|
|
114
120
|
return _context2.stop();
|
115
121
|
}
|
116
122
|
}, _callee2);
|
117
|
-
}))
|
123
|
+
}));
|
124
|
+
return _buildData.apply(this, arguments);
|
118
125
|
}
|
126
|
+
|
119
127
|
export default function getTopoData(_x3, _x4) {
|
120
|
-
return
|
128
|
+
return _getTopoData.apply(this, arguments);
|
129
|
+
}
|
130
|
+
|
131
|
+
function _getTopoData() {
|
132
|
+
_getTopoData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, topoService) {
|
121
133
|
var data;
|
122
134
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
123
135
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -149,5 +161,6 @@ export default function getTopoData(_x3, _x4) {
|
|
149
161
|
return _context3.stop();
|
150
162
|
}
|
151
163
|
}, _callee3);
|
152
|
-
}))
|
164
|
+
}));
|
165
|
+
return _getTopoData.apply(this, arguments);
|
153
166
|
}
|