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