@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
@@ -56,20 +56,19 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
56
56
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
57
57
|
|
58
58
|
// eslint-disable-next-line no-undef
|
59
|
-
var version = typeof "11.0.
|
59
|
+
var version = typeof "11.0.31" === 'string' ? "11.0.31" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
63
63
|
*/
|
64
64
|
|
65
65
|
var Topo = /*#__PURE__*/function () {
|
66
|
+
/**
|
67
|
+
* @type TopoGraphView
|
68
|
+
*/
|
66
69
|
function Topo(options) {
|
67
70
|
this.options = void 0;
|
68
71
|
this.id = void 0;
|
69
|
-
|
70
|
-
/**
|
71
|
-
* @type TopoGraphView
|
72
|
-
*/
|
73
72
|
this.view = void 0;
|
74
73
|
this.alarm = new _Alarm["default"]();
|
75
74
|
this.store = void 0;
|
@@ -131,18 +130,20 @@ var Topo = /*#__PURE__*/function () {
|
|
131
130
|
var _exit = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
132
131
|
var topoDispatchers;
|
133
132
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
134
|
-
while (1)
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
133
|
+
while (1) {
|
134
|
+
switch (_context.prev = _context.next) {
|
135
|
+
case 0:
|
136
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
137
|
+
_context.next = 3;
|
138
|
+
return topoDispatchers.exit();
|
139
|
+
|
140
|
+
case 3:
|
141
|
+
this.destroy();
|
142
|
+
|
143
|
+
case 4:
|
144
|
+
case "end":
|
145
|
+
return _context.stop();
|
146
|
+
}
|
146
147
|
}
|
147
148
|
}, _callee, this);
|
148
149
|
}));
|
@@ -159,27 +160,29 @@ var Topo = /*#__PURE__*/function () {
|
|
159
160
|
var _data$groups, groups, _data$nodes, nodes, links, lines, topoDispatchers;
|
160
161
|
|
161
162
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
162
|
-
while (1)
|
163
|
-
|
164
|
-
|
165
|
-
options
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
163
|
+
while (1) {
|
164
|
+
switch (_context2.prev = _context2.next) {
|
165
|
+
case 0:
|
166
|
+
if (options === void 0) {
|
167
|
+
options = {};
|
168
|
+
}
|
169
|
+
|
170
|
+
_data$groups = data.groups, groups = _data$groups === void 0 ? [] : _data$groups, _data$nodes = data.nodes, nodes = _data$nodes === void 0 ? [] : _data$nodes, links = data.links, lines = data.lines;
|
171
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
172
|
+
_context2.next = 5;
|
173
|
+
return topoDispatchers.openTopoPage((0, _extends2["default"])({
|
174
|
+
data: (0, _extends2["default"])({}, data, {
|
175
|
+
groups: groups,
|
176
|
+
nodes: nodes,
|
177
|
+
links: links || lines || [],
|
178
|
+
linkGroups: data.linkGroups || data.lineGroups || []
|
179
|
+
})
|
180
|
+
}, options));
|
181
|
+
|
182
|
+
case 5:
|
183
|
+
case "end":
|
184
|
+
return _context2.stop();
|
185
|
+
}
|
183
186
|
}
|
184
187
|
}, _callee2, this);
|
185
188
|
}));
|
@@ -194,10 +197,12 @@ var Topo = /*#__PURE__*/function () {
|
|
194
197
|
_proto.clear = /*#__PURE__*/function () {
|
195
198
|
var _clear = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
196
199
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
197
|
-
while (1)
|
198
|
-
|
199
|
-
|
200
|
-
|
200
|
+
while (1) {
|
201
|
+
switch (_context3.prev = _context3.next) {
|
202
|
+
case 0:
|
203
|
+
case "end":
|
204
|
+
return _context3.stop();
|
205
|
+
}
|
201
206
|
}
|
202
207
|
}, _callee3);
|
203
208
|
}));
|
@@ -266,28 +271,30 @@ var Topo = /*#__PURE__*/function () {
|
|
266
271
|
var _data$groups2, groups, _data$nodes2, nodes, links, lines;
|
267
272
|
|
268
273
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
269
|
-
while (1)
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
274
|
+
while (1) {
|
275
|
+
switch (_context4.prev = _context4.next) {
|
276
|
+
case 0:
|
277
|
+
_data$groups2 = data.groups, groups = _data$groups2 === void 0 ? [] : _data$groups2, _data$nodes2 = data.nodes, nodes = _data$nodes2 === void 0 ? [] : _data$nodes2, links = data.links, lines = data.lines;
|
278
|
+
this.view.topoClient.updateElements((0, _lodash.cloneDeep)({
|
279
|
+
groups: (0, _topoData.formatGroups)(groups),
|
280
|
+
nodes: nodes.map(function (node) {
|
281
|
+
return (0, _extends2["default"])({}, node, {
|
282
|
+
type: 'node',
|
283
|
+
dtype: 'device'
|
284
|
+
});
|
285
|
+
}),
|
286
|
+
links: (links || lines || []).map(function (link) {
|
287
|
+
return (0, _extends2["default"])({}, link, {
|
288
|
+
type: 'link',
|
289
|
+
dtype: 'link'
|
290
|
+
});
|
291
|
+
})
|
292
|
+
})); // TODO 更新store,触发属性、指标模型加载,更新指标
|
293
|
+
|
294
|
+
case 2:
|
295
|
+
case "end":
|
296
|
+
return _context4.stop();
|
297
|
+
}
|
291
298
|
}
|
292
299
|
}, _callee4, this);
|
293
300
|
}));
|
@@ -311,18 +318,20 @@ var Topo = /*#__PURE__*/function () {
|
|
311
318
|
var _addElements = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(elements) {
|
312
319
|
var data;
|
313
320
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
314
|
-
while (1)
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
321
|
+
while (1) {
|
322
|
+
switch (_context5.prev = _context5.next) {
|
323
|
+
case 0:
|
324
|
+
data = {
|
325
|
+
groups: [].concat(this.getGroups(), elements.groups || []),
|
326
|
+
nodes: [].concat(this.getNodes(), elements.nodes || []),
|
327
|
+
lines: [].concat(this.getLines(), elements.lines || [])
|
328
|
+
};
|
329
|
+
this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
|
330
|
+
|
331
|
+
case 2:
|
332
|
+
case "end":
|
333
|
+
return _context5.stop();
|
334
|
+
}
|
326
335
|
}
|
327
336
|
}, _callee5, this);
|
328
337
|
}));
|
@@ -345,13 +354,15 @@ var Topo = /*#__PURE__*/function () {
|
|
345
354
|
function () {
|
346
355
|
var _updateData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(data) {
|
347
356
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
348
|
-
while (1)
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
357
|
+
while (1) {
|
358
|
+
switch (_context6.prev = _context6.next) {
|
359
|
+
case 0:
|
360
|
+
this.updateElements(data);
|
361
|
+
|
362
|
+
case 1:
|
363
|
+
case "end":
|
364
|
+
return _context6.stop();
|
365
|
+
}
|
355
366
|
}
|
356
367
|
}, _callee6, this);
|
357
368
|
}));
|
@@ -382,22 +393,24 @@ var Topo = /*#__PURE__*/function () {
|
|
382
393
|
var _open = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id, mode) {
|
383
394
|
var lastId;
|
384
395
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
385
|
-
while (1)
|
386
|
-
|
387
|
-
|
396
|
+
while (1) {
|
397
|
+
switch (_context7.prev = _context7.next) {
|
398
|
+
case 0:
|
399
|
+
_rlog["default"].info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
|
388
400
|
|
389
401
|
|
390
|
-
|
391
|
-
|
402
|
+
lastId = this.id;
|
403
|
+
this.id = id;
|
392
404
|
|
393
|
-
|
394
|
-
|
395
|
-
|
405
|
+
if (lastId && id !== lastId) {
|
406
|
+
this.alarm.close();
|
407
|
+
} // 加载新拓扑图
|
396
408
|
|
397
409
|
|
398
|
-
|
399
|
-
|
400
|
-
|
410
|
+
case 4:
|
411
|
+
case "end":
|
412
|
+
return _context7.stop();
|
413
|
+
}
|
401
414
|
}
|
402
415
|
}, _callee7, this);
|
403
416
|
}));
|
@@ -412,24 +425,26 @@ var Topo = /*#__PURE__*/function () {
|
|
412
425
|
_proto.close = /*#__PURE__*/function () {
|
413
426
|
var _close = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
414
427
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
415
|
-
while (1)
|
416
|
-
|
417
|
-
|
428
|
+
while (1) {
|
429
|
+
switch (_context8.prev = _context8.next) {
|
430
|
+
case 0:
|
431
|
+
_rlog["default"].info('关闭拓扑图', this.id);
|
418
432
|
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
433
|
+
if (this.id) {
|
434
|
+
_context8.next = 3;
|
435
|
+
break;
|
436
|
+
}
|
423
437
|
|
424
|
-
|
438
|
+
return _context8.abrupt("return");
|
425
439
|
|
426
|
-
|
427
|
-
|
428
|
-
|
440
|
+
case 3:
|
441
|
+
this.alarm.close();
|
442
|
+
this.id = null;
|
429
443
|
|
430
|
-
|
431
|
-
|
432
|
-
|
444
|
+
case 5:
|
445
|
+
case "end":
|
446
|
+
return _context8.stop();
|
447
|
+
}
|
433
448
|
}
|
434
449
|
}, _callee8, this);
|
435
450
|
}));
|
@@ -444,10 +459,12 @@ var Topo = /*#__PURE__*/function () {
|
|
444
459
|
_proto.refresh = /*#__PURE__*/function () {
|
445
460
|
var _refresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
446
461
|
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
447
|
-
while (1)
|
448
|
-
|
449
|
-
|
450
|
-
|
462
|
+
while (1) {
|
463
|
+
switch (_context9.prev = _context9.next) {
|
464
|
+
case 0:
|
465
|
+
case "end":
|
466
|
+
return _context9.stop();
|
467
|
+
}
|
451
468
|
}
|
452
469
|
}, _callee9);
|
453
470
|
}));
|
@@ -487,10 +504,12 @@ var Topo = /*#__PURE__*/function () {
|
|
487
504
|
_proto.openViewMode = /*#__PURE__*/function () {
|
488
505
|
var _openViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(id) {
|
489
506
|
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
490
|
-
while (1)
|
491
|
-
|
492
|
-
|
493
|
-
|
507
|
+
while (1) {
|
508
|
+
switch (_context10.prev = _context10.next) {
|
509
|
+
case 0:
|
510
|
+
case "end":
|
511
|
+
return _context10.stop();
|
512
|
+
}
|
494
513
|
}
|
495
514
|
}, _callee10);
|
496
515
|
}));
|
@@ -517,13 +536,15 @@ var Topo = /*#__PURE__*/function () {
|
|
517
536
|
_proto.onTopoDataLoaded = /*#__PURE__*/function () {
|
518
537
|
var _onTopoDataLoaded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(topoData) {
|
519
538
|
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
520
|
-
while (1)
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
539
|
+
while (1) {
|
540
|
+
switch (_context11.prev = _context11.next) {
|
541
|
+
case 0:
|
542
|
+
this.pluginManager.onTopoDataLoaded(topoData);
|
543
|
+
|
544
|
+
case 1:
|
545
|
+
case "end":
|
546
|
+
return _context11.stop();
|
547
|
+
}
|
527
548
|
}
|
528
549
|
}, _callee11, this);
|
529
550
|
}));
|
@@ -545,53 +566,55 @@ var Topo = /*#__PURE__*/function () {
|
|
545
566
|
var _enterEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
|
546
567
|
var topoDispatchers, iconManageDispatchers;
|
547
568
|
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
548
|
-
while (1)
|
549
|
-
|
550
|
-
|
569
|
+
while (1) {
|
570
|
+
switch (_context12.prev = _context12.next) {
|
571
|
+
case 0:
|
572
|
+
_rlog["default"].info('TopoApp.enterEditMode');
|
573
|
+
|
574
|
+
if (!this.options.onSwitchToEditModeBegin) {
|
575
|
+
_context12.next = 4;
|
576
|
+
break;
|
577
|
+
}
|
551
578
|
|
552
|
-
if (!this.options.onSwitchToEditModeBegin) {
|
553
579
|
_context12.next = 4;
|
554
|
-
|
555
|
-
}
|
580
|
+
return this.options.onSwitchToEditModeBegin(this);
|
556
581
|
|
557
|
-
|
558
|
-
|
582
|
+
case 4:
|
583
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
584
|
+
_context12.next = 7;
|
585
|
+
return topoDispatchers.update({
|
586
|
+
viewState: 'edit'
|
587
|
+
});
|
559
588
|
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
return topoDispatchers.update({
|
564
|
-
viewState: 'edit'
|
565
|
-
});
|
589
|
+
case 7:
|
590
|
+
_context12.next = 9;
|
591
|
+
return this.view.switchToEditMode();
|
566
592
|
|
567
|
-
|
568
|
-
|
569
|
-
return this.view.switchToEditMode();
|
593
|
+
case 9:
|
594
|
+
(0, _edgeUtil.updateEdgeExpanded)(this);
|
570
595
|
|
571
|
-
|
572
|
-
|
596
|
+
if (!this.options.onSwitchToEditMode) {
|
597
|
+
_context12.next = 13;
|
598
|
+
break;
|
599
|
+
}
|
573
600
|
|
574
|
-
if (!this.options.onSwitchToEditMode) {
|
575
601
|
_context12.next = 13;
|
576
|
-
|
577
|
-
}
|
578
|
-
|
579
|
-
_context12.next = 13;
|
580
|
-
return this.options.onSwitchToEditMode(this);
|
602
|
+
return this.options.onSwitchToEditMode(this);
|
581
603
|
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
604
|
+
case 13:
|
605
|
+
if (this.getDataModel()) {
|
606
|
+
// 更新节点名称显示隐藏
|
607
|
+
this.attributeMetricDisplay.updateNodesNameVisible();
|
608
|
+
} // 加载自定义上传的图标
|
587
609
|
|
588
610
|
|
589
|
-
|
590
|
-
|
611
|
+
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
612
|
+
iconManageDispatchers.loadEditorIcons();
|
591
613
|
|
592
|
-
|
593
|
-
|
594
|
-
|
614
|
+
case 16:
|
615
|
+
case "end":
|
616
|
+
return _context12.stop();
|
617
|
+
}
|
595
618
|
}
|
596
619
|
}, _callee12, this);
|
597
620
|
}));
|
@@ -607,26 +630,28 @@ var Topo = /*#__PURE__*/function () {
|
|
607
630
|
var _exitEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13() {
|
608
631
|
var editDispatchers;
|
609
632
|
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
610
|
-
while (1)
|
611
|
-
|
612
|
-
|
613
|
-
|
633
|
+
while (1) {
|
634
|
+
switch (_context13.prev = _context13.next) {
|
635
|
+
case 0:
|
636
|
+
_context13.next = 2;
|
637
|
+
return this.view.switchToViewMode();
|
614
638
|
|
615
|
-
|
616
|
-
|
617
|
-
|
639
|
+
case 2:
|
640
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
641
|
+
editDispatchers.switchToViewMode(this.id);
|
618
642
|
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
643
|
+
if (!this.options.onSwitchToViewMode) {
|
644
|
+
_context13.next = 7;
|
645
|
+
break;
|
646
|
+
}
|
623
647
|
|
624
|
-
|
625
|
-
|
648
|
+
_context13.next = 7;
|
649
|
+
return this.options.onSwitchToViewMode(this);
|
626
650
|
|
627
|
-
|
628
|
-
|
629
|
-
|
651
|
+
case 7:
|
652
|
+
case "end":
|
653
|
+
return _context13.stop();
|
654
|
+
}
|
630
655
|
}
|
631
656
|
}, _callee13, this);
|
632
657
|
}));
|
@@ -647,13 +672,15 @@ var Topo = /*#__PURE__*/function () {
|
|
647
672
|
function () {
|
648
673
|
var _triggerSaveEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14() {
|
649
674
|
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
650
|
-
while (1)
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
675
|
+
while (1) {
|
676
|
+
switch (_context14.prev = _context14.next) {
|
677
|
+
case 0:
|
678
|
+
this.view.topoClient.saveExternal();
|
679
|
+
|
680
|
+
case 1:
|
681
|
+
case "end":
|
682
|
+
return _context14.stop();
|
683
|
+
}
|
657
684
|
}
|
658
685
|
}, _callee14, this);
|
659
686
|
}));
|
@@ -674,13 +701,15 @@ var Topo = /*#__PURE__*/function () {
|
|
674
701
|
function () {
|
675
702
|
var _save = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15() {
|
676
703
|
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
677
|
-
while (1)
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
704
|
+
while (1) {
|
705
|
+
switch (_context15.prev = _context15.next) {
|
706
|
+
case 0:
|
707
|
+
this.triggerSaveEvent();
|
708
|
+
|
709
|
+
case 1:
|
710
|
+
case "end":
|
711
|
+
return _context15.stop();
|
712
|
+
}
|
684
713
|
}
|
685
714
|
}, _callee15, this);
|
686
715
|
}));
|
@@ -704,18 +733,20 @@ var Topo = /*#__PURE__*/function () {
|
|
704
733
|
var _exportImage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(name) {
|
705
734
|
var fileName;
|
706
735
|
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
707
|
-
while (1)
|
708
|
-
|
709
|
-
|
736
|
+
while (1) {
|
737
|
+
switch (_context16.prev = _context16.next) {
|
738
|
+
case 0:
|
739
|
+
fileName = name;
|
710
740
|
|
711
|
-
|
712
|
-
|
741
|
+
if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
|
742
|
+
}
|
713
743
|
|
714
|
-
|
744
|
+
this.view.topoClient.exportImage(fileName);
|
715
745
|
|
716
|
-
|
717
|
-
|
718
|
-
|
746
|
+
case 3:
|
747
|
+
case "end":
|
748
|
+
return _context16.stop();
|
749
|
+
}
|
719
750
|
}
|
720
751
|
}, _callee16, this);
|
721
752
|
}));
|
@@ -736,10 +767,12 @@ var Topo = /*#__PURE__*/function () {
|
|
736
767
|
_proto.switchToViewMode = /*#__PURE__*/function () {
|
737
768
|
var _switchToViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {
|
738
769
|
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
739
|
-
while (1)
|
740
|
-
|
741
|
-
|
742
|
-
|
770
|
+
while (1) {
|
771
|
+
switch (_context17.prev = _context17.next) {
|
772
|
+
case 0:
|
773
|
+
case "end":
|
774
|
+
return _context17.stop();
|
775
|
+
}
|
743
776
|
}
|
744
777
|
}, _callee17);
|
745
778
|
}));
|
@@ -754,10 +787,12 @@ var Topo = /*#__PURE__*/function () {
|
|
754
787
|
_proto.switchToEditMode = /*#__PURE__*/function () {
|
755
788
|
var _switchToEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18() {
|
756
789
|
return _regenerator["default"].wrap(function _callee18$(_context18) {
|
757
|
-
while (1)
|
758
|
-
|
759
|
-
|
760
|
-
|
790
|
+
while (1) {
|
791
|
+
switch (_context18.prev = _context18.next) {
|
792
|
+
case 0:
|
793
|
+
case "end":
|
794
|
+
return _context18.stop();
|
795
|
+
}
|
761
796
|
}
|
762
797
|
}, _callee18);
|
763
798
|
}));
|