@riil-frontend/component-topology 11.0.34 → 12.0.0-dev.1
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 +57 -34
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/MultiResourceDrawer/index.js +16 -18
- package/es/components/ResourceList/ResourceSelect.js +48 -50
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
- package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +119 -129
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
- package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
- 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/copyElementUtil.js +171 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +117 -121
- package/es/core/hooks/useResourceConfig.js +58 -66
- package/es/core/hooks/useTopoEdit.js +473 -503
- package/es/core/models/Alarm.js +281 -298
- package/es/core/models/AttributeMetricDisplay.js +101 -107
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +205 -240
- package/es/core/models/TopoGraphView.js +18 -21
- package/es/core/models/cache/CiCache.js +28 -27
- package/es/core/models/cache/CiTypeCache.js +37 -41
- package/es/core/models/cache/DictCache.js +33 -35
- package/es/core/models/graph/Background.js +15 -17
- package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
- package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/es/core/models/topoData.js +68 -70
- package/es/core/models/utils/linkUtils.js +41 -43
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +9 -11
- package/es/core/services/cmdb.js +20 -20
- package/es/core/services/index.js +39 -45
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +10 -12
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +120 -134
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- package/es/core/utils/imageUtil.js +18 -20
- package/es/core/utils/metricUtil.js +5 -0
- package/es/core/utils/saveSerialize.js +9 -11
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
- package/es/networkTopo/components/Link/hook.js +73 -77
- package/es/networkTopo/components/Link/index.js +86 -94
- package/es/networkTopo/components/Link/setting.js +42 -44
- package/es/networkTopo/getTopoData.js +63 -69
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +18 -22
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +422 -470
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +18 -24
- package/es/networkTopo/services/metric.js +23 -27
- package/es/networkTopo/services/model.js +445 -509
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +251 -289
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +52 -54
- package/lib/components/BatchAttrMetric/setting.js +1 -1
- package/lib/components/MultiResourceDrawer/index.js +16 -18
- package/lib/components/ResourceList/ResourceSelect.js +48 -50
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +118 -128
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
- package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
- 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/copyElementUtil.js +182 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +116 -120
- package/lib/core/hooks/useResourceConfig.js +58 -66
- package/lib/core/hooks/useTopoEdit.js +465 -495
- package/lib/core/models/Alarm.js +275 -292
- package/lib/core/models/AttributeMetricDisplay.js +104 -110
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +205 -240
- package/lib/core/models/TopoGraphView.js +18 -21
- package/lib/core/models/cache/CiCache.js +33 -32
- package/lib/core/models/cache/CiTypeCache.js +38 -42
- package/lib/core/models/cache/DictCache.js +33 -35
- package/lib/core/models/graph/Background.js +16 -18
- package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
- package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/lib/core/models/topoData.js +69 -71
- package/lib/core/models/utils/linkUtils.js +41 -43
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +10 -12
- package/lib/core/services/cmdb.js +22 -22
- package/lib/core/services/index.js +45 -51
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +12 -14
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +120 -134
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- package/lib/core/utils/imageUtil.js +22 -24
- package/lib/core/utils/metricUtil.js +5 -0
- package/lib/core/utils/saveSerialize.js +9 -11
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
- package/lib/networkTopo/components/Link/hook.js +73 -77
- package/lib/networkTopo/components/Link/index.js +87 -95
- package/lib/networkTopo/components/Link/setting.js +42 -44
- package/lib/networkTopo/getTopoData.js +63 -69
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +18 -22
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +422 -470
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +21 -27
- package/lib/networkTopo/services/metric.js +27 -31
- package/lib/networkTopo/services/model.js +445 -509
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +252 -290
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +59 -61
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +5 -3
@@ -56,19 +56,20 @@ 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 "
|
59
|
+
var version = typeof "12.0.0-dev.1" === 'string' ? "12.0.0-dev.1" : 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
|
-
*/
|
69
66
|
function Topo(options) {
|
70
67
|
this.options = void 0;
|
71
68
|
this.id = void 0;
|
69
|
+
|
70
|
+
/**
|
71
|
+
* @type TopoGraphView
|
72
|
+
*/
|
72
73
|
this.view = void 0;
|
73
74
|
this.alarm = new _Alarm["default"]();
|
74
75
|
this.store = void 0;
|
@@ -130,20 +131,18 @@ var Topo = /*#__PURE__*/function () {
|
|
130
131
|
var _exit = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
131
132
|
var topoDispatchers;
|
132
133
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
133
|
-
while (1) {
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
return _context.stop();
|
146
|
-
}
|
134
|
+
while (1) 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();
|
147
146
|
}
|
148
147
|
}, _callee, this);
|
149
148
|
}));
|
@@ -160,29 +159,27 @@ var Topo = /*#__PURE__*/function () {
|
|
160
159
|
var _data$groups, groups, _data$nodes, nodes, links, lines, topoDispatchers;
|
161
160
|
|
162
161
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
163
|
-
while (1) {
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
return _context2.stop();
|
185
|
-
}
|
162
|
+
while (1) switch (_context2.prev = _context2.next) {
|
163
|
+
case 0:
|
164
|
+
if (options === void 0) {
|
165
|
+
options = {};
|
166
|
+
}
|
167
|
+
|
168
|
+
_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;
|
169
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
170
|
+
_context2.next = 5;
|
171
|
+
return topoDispatchers.openTopoPage((0, _extends2["default"])({
|
172
|
+
data: (0, _extends2["default"])({}, data, {
|
173
|
+
groups: groups,
|
174
|
+
nodes: nodes,
|
175
|
+
links: links || lines || [],
|
176
|
+
linkGroups: data.linkGroups || data.lineGroups || []
|
177
|
+
})
|
178
|
+
}, options));
|
179
|
+
|
180
|
+
case 5:
|
181
|
+
case "end":
|
182
|
+
return _context2.stop();
|
186
183
|
}
|
187
184
|
}, _callee2, this);
|
188
185
|
}));
|
@@ -197,12 +194,10 @@ var Topo = /*#__PURE__*/function () {
|
|
197
194
|
_proto.clear = /*#__PURE__*/function () {
|
198
195
|
var _clear = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
199
196
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
200
|
-
while (1) {
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
return _context3.stop();
|
205
|
-
}
|
197
|
+
while (1) switch (_context3.prev = _context3.next) {
|
198
|
+
case 0:
|
199
|
+
case "end":
|
200
|
+
return _context3.stop();
|
206
201
|
}
|
207
202
|
}, _callee3);
|
208
203
|
}));
|
@@ -271,30 +266,28 @@ var Topo = /*#__PURE__*/function () {
|
|
271
266
|
var _data$groups2, groups, _data$nodes2, nodes, links, lines;
|
272
267
|
|
273
268
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
274
|
-
while (1) {
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
return _context4.stop();
|
297
|
-
}
|
269
|
+
while (1) switch (_context4.prev = _context4.next) {
|
270
|
+
case 0:
|
271
|
+
_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;
|
272
|
+
this.view.topoClient.updateElements((0, _lodash.cloneDeep)({
|
273
|
+
groups: (0, _topoData.formatGroups)(groups),
|
274
|
+
nodes: nodes.map(function (node) {
|
275
|
+
return (0, _extends2["default"])({}, node, {
|
276
|
+
type: 'node',
|
277
|
+
dtype: 'device'
|
278
|
+
});
|
279
|
+
}),
|
280
|
+
links: (links || lines || []).map(function (link) {
|
281
|
+
return (0, _extends2["default"])({}, link, {
|
282
|
+
type: 'link',
|
283
|
+
dtype: 'link'
|
284
|
+
});
|
285
|
+
})
|
286
|
+
})); // TODO 更新store,触发属性、指标模型加载,更新指标
|
287
|
+
|
288
|
+
case 2:
|
289
|
+
case "end":
|
290
|
+
return _context4.stop();
|
298
291
|
}
|
299
292
|
}, _callee4, this);
|
300
293
|
}));
|
@@ -318,20 +311,18 @@ var Topo = /*#__PURE__*/function () {
|
|
318
311
|
var _addElements = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(elements) {
|
319
312
|
var data;
|
320
313
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
321
|
-
while (1) {
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
return _context5.stop();
|
334
|
-
}
|
314
|
+
while (1) switch (_context5.prev = _context5.next) {
|
315
|
+
case 0:
|
316
|
+
data = {
|
317
|
+
groups: [].concat(this.getGroups(), elements.groups || []),
|
318
|
+
nodes: [].concat(this.getNodes(), elements.nodes || []),
|
319
|
+
lines: [].concat(this.getLines(), elements.lines || [])
|
320
|
+
};
|
321
|
+
this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
|
322
|
+
|
323
|
+
case 2:
|
324
|
+
case "end":
|
325
|
+
return _context5.stop();
|
335
326
|
}
|
336
327
|
}, _callee5, this);
|
337
328
|
}));
|
@@ -354,15 +345,13 @@ var Topo = /*#__PURE__*/function () {
|
|
354
345
|
function () {
|
355
346
|
var _updateData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(data) {
|
356
347
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
357
|
-
while (1) {
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
return _context6.stop();
|
365
|
-
}
|
348
|
+
while (1) switch (_context6.prev = _context6.next) {
|
349
|
+
case 0:
|
350
|
+
this.updateElements(data);
|
351
|
+
|
352
|
+
case 1:
|
353
|
+
case "end":
|
354
|
+
return _context6.stop();
|
366
355
|
}
|
367
356
|
}, _callee6, this);
|
368
357
|
}));
|
@@ -393,24 +382,22 @@ var Topo = /*#__PURE__*/function () {
|
|
393
382
|
var _open = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id, mode) {
|
394
383
|
var lastId;
|
395
384
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
396
|
-
while (1) {
|
397
|
-
|
398
|
-
|
399
|
-
_rlog["default"].info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
|
385
|
+
while (1) switch (_context7.prev = _context7.next) {
|
386
|
+
case 0:
|
387
|
+
_rlog["default"].info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
|
400
388
|
|
401
389
|
|
402
|
-
|
403
|
-
|
390
|
+
lastId = this.id;
|
391
|
+
this.id = id;
|
404
392
|
|
405
|
-
|
406
|
-
|
407
|
-
|
393
|
+
if (lastId && id !== lastId) {
|
394
|
+
this.alarm.close();
|
395
|
+
} // 加载新拓扑图
|
408
396
|
|
409
397
|
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
}
|
398
|
+
case 4:
|
399
|
+
case "end":
|
400
|
+
return _context7.stop();
|
414
401
|
}
|
415
402
|
}, _callee7, this);
|
416
403
|
}));
|
@@ -425,26 +412,24 @@ var Topo = /*#__PURE__*/function () {
|
|
425
412
|
_proto.close = /*#__PURE__*/function () {
|
426
413
|
var _close = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
427
414
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
428
|
-
while (1) {
|
429
|
-
|
430
|
-
|
431
|
-
_rlog["default"].info('关闭拓扑图', this.id);
|
415
|
+
while (1) switch (_context8.prev = _context8.next) {
|
416
|
+
case 0:
|
417
|
+
_rlog["default"].info('关闭拓扑图', this.id);
|
432
418
|
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
419
|
+
if (this.id) {
|
420
|
+
_context8.next = 3;
|
421
|
+
break;
|
422
|
+
}
|
437
423
|
|
438
|
-
|
424
|
+
return _context8.abrupt("return");
|
439
425
|
|
440
|
-
|
441
|
-
|
442
|
-
|
426
|
+
case 3:
|
427
|
+
this.alarm.close();
|
428
|
+
this.id = null;
|
443
429
|
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
}
|
430
|
+
case 5:
|
431
|
+
case "end":
|
432
|
+
return _context8.stop();
|
448
433
|
}
|
449
434
|
}, _callee8, this);
|
450
435
|
}));
|
@@ -459,12 +444,10 @@ var Topo = /*#__PURE__*/function () {
|
|
459
444
|
_proto.refresh = /*#__PURE__*/function () {
|
460
445
|
var _refresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
461
446
|
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
462
|
-
while (1) {
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
return _context9.stop();
|
467
|
-
}
|
447
|
+
while (1) switch (_context9.prev = _context9.next) {
|
448
|
+
case 0:
|
449
|
+
case "end":
|
450
|
+
return _context9.stop();
|
468
451
|
}
|
469
452
|
}, _callee9);
|
470
453
|
}));
|
@@ -504,12 +487,10 @@ var Topo = /*#__PURE__*/function () {
|
|
504
487
|
_proto.openViewMode = /*#__PURE__*/function () {
|
505
488
|
var _openViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(id) {
|
506
489
|
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
507
|
-
while (1) {
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
return _context10.stop();
|
512
|
-
}
|
490
|
+
while (1) switch (_context10.prev = _context10.next) {
|
491
|
+
case 0:
|
492
|
+
case "end":
|
493
|
+
return _context10.stop();
|
513
494
|
}
|
514
495
|
}, _callee10);
|
515
496
|
}));
|
@@ -536,15 +517,13 @@ var Topo = /*#__PURE__*/function () {
|
|
536
517
|
_proto.onTopoDataLoaded = /*#__PURE__*/function () {
|
537
518
|
var _onTopoDataLoaded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(topoData) {
|
538
519
|
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
539
|
-
while (1) {
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
return _context11.stop();
|
547
|
-
}
|
520
|
+
while (1) switch (_context11.prev = _context11.next) {
|
521
|
+
case 0:
|
522
|
+
this.pluginManager.onTopoDataLoaded(topoData);
|
523
|
+
|
524
|
+
case 1:
|
525
|
+
case "end":
|
526
|
+
return _context11.stop();
|
548
527
|
}
|
549
528
|
}, _callee11, this);
|
550
529
|
}));
|
@@ -566,55 +545,53 @@ var Topo = /*#__PURE__*/function () {
|
|
566
545
|
var _enterEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
|
567
546
|
var topoDispatchers, iconManageDispatchers;
|
568
547
|
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
569
|
-
while (1) {
|
570
|
-
|
571
|
-
|
572
|
-
_rlog["default"].info('TopoApp.enterEditMode');
|
573
|
-
|
574
|
-
if (!this.options.onSwitchToEditModeBegin) {
|
575
|
-
_context12.next = 4;
|
576
|
-
break;
|
577
|
-
}
|
548
|
+
while (1) switch (_context12.prev = _context12.next) {
|
549
|
+
case 0:
|
550
|
+
_rlog["default"].info('TopoApp.enterEditMode');
|
578
551
|
|
552
|
+
if (!this.options.onSwitchToEditModeBegin) {
|
579
553
|
_context12.next = 4;
|
580
|
-
|
554
|
+
break;
|
555
|
+
}
|
581
556
|
|
582
|
-
|
583
|
-
|
584
|
-
_context12.next = 7;
|
585
|
-
return topoDispatchers.update({
|
586
|
-
viewState: 'edit'
|
587
|
-
});
|
557
|
+
_context12.next = 4;
|
558
|
+
return this.options.onSwitchToEditModeBegin(this);
|
588
559
|
|
589
|
-
|
590
|
-
|
591
|
-
|
560
|
+
case 4:
|
561
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
562
|
+
_context12.next = 7;
|
563
|
+
return topoDispatchers.update({
|
564
|
+
viewState: 'edit'
|
565
|
+
});
|
592
566
|
|
593
|
-
|
594
|
-
|
567
|
+
case 7:
|
568
|
+
_context12.next = 9;
|
569
|
+
return this.view.switchToEditMode();
|
595
570
|
|
596
|
-
|
597
|
-
|
598
|
-
break;
|
599
|
-
}
|
571
|
+
case 9:
|
572
|
+
(0, _edgeUtil.updateEdgeExpanded)(this);
|
600
573
|
|
574
|
+
if (!this.options.onSwitchToEditMode) {
|
601
575
|
_context12.next = 13;
|
602
|
-
|
576
|
+
break;
|
577
|
+
}
|
578
|
+
|
579
|
+
_context12.next = 13;
|
580
|
+
return this.options.onSwitchToEditMode(this);
|
603
581
|
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
582
|
+
case 13:
|
583
|
+
if (this.getDataModel()) {
|
584
|
+
// 更新节点名称显示隐藏
|
585
|
+
this.attributeMetricDisplay.updateNodesNameVisible();
|
586
|
+
} // 加载自定义上传的图标
|
609
587
|
|
610
588
|
|
611
|
-
|
612
|
-
|
589
|
+
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
590
|
+
iconManageDispatchers.loadEditorIcons();
|
613
591
|
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
}
|
592
|
+
case 16:
|
593
|
+
case "end":
|
594
|
+
return _context12.stop();
|
618
595
|
}
|
619
596
|
}, _callee12, this);
|
620
597
|
}));
|
@@ -630,28 +607,26 @@ var Topo = /*#__PURE__*/function () {
|
|
630
607
|
var _exitEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13() {
|
631
608
|
var editDispatchers;
|
632
609
|
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
633
|
-
while (1) {
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
return this.view.switchToViewMode();
|
638
|
-
|
639
|
-
case 2:
|
640
|
-
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
641
|
-
editDispatchers.switchToViewMode(this.id);
|
610
|
+
while (1) switch (_context13.prev = _context13.next) {
|
611
|
+
case 0:
|
612
|
+
_context13.next = 2;
|
613
|
+
return this.view.switchToViewMode();
|
642
614
|
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
}
|
615
|
+
case 2:
|
616
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
617
|
+
editDispatchers.switchToViewMode(this.id);
|
647
618
|
|
619
|
+
if (!this.options.onSwitchToViewMode) {
|
648
620
|
_context13.next = 7;
|
649
|
-
|
621
|
+
break;
|
622
|
+
}
|
650
623
|
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
624
|
+
_context13.next = 7;
|
625
|
+
return this.options.onSwitchToViewMode(this);
|
626
|
+
|
627
|
+
case 7:
|
628
|
+
case "end":
|
629
|
+
return _context13.stop();
|
655
630
|
}
|
656
631
|
}, _callee13, this);
|
657
632
|
}));
|
@@ -672,15 +647,13 @@ var Topo = /*#__PURE__*/function () {
|
|
672
647
|
function () {
|
673
648
|
var _triggerSaveEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14() {
|
674
649
|
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
675
|
-
while (1) {
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
return _context14.stop();
|
683
|
-
}
|
650
|
+
while (1) switch (_context14.prev = _context14.next) {
|
651
|
+
case 0:
|
652
|
+
this.view.topoClient.saveExternal();
|
653
|
+
|
654
|
+
case 1:
|
655
|
+
case "end":
|
656
|
+
return _context14.stop();
|
684
657
|
}
|
685
658
|
}, _callee14, this);
|
686
659
|
}));
|
@@ -701,15 +674,13 @@ var Topo = /*#__PURE__*/function () {
|
|
701
674
|
function () {
|
702
675
|
var _save = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15() {
|
703
676
|
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
704
|
-
while (1) {
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
return _context15.stop();
|
712
|
-
}
|
677
|
+
while (1) switch (_context15.prev = _context15.next) {
|
678
|
+
case 0:
|
679
|
+
this.triggerSaveEvent();
|
680
|
+
|
681
|
+
case 1:
|
682
|
+
case "end":
|
683
|
+
return _context15.stop();
|
713
684
|
}
|
714
685
|
}, _callee15, this);
|
715
686
|
}));
|
@@ -733,20 +704,18 @@ var Topo = /*#__PURE__*/function () {
|
|
733
704
|
var _exportImage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(name) {
|
734
705
|
var fileName;
|
735
706
|
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
736
|
-
while (1) {
|
737
|
-
|
738
|
-
|
739
|
-
fileName = name;
|
707
|
+
while (1) switch (_context16.prev = _context16.next) {
|
708
|
+
case 0:
|
709
|
+
fileName = name;
|
740
710
|
|
741
|
-
|
742
|
-
|
711
|
+
if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
|
712
|
+
}
|
743
713
|
|
744
|
-
|
714
|
+
this.view.topoClient.exportImage(fileName);
|
745
715
|
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
}
|
716
|
+
case 3:
|
717
|
+
case "end":
|
718
|
+
return _context16.stop();
|
750
719
|
}
|
751
720
|
}, _callee16, this);
|
752
721
|
}));
|
@@ -767,12 +736,10 @@ var Topo = /*#__PURE__*/function () {
|
|
767
736
|
_proto.switchToViewMode = /*#__PURE__*/function () {
|
768
737
|
var _switchToViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {
|
769
738
|
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
770
|
-
while (1) {
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
return _context17.stop();
|
775
|
-
}
|
739
|
+
while (1) switch (_context17.prev = _context17.next) {
|
740
|
+
case 0:
|
741
|
+
case "end":
|
742
|
+
return _context17.stop();
|
776
743
|
}
|
777
744
|
}, _callee17);
|
778
745
|
}));
|
@@ -787,12 +754,10 @@ var Topo = /*#__PURE__*/function () {
|
|
787
754
|
_proto.switchToEditMode = /*#__PURE__*/function () {
|
788
755
|
var _switchToEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18() {
|
789
756
|
return _regenerator["default"].wrap(function _callee18$(_context18) {
|
790
|
-
while (1) {
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
return _context18.stop();
|
795
|
-
}
|
757
|
+
while (1) switch (_context18.prev = _context18.next) {
|
758
|
+
case 0:
|
759
|
+
case "end":
|
760
|
+
return _context18.stop();
|
796
761
|
}
|
797
762
|
}, _callee18);
|
798
763
|
}));
|