@riil-frontend/component-topology 10.0.58 → 10.0.59
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/IndexSettingDrawer/index.js +6 -5
- 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/ResourceDisplay/useElementTagTipConfig.js +78 -100
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
- 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/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 +110 -122
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +539 -638
- package/es/core/models/Alarm.js +311 -394
- 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 +287 -454
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +70 -84
- 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 +34 -40
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- 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 +11 -13
- 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 +28 -32
- package/es/core/store/models/topoConfig.js +217 -233
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +379 -401
- 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 copy.js +104 -126
- 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 +274 -314
- 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/linkDynamicStyle.js +102 -108
- package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/es/networkTopo/store/linkManager.js +4 -6
- 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/IndexSettingDrawer/index.js +6 -5
- 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/ResourceDisplay/useElementTagTipConfig.js +82 -104
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
- 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/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 +108 -120
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +530 -629
- package/lib/core/models/Alarm.js +308 -391
- 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 +287 -454
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +71 -85
- 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 +34 -40
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- 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 +13 -15
- 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 +34 -38
- package/lib/core/store/models/topoConfig.js +224 -240
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +381 -403
- 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 copy.js +105 -127
- 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 +277 -317
- 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/linkDynamicStyle.js +103 -109
- package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/lib/networkTopo/store/linkManager.js +4 -6
- 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 +3 -3
@@ -4,6 +4,8 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
5
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
6
6
|
export default function (topo) {
|
7
|
+
var _onTopoDataLoaded, _initData, _saveResourceWebUrl;
|
8
|
+
|
7
9
|
var resourceUrlMap = {};
|
8
10
|
var currentId = null;
|
9
11
|
init();
|
@@ -21,75 +23,61 @@ export default function (topo) {
|
|
21
23
|
}
|
22
24
|
|
23
25
|
function onTopoDataLoaded(_x) {
|
24
|
-
return _onTopoDataLoaded.
|
25
|
-
}
|
26
|
-
|
27
|
-
function _onTopoDataLoaded() {
|
28
|
-
_onTopoDataLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topoData) {
|
26
|
+
return (_onTopoDataLoaded = _onTopoDataLoaded || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topoData) {
|
29
27
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
30
|
-
while (1) {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
return _context.stop();
|
38
|
-
}
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
29
|
+
case 0:
|
30
|
+
initData(topoData.nodes);
|
31
|
+
|
32
|
+
case 1:
|
33
|
+
case "end":
|
34
|
+
return _context.stop();
|
39
35
|
}
|
40
36
|
}, _callee);
|
41
|
-
}));
|
42
|
-
return _onTopoDataLoaded.apply(this, arguments);
|
37
|
+
}))).apply(this, arguments);
|
43
38
|
}
|
44
39
|
|
45
40
|
function initData(_x2) {
|
46
|
-
return _initData.
|
47
|
-
}
|
48
|
-
|
49
|
-
function _initData() {
|
50
|
-
_initData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(nodes) {
|
41
|
+
return (_initData = _initData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(nodes) {
|
51
42
|
var ids, list;
|
52
43
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
53
|
-
while (1) {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
_context2.next = 3;
|
62
|
-
break;
|
63
|
-
}
|
64
|
-
|
65
|
-
return _context2.abrupt("return");
|
66
|
-
|
67
|
-
case 3:
|
68
|
-
_context2.prev = 3;
|
69
|
-
_context2.next = 6;
|
70
|
-
return topoService.resourceWebUrl.list(ids);
|
71
|
-
|
72
|
-
case 6:
|
73
|
-
list = _context2.sent;
|
74
|
-
list.forEach(function (item) {
|
75
|
-
resourceUrlMap[item.ciId] = item.webUrl;
|
76
|
-
});
|
77
|
-
_context2.next = 13;
|
44
|
+
while (1) switch (_context2.prev = _context2.next) {
|
45
|
+
case 0:
|
46
|
+
ids = nodes.map(function (node) {
|
47
|
+
return node.id;
|
48
|
+
});
|
49
|
+
|
50
|
+
if (ids.length) {
|
51
|
+
_context2.next = 3;
|
78
52
|
break;
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
53
|
+
}
|
54
|
+
|
55
|
+
return _context2.abrupt("return");
|
56
|
+
|
57
|
+
case 3:
|
58
|
+
_context2.prev = 3;
|
59
|
+
_context2.next = 6;
|
60
|
+
return topoService.resourceWebUrl.list(ids);
|
61
|
+
|
62
|
+
case 6:
|
63
|
+
list = _context2.sent;
|
64
|
+
list.forEach(function (item) {
|
65
|
+
resourceUrlMap[item.ciId] = item.webUrl;
|
66
|
+
});
|
67
|
+
_context2.next = 13;
|
68
|
+
break;
|
69
|
+
|
70
|
+
case 10:
|
71
|
+
_context2.prev = 10;
|
72
|
+
_context2.t0 = _context2["catch"](3);
|
73
|
+
rlog.error('资源web控制台.加载数据异常', _context2.t0);
|
74
|
+
|
75
|
+
case 13:
|
76
|
+
case "end":
|
77
|
+
return _context2.stop();
|
89
78
|
}
|
90
79
|
}, _callee2, null, [[3, 10]]);
|
91
|
-
}));
|
92
|
-
return _initData.apply(this, arguments);
|
80
|
+
}))).apply(this, arguments);
|
93
81
|
}
|
94
82
|
|
95
83
|
function getModelDispatchers() {
|
@@ -128,59 +116,52 @@ export default function (topo) {
|
|
128
116
|
}
|
129
117
|
|
130
118
|
function saveResourceWebUrl(_x3, _x4) {
|
131
|
-
return _saveResourceWebUrl.
|
132
|
-
}
|
133
|
-
|
134
|
-
function _saveResourceWebUrl() {
|
135
|
-
_saveResourceWebUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, url) {
|
119
|
+
return (_saveResourceWebUrl = _saveResourceWebUrl || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, url) {
|
136
120
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
137
|
-
while (1) {
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
_context3.next = 4;
|
142
|
-
break;
|
143
|
-
}
|
144
|
-
|
145
|
-
_Message.success('链接设置成功');
|
146
|
-
|
147
|
-
closeSettingDialog();
|
148
|
-
return _context3.abrupt("return");
|
149
|
-
|
150
|
-
case 4:
|
151
|
-
updateStore({
|
152
|
-
saving: true
|
153
|
-
});
|
154
|
-
_context3.prev = 5;
|
155
|
-
_context3.next = 8;
|
156
|
-
return topoService.resourceWebUrl.save(id, url || null);
|
157
|
-
|
158
|
-
case 8:
|
159
|
-
_Message.success('链接设置成功');
|
160
|
-
|
161
|
-
resourceUrlMap[id] = url;
|
162
|
-
closeSettingDialog();
|
163
|
-
_context3.next = 17;
|
121
|
+
while (1) switch (_context3.prev = _context3.next) {
|
122
|
+
case 0:
|
123
|
+
if (!(!url && !getResourceUrl(id))) {
|
124
|
+
_context3.next = 4;
|
164
125
|
break;
|
126
|
+
}
|
127
|
+
|
128
|
+
_Message.success('链接设置成功');
|
129
|
+
|
130
|
+
closeSettingDialog();
|
131
|
+
return _context3.abrupt("return");
|
132
|
+
|
133
|
+
case 4:
|
134
|
+
updateStore({
|
135
|
+
saving: true
|
136
|
+
});
|
137
|
+
_context3.prev = 5;
|
138
|
+
_context3.next = 8;
|
139
|
+
return topoService.resourceWebUrl.save(id, url || null);
|
140
|
+
|
141
|
+
case 8:
|
142
|
+
_Message.success('链接设置成功');
|
143
|
+
|
144
|
+
resourceUrlMap[id] = url;
|
145
|
+
closeSettingDialog();
|
146
|
+
_context3.next = 17;
|
147
|
+
break;
|
165
148
|
|
166
|
-
|
167
|
-
|
168
|
-
|
149
|
+
case 13:
|
150
|
+
_context3.prev = 13;
|
151
|
+
_context3.t0 = _context3["catch"](5);
|
169
152
|
|
170
|
-
|
153
|
+
_Message.error('链接设置失败');
|
171
154
|
|
172
|
-
|
173
|
-
|
174
|
-
|
155
|
+
updateStore({
|
156
|
+
saving: false
|
157
|
+
});
|
175
158
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
}
|
159
|
+
case 17:
|
160
|
+
case "end":
|
161
|
+
return _context3.stop();
|
180
162
|
}
|
181
163
|
}, _callee3, null, [[5, 13]]);
|
182
|
-
}));
|
183
|
-
return _saveResourceWebUrl.apply(this, arguments);
|
164
|
+
}))).apply(this, arguments);
|
184
165
|
}
|
185
166
|
|
186
167
|
var resourceWebUrl = {
|
@@ -6,6 +6,8 @@ import { getMetricsByMonitorTemplateCodes } from "../../services/topo/tagtip";
|
|
6
6
|
import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
|
7
7
|
|
8
8
|
var ElementTagTipConfig = /*#__PURE__*/function () {
|
9
|
+
var _init;
|
10
|
+
|
9
11
|
function ElementTagTipConfig(topo) {
|
10
12
|
this.topoData = void 0;
|
11
13
|
this.mtCodes = void 0;
|
@@ -16,53 +18,45 @@ var ElementTagTipConfig = /*#__PURE__*/function () {
|
|
16
18
|
|
17
19
|
var _proto = ElementTagTipConfig.prototype;
|
18
20
|
|
19
|
-
_proto.init =
|
20
|
-
|
21
|
+
_proto.init = function init(_x) {
|
22
|
+
return (_init = _init || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topoData) {
|
21
23
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
22
|
-
while (1) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
_context.next = 7;
|
31
|
-
break;
|
32
|
-
}
|
33
|
-
|
34
|
-
_context.next = 6;
|
35
|
-
return getMetricsByMonitorTemplateCodes(this.mtCodes);
|
36
|
-
|
37
|
-
case 6:
|
38
|
-
this.mtMetricsMap = _context.sent;
|
39
|
-
|
40
|
-
case 7:
|
41
|
-
_context.next = 12;
|
24
|
+
while (1) switch (_context.prev = _context.next) {
|
25
|
+
case 0:
|
26
|
+
this.topoData = topoData;
|
27
|
+
this.mtCodes = getMonitorTemplateCodesFromTopoData(topoData);
|
28
|
+
_context.prev = 2;
|
29
|
+
|
30
|
+
if (!this.mtCodes.length) {
|
31
|
+
_context.next = 7;
|
42
32
|
break;
|
33
|
+
}
|
43
34
|
|
44
|
-
|
45
|
-
|
46
|
-
_context.t0 = _context["catch"](2);
|
47
|
-
rlog.error('查询监控模板指标失败', _context.t0);
|
35
|
+
_context.next = 6;
|
36
|
+
return getMetricsByMonitorTemplateCodes(this.mtCodes);
|
48
37
|
|
49
|
-
|
50
|
-
|
38
|
+
case 6:
|
39
|
+
this.mtMetricsMap = _context.sent;
|
51
40
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
41
|
+
case 7:
|
42
|
+
_context.next = 12;
|
43
|
+
break;
|
44
|
+
|
45
|
+
case 9:
|
46
|
+
_context.prev = 9;
|
47
|
+
_context.t0 = _context["catch"](2);
|
48
|
+
rlog.error('查询监控模板指标失败', _context.t0);
|
59
49
|
|
60
|
-
|
61
|
-
|
62
|
-
}
|
50
|
+
case 12:
|
51
|
+
this.mtCiTypeMap = getMtCodeCiTypeMap(topoData);
|
63
52
|
|
64
|
-
|
65
|
-
|
53
|
+
case 13:
|
54
|
+
case "end":
|
55
|
+
return _context.stop();
|
56
|
+
}
|
57
|
+
}, _callee, this, [[2, 9]]);
|
58
|
+
}))).apply(this, arguments);
|
59
|
+
}
|
66
60
|
/**
|
67
61
|
* 获得节点字段配置项map
|
68
62
|
*/
|
@@ -1,5 +1,8 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
|
+
|
4
|
+
var _saveTopo;
|
5
|
+
|
3
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
7
|
import { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
|
5
8
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
@@ -36,95 +39,88 @@ export function resToConditions(resources, persist) {
|
|
36
39
|
return null;
|
37
40
|
}
|
38
41
|
export function saveTopo(_x) {
|
39
|
-
return _saveTopo.
|
40
|
-
}
|
41
|
-
|
42
|
-
function _saveTopo() {
|
43
|
-
_saveTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
42
|
+
return (_saveTopo = _saveTopo || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
44
43
|
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
|
45
44
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
46
|
-
while (1) {
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
rlog.debug("saveTopo", data); // 保存布局
|
51
|
-
|
52
|
-
if (!(template && layout)) {
|
53
|
-
_context.next = 5;
|
54
|
-
break;
|
55
|
-
}
|
45
|
+
while (1) switch (_context.prev = _context.next) {
|
46
|
+
case 0:
|
47
|
+
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, exportLinkIdList = data.exportLinkIdList, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
48
|
+
rlog.debug("saveTopo", data); // 保存布局
|
56
49
|
|
50
|
+
if (!(template && layout)) {
|
57
51
|
_context.next = 5;
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
52
|
+
break;
|
53
|
+
}
|
54
|
+
|
55
|
+
_context.next = 5;
|
56
|
+
return topoService.changeLayout({
|
57
|
+
id: topoId,
|
58
|
+
template: template,
|
59
|
+
layout: getLayoutId(layout),
|
60
|
+
backgroundId: backgroundId
|
61
|
+
});
|
62
|
+
|
63
|
+
case 5:
|
64
|
+
if (!globalConfig) {
|
65
|
+
_context.next = 8;
|
66
|
+
break;
|
67
|
+
}
|
64
68
|
|
65
|
-
|
66
|
-
|
67
|
-
_context.next = 8;
|
68
|
-
break;
|
69
|
-
}
|
69
|
+
_context.next = 8;
|
70
|
+
return topoService.saveTopoSettings(topoId, globalConfig);
|
70
71
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
case 8:
|
75
|
-
if (!(resources || groups)) {
|
76
|
-
_context.next = 16;
|
77
|
-
break;
|
78
|
-
}
|
79
|
-
|
80
|
-
groupInfo = groups.map(function (group) {
|
81
|
-
return _extends({}, group, {
|
82
|
-
layout: getLayoutId(group.layout),
|
83
|
-
resources: resToConditions(group.resources, true)
|
84
|
-
});
|
85
|
-
}); // 视图
|
86
|
-
|
87
|
-
viewResources = resToConditions(resources, true);
|
88
|
-
|
89
|
-
if (viewResources) {
|
90
|
-
groupInfo.push({
|
91
|
-
id: viewGroupId,
|
92
|
-
parentId: TOPO_PARENT_ID,
|
93
|
-
order: 100,
|
94
|
-
resources: viewResources
|
95
|
-
});
|
96
|
-
}
|
97
|
-
|
98
|
-
linkIps = []; // resources?.static.map((nodeId) => {
|
99
|
-
// if (nodeId.startsWith("ip_")) {
|
100
|
-
// linkIps.push(nodeId.replace("ip_", ""));
|
101
|
-
// }
|
102
|
-
// });
|
103
|
-
|
104
|
-
rlog.debug("saveTopo-groupInfo", groupInfo);
|
72
|
+
case 8:
|
73
|
+
if (!(resources || groups)) {
|
105
74
|
_context.next = 16;
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
|
78
|
+
groupInfo = groups.map(function (group) {
|
79
|
+
return _extends({}, group, {
|
80
|
+
layout: getLayoutId(group.layout),
|
81
|
+
resources: resToConditions(group.resources, true)
|
111
82
|
});
|
83
|
+
}); // 视图
|
112
84
|
|
113
|
-
|
114
|
-
if (!serialize) {
|
115
|
-
_context.next = 19;
|
116
|
-
break;
|
117
|
-
}
|
85
|
+
viewResources = resToConditions(resources, true);
|
118
86
|
|
87
|
+
if (viewResources) {
|
88
|
+
groupInfo.push({
|
89
|
+
id: viewGroupId,
|
90
|
+
parentId: TOPO_PARENT_ID,
|
91
|
+
order: 100,
|
92
|
+
resources: viewResources
|
93
|
+
});
|
94
|
+
}
|
95
|
+
|
96
|
+
linkIps = []; // resources?.static.map((nodeId) => {
|
97
|
+
// if (nodeId.startsWith("ip_")) {
|
98
|
+
// linkIps.push(nodeId.replace("ip_", ""));
|
99
|
+
// }
|
100
|
+
// });
|
101
|
+
|
102
|
+
rlog.debug("saveTopo-groupInfo", groupInfo);
|
103
|
+
_context.next = 16;
|
104
|
+
return topoService.bindResourceToTopo(topoId, {
|
105
|
+
groups: groupInfo,
|
106
|
+
linkIps: linkIps,
|
107
|
+
exportLinkIdList: exportLinkIdList,
|
108
|
+
relateTopoIdList: relateTopoIdList
|
109
|
+
});
|
110
|
+
|
111
|
+
case 16:
|
112
|
+
if (!serialize) {
|
119
113
|
_context.next = 19;
|
120
|
-
|
114
|
+
break;
|
115
|
+
}
|
116
|
+
|
117
|
+
_context.next = 19;
|
118
|
+
return topoService.saveSerializeData(topoId, serialize);
|
121
119
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
}
|
120
|
+
case 19:
|
121
|
+
case "end":
|
122
|
+
return _context.stop();
|
126
123
|
}
|
127
124
|
}, _callee);
|
128
|
-
}));
|
129
|
-
return _saveTopo.apply(this, arguments);
|
125
|
+
}))).apply(this, arguments);
|
130
126
|
}
|
@@ -1,5 +1,8 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
|
4
|
+
var _getLinksDetail;
|
5
|
+
|
3
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
7
|
import keyBy from "lodash/keyBy";
|
5
8
|
import _ from "lodash";
|
@@ -74,62 +77,54 @@ export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceD
|
|
74
77
|
});
|
75
78
|
}
|
76
79
|
export function getLinksDetail(_x, _x2) {
|
77
|
-
return _getLinksDetail.
|
78
|
-
}
|
79
|
-
|
80
|
-
function _getLinksDetail() {
|
81
|
-
_getLinksDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(links, nodes) {
|
80
|
+
return (_getLinksDetail = _getLinksDetail || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(links, nodes) {
|
82
81
|
var linkCis, interfaceIds, interfaceTypes, interfaceCiMap, interfaceDoc;
|
83
82
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
84
|
-
while (1) {
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
return _context.stop();
|
126
|
-
}
|
83
|
+
while (1) switch (_context.prev = _context.next) {
|
84
|
+
case 0:
|
85
|
+
if (!(!links || !links.length)) {
|
86
|
+
_context.next = 2;
|
87
|
+
break;
|
88
|
+
}
|
89
|
+
|
90
|
+
return _context.abrupt("return", []);
|
91
|
+
|
92
|
+
case 2:
|
93
|
+
// const linkCis = await topoService.relation.batchQueryRelation(
|
94
|
+
// links.map((link) => link.id)
|
95
|
+
// );
|
96
|
+
linkCis = links;
|
97
|
+
interfaceIds = [].concat(linkCis.map(function (item) {
|
98
|
+
return item.attributes.source_id;
|
99
|
+
}), linkCis.map(function (item) {
|
100
|
+
return item.attributes.destination_id;
|
101
|
+
}));
|
102
|
+
interfaceTypes = _.compact(_.uniq([].concat(linkCis.map(function (item) {
|
103
|
+
return item.attributes.source_type;
|
104
|
+
}), linkCis.map(function (item) {
|
105
|
+
return item.attributes.destination_type;
|
106
|
+
})))).filter(function (item) {
|
107
|
+
return item !== "ip";
|
108
|
+
});
|
109
|
+
_context.next = 7;
|
110
|
+
return CiCache.load(interfaceIds);
|
111
|
+
|
112
|
+
case 7:
|
113
|
+
interfaceCiMap = _context.sent;
|
114
|
+
_context.next = 10;
|
115
|
+
return CiTypeCache.getCiTypeMap(interfaceTypes);
|
116
|
+
|
117
|
+
case 10:
|
118
|
+
interfaceDoc = _context.sent;
|
119
|
+
return _context.abrupt("return", mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc));
|
120
|
+
|
121
|
+
case 12:
|
122
|
+
case "end":
|
123
|
+
return _context.stop();
|
127
124
|
}
|
128
125
|
}, _callee);
|
129
|
-
}));
|
130
|
-
return _getLinksDetail.apply(this, arguments);
|
126
|
+
}))).apply(this, arguments);
|
131
127
|
}
|
132
|
-
|
133
128
|
export function buildTopoLinkData() {}
|
134
129
|
export var compatibleWith = function compatibleWith(value) {
|
135
130
|
// console.log("compatibleWith",value);
|
@@ -13,24 +13,22 @@ export default {
|
|
13
13
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
14
14
|
var parms, result;
|
15
15
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
16
|
-
while (1) {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
return topoService.getAlarmByIds(parms);
|
16
|
+
while (1) switch (_context.prev = _context.next) {
|
17
|
+
case 0:
|
18
|
+
parms = _extends({
|
19
|
+
mainCiIdList: ciIds
|
20
|
+
}, params);
|
21
|
+
_context.next = 3;
|
22
|
+
return topoService.getAlarmByIds(parms);
|
24
23
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
case 3:
|
25
|
+
result = _context.sent;
|
26
|
+
rlog.debug('查询告警列表', ciIds, result);
|
27
|
+
return _context.abrupt("return", result);
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
29
|
+
case 6:
|
30
|
+
case "end":
|
31
|
+
return _context.stop();
|
34
32
|
}
|
35
33
|
}, _callee);
|
36
34
|
}))();
|