@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
@@ -24,20 +24,19 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "11.0.
|
27
|
+
var version = typeof "11.0.31" === 'string' ? "11.0.31" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
31
31
|
*/
|
32
32
|
|
33
33
|
var Topo = /*#__PURE__*/function () {
|
34
|
+
/**
|
35
|
+
* @type TopoGraphView
|
36
|
+
*/
|
34
37
|
function Topo(options) {
|
35
38
|
this.options = void 0;
|
36
39
|
this.id = void 0;
|
37
|
-
|
38
|
-
/**
|
39
|
-
* @type TopoGraphView
|
40
|
-
*/
|
41
40
|
this.view = void 0;
|
42
41
|
this.alarm = new Alarm();
|
43
42
|
this.store = void 0;
|
@@ -99,18 +98,20 @@ var Topo = /*#__PURE__*/function () {
|
|
99
98
|
var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
100
99
|
var topoDispatchers;
|
101
100
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
102
|
-
while (1)
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
101
|
+
while (1) {
|
102
|
+
switch (_context.prev = _context.next) {
|
103
|
+
case 0:
|
104
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
105
|
+
_context.next = 3;
|
106
|
+
return topoDispatchers.exit();
|
107
|
+
|
108
|
+
case 3:
|
109
|
+
this.destroy();
|
110
|
+
|
111
|
+
case 4:
|
112
|
+
case "end":
|
113
|
+
return _context.stop();
|
114
|
+
}
|
114
115
|
}
|
115
116
|
}, _callee, this);
|
116
117
|
}));
|
@@ -127,27 +128,29 @@ var Topo = /*#__PURE__*/function () {
|
|
127
128
|
var _data$groups, groups, _data$nodes, nodes, links, lines, topoDispatchers;
|
128
129
|
|
129
130
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
130
|
-
while (1)
|
131
|
-
|
132
|
-
|
133
|
-
options
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
131
|
+
while (1) {
|
132
|
+
switch (_context2.prev = _context2.next) {
|
133
|
+
case 0:
|
134
|
+
if (options === void 0) {
|
135
|
+
options = {};
|
136
|
+
}
|
137
|
+
|
138
|
+
_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;
|
139
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
140
|
+
_context2.next = 5;
|
141
|
+
return topoDispatchers.openTopoPage(_extends({
|
142
|
+
data: _extends({}, data, {
|
143
|
+
groups: groups,
|
144
|
+
nodes: nodes,
|
145
|
+
links: links || lines || [],
|
146
|
+
linkGroups: data.linkGroups || data.lineGroups || []
|
147
|
+
})
|
148
|
+
}, options));
|
149
|
+
|
150
|
+
case 5:
|
151
|
+
case "end":
|
152
|
+
return _context2.stop();
|
153
|
+
}
|
151
154
|
}
|
152
155
|
}, _callee2, this);
|
153
156
|
}));
|
@@ -162,10 +165,12 @@ var Topo = /*#__PURE__*/function () {
|
|
162
165
|
_proto.clear = /*#__PURE__*/function () {
|
163
166
|
var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
164
167
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
165
|
-
while (1)
|
166
|
-
|
167
|
-
|
168
|
-
|
168
|
+
while (1) {
|
169
|
+
switch (_context3.prev = _context3.next) {
|
170
|
+
case 0:
|
171
|
+
case "end":
|
172
|
+
return _context3.stop();
|
173
|
+
}
|
169
174
|
}
|
170
175
|
}, _callee3);
|
171
176
|
}));
|
@@ -235,28 +240,30 @@ var Topo = /*#__PURE__*/function () {
|
|
235
240
|
var _data$groups2, groups, _data$nodes2, nodes, links, lines;
|
236
241
|
|
237
242
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
238
|
-
while (1)
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
243
|
+
while (1) {
|
244
|
+
switch (_context4.prev = _context4.next) {
|
245
|
+
case 0:
|
246
|
+
_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;
|
247
|
+
this.view.topoClient.updateElements(cloneDeep({
|
248
|
+
groups: formatGroups(groups),
|
249
|
+
nodes: nodes.map(function (node) {
|
250
|
+
return _extends({}, node, {
|
251
|
+
type: 'node',
|
252
|
+
dtype: 'device'
|
253
|
+
});
|
254
|
+
}),
|
255
|
+
links: (links || lines || []).map(function (link) {
|
256
|
+
return _extends({}, link, {
|
257
|
+
type: 'link',
|
258
|
+
dtype: 'link'
|
259
|
+
});
|
260
|
+
})
|
261
|
+
})); // TODO 更新store,触发属性、指标模型加载,更新指标
|
262
|
+
|
263
|
+
case 2:
|
264
|
+
case "end":
|
265
|
+
return _context4.stop();
|
266
|
+
}
|
260
267
|
}
|
261
268
|
}, _callee4, this);
|
262
269
|
}));
|
@@ -280,18 +287,20 @@ var Topo = /*#__PURE__*/function () {
|
|
280
287
|
var _addElements = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(elements) {
|
281
288
|
var data;
|
282
289
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
283
|
-
while (1)
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
290
|
+
while (1) {
|
291
|
+
switch (_context5.prev = _context5.next) {
|
292
|
+
case 0:
|
293
|
+
data = {
|
294
|
+
groups: [].concat(this.getGroups(), elements.groups || []),
|
295
|
+
nodes: [].concat(this.getNodes(), elements.nodes || []),
|
296
|
+
lines: [].concat(this.getLines(), elements.lines || [])
|
297
|
+
};
|
298
|
+
this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
|
299
|
+
|
300
|
+
case 2:
|
301
|
+
case "end":
|
302
|
+
return _context5.stop();
|
303
|
+
}
|
295
304
|
}
|
296
305
|
}, _callee5, this);
|
297
306
|
}));
|
@@ -314,13 +323,15 @@ var Topo = /*#__PURE__*/function () {
|
|
314
323
|
function () {
|
315
324
|
var _updateData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data) {
|
316
325
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
317
|
-
while (1)
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
326
|
+
while (1) {
|
327
|
+
switch (_context6.prev = _context6.next) {
|
328
|
+
case 0:
|
329
|
+
this.updateElements(data);
|
330
|
+
|
331
|
+
case 1:
|
332
|
+
case "end":
|
333
|
+
return _context6.stop();
|
334
|
+
}
|
324
335
|
}
|
325
336
|
}, _callee6, this);
|
326
337
|
}));
|
@@ -351,21 +362,23 @@ var Topo = /*#__PURE__*/function () {
|
|
351
362
|
var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, mode) {
|
352
363
|
var lastId;
|
353
364
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
354
|
-
while (1)
|
355
|
-
|
356
|
-
|
365
|
+
while (1) {
|
366
|
+
switch (_context7.prev = _context7.next) {
|
367
|
+
case 0:
|
368
|
+
rlog.info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
|
357
369
|
|
358
|
-
|
359
|
-
|
370
|
+
lastId = this.id;
|
371
|
+
this.id = id;
|
360
372
|
|
361
|
-
|
362
|
-
|
363
|
-
|
373
|
+
if (lastId && id !== lastId) {
|
374
|
+
this.alarm.close();
|
375
|
+
} // 加载新拓扑图
|
364
376
|
|
365
377
|
|
366
|
-
|
367
|
-
|
368
|
-
|
378
|
+
case 4:
|
379
|
+
case "end":
|
380
|
+
return _context7.stop();
|
381
|
+
}
|
369
382
|
}
|
370
383
|
}, _callee7, this);
|
371
384
|
}));
|
@@ -380,24 +393,26 @@ var Topo = /*#__PURE__*/function () {
|
|
380
393
|
_proto.close = /*#__PURE__*/function () {
|
381
394
|
var _close = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
382
395
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
383
|
-
while (1)
|
384
|
-
|
385
|
-
|
396
|
+
while (1) {
|
397
|
+
switch (_context8.prev = _context8.next) {
|
398
|
+
case 0:
|
399
|
+
rlog.info('关闭拓扑图', this.id);
|
386
400
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
401
|
+
if (this.id) {
|
402
|
+
_context8.next = 3;
|
403
|
+
break;
|
404
|
+
}
|
391
405
|
|
392
|
-
|
406
|
+
return _context8.abrupt("return");
|
393
407
|
|
394
|
-
|
395
|
-
|
396
|
-
|
408
|
+
case 3:
|
409
|
+
this.alarm.close();
|
410
|
+
this.id = null;
|
397
411
|
|
398
|
-
|
399
|
-
|
400
|
-
|
412
|
+
case 5:
|
413
|
+
case "end":
|
414
|
+
return _context8.stop();
|
415
|
+
}
|
401
416
|
}
|
402
417
|
}, _callee8, this);
|
403
418
|
}));
|
@@ -412,10 +427,12 @@ var Topo = /*#__PURE__*/function () {
|
|
412
427
|
_proto.refresh = /*#__PURE__*/function () {
|
413
428
|
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
414
429
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
415
|
-
while (1)
|
416
|
-
|
417
|
-
|
418
|
-
|
430
|
+
while (1) {
|
431
|
+
switch (_context9.prev = _context9.next) {
|
432
|
+
case 0:
|
433
|
+
case "end":
|
434
|
+
return _context9.stop();
|
435
|
+
}
|
419
436
|
}
|
420
437
|
}, _callee9);
|
421
438
|
}));
|
@@ -455,10 +472,12 @@ var Topo = /*#__PURE__*/function () {
|
|
455
472
|
_proto.openViewMode = /*#__PURE__*/function () {
|
456
473
|
var _openViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id) {
|
457
474
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
458
|
-
while (1)
|
459
|
-
|
460
|
-
|
461
|
-
|
475
|
+
while (1) {
|
476
|
+
switch (_context10.prev = _context10.next) {
|
477
|
+
case 0:
|
478
|
+
case "end":
|
479
|
+
return _context10.stop();
|
480
|
+
}
|
462
481
|
}
|
463
482
|
}, _callee10);
|
464
483
|
}));
|
@@ -485,13 +504,15 @@ var Topo = /*#__PURE__*/function () {
|
|
485
504
|
_proto.onTopoDataLoaded = /*#__PURE__*/function () {
|
486
505
|
var _onTopoDataLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(topoData) {
|
487
506
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
488
|
-
while (1)
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
507
|
+
while (1) {
|
508
|
+
switch (_context11.prev = _context11.next) {
|
509
|
+
case 0:
|
510
|
+
this.pluginManager.onTopoDataLoaded(topoData);
|
511
|
+
|
512
|
+
case 1:
|
513
|
+
case "end":
|
514
|
+
return _context11.stop();
|
515
|
+
}
|
495
516
|
}
|
496
517
|
}, _callee11, this);
|
497
518
|
}));
|
@@ -513,53 +534,55 @@ var Topo = /*#__PURE__*/function () {
|
|
513
534
|
var _enterEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
514
535
|
var topoDispatchers, iconManageDispatchers;
|
515
536
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
516
|
-
while (1)
|
517
|
-
|
518
|
-
|
537
|
+
while (1) {
|
538
|
+
switch (_context12.prev = _context12.next) {
|
539
|
+
case 0:
|
540
|
+
rlog.info('TopoApp.enterEditMode');
|
541
|
+
|
542
|
+
if (!this.options.onSwitchToEditModeBegin) {
|
543
|
+
_context12.next = 4;
|
544
|
+
break;
|
545
|
+
}
|
519
546
|
|
520
|
-
if (!this.options.onSwitchToEditModeBegin) {
|
521
547
|
_context12.next = 4;
|
522
|
-
|
523
|
-
}
|
548
|
+
return this.options.onSwitchToEditModeBegin(this);
|
524
549
|
|
525
|
-
|
526
|
-
|
550
|
+
case 4:
|
551
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
552
|
+
_context12.next = 7;
|
553
|
+
return topoDispatchers.update({
|
554
|
+
viewState: 'edit'
|
555
|
+
});
|
527
556
|
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
return topoDispatchers.update({
|
532
|
-
viewState: 'edit'
|
533
|
-
});
|
557
|
+
case 7:
|
558
|
+
_context12.next = 9;
|
559
|
+
return this.view.switchToEditMode();
|
534
560
|
|
535
|
-
|
536
|
-
|
537
|
-
return this.view.switchToEditMode();
|
561
|
+
case 9:
|
562
|
+
updateEdgeExpanded(this);
|
538
563
|
|
539
|
-
|
540
|
-
|
564
|
+
if (!this.options.onSwitchToEditMode) {
|
565
|
+
_context12.next = 13;
|
566
|
+
break;
|
567
|
+
}
|
541
568
|
|
542
|
-
if (!this.options.onSwitchToEditMode) {
|
543
569
|
_context12.next = 13;
|
544
|
-
|
545
|
-
}
|
546
|
-
|
547
|
-
_context12.next = 13;
|
548
|
-
return this.options.onSwitchToEditMode(this);
|
570
|
+
return this.options.onSwitchToEditMode(this);
|
549
571
|
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
572
|
+
case 13:
|
573
|
+
if (this.getDataModel()) {
|
574
|
+
// 更新节点名称显示隐藏
|
575
|
+
this.attributeMetricDisplay.updateNodesNameVisible();
|
576
|
+
} // 加载自定义上传的图标
|
555
577
|
|
556
578
|
|
557
|
-
|
558
|
-
|
579
|
+
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
580
|
+
iconManageDispatchers.loadEditorIcons();
|
559
581
|
|
560
|
-
|
561
|
-
|
562
|
-
|
582
|
+
case 16:
|
583
|
+
case "end":
|
584
|
+
return _context12.stop();
|
585
|
+
}
|
563
586
|
}
|
564
587
|
}, _callee12, this);
|
565
588
|
}));
|
@@ -575,26 +598,28 @@ var Topo = /*#__PURE__*/function () {
|
|
575
598
|
var _exitEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
576
599
|
var editDispatchers;
|
577
600
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
578
|
-
while (1)
|
579
|
-
|
580
|
-
|
581
|
-
|
601
|
+
while (1) {
|
602
|
+
switch (_context13.prev = _context13.next) {
|
603
|
+
case 0:
|
604
|
+
_context13.next = 2;
|
605
|
+
return this.view.switchToViewMode();
|
582
606
|
|
583
|
-
|
584
|
-
|
585
|
-
|
607
|
+
case 2:
|
608
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
609
|
+
editDispatchers.switchToViewMode(this.id);
|
586
610
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
611
|
+
if (!this.options.onSwitchToViewMode) {
|
612
|
+
_context13.next = 7;
|
613
|
+
break;
|
614
|
+
}
|
591
615
|
|
592
|
-
|
593
|
-
|
616
|
+
_context13.next = 7;
|
617
|
+
return this.options.onSwitchToViewMode(this);
|
594
618
|
|
595
|
-
|
596
|
-
|
597
|
-
|
619
|
+
case 7:
|
620
|
+
case "end":
|
621
|
+
return _context13.stop();
|
622
|
+
}
|
598
623
|
}
|
599
624
|
}, _callee13, this);
|
600
625
|
}));
|
@@ -615,13 +640,15 @@ var Topo = /*#__PURE__*/function () {
|
|
615
640
|
function () {
|
616
641
|
var _triggerSaveEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
617
642
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
618
|
-
while (1)
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
643
|
+
while (1) {
|
644
|
+
switch (_context14.prev = _context14.next) {
|
645
|
+
case 0:
|
646
|
+
this.view.topoClient.saveExternal();
|
647
|
+
|
648
|
+
case 1:
|
649
|
+
case "end":
|
650
|
+
return _context14.stop();
|
651
|
+
}
|
625
652
|
}
|
626
653
|
}, _callee14, this);
|
627
654
|
}));
|
@@ -642,13 +669,15 @@ var Topo = /*#__PURE__*/function () {
|
|
642
669
|
function () {
|
643
670
|
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
644
671
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
645
|
-
while (1)
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
672
|
+
while (1) {
|
673
|
+
switch (_context15.prev = _context15.next) {
|
674
|
+
case 0:
|
675
|
+
this.triggerSaveEvent();
|
676
|
+
|
677
|
+
case 1:
|
678
|
+
case "end":
|
679
|
+
return _context15.stop();
|
680
|
+
}
|
652
681
|
}
|
653
682
|
}, _callee15, this);
|
654
683
|
}));
|
@@ -672,18 +701,20 @@ var Topo = /*#__PURE__*/function () {
|
|
672
701
|
var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(name) {
|
673
702
|
var fileName;
|
674
703
|
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
675
|
-
while (1)
|
676
|
-
|
677
|
-
|
704
|
+
while (1) {
|
705
|
+
switch (_context16.prev = _context16.next) {
|
706
|
+
case 0:
|
707
|
+
fileName = name;
|
678
708
|
|
679
|
-
|
680
|
-
|
709
|
+
if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
|
710
|
+
}
|
681
711
|
|
682
|
-
|
712
|
+
this.view.topoClient.exportImage(fileName);
|
683
713
|
|
684
|
-
|
685
|
-
|
686
|
-
|
714
|
+
case 3:
|
715
|
+
case "end":
|
716
|
+
return _context16.stop();
|
717
|
+
}
|
687
718
|
}
|
688
719
|
}, _callee16, this);
|
689
720
|
}));
|
@@ -704,10 +735,12 @@ var Topo = /*#__PURE__*/function () {
|
|
704
735
|
_proto.switchToViewMode = /*#__PURE__*/function () {
|
705
736
|
var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
706
737
|
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
707
|
-
while (1)
|
708
|
-
|
709
|
-
|
710
|
-
|
738
|
+
while (1) {
|
739
|
+
switch (_context17.prev = _context17.next) {
|
740
|
+
case 0:
|
741
|
+
case "end":
|
742
|
+
return _context17.stop();
|
743
|
+
}
|
711
744
|
}
|
712
745
|
}, _callee17);
|
713
746
|
}));
|
@@ -722,10 +755,12 @@ var Topo = /*#__PURE__*/function () {
|
|
722
755
|
_proto.switchToEditMode = /*#__PURE__*/function () {
|
723
756
|
var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
724
757
|
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
725
|
-
while (1)
|
726
|
-
|
727
|
-
|
728
|
-
|
758
|
+
while (1) {
|
759
|
+
switch (_context18.prev = _context18.next) {
|
760
|
+
case 0:
|
761
|
+
case "end":
|
762
|
+
return _context18.stop();
|
763
|
+
}
|
729
764
|
}
|
730
765
|
}, _callee18);
|
731
766
|
}));
|
@@ -9,12 +9,11 @@ import Background from "./graph/Background";
|
|
9
9
|
*/
|
10
10
|
|
11
11
|
var TopoGraphView = /*#__PURE__*/function () {
|
12
|
+
/**
|
13
|
+
* @type TopoClient
|
14
|
+
*/
|
12
15
|
function TopoGraphView() {
|
13
16
|
this.store = void 0;
|
14
|
-
|
15
|
-
/**
|
16
|
-
* @type TopoClient
|
17
|
-
*/
|
18
17
|
this.topoClient = void 0;
|
19
18
|
this.background = void 0;
|
20
19
|
this.init();
|
@@ -53,13 +52,15 @@ var TopoGraphView = /*#__PURE__*/function () {
|
|
53
52
|
_proto.switchToViewMode = /*#__PURE__*/function () {
|
54
53
|
var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
55
54
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
56
|
-
while (1)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
while (1) {
|
56
|
+
switch (_context.prev = _context.next) {
|
57
|
+
case 0:
|
58
|
+
this.topoClient.exitEditMode();
|
59
|
+
|
60
|
+
case 1:
|
61
|
+
case "end":
|
62
|
+
return _context.stop();
|
63
|
+
}
|
63
64
|
}
|
64
65
|
}, _callee, this);
|
65
66
|
}));
|
@@ -74,13 +75,15 @@ var TopoGraphView = /*#__PURE__*/function () {
|
|
74
75
|
_proto.switchToEditMode = /*#__PURE__*/function () {
|
75
76
|
var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
76
77
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
77
|
-
while (1)
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
78
|
+
while (1) {
|
79
|
+
switch (_context2.prev = _context2.next) {
|
80
|
+
case 0:
|
81
|
+
this.topoClient.enterEditMode();
|
82
|
+
|
83
|
+
case 1:
|
84
|
+
case "end":
|
85
|
+
return _context2.stop();
|
86
|
+
}
|
84
87
|
}
|
85
88
|
}, _callee2, this);
|
86
89
|
}));
|