@riil-frontend/component-topology 11.0.33 → 11.0.35
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.css +4 -2
- package/build/index.js +52 -45
- package/es/components/MultiResourceDrawer/index.js +22 -26
- package/es/components/ResourceList/ResourceSelect.js +55 -58
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
- package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +149 -178
- package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
- package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +130 -142
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +525 -623
- package/es/core/models/Alarm.js +319 -402
- package/es/core/models/AttributeMetricDisplay.js +115 -143
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +279 -436
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +47 -61
- package/es/core/models/cache/DictCache.js +36 -42
- package/es/core/models/graph/Background.js +21 -26
- package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
- package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +14 -18
- package/es/core/services/cmdb.js +23 -27
- package/es/core/services/index.js +48 -68
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +15 -19
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +126 -145
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- package/es/core/utils/imageUtil.js +23 -27
- package/es/core/utils/saveSerialize.js +14 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
- package/es/networkTopo/components/Link/hook.js +85 -96
- package/es/networkTopo/components/Link/index.js +104 -126
- package/es/networkTopo/components/Link/setting.js +48 -52
- package/es/networkTopo/getTopoData.js +73 -92
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +28 -46
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +548 -696
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +33 -48
- package/es/networkTopo/services/metric.js +38 -47
- package/es/networkTopo/services/model.js +616 -809
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +251 -289
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +57 -61
- package/lib/components/MultiResourceDrawer/index.js +22 -26
- package/lib/components/ResourceList/ResourceSelect.js +54 -58
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +148 -177
- package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +129 -141
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +517 -615
- package/lib/core/models/Alarm.js +313 -396
- package/lib/core/models/AttributeMetricDisplay.js +118 -146
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +279 -436
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +48 -62
- package/lib/core/models/cache/DictCache.js +39 -45
- package/lib/core/models/graph/Background.js +22 -27
- package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
- package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +14 -19
- package/lib/core/services/cmdb.js +24 -29
- package/lib/core/services/index.js +53 -72
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +16 -21
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +126 -145
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- package/lib/core/utils/imageUtil.js +26 -31
- package/lib/core/utils/saveSerialize.js +13 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
- package/lib/networkTopo/components/Link/hook.js +86 -98
- package/lib/networkTopo/components/Link/index.js +105 -127
- package/lib/networkTopo/components/Link/setting.js +48 -52
- package/lib/networkTopo/getTopoData.js +73 -92
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +28 -46
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +551 -700
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +35 -51
- package/lib/networkTopo/services/metric.js +37 -47
- package/lib/networkTopo/services/model.js +615 -809
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +252 -290
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +63 -68
- package/package.json +4 -3
@@ -16,6 +16,8 @@ var _topo = _interopRequireDefault(require("@riil-frontend/component-topology-co
|
|
16
16
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
17
17
|
|
18
18
|
function _default(topo) {
|
19
|
+
var _onTopoDataLoaded, _initData, _saveResourceWebUrl;
|
20
|
+
|
19
21
|
var resourceUrlMap = {};
|
20
22
|
var currentId = null;
|
21
23
|
init();
|
@@ -33,76 +35,62 @@ function _default(topo) {
|
|
33
35
|
}
|
34
36
|
|
35
37
|
function onTopoDataLoaded(_x) {
|
36
|
-
return _onTopoDataLoaded
|
37
|
-
}
|
38
|
-
|
39
|
-
function _onTopoDataLoaded() {
|
40
|
-
_onTopoDataLoaded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(topoData) {
|
38
|
+
return (_onTopoDataLoaded = _onTopoDataLoaded || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(topoData) {
|
41
39
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
42
|
-
while (1) {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
return _context.stop();
|
50
|
-
}
|
40
|
+
while (1) switch (_context.prev = _context.next) {
|
41
|
+
case 0:
|
42
|
+
initData(topoData.nodes);
|
43
|
+
|
44
|
+
case 1:
|
45
|
+
case "end":
|
46
|
+
return _context.stop();
|
51
47
|
}
|
52
48
|
}, _callee);
|
53
|
-
}));
|
54
|
-
return _onTopoDataLoaded.apply(this, arguments);
|
49
|
+
}))).apply(this, arguments);
|
55
50
|
}
|
56
51
|
|
57
52
|
function initData(_x2) {
|
58
|
-
return _initData
|
59
|
-
}
|
60
|
-
|
61
|
-
function _initData() {
|
62
|
-
_initData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(nodes) {
|
53
|
+
return (_initData = _initData || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(nodes) {
|
63
54
|
var ids, list;
|
64
55
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
65
|
-
while (1) {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
_context2.next = 3;
|
74
|
-
break;
|
75
|
-
}
|
76
|
-
|
77
|
-
return _context2.abrupt("return");
|
78
|
-
|
79
|
-
case 3:
|
80
|
-
_context2.prev = 3;
|
81
|
-
_context2.next = 6;
|
82
|
-
return _topo["default"].resourceWebUrl.list(ids);
|
83
|
-
|
84
|
-
case 6:
|
85
|
-
list = _context2.sent;
|
86
|
-
list.forEach(function (item) {
|
87
|
-
resourceUrlMap[item.ciId] = item.webUrl;
|
88
|
-
});
|
89
|
-
_context2.next = 13;
|
56
|
+
while (1) switch (_context2.prev = _context2.next) {
|
57
|
+
case 0:
|
58
|
+
ids = nodes.map(function (node) {
|
59
|
+
return node.id;
|
60
|
+
});
|
61
|
+
|
62
|
+
if (ids.length) {
|
63
|
+
_context2.next = 3;
|
90
64
|
break;
|
65
|
+
}
|
66
|
+
|
67
|
+
return _context2.abrupt("return");
|
68
|
+
|
69
|
+
case 3:
|
70
|
+
_context2.prev = 3;
|
71
|
+
_context2.next = 6;
|
72
|
+
return _topo["default"].resourceWebUrl.list(ids);
|
91
73
|
|
92
|
-
|
93
|
-
|
94
|
-
|
74
|
+
case 6:
|
75
|
+
list = _context2.sent;
|
76
|
+
list.forEach(function (item) {
|
77
|
+
resourceUrlMap[item.ciId] = item.webUrl;
|
78
|
+
});
|
79
|
+
_context2.next = 13;
|
80
|
+
break;
|
95
81
|
|
96
|
-
|
82
|
+
case 10:
|
83
|
+
_context2.prev = 10;
|
84
|
+
_context2.t0 = _context2["catch"](3);
|
97
85
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
86
|
+
_rlog["default"].error('资源web控制台.加载数据异常', _context2.t0);
|
87
|
+
|
88
|
+
case 13:
|
89
|
+
case "end":
|
90
|
+
return _context2.stop();
|
102
91
|
}
|
103
92
|
}, _callee2, null, [[3, 10]]);
|
104
|
-
}));
|
105
|
-
return _initData.apply(this, arguments);
|
93
|
+
}))).apply(this, arguments);
|
106
94
|
}
|
107
95
|
|
108
96
|
function getModelDispatchers() {
|
@@ -141,59 +129,52 @@ function _default(topo) {
|
|
141
129
|
}
|
142
130
|
|
143
131
|
function saveResourceWebUrl(_x3, _x4) {
|
144
|
-
return _saveResourceWebUrl.
|
145
|
-
}
|
146
|
-
|
147
|
-
function _saveResourceWebUrl() {
|
148
|
-
_saveResourceWebUrl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id, url) {
|
132
|
+
return (_saveResourceWebUrl = _saveResourceWebUrl || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id, url) {
|
149
133
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
150
|
-
while (1) {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
_context3.next = 4;
|
155
|
-
break;
|
156
|
-
}
|
157
|
-
|
158
|
-
_message["default"].success('链接设置成功');
|
159
|
-
|
160
|
-
closeSettingDialog();
|
161
|
-
return _context3.abrupt("return");
|
162
|
-
|
163
|
-
case 4:
|
164
|
-
updateStore({
|
165
|
-
saving: true
|
166
|
-
});
|
167
|
-
_context3.prev = 5;
|
168
|
-
_context3.next = 8;
|
169
|
-
return _topo["default"].resourceWebUrl.save(id, url || null);
|
170
|
-
|
171
|
-
case 8:
|
172
|
-
_message["default"].success('链接设置成功');
|
173
|
-
|
174
|
-
resourceUrlMap[id] = url;
|
175
|
-
closeSettingDialog();
|
176
|
-
_context3.next = 17;
|
134
|
+
while (1) switch (_context3.prev = _context3.next) {
|
135
|
+
case 0:
|
136
|
+
if (!(!url && !getResourceUrl(id))) {
|
137
|
+
_context3.next = 4;
|
177
138
|
break;
|
139
|
+
}
|
140
|
+
|
141
|
+
_message["default"].success('链接设置成功');
|
142
|
+
|
143
|
+
closeSettingDialog();
|
144
|
+
return _context3.abrupt("return");
|
145
|
+
|
146
|
+
case 4:
|
147
|
+
updateStore({
|
148
|
+
saving: true
|
149
|
+
});
|
150
|
+
_context3.prev = 5;
|
151
|
+
_context3.next = 8;
|
152
|
+
return _topo["default"].resourceWebUrl.save(id, url || null);
|
153
|
+
|
154
|
+
case 8:
|
155
|
+
_message["default"].success('链接设置成功');
|
156
|
+
|
157
|
+
resourceUrlMap[id] = url;
|
158
|
+
closeSettingDialog();
|
159
|
+
_context3.next = 17;
|
160
|
+
break;
|
178
161
|
|
179
|
-
|
180
|
-
|
181
|
-
|
162
|
+
case 13:
|
163
|
+
_context3.prev = 13;
|
164
|
+
_context3.t0 = _context3["catch"](5);
|
182
165
|
|
183
|
-
|
166
|
+
_message["default"].error('链接设置失败');
|
184
167
|
|
185
|
-
|
186
|
-
|
187
|
-
|
168
|
+
updateStore({
|
169
|
+
saving: false
|
170
|
+
});
|
188
171
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
}
|
172
|
+
case 17:
|
173
|
+
case "end":
|
174
|
+
return _context3.stop();
|
193
175
|
}
|
194
176
|
}, _callee3, null, [[5, 13]]);
|
195
|
-
}));
|
196
|
-
return _saveResourceWebUrl.apply(this, arguments);
|
177
|
+
}))).apply(this, arguments);
|
197
178
|
}
|
198
179
|
|
199
180
|
var resourceWebUrl = {
|
@@ -23,6 +23,8 @@ var _tagtip = require("../../services/topo/tagtip");
|
|
23
23
|
* 标注、悬浮框字段模型
|
24
24
|
*/
|
25
25
|
var ElementTagTipConfig = /*#__PURE__*/function () {
|
26
|
+
var _init, _initNetworkLinkModel;
|
27
|
+
|
26
28
|
function ElementTagTipConfig(topo) {
|
27
29
|
this.topoData = void 0;
|
28
30
|
this.modelMap = {};
|
@@ -34,79 +36,63 @@ var ElementTagTipConfig = /*#__PURE__*/function () {
|
|
34
36
|
|
35
37
|
var _proto = ElementTagTipConfig.prototype;
|
36
38
|
|
37
|
-
_proto.init =
|
38
|
-
|
39
|
+
_proto.init = function init(_x) {
|
40
|
+
return (_init = _init || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(topoData) {
|
39
41
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
40
|
-
while (1) {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
return _context.stop();
|
53
|
-
}
|
42
|
+
while (1) switch (_context.prev = _context.next) {
|
43
|
+
case 0:
|
44
|
+
this.topoData = topoData;
|
45
|
+
_context.next = 3;
|
46
|
+
return this.initNetworkLinkModel();
|
47
|
+
|
48
|
+
case 3:
|
49
|
+
this.mtCiTypeMap = (0, _utils.getMtCodeCiTypeMap)(topoData);
|
50
|
+
|
51
|
+
case 4:
|
52
|
+
case "end":
|
53
|
+
return _context.stop();
|
54
54
|
}
|
55
55
|
}, _callee, this);
|
56
|
-
}));
|
57
|
-
|
58
|
-
function init(_x) {
|
59
|
-
return _init.apply(this, arguments);
|
60
|
-
}
|
61
|
-
|
62
|
-
return init;
|
63
|
-
}();
|
56
|
+
}))).apply(this, arguments);
|
57
|
+
};
|
64
58
|
|
65
|
-
_proto.initNetworkLinkModel =
|
66
|
-
|
59
|
+
_proto.initNetworkLinkModel = function initNetworkLinkModel() {
|
60
|
+
return (_initNetworkLinkModel = _initNetworkLinkModel || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
67
61
|
var mtCodes;
|
68
62
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
69
|
-
while (1) {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
mtCodes = ['m.critical_link', 'm.ethernet_link'];
|
63
|
+
while (1) switch (_context2.prev = _context2.next) {
|
64
|
+
case 0:
|
65
|
+
_context2.prev = 0;
|
66
|
+
mtCodes = ['m.critical_link', 'm.ethernet_link'];
|
74
67
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
68
|
+
if (!mtCodes.length) {
|
69
|
+
_context2.next = 6;
|
70
|
+
break;
|
71
|
+
}
|
79
72
|
|
80
|
-
|
81
|
-
|
73
|
+
_context2.next = 5;
|
74
|
+
return (0, _tagtip.getMetricsByMonitorTemplateCodes)(mtCodes);
|
82
75
|
|
83
|
-
|
84
|
-
|
76
|
+
case 5:
|
77
|
+
this.mtMetricsMap = _context2.sent;
|
85
78
|
|
86
|
-
|
87
|
-
|
88
|
-
|
79
|
+
case 6:
|
80
|
+
_context2.next = 11;
|
81
|
+
break;
|
89
82
|
|
90
|
-
|
91
|
-
|
92
|
-
|
83
|
+
case 8:
|
84
|
+
_context2.prev = 8;
|
85
|
+
_context2.t0 = _context2["catch"](0);
|
93
86
|
|
94
|
-
|
87
|
+
_rlog["default"].error('查询监控模板指标失败', _context2.t0);
|
95
88
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
}
|
89
|
+
case 11:
|
90
|
+
case "end":
|
91
|
+
return _context2.stop();
|
100
92
|
}
|
101
93
|
}, _callee2, this, [[0, 8]]);
|
102
|
-
}));
|
103
|
-
|
104
|
-
function initNetworkLinkModel() {
|
105
|
-
return _initNetworkLinkModel.apply(this, arguments);
|
106
|
-
}
|
107
|
-
|
108
|
-
return initNetworkLinkModel;
|
109
|
-
}();
|
94
|
+
}))).apply(this, arguments);
|
95
|
+
};
|
110
96
|
|
111
97
|
_proto.getModelTypes = function getModelTypes(cis) {
|
112
98
|
var _this = this;
|
@@ -17,6 +17,8 @@ var _topo = require("@riil-frontend/component-topology-common/es/services/topo")
|
|
17
17
|
|
18
18
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
19
19
|
|
20
|
+
var _saveTopo;
|
21
|
+
|
20
22
|
function getLayoutId(layout) {
|
21
23
|
if (!layout) {
|
22
24
|
return layout;
|
@@ -52,98 +54,91 @@ function resToConditions(resources, persist) {
|
|
52
54
|
}
|
53
55
|
|
54
56
|
function saveTopo(_x) {
|
55
|
-
return _saveTopo
|
56
|
-
}
|
57
|
-
|
58
|
-
function _saveTopo() {
|
59
|
-
_saveTopo = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
57
|
+
return (_saveTopo = _saveTopo || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
60
58
|
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
|
61
59
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
62
|
-
while (1) {
|
63
|
-
|
64
|
-
|
65
|
-
topoService = data.topoService, topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
60
|
+
while (1) switch (_context.prev = _context.next) {
|
61
|
+
case 0:
|
62
|
+
topoService = data.topoService, topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
66
63
|
|
67
|
-
|
64
|
+
_rlog["default"].debug("saveTopo", data); // 保存布局
|
68
65
|
|
69
66
|
|
70
|
-
|
71
|
-
_context.next = 5;
|
72
|
-
break;
|
73
|
-
}
|
74
|
-
|
67
|
+
if (!(template && layout)) {
|
75
68
|
_context.next = 5;
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
69
|
+
break;
|
70
|
+
}
|
71
|
+
|
72
|
+
_context.next = 5;
|
73
|
+
return topoService.changeLayout({
|
74
|
+
id: topoId,
|
75
|
+
template: template,
|
76
|
+
layout: getLayoutId(layout),
|
77
|
+
backgroundId: backgroundId
|
78
|
+
});
|
79
|
+
|
80
|
+
case 5:
|
81
|
+
if (!globalConfig) {
|
89
82
|
_context.next = 8;
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
break;
|
96
|
-
}
|
97
|
-
|
98
|
-
groupInfo = groups.map(function (group) {
|
99
|
-
return (0, _extends2["default"])({}, group, {
|
100
|
-
layout: getLayoutId(group.layout),
|
101
|
-
resources: resToConditions(group.resources, true)
|
102
|
-
});
|
103
|
-
}); // 视图
|
104
|
-
|
105
|
-
viewResources = resToConditions(resources, true);
|
106
|
-
|
107
|
-
if (viewResources) {
|
108
|
-
groupInfo.push({
|
109
|
-
id: viewGroupId,
|
110
|
-
parentId: _topo.TOPO_PARENT_ID,
|
111
|
-
order: 100,
|
112
|
-
resources: viewResources
|
113
|
-
});
|
114
|
-
}
|
115
|
-
|
116
|
-
linkIps = []; // resources?.static.map((nodeId) => {
|
117
|
-
// if (nodeId.startsWith("ip_")) {
|
118
|
-
// linkIps.push(nodeId.replace("ip_", ""));
|
119
|
-
// }
|
120
|
-
// });
|
121
|
-
|
122
|
-
_rlog["default"].debug("saveTopo-groupInfo", groupInfo);
|
83
|
+
break;
|
84
|
+
}
|
85
|
+
|
86
|
+
_context.next = 8;
|
87
|
+
return topoService.saveTopoSettings(topoId, globalConfig);
|
123
88
|
|
89
|
+
case 8:
|
90
|
+
if (!(resources || groups)) {
|
124
91
|
_context.next = 16;
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
92
|
+
break;
|
93
|
+
}
|
94
|
+
|
95
|
+
groupInfo = groups.map(function (group) {
|
96
|
+
return (0, _extends2["default"])({}, group, {
|
97
|
+
layout: getLayoutId(group.layout),
|
98
|
+
resources: resToConditions(group.resources, true)
|
130
99
|
});
|
100
|
+
}); // 视图
|
131
101
|
|
132
|
-
|
133
|
-
if (!serialize) {
|
134
|
-
_context.next = 19;
|
135
|
-
break;
|
136
|
-
}
|
102
|
+
viewResources = resToConditions(resources, true);
|
137
103
|
|
104
|
+
if (viewResources) {
|
105
|
+
groupInfo.push({
|
106
|
+
id: viewGroupId,
|
107
|
+
parentId: _topo.TOPO_PARENT_ID,
|
108
|
+
order: 100,
|
109
|
+
resources: viewResources
|
110
|
+
});
|
111
|
+
}
|
112
|
+
|
113
|
+
linkIps = []; // resources?.static.map((nodeId) => {
|
114
|
+
// if (nodeId.startsWith("ip_")) {
|
115
|
+
// linkIps.push(nodeId.replace("ip_", ""));
|
116
|
+
// }
|
117
|
+
// });
|
118
|
+
|
119
|
+
_rlog["default"].debug("saveTopo-groupInfo", groupInfo);
|
120
|
+
|
121
|
+
_context.next = 16;
|
122
|
+
return topoService.bindResourceToTopo(topoId, {
|
123
|
+
groups: groupInfo,
|
124
|
+
linkIps: linkIps,
|
125
|
+
// exportLinkIdList,
|
126
|
+
relateTopoIdList: relateTopoIdList
|
127
|
+
});
|
128
|
+
|
129
|
+
case 16:
|
130
|
+
if (!serialize) {
|
138
131
|
_context.next = 19;
|
139
|
-
|
132
|
+
break;
|
133
|
+
}
|
134
|
+
|
135
|
+
_context.next = 19;
|
136
|
+
return topoService.saveSerializeData(topoId, serialize);
|
140
137
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
}
|
138
|
+
case 19:
|
139
|
+
case "end":
|
140
|
+
return _context.stop();
|
145
141
|
}
|
146
142
|
}, _callee);
|
147
|
-
}));
|
148
|
-
return _saveTopo.apply(this, arguments);
|
143
|
+
}))).apply(this, arguments);
|
149
144
|
}
|
@@ -30,7 +30,8 @@ var _CiTypeCache = _interopRequireDefault(require("../cache/CiTypeCache"));
|
|
30
30
|
|
31
31
|
var _CiCache = _interopRequireDefault(require("../cache/CiCache"));
|
32
32
|
|
33
|
-
|
33
|
+
var _getLinksDetail;
|
34
|
+
|
34
35
|
// const interfaceTypeMap = {
|
35
36
|
// "network.interface": {
|
36
37
|
// displayName: "网络接口",
|
@@ -98,60 +99,53 @@ function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
|
98
99
|
}
|
99
100
|
|
100
101
|
function getLinksDetail(_x, _x2) {
|
101
|
-
return _getLinksDetail.
|
102
|
-
}
|
103
|
-
|
104
|
-
function _getLinksDetail() {
|
105
|
-
_getLinksDetail = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(links, nodes) {
|
102
|
+
return (_getLinksDetail = _getLinksDetail || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(links, nodes) {
|
106
103
|
var linkCis, interfaceIds, interfaceTypes, interfaceCiMap, interfaceDoc;
|
107
104
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
108
|
-
while (1) {
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
return _context.stop();
|
150
|
-
}
|
105
|
+
while (1) switch (_context.prev = _context.next) {
|
106
|
+
case 0:
|
107
|
+
if (!(!links || !links.length)) {
|
108
|
+
_context.next = 2;
|
109
|
+
break;
|
110
|
+
}
|
111
|
+
|
112
|
+
return _context.abrupt("return", []);
|
113
|
+
|
114
|
+
case 2:
|
115
|
+
// const linkCis = await topoService.relation.batchQueryRelation(
|
116
|
+
// links.map((link) => link.id)
|
117
|
+
// );
|
118
|
+
linkCis = links;
|
119
|
+
interfaceIds = [].concat(linkCis.map(function (item) {
|
120
|
+
return item.attributes.source_id;
|
121
|
+
}), linkCis.map(function (item) {
|
122
|
+
return item.attributes.destination_id;
|
123
|
+
}));
|
124
|
+
interfaceTypes = _lodash["default"].compact(_lodash["default"].uniq([].concat(linkCis.map(function (item) {
|
125
|
+
return item.attributes.source_type;
|
126
|
+
}), linkCis.map(function (item) {
|
127
|
+
return item.attributes.destination_type;
|
128
|
+
})))).filter(function (item) {
|
129
|
+
return item !== "ip";
|
130
|
+
});
|
131
|
+
_context.next = 7;
|
132
|
+
return _CiCache["default"].load(interfaceIds);
|
133
|
+
|
134
|
+
case 7:
|
135
|
+
interfaceCiMap = _context.sent;
|
136
|
+
_context.next = 10;
|
137
|
+
return _CiTypeCache["default"].load(interfaceTypes);
|
138
|
+
|
139
|
+
case 10:
|
140
|
+
interfaceDoc = _context.sent;
|
141
|
+
return _context.abrupt("return", mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc));
|
142
|
+
|
143
|
+
case 12:
|
144
|
+
case "end":
|
145
|
+
return _context.stop();
|
151
146
|
}
|
152
147
|
}, _callee);
|
153
|
-
}));
|
154
|
-
return _getLinksDetail.apply(this, arguments);
|
148
|
+
}))).apply(this, arguments);
|
155
149
|
}
|
156
150
|
|
157
151
|
function buildTopoLinkData() {}
|
@@ -33,8 +33,8 @@ function updateNodesNameVisible(topo) {
|
|
33
33
|
|
34
34
|
function setNewNodeNameVisible(topo, element) {
|
35
35
|
if ((0, _htElementUtils.isNode)(element)) {
|
36
|
-
var _topo$store$
|
37
|
-
nodeTag = _topo$store$
|
36
|
+
var _topo$store$getModelS2 = topo.store.getModelState('displayConfig'),
|
37
|
+
nodeTag = _topo$store$getModelS2.nodeTag;
|
38
38
|
|
39
39
|
var nameVisible = getNodeNameVisible({
|
40
40
|
node: element,
|
@@ -46,8 +46,8 @@ function setNewNodeNameVisible(topo, element) {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
function getNodesNameVisible(topo) {
|
49
|
-
var _topo$store$
|
50
|
-
nodeTag = _topo$store$
|
49
|
+
var _topo$store$getModelS3 = topo.store.getModelState('displayConfig'),
|
50
|
+
nodeTag = _topo$store$getModelS3.nodeTag;
|
51
51
|
|
52
52
|
var dm = topo.getDataModel();
|
53
53
|
var htNodes = (0, _htElementUtils.getNodes)(dm);
|