@riil-frontend/component-topology 11.0.30 → 11.0.31
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 +2 -4
- package/build/index.js +34 -49
- package/es/components/MultiResourceDrawer/index.js +18 -16
- package/es/components/ResourceList/ResourceSelect.js +50 -48
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
- package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
- package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
- package/es/core/editor/components/BackgroundView/index.js +129 -119
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
- 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 +10 -8
- package/es/core/editor/store/topoEdit.js +6 -4
- package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
- package/es/core/hooks/usePolling.js +121 -117
- package/es/core/hooks/useResourceConfig.js +66 -58
- package/es/core/hooks/useTopoEdit.js +511 -476
- package/es/core/models/Alarm.js +298 -281
- package/es/core/models/AttributeMetricDisplay.js +107 -101
- package/es/core/models/PluginManager.js +3 -4
- package/es/core/models/SelectionModel.js +5 -4
- package/es/core/models/TopoApp.js +240 -205
- package/es/core/models/TopoGraphView.js +21 -18
- package/es/core/models/cache/CiCache.js +27 -28
- package/es/core/models/cache/CiTypeCache.js +41 -37
- package/es/core/models/cache/DictCache.js +35 -33
- package/es/core/models/graph/Background.js +17 -15
- package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
- package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
- package/es/core/models/topoData.js +70 -68
- package/es/core/models/utils/linkUtils.js +43 -41
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +16 -14
- package/es/core/services/background.js +67 -59
- package/es/core/services/cmdb/metric.js +11 -9
- package/es/core/services/cmdb.js +20 -18
- package/es/core/services/index.js +45 -39
- package/es/core/services/overview.js +151 -131
- package/es/core/services/topo/basic.js +13 -11
- package/es/core/services/topo/tagtip.js +12 -10
- package/es/core/store/models/ciModel.js +62 -58
- package/es/core/store/models/customIcon.js +134 -120
- package/es/core/store/models/displayConfig.js +19 -15
- package/es/core/store/models/selection.js +6 -4
- package/es/core/store/models/topoAlarm.js +145 -162
- package/es/core/store/models/topoBaseInfoOverview.js +6 -4
- package/es/core/store/models/topoBizMod.js +32 -28
- package/es/core/store/models/topoConfig.js +231 -215
- package/es/core/store/models/topoGraphView.js +6 -4
- package/es/core/store/models/topoMod.js +395 -373
- package/es/core/utils/imageUtil.js +20 -18
- package/es/core/utils/saveSerialize.js +11 -9
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
- package/es/networkTopo/components/Link/hook.js +77 -73
- package/es/networkTopo/components/Link/index.js +94 -86
- package/es/networkTopo/components/Link/setting.js +44 -42
- package/es/networkTopo/getTopoData.js +69 -63
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +22 -18
- package/es/networkTopo/services/alert.js +22 -18
- package/es/networkTopo/services/authorization.js +55 -45
- package/es/networkTopo/services/cmdb.js +470 -422
- package/es/networkTopo/services/funcAuth.js +24 -22
- package/es/networkTopo/services/link.js +117 -107
- package/es/networkTopo/services/mdc.js +24 -18
- package/es/networkTopo/services/metric.js +27 -23
- package/es/networkTopo/services/model.js +509 -445
- package/es/networkTopo/services/risk.js +11 -9
- package/es/networkTopo/services/topo/auth.js +33 -27
- package/es/networkTopo/services/topo/basic.js +314 -274
- package/es/networkTopo/services/topo/blacklist.js +24 -20
- package/es/networkTopo/services/topo/ciInfo.js +31 -27
- package/es/networkTopo/services/topo/icon.js +59 -49
- package/es/networkTopo/services/topo/networkLink.js +36 -32
- package/es/networkTopo/services/topo/relation.js +11 -9
- package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
- package/es/networkTopo/store/functionAuth.js +37 -31
- package/es/networkTopo/store/topoCenter.js +152 -142
- package/es/networkTopo/store/topoLinkMod.js +6 -4
- package/es/networkTopo/store/topoTreeMod.js +182 -170
- package/es/networkTopo/utils/exportData.js +54 -52
- package/lib/components/MultiResourceDrawer/index.js +18 -16
- package/lib/components/ResourceList/ResourceSelect.js +50 -48
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
- package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
- package/lib/core/editor/components/BackgroundView/index.js +128 -118
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
- 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 +10 -8
- package/lib/core/editor/store/topoEdit.js +6 -4
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
- package/lib/core/hooks/usePolling.js +120 -116
- package/lib/core/hooks/useResourceConfig.js +66 -58
- package/lib/core/hooks/useTopoEdit.js +503 -468
- package/lib/core/models/Alarm.js +292 -275
- package/lib/core/models/AttributeMetricDisplay.js +110 -104
- package/lib/core/models/PluginManager.js +3 -4
- package/lib/core/models/SelectionModel.js +5 -4
- package/lib/core/models/TopoApp.js +240 -205
- package/lib/core/models/TopoGraphView.js +21 -18
- package/lib/core/models/cache/CiCache.js +32 -33
- package/lib/core/models/cache/CiTypeCache.js +42 -38
- package/lib/core/models/cache/DictCache.js +35 -33
- package/lib/core/models/graph/Background.js +18 -16
- package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
- package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
- package/lib/core/models/topoData.js +71 -69
- package/lib/core/models/utils/linkUtils.js +43 -41
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +20 -18
- package/lib/core/services/background.js +78 -70
- package/lib/core/services/cmdb/metric.js +12 -10
- package/lib/core/services/cmdb.js +22 -20
- package/lib/core/services/index.js +51 -45
- package/lib/core/services/overview.js +151 -131
- package/lib/core/services/topo/basic.js +15 -13
- package/lib/core/services/topo/tagtip.js +14 -12
- package/lib/core/store/models/ciModel.js +70 -66
- package/lib/core/store/models/customIcon.js +134 -120
- package/lib/core/store/models/displayConfig.js +19 -15
- package/lib/core/store/models/selection.js +6 -4
- package/lib/core/store/models/topoAlarm.js +145 -163
- package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
- package/lib/core/store/models/topoBizMod.js +38 -34
- package/lib/core/store/models/topoConfig.js +238 -222
- package/lib/core/store/models/topoGraphView.js +6 -4
- package/lib/core/store/models/topoMod.js +397 -375
- package/lib/core/utils/imageUtil.js +24 -22
- package/lib/core/utils/saveSerialize.js +11 -9
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
- package/lib/networkTopo/components/Link/hook.js +77 -73
- package/lib/networkTopo/components/Link/index.js +95 -87
- package/lib/networkTopo/components/Link/setting.js +44 -42
- package/lib/networkTopo/getTopoData.js +69 -63
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +22 -18
- package/lib/networkTopo/services/alert.js +22 -18
- package/lib/networkTopo/services/authorization.js +65 -55
- package/lib/networkTopo/services/cmdb.js +470 -422
- package/lib/networkTopo/services/funcAuth.js +26 -24
- package/lib/networkTopo/services/link.js +118 -108
- package/lib/networkTopo/services/mdc.js +27 -21
- package/lib/networkTopo/services/metric.js +31 -27
- package/lib/networkTopo/services/model.js +509 -445
- package/lib/networkTopo/services/risk.js +13 -11
- package/lib/networkTopo/services/topo/auth.js +33 -27
- package/lib/networkTopo/services/topo/basic.js +317 -277
- package/lib/networkTopo/services/topo/blacklist.js +24 -20
- package/lib/networkTopo/services/topo/ciInfo.js +38 -34
- package/lib/networkTopo/services/topo/icon.js +69 -59
- package/lib/networkTopo/services/topo/networkLink.js +36 -32
- package/lib/networkTopo/services/topo/relation.js +13 -11
- package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
- package/lib/networkTopo/store/functionAuth.js +37 -31
- package/lib/networkTopo/store/topoCenter.js +152 -142
- package/lib/networkTopo/store/topoLinkMod.js +6 -4
- package/lib/networkTopo/store/topoTreeMod.js +178 -166
- package/lib/networkTopo/utils/exportData.js +61 -59
- package/package.json +3 -3
@@ -52,31 +52,33 @@ function _default(topoApp) {
|
|
52
52
|
var id, resTreeData, _formatTree, treeData, defId, selectedTopoId;
|
53
53
|
|
54
54
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
55
|
-
while (1)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
55
|
+
while (1) {
|
56
|
+
switch (_context.prev = _context.next) {
|
57
|
+
case 0:
|
58
|
+
id = payload.id;
|
59
|
+
_context.next = 3;
|
60
|
+
return _this.getTopoTree();
|
61
|
+
|
62
|
+
case 3:
|
63
|
+
resTreeData = _context.sent;
|
64
|
+
// 格式化tree数据
|
65
|
+
_formatTree = (0, _tree.formatTree)(resTreeData, rootState.functionAuth.permissions), treeData = _formatTree[0], defId = _formatTree[1]; // 选中上次选择或指定的,如无则选中默认
|
66
|
+
|
67
|
+
selectedTopoId = id || (defId === '-1' ? undefined : defId);
|
68
|
+
|
69
|
+
_this.update({
|
70
|
+
loaded: true,
|
71
|
+
treeData: (0, _tree.treeNodeCount)(treeData),
|
72
|
+
defId: defId,
|
73
|
+
selectedNode: [selectedTopoId],
|
74
|
+
expandedKeys: (0, _tree.findParentIdsById)(treeData, selectedTopoId)
|
75
|
+
}); // console.log('resTreeData', resTreeData, rootState.topoMod.topoId);
|
76
|
+
|
77
|
+
|
78
|
+
case 7:
|
79
|
+
case "end":
|
80
|
+
return _context.stop();
|
81
|
+
}
|
80
82
|
}
|
81
83
|
}, _callee);
|
82
84
|
}))();
|
@@ -85,37 +87,39 @@ function _default(topoApp) {
|
|
85
87
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
86
88
|
var showAllTree, resTreeData;
|
87
89
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
88
|
-
while (1)
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
while (1) {
|
91
|
+
switch (_context2.prev = _context2.next) {
|
92
|
+
case 0:
|
93
|
+
// 拓扑中心 如果有管理导航树权限,展示完整拓扑树
|
94
|
+
showAllTree = topoApp.options.full && rootState.functionAuth.permissions.manageNavTree;
|
95
|
+
|
96
|
+
if (!showAllTree) {
|
97
|
+
_context2.next = 7;
|
98
|
+
break;
|
99
|
+
}
|
100
|
+
|
101
|
+
_context2.next = 4;
|
102
|
+
return topoApp.serverApi.getTopoTree();
|
103
|
+
|
104
|
+
case 4:
|
105
|
+
resTreeData = _context2.sent;
|
106
|
+
_context2.next = 10;
|
95
107
|
break;
|
96
|
-
}
|
97
|
-
|
98
|
-
_context2.next = 4;
|
99
|
-
return topoApp.serverApi.getTopoTree();
|
100
|
-
|
101
|
-
case 4:
|
102
|
-
resTreeData = _context2.sent;
|
103
|
-
_context2.next = 10;
|
104
|
-
break;
|
105
108
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
+
case 7:
|
110
|
+
_context2.next = 9;
|
111
|
+
return topoApp.serverApi.getTopoTreeByLoginUser();
|
109
112
|
|
110
|
-
|
111
|
-
|
113
|
+
case 9:
|
114
|
+
resTreeData = _context2.sent;
|
112
115
|
|
113
|
-
|
114
|
-
|
116
|
+
case 10:
|
117
|
+
return _context2.abrupt("return", resTreeData);
|
115
118
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
+
case 11:
|
120
|
+
case "end":
|
121
|
+
return _context2.stop();
|
122
|
+
}
|
119
123
|
}
|
120
124
|
}, _callee2);
|
121
125
|
}))();
|
@@ -130,25 +134,27 @@ function _default(topoApp) {
|
|
130
134
|
var resTreeData, _formatTree2, treeData, defId;
|
131
135
|
|
132
136
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
133
|
-
while (1)
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
137
|
+
while (1) {
|
138
|
+
switch (_context3.prev = _context3.next) {
|
139
|
+
case 0:
|
140
|
+
_context3.next = 2;
|
141
|
+
return _this2.getTopoTree();
|
142
|
+
|
143
|
+
case 2:
|
144
|
+
resTreeData = _context3.sent;
|
145
|
+
// 格式化tree数据
|
146
|
+
_formatTree2 = (0, _tree.formatTree)(resTreeData, rootState.functionAuth.permissions), treeData = _formatTree2[0], defId = _formatTree2[1];
|
147
|
+
|
148
|
+
_this2.update({
|
149
|
+
loaded: true,
|
150
|
+
treeData: (0, _tree.treeNodeCount)(treeData),
|
151
|
+
defId: defId
|
152
|
+
});
|
153
|
+
|
154
|
+
case 5:
|
155
|
+
case "end":
|
156
|
+
return _context3.stop();
|
157
|
+
}
|
152
158
|
}
|
153
159
|
}, _callee3);
|
154
160
|
}))();
|
@@ -159,45 +165,47 @@ function _default(topoApp) {
|
|
159
165
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
160
166
|
var resTreeData, treeData;
|
161
167
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
162
|
-
while (1)
|
163
|
-
|
164
|
-
|
165
|
-
conditions
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
case 4:
|
178
|
-
resTreeData = _context4.sent;
|
179
|
-
treeData = clone(state.topoTreeMod.treeData);
|
180
|
-
|
181
|
-
if (resTreeData) {
|
182
|
-
(0, _tree.loopTree)(treeData, conditions.id, function (parent, index, arr) {
|
183
|
-
arr[index].label = conditions.name;
|
168
|
+
while (1) {
|
169
|
+
switch (_context4.prev = _context4.next) {
|
170
|
+
case 0:
|
171
|
+
if (conditions === void 0) {
|
172
|
+
conditions = {};
|
173
|
+
}
|
174
|
+
|
175
|
+
_rlog["default"].debug('editTopoOnTree', conditions);
|
176
|
+
|
177
|
+
_context4.next = 4;
|
178
|
+
return topoApp.serverApi.editTopo({
|
179
|
+
id: parseInt(conditions.id, 10),
|
180
|
+
name: conditions.name,
|
181
|
+
type: conditions.type
|
184
182
|
});
|
185
183
|
|
186
|
-
|
187
|
-
|
188
|
-
|
184
|
+
case 4:
|
185
|
+
resTreeData = _context4.sent;
|
186
|
+
treeData = clone(state.topoTreeMod.treeData);
|
189
187
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
188
|
+
if (resTreeData) {
|
189
|
+
(0, _tree.loopTree)(treeData, conditions.id, function (parent, index, arr) {
|
190
|
+
arr[index].label = conditions.name;
|
191
|
+
});
|
192
|
+
|
193
|
+
_this3.update({
|
194
|
+
treeData: treeData
|
195
|
+
});
|
196
196
|
|
197
|
+
dispatch.topoMod.operationTopoPage({
|
198
|
+
type: 'rename',
|
199
|
+
name: conditions.name,
|
200
|
+
id: conditions.id
|
201
|
+
});
|
202
|
+
} // const resTree = formatTreeData(resTreeData);
|
197
203
|
|
198
|
-
|
199
|
-
|
200
|
-
|
204
|
+
|
205
|
+
case 7:
|
206
|
+
case "end":
|
207
|
+
return _context4.stop();
|
208
|
+
}
|
201
209
|
}
|
202
210
|
}, _callee4);
|
203
211
|
}))();
|
@@ -234,60 +242,62 @@ function _default(topoApp) {
|
|
234
242
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
235
243
|
var currentTopoId, isDeleteCurrentP;
|
236
244
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
237
|
-
while (1)
|
238
|
-
|
239
|
-
|
245
|
+
while (1) {
|
246
|
+
switch (_context5.prev = _context5.next) {
|
247
|
+
case 0:
|
248
|
+
_rlog["default"].debug('deleteTopoOnTree', conditions, state, dispatch.topoMod);
|
240
249
|
|
241
|
-
|
250
|
+
currentTopoId = state.topoMod.topoId;
|
242
251
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
252
|
+
if (!("" + conditions === "" + currentTopoId)) {
|
253
|
+
_context5.next = 13;
|
254
|
+
break;
|
255
|
+
}
|
247
256
|
|
248
|
-
|
257
|
+
_rlog["default"].debug('deleteTopo-currentTopo', conditions);
|
249
258
|
|
250
|
-
|
251
|
-
|
259
|
+
_context5.next = 6;
|
260
|
+
return dispatch.topoMod.updateDelId("" + conditions);
|
252
261
|
|
253
|
-
|
254
|
-
|
255
|
-
|
262
|
+
case 6:
|
263
|
+
_context5.next = 8;
|
264
|
+
return topoApp.alarm.close();
|
256
265
|
|
257
|
-
|
258
|
-
|
259
|
-
|
266
|
+
case 8:
|
267
|
+
_context5.next = 10;
|
268
|
+
return topoApp.serverApi.deleteTopoonTree(parseInt(conditions, 10));
|
260
269
|
|
261
|
-
|
262
|
-
|
270
|
+
case 10:
|
271
|
+
return _context5.abrupt("return", _context5.sent);
|
263
272
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
273
|
+
case 13:
|
274
|
+
// 判断删除的拓扑或文件,是否包含当前拓扑,如果包含就先关闭告警
|
275
|
+
isDeleteCurrentP = false;
|
276
|
+
(0, _tree.loopTree)(state.topoTreeMod.treeData, conditions, function (item, index, arr, pid) {
|
277
|
+
(0, _tree.loopTree)([item], currentTopoId, function (i) {
|
278
|
+
isDeleteCurrentP = true;
|
279
|
+
});
|
270
280
|
});
|
271
|
-
});
|
272
281
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
282
|
+
if (!isDeleteCurrentP) {
|
283
|
+
_context5.next = 18;
|
284
|
+
break;
|
285
|
+
}
|
277
286
|
|
278
|
-
|
279
|
-
|
287
|
+
_context5.next = 18;
|
288
|
+
return topoApp.alarm.close();
|
280
289
|
|
281
|
-
|
282
|
-
|
283
|
-
|
290
|
+
case 18:
|
291
|
+
_context5.next = 20;
|
292
|
+
return topoApp.serverApi.deleteTopoonTree(parseInt(conditions, 10));
|
284
293
|
|
285
|
-
|
286
|
-
|
294
|
+
case 20:
|
295
|
+
return _context5.abrupt("return", _context5.sent);
|
287
296
|
|
288
|
-
|
289
|
-
|
290
|
-
|
297
|
+
case 21:
|
298
|
+
case "end":
|
299
|
+
return _context5.stop();
|
300
|
+
}
|
291
301
|
}
|
292
302
|
}, _callee5);
|
293
303
|
}))();
|
@@ -298,28 +308,30 @@ function _default(topoApp) {
|
|
298
308
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
299
309
|
var resTreeData;
|
300
310
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
301
|
-
while (1)
|
302
|
-
|
303
|
-
|
304
|
-
conditions
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
311
|
+
while (1) {
|
312
|
+
switch (_context6.prev = _context6.next) {
|
313
|
+
case 0:
|
314
|
+
if (conditions === void 0) {
|
315
|
+
conditions = {};
|
316
|
+
}
|
317
|
+
|
318
|
+
_rlog["default"].debug('setDefTopoOnTree', conditions);
|
319
|
+
|
320
|
+
_context6.next = 4;
|
321
|
+
return topoApp.serverApi.setDefTopo(parseInt(conditions, 10));
|
322
|
+
|
323
|
+
case 4:
|
324
|
+
resTreeData = _context6.sent;
|
325
|
+
_context6.next = 7;
|
326
|
+
return _this4.refreshTree();
|
327
|
+
|
328
|
+
case 7:
|
329
|
+
_message["default"].success('设置成功');
|
330
|
+
|
331
|
+
case 8:
|
332
|
+
case "end":
|
333
|
+
return _context6.stop();
|
334
|
+
}
|
323
335
|
}
|
324
336
|
}, _callee6);
|
325
337
|
}))();
|
@@ -24,65 +24,67 @@ function _ref() {
|
|
24
24
|
var _topo$store$getModelS, nodes, links, linkGroups, clusters, params, fileData, fileName, blob, elink;
|
25
25
|
|
26
26
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
27
|
-
while (1)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
return
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
27
|
+
while (1) {
|
28
|
+
switch (_context.prev = _context.next) {
|
29
|
+
case 0:
|
30
|
+
_topo$store$getModelS = topo.store.getModelState('topoMod').data, nodes = _topo$store$getModelS.nodes, links = _topo$store$getModelS.links, linkGroups = _topo$store$getModelS.linkGroups;
|
31
|
+
clusters = (0, _clusterUtil.findClusters)(nodes);
|
32
|
+
params = {
|
33
|
+
id: topo.id,
|
34
|
+
'nodes': nodes.filter(function (node) {
|
35
|
+
return !clusters.find(function (c) {
|
36
|
+
return c.id === node.ownedCluster;
|
37
|
+
});
|
38
|
+
}).map(function (node) {
|
39
|
+
var element = topo.getDataModel().getDataByTag(node.id);
|
40
|
+
return {
|
41
|
+
'id': node.id,
|
42
|
+
'imageName': element.a('customName') || element.a('name') || element.getName()
|
43
|
+
};
|
44
|
+
}),
|
45
|
+
'links': [].concat(links, linkGroups).map(function (link) {
|
46
|
+
var id = link.id,
|
47
|
+
source = link.source,
|
48
|
+
target = link.target,
|
49
|
+
interfaceSource = link.interfaceSource,
|
50
|
+
interfaceTarget = link.interfaceTarget;
|
51
|
+
return {
|
52
|
+
id: id,
|
53
|
+
source: source,
|
54
|
+
target: target,
|
55
|
+
interfaceSource: interfaceSource,
|
56
|
+
interfaceTarget: interfaceTarget
|
57
|
+
};
|
58
|
+
})
|
59
|
+
};
|
60
|
+
|
61
|
+
_rlog["default"].error('导出数据', params);
|
62
|
+
|
63
|
+
_context.next = 6;
|
64
|
+
return _componentTopologyUtils.request.post('/topo/v1/api/structure/excel', params, {
|
65
|
+
responseType: 'blob' // responseType: 'arraybuffer',
|
66
|
+
|
67
|
+
});
|
68
|
+
|
69
|
+
case 6:
|
70
|
+
fileData = _context.sent;
|
71
|
+
fileName = topo.store.getModelState('topoMod').topoData.config.name + ".xls";
|
72
|
+
blob = new Blob([fileData]); // 处理文档流
|
73
|
+
|
74
|
+
elink = document.createElement('a');
|
75
|
+
elink.download = fileName;
|
76
|
+
elink.style.display = 'none';
|
77
|
+
elink.href = URL.createObjectURL(blob);
|
78
|
+
document.body.appendChild(elink);
|
79
|
+
elink.click();
|
80
|
+
URL.revokeObjectURL(elink.href); // 释放URL 对象
|
81
|
+
|
82
|
+
document.body.removeChild(elink);
|
83
|
+
|
84
|
+
case 17:
|
85
|
+
case "end":
|
86
|
+
return _context.stop();
|
87
|
+
}
|
86
88
|
}
|
87
89
|
}, _callee);
|
88
90
|
}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "11.0.
|
3
|
+
"version": "11.0.31",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -81,7 +81,7 @@
|
|
81
81
|
"@riil-frontend/next-collapse": "^1.0.1-a.0",
|
82
82
|
"@riil-frontend/utils": "^1.0.20",
|
83
83
|
"axios": "^0.21.1",
|
84
|
-
"build-plugin-component": "^1.
|
84
|
+
"build-plugin-component": "^1.9.2",
|
85
85
|
"build-plugin-fusion": "^0.1.0",
|
86
86
|
"build-plugin-moment-locales": "^0.1.0",
|
87
87
|
"build-scripts": "^1.1.1",
|
@@ -118,6 +118,6 @@
|
|
118
118
|
"access": "public"
|
119
119
|
},
|
120
120
|
"license": "MIT",
|
121
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.
|
121
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.31/build/index.html",
|
122
122
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
123
123
|
}
|