@riil-frontend/component-topology 7.0.9 → 8.0.0-a.10
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/index.css +1 -1
- package/build/index.js +13 -13
- package/es/components/BatchAttrMetric/setting.js +0 -2
- package/es/core/common/icons/basicIcons.js +57 -0
- package/es/core/common/icons/icon.js +4 -6
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +5 -11
- package/es/core/components/ResourceViewAttributeSetting/nodeCiTypeAttrUtil.js +121 -0
- package/es/core/components/TopoView/GraphViewPanel.js +1 -2
- package/es/core/components/TopoView/topoView.js +3 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +42 -24
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +7 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +4 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -3
- package/es/core/hooks/useTopoEdit.js +35 -127
- package/es/core/models/AttributeMetricDisplay.js +4 -4
- package/es/core/models/TopoApp.js +2 -2
- package/es/core/models/tagstips/ElementTagTipConfig.js +18 -10
- package/es/core/models/topoData.js +9 -1
- package/es/core/models/utils/linkUtils.js +53 -91
- package/es/core/services/topo/basic.js +34 -0
- package/es/core/services/topo/constants.js +1 -0
- package/es/core/services/topo/index.js +4 -0
- package/es/core/store/models/topoBizMod.js +1 -11
- package/es/core/store/models/topoConfig.js +6 -7
- package/es/core/store/models/topoMod.js +74 -50
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +1 -1
- package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +4 -0
- package/es/networkTopo/getTopoData.js +72 -64
- package/es/networkTopo/models/TopoCenter.js +14 -94
- package/es/networkTopo/services/topo/basic.js +30 -10
- package/es/networkTopo/store/linkManager.js +0 -1
- package/es/networkTopo/store/topoCenter.js +0 -1
- package/es/networkTopo/store/topoLinkMod.js +0 -1
- package/es/networkTopo/utils/resourcePermissionUtil.js +2 -2
- package/es/utils/topoData.js +4 -169
- package/lib/components/BatchAttrMetric/setting.js +0 -4
- package/lib/core/common/icons/basicIcons.js +62 -0
- package/lib/core/common/icons/icon.js +5 -7
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +6 -11
- package/lib/core/components/ResourceViewAttributeSetting/nodeCiTypeAttrUtil.js +127 -0
- package/lib/core/components/TopoView/GraphViewPanel.js +1 -2
- package/lib/core/components/TopoView/topoView.js +4 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +43 -24
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +4 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -3
- package/lib/core/hooks/useTopoEdit.js +35 -129
- package/lib/core/models/AttributeMetricDisplay.js +4 -4
- package/lib/core/models/TopoApp.js +3 -3
- package/lib/core/models/tagstips/ElementTagTipConfig.js +19 -11
- package/lib/core/models/topoData.js +9 -1
- package/lib/core/models/utils/linkUtils.js +52 -93
- package/lib/core/services/topo/basic.js +46 -0
- package/lib/core/services/topo/constants.js +6 -0
- package/lib/core/services/topo/index.js +16 -0
- package/lib/core/store/models/topoBizMod.js +1 -11
- package/lib/core/store/models/topoConfig.js +5 -6
- package/lib/core/store/models/topoMod.js +71 -48
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +1 -1
- package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +4 -0
- package/lib/networkTopo/getTopoData.js +73 -65
- package/lib/networkTopo/models/TopoCenter.js +14 -94
- package/lib/networkTopo/services/topo/basic.js +30 -10
- package/lib/networkTopo/store/linkManager.js +0 -2
- package/lib/networkTopo/store/topoCenter.js +0 -2
- package/lib/networkTopo/store/topoLinkMod.js +0 -2
- package/lib/networkTopo/utils/resourcePermissionUtil.js +2 -2
- package/lib/utils/topoData.js +6 -172
- package/package.json +2 -2
- /package/es/core/services/{topo.js → topo/tagtip.js} +0 -0
- /package/lib/core/services/{topo.js → topo/tagtip.js} +0 -0
@@ -1,18 +1,19 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import moment from
|
5
|
-
import topoService from
|
6
|
-
import rlog from
|
4
|
+
import moment from 'moment';
|
5
|
+
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
6
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
7
7
|
import { combTopoData, getCiTypes, parseTopoData } from "../../../utils/topoData";
|
8
8
|
import { loopTreeByKey } from "../../../utils/tree";
|
9
|
-
import topoPermissonUtil from "../../../utils/topoPermissionUtil";
|
9
|
+
import topoPermissonUtil from "../../../utils/topoPermissionUtil";
|
10
|
+
import { addLinkData } from "../../../networkTopo/getTopoData"; // const clone = (data) => JSON.parse(JSON.stringify(data));
|
10
11
|
|
11
12
|
export default function (topoApp) {
|
12
13
|
return {
|
13
14
|
state: {
|
14
15
|
loading: true,
|
15
|
-
viewState:
|
16
|
+
viewState: 'view',
|
16
17
|
// view, create, 2种模式
|
17
18
|
graphLoaded: false,
|
18
19
|
graphLoaded2: false,
|
@@ -21,7 +22,7 @@ export default function (topoApp) {
|
|
21
22
|
initParams: {},
|
22
23
|
topoLoadError: false,
|
23
24
|
id: undefined,
|
24
|
-
topoId:
|
25
|
+
topoId: '',
|
25
26
|
type: undefined,
|
26
27
|
// 拓扑类型
|
27
28
|
currentTopo: undefined,
|
@@ -65,8 +66,8 @@ export default function (topoApp) {
|
|
65
66
|
|
66
67
|
topoModState = rootState.topoMod; // 处理URL参数
|
67
68
|
|
68
|
-
type = params.type ||
|
69
|
-
id = params.id || topoModState.topoId ||
|
69
|
+
type = params.type || 'view';
|
70
|
+
id = params.id || topoModState.topoId || '';
|
70
71
|
rlog.debug("topoMod.init \u521D\u59CB\u5316(" + id + ")...", {
|
71
72
|
params: params,
|
72
73
|
rootState: rootState
|
@@ -99,7 +100,7 @@ export default function (topoApp) {
|
|
99
100
|
loading: false
|
100
101
|
});
|
101
102
|
|
102
|
-
rlog.debug(
|
103
|
+
rlog.debug('topoMod.initTopoCenter 初始化完成', {
|
103
104
|
rootState: rootState
|
104
105
|
});
|
105
106
|
|
@@ -144,7 +145,7 @@ export default function (topoApp) {
|
|
144
145
|
switch (_context2.prev = _context2.next) {
|
145
146
|
case 0:
|
146
147
|
id = playload.id, data = playload.data, linkTo = playload.linkTo;
|
147
|
-
viewState = playload.mode || playload.viewState ||
|
148
|
+
viewState = playload.mode || playload.viewState || 'view';
|
148
149
|
topoId = id || data.config.id;
|
149
150
|
|
150
151
|
_this2.update({
|
@@ -164,7 +165,7 @@ export default function (topoApp) {
|
|
164
165
|
});
|
165
166
|
|
166
167
|
case 6:
|
167
|
-
if (viewState ===
|
168
|
+
if (viewState === 'edit') {
|
168
169
|
// TODO 待优化进入编辑模式方式
|
169
170
|
_this2.enterEditMode();
|
170
171
|
}
|
@@ -191,7 +192,7 @@ export default function (topoApp) {
|
|
191
192
|
this.update({
|
192
193
|
graphLoaded: false,
|
193
194
|
graphLoaded2: false,
|
194
|
-
topoId:
|
195
|
+
topoId: '',
|
195
196
|
topoData: null,
|
196
197
|
currentTopo: undefined,
|
197
198
|
data: null,
|
@@ -201,7 +202,7 @@ export default function (topoApp) {
|
|
201
202
|
},
|
202
203
|
switchToViewMode: function switchToViewMode(playload, rootState) {
|
203
204
|
this.update({
|
204
|
-
viewState:
|
205
|
+
viewState: 'view'
|
205
206
|
});
|
206
207
|
},
|
207
208
|
enterEditMode: function enterEditMode(playload, rootState) {
|
@@ -225,7 +226,7 @@ export default function (topoApp) {
|
|
225
226
|
if (!topoId) {
|
226
227
|
// 查找第一个
|
227
228
|
treeData = rootState.topoTreeMod.treeData;
|
228
|
-
loopTreeByKey(treeData,
|
229
|
+
loopTreeByKey(treeData, 'type', 1, function (item, index, arr) {
|
229
230
|
if (!topoId) {
|
230
231
|
topoId = item.id;
|
231
232
|
}
|
@@ -302,7 +303,7 @@ export default function (topoApp) {
|
|
302
303
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
303
304
|
var _result$config;
|
304
305
|
|
305
|
-
var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig, _yield$Promise$all, ciTypeMap, customIcons, xxx, extraConfig, _combTopoData, topoData, resAndMetrics, endTime;
|
306
|
+
var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig, _yield$Promise$all, ciTypeMap, customIcons, xxx, extraConfig, _combTopoData, topoData, resAndMetrics, _yield$Promise$all2, newData, endTime;
|
306
307
|
|
307
308
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
308
309
|
while (1) {
|
@@ -335,25 +336,28 @@ export default function (topoApp) {
|
|
335
336
|
|
336
337
|
_this5.update(startState);
|
337
338
|
|
339
|
+
dispatch.topoBizMod.update({
|
340
|
+
pollingSwitch: false
|
341
|
+
});
|
338
342
|
topoApp.options.onLoadStart(); // TODO 待移到拓扑中心
|
339
343
|
|
340
|
-
permission =
|
344
|
+
permission = 'write';
|
341
345
|
|
342
346
|
if (!topoApp.options.usePermission) {
|
343
|
-
_context6.next =
|
347
|
+
_context6.next = 19;
|
344
348
|
break;
|
345
349
|
}
|
346
350
|
|
347
|
-
_context6.next =
|
351
|
+
_context6.next = 14;
|
348
352
|
return _this5.getTopoPermission({
|
349
353
|
id: topoId
|
350
354
|
});
|
351
355
|
|
352
|
-
case
|
356
|
+
case 14:
|
353
357
|
permission = _context6.sent;
|
354
358
|
|
355
359
|
if (topoPermissonUtil.isReadable(permission)) {
|
356
|
-
_context6.next =
|
360
|
+
_context6.next = 19;
|
357
361
|
break;
|
358
362
|
}
|
359
363
|
|
@@ -368,23 +372,23 @@ export default function (topoApp) {
|
|
368
372
|
topoApp.options.onLoad();
|
369
373
|
return _context6.abrupt("return");
|
370
374
|
|
371
|
-
case
|
375
|
+
case 19:
|
372
376
|
if (!data) {
|
373
|
-
_context6.next =
|
377
|
+
_context6.next = 30;
|
374
378
|
break;
|
375
379
|
}
|
376
380
|
|
377
381
|
graphConfig = {};
|
378
382
|
|
379
383
|
if (!topoId) {
|
380
|
-
_context6.next =
|
384
|
+
_context6.next = 27;
|
381
385
|
break;
|
382
386
|
}
|
383
387
|
|
384
|
-
_context6.next =
|
388
|
+
_context6.next = 24;
|
385
389
|
return topoService.getTopoData(topoId);
|
386
390
|
|
387
|
-
case
|
391
|
+
case 24:
|
388
392
|
topoConfig = _context6.sent;
|
389
393
|
if (!topoConfig) rlog.error("\u672A\u67E5\u8BE2\u5230\u62D3\u6251id " + topoId + " \u7684\u6570\u636E\uFF0C\u8BF7\u68C0\u67E5");
|
390
394
|
graphConfig = {
|
@@ -393,21 +397,21 @@ export default function (topoApp) {
|
|
393
397
|
serialize: topoConfig === null || topoConfig === void 0 ? void 0 : topoConfig.serialize
|
394
398
|
};
|
395
399
|
|
396
|
-
case
|
400
|
+
case 27:
|
397
401
|
result = _extends({}, data, graphConfig);
|
398
|
-
_context6.next =
|
402
|
+
_context6.next = 33;
|
399
403
|
break;
|
400
404
|
|
401
|
-
case
|
402
|
-
_context6.next =
|
405
|
+
case 30:
|
406
|
+
_context6.next = 32;
|
403
407
|
return topoApp.options.loadData(topoId, topoApp.serverApi);
|
404
408
|
|
405
|
-
case
|
409
|
+
case 32:
|
406
410
|
result = _context6.sent;
|
407
411
|
|
408
|
-
case
|
412
|
+
case 33:
|
409
413
|
if (result) {
|
410
|
-
_context6.next =
|
414
|
+
_context6.next = 37;
|
411
415
|
break;
|
412
416
|
}
|
413
417
|
|
@@ -422,19 +426,19 @@ export default function (topoApp) {
|
|
422
426
|
topoApp.options.onLoad();
|
423
427
|
return _context6.abrupt("return");
|
424
428
|
|
425
|
-
case
|
429
|
+
case 37:
|
426
430
|
result = parseTopoData(result);
|
427
|
-
rlog.debug(
|
428
|
-
_context6.next =
|
429
|
-
return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(result)),
|
431
|
+
rlog.debug('topoMod.initTopoData 查询数据完成', topoId, linkTo, result);
|
432
|
+
_context6.next = 41;
|
433
|
+
return Promise.all([// topoApp.ciTyeCache.getCiTypeMap(getCiTypes(result)),
|
434
|
+
dispatch.customIcon.loadCustomIcons() // topoApp.elementTagTipConfig.init(result), // 暂停新配置开发
|
430
435
|
]);
|
431
436
|
|
432
|
-
case
|
437
|
+
case 41:
|
433
438
|
_yield$Promise$all = _context6.sent;
|
434
439
|
ciTypeMap = _yield$Promise$all[0];
|
435
440
|
customIcons = _yield$Promise$all[1];
|
436
441
|
xxx = _yield$Promise$all[2];
|
437
|
-
rlog.debug("topoMod.initTopoData Ci属性指标元数据", ciTypeMap);
|
438
442
|
extraConfig = result.global.extraConfig;
|
439
443
|
_context6.next = 48;
|
440
444
|
return dispatch.displayConfig.setConfig(_extends({}, extraConfig, {
|
@@ -447,13 +451,11 @@ export default function (topoApp) {
|
|
447
451
|
engine: topoApp,
|
448
452
|
data: result,
|
449
453
|
linkTo: linkTo,
|
450
|
-
globalConfig: extraConfig
|
451
|
-
ciTypeMap: ciTypeMap,
|
452
|
-
permission: permission
|
454
|
+
globalConfig: extraConfig
|
453
455
|
}), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics; // rlog.debug("topoMod.initTopoData combTopoData", { topoData, resAndMetrics, });
|
454
456
|
|
455
|
-
|
456
|
-
|
457
|
+
_context6.next = 51;
|
458
|
+
return _this5.update({
|
457
459
|
currentTopo: topoData.config,
|
458
460
|
data: result,
|
459
461
|
globalConfig: extraConfig,
|
@@ -462,16 +464,38 @@ export default function (topoApp) {
|
|
462
464
|
resAndMetrics: resAndMetrics
|
463
465
|
});
|
464
466
|
|
467
|
+
case 51:
|
465
468
|
dispatch.topoBizMod.combBatchCiInfo(resAndMetrics);
|
466
469
|
dispatch.background.init(extraConfig); // TODO 优化打开拓扑图显示告警速度:打开拓扑图立即请求告警
|
467
470
|
|
468
|
-
topoApp.alarm.open();
|
471
|
+
topoApp.alarm.open(); // 加载标注悬浮框数据
|
472
|
+
|
473
|
+
_context6.next = 56;
|
474
|
+
return Promise.all([addLinkData(result), topoApp.ciTyeCache.getCiTypeMap(getCiTypes(result)), topoApp.elementTagTipConfig.init(result) // 暂停新配置开发
|
475
|
+
]);
|
476
|
+
|
477
|
+
case 56:
|
478
|
+
_yield$Promise$all2 = _context6.sent;
|
479
|
+
newData = _yield$Promise$all2[0];
|
480
|
+
_context6.next = 60;
|
481
|
+
return _this5.update({
|
482
|
+
data: newData
|
483
|
+
});
|
484
|
+
|
485
|
+
case 60:
|
486
|
+
dispatch.topoBizMod.update({
|
487
|
+
pollingSwitch: true
|
488
|
+
});
|
469
489
|
topoApp.onTopoDataLoaded(topoData);
|
470
490
|
endTime = moment();
|
471
|
-
rlog.info(
|
491
|
+
rlog.info('topoMod.initTopoData 初始化拓扑图数据完成. 耗时: ', endTime.diff(startTime, 'seconds', true));
|
472
492
|
topoApp.options.onLoad();
|
473
493
|
|
474
|
-
|
494
|
+
_this5.update({
|
495
|
+
loading: false
|
496
|
+
});
|
497
|
+
|
498
|
+
case 66:
|
475
499
|
case "end":
|
476
500
|
return _context6.stop();
|
477
501
|
}
|
@@ -527,13 +551,13 @@ export default function (topoApp) {
|
|
527
551
|
}
|
528
552
|
|
529
553
|
if (conditions.id === state.topoMod.topoId) {
|
530
|
-
if (conditions.type ===
|
554
|
+
if (conditions.type === 'delete') {
|
531
555
|
_this7.update({
|
532
556
|
topoId: conditions.defId
|
533
557
|
});
|
534
558
|
}
|
535
559
|
|
536
|
-
if (conditions.type ===
|
560
|
+
if (conditions.type === 'rename') {
|
537
561
|
td = _extends({}, state.topoMod.topoData, {
|
538
562
|
config: _extends({}, state.topoMod.topoData.config, {
|
539
563
|
name: conditions.name
|
@@ -577,10 +601,10 @@ export default function (topoApp) {
|
|
577
601
|
switch (_context10.prev = _context10.next) {
|
578
602
|
case 0:
|
579
603
|
if (conditions === void 0) {
|
580
|
-
conditions =
|
604
|
+
conditions = '';
|
581
605
|
}
|
582
606
|
|
583
|
-
rlog.debug(
|
607
|
+
rlog.debug('updateDelId', conditions);
|
584
608
|
|
585
609
|
case 2:
|
586
610
|
case "end":
|
@@ -525,7 +525,7 @@ export default function ResourceOverview(props) {
|
|
525
525
|
ciType: ciType,
|
526
526
|
type: type,
|
527
527
|
// name: '123'
|
528
|
-
name: props.name
|
528
|
+
name: props.name ? props.name : props.resourceData.attributes.name
|
529
529
|
}; // 基本信息设置改变
|
530
530
|
|
531
531
|
function baseInfoColChange(_x5) {
|
@@ -1,11 +1,25 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import { getLinksDetail } from "../core/models/utils/linkUtils";
|
5
5
|
import { addTopoDataResourcePermission } from "./utils/resourcePermissionUtil"; // import "./utils/__tests__/resourcePermissionUtil.test";
|
6
|
+
// 过滤掉无两端节点数据的链路
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
function filterLinkNoSourceTarget(data) {
|
9
|
+
var links = (data.links || []).filter(function (link) {
|
10
|
+
var sourceNode = (data.nodes || []).find(function (node) {
|
11
|
+
return node.id === link.source;
|
12
|
+
});
|
13
|
+
|
14
|
+
if (link.source && !sourceNode) {
|
15
|
+
return false;
|
16
|
+
}
|
17
|
+
|
18
|
+
return true;
|
19
|
+
});
|
20
|
+
return _extends({}, data, {
|
21
|
+
links: links
|
22
|
+
});
|
9
23
|
}
|
10
24
|
/**
|
11
25
|
* 修正告警配置。因为:接口返回值没有全局告警配置时,返回null,代表开启
|
@@ -13,42 +27,65 @@ export function addLinkData(_x, _x2) {
|
|
13
27
|
* @returns
|
14
28
|
*/
|
15
29
|
|
30
|
+
|
31
|
+
function fixAlarmConfig(data) {
|
32
|
+
var _data$global = data.global,
|
33
|
+
alarmSwitch = _data$global.alarmSwitch,
|
34
|
+
alarmListDefaultOpen = _data$global.alarmListDefaultOpen;
|
35
|
+
return _extends({}, data, {
|
36
|
+
global: _extends({}, data.global, {
|
37
|
+
alarmSwitch: alarmSwitch === null ? true : alarmSwitch,
|
38
|
+
alarmListDefaultOpen: alarmListDefaultOpen === null ? true : alarmListDefaultOpen
|
39
|
+
})
|
40
|
+
});
|
41
|
+
} // 修正容器找不到时groupId设为空
|
42
|
+
|
43
|
+
|
44
|
+
function fixNodeGroupId(data) {
|
45
|
+
var nodes = (data.nodes || [] // 修正容器找不到时groupId设为空
|
46
|
+
).map(function (node) {
|
47
|
+
var groupExisted = !!(data.groups || []).filter(function (g) {
|
48
|
+
return g.id === node.groupId;
|
49
|
+
}).length;
|
50
|
+
return _extends({}, node, {
|
51
|
+
groupId: groupExisted ? node.groupId : null
|
52
|
+
});
|
53
|
+
});
|
54
|
+
return _extends({}, data, {
|
55
|
+
nodes: nodes
|
56
|
+
});
|
57
|
+
}
|
58
|
+
|
59
|
+
export function addLinkData(_x) {
|
60
|
+
return _addLinkData.apply(this, arguments);
|
61
|
+
} // FIXME 业务拓扑不需要链路相关逻辑
|
62
|
+
|
16
63
|
function _addLinkData() {
|
17
|
-
_addLinkData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(
|
18
|
-
var links, networkLinks, otherLinks;
|
64
|
+
_addLinkData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
65
|
+
var links, nodes, networkLinks, otherLinks;
|
19
66
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
20
67
|
while (1) {
|
21
68
|
switch (_context.prev = _context.next) {
|
22
69
|
case 0:
|
23
|
-
|
24
|
-
|
25
|
-
var sourceNode = nodes.find(function (node) {
|
26
|
-
return node.id === link.source;
|
27
|
-
});
|
28
|
-
|
29
|
-
if (link.source && !sourceNode) {
|
30
|
-
return false;
|
31
|
-
}
|
32
|
-
|
33
|
-
return true;
|
34
|
-
}); // 如果是网络链路,补充详情信息
|
70
|
+
links = data.links || [];
|
71
|
+
nodes = data.nodes || []; // 如果是网络链路,补充详情信息
|
35
72
|
|
36
|
-
_context.next =
|
73
|
+
_context.next = 4;
|
37
74
|
return getLinksDetail(links.filter(function (link) {
|
38
|
-
return
|
75
|
+
return link.ciType === 'network_link';
|
39
76
|
}), nodes);
|
40
77
|
|
41
|
-
case
|
78
|
+
case 4:
|
42
79
|
networkLinks = _context.sent;
|
43
80
|
otherLinks = links.filter(function (link) {
|
44
|
-
return
|
81
|
+
return link.ciType !== 'network_link';
|
45
82
|
});
|
46
|
-
return _context.abrupt("return", {
|
83
|
+
return _context.abrupt("return", _extends({}, data, {
|
47
84
|
links: [].concat(networkLinks, otherLinks),
|
48
85
|
linkGroups: []
|
49
|
-
});
|
86
|
+
}));
|
50
87
|
|
51
|
-
case
|
88
|
+
case 7:
|
52
89
|
case "end":
|
53
90
|
return _context.stop();
|
54
91
|
}
|
@@ -58,54 +95,25 @@ function _addLinkData() {
|
|
58
95
|
return _addLinkData.apply(this, arguments);
|
59
96
|
}
|
60
97
|
|
61
|
-
function
|
62
|
-
var _data$global = data.global,
|
63
|
-
alarmSwitch = _data$global.alarmSwitch,
|
64
|
-
alarmListDefaultOpen = _data$global.alarmListDefaultOpen;
|
65
|
-
return _extends({}, data, {
|
66
|
-
global: _extends({}, data.global, {
|
67
|
-
alarmSwitch: alarmSwitch === null ? true : alarmSwitch,
|
68
|
-
alarmListDefaultOpen: alarmListDefaultOpen === null ? true : alarmListDefaultOpen
|
69
|
-
})
|
70
|
-
});
|
71
|
-
} // FIXME 业务拓扑不需要链路相关逻辑
|
72
|
-
|
73
|
-
|
74
|
-
export function buildData(_x3) {
|
98
|
+
export function buildData(_x2) {
|
75
99
|
return _buildData.apply(this, arguments);
|
76
100
|
}
|
77
101
|
|
78
102
|
function _buildData() {
|
79
|
-
_buildData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(
|
80
|
-
var
|
81
|
-
|
103
|
+
_buildData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(oldData) {
|
104
|
+
var data;
|
82
105
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
83
106
|
while (1) {
|
84
107
|
switch (_context2.prev = _context2.next) {
|
85
108
|
case 0:
|
86
|
-
|
87
|
-
|
88
|
-
)
|
89
|
-
var groupExisted = !!(data.groups || []).filter(function (g) {
|
90
|
-
return g.id === node.groupId;
|
91
|
-
}).length;
|
92
|
-
return _extends({}, node, {
|
93
|
-
groupId: groupExisted ? node.groupId : null
|
94
|
-
});
|
95
|
-
});
|
96
|
-
_context2.next = 4;
|
97
|
-
return Promise.all([addLinkData(data.links || [], nodes)]);
|
109
|
+
data = oldData;
|
110
|
+
data = fixNodeGroupId(data);
|
111
|
+
data = filterLinkNoSourceTarget(data); // data = await addLinkData(data)
|
98
112
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
nodes: nodes
|
104
|
-
}, linkData);
|
105
|
-
newData = addTopoDataResourcePermission(newData);
|
106
|
-
return _context2.abrupt("return", newData);
|
107
|
-
|
108
|
-
case 9:
|
113
|
+
data = addTopoDataResourcePermission(data);
|
114
|
+
return _context2.abrupt("return", data);
|
115
|
+
|
116
|
+
case 5:
|
109
117
|
case "end":
|
110
118
|
return _context2.stop();
|
111
119
|
}
|
@@ -115,7 +123,7 @@ function _buildData() {
|
|
115
123
|
return _buildData.apply(this, arguments);
|
116
124
|
}
|
117
125
|
|
118
|
-
export default function getTopoData(
|
126
|
+
export default function getTopoData(_x3, _x4) {
|
119
127
|
return _getTopoData.apply(this, arguments);
|
120
128
|
}
|
121
129
|
|
@@ -30,87 +30,7 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
30
30
|
return DEFAULT_TIP_COMMON_CONFIG;
|
31
31
|
} // ExtElementTagTipBuilder: LinkTagsTipsBuilder,
|
32
32
|
|
33
|
-
}
|
34
|
-
onSwitchToEditModeBegin: function () {
|
35
|
-
var _onSwitchToEditModeBegin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topo) {
|
36
|
-
var topoDispatchers;
|
37
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
38
|
-
while (1) {
|
39
|
-
switch (_context.prev = _context.next) {
|
40
|
-
case 0:
|
41
|
-
topoDispatchers = topo.store.getModelDispatchers('topoMod'); // topoDispatchers.update({ topoData: null });
|
42
|
-
|
43
|
-
_context.next = 3;
|
44
|
-
return topoDispatchers.refreshTopo();
|
45
|
-
|
46
|
-
case 3:
|
47
|
-
case "end":
|
48
|
-
return _context.stop();
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}, _callee);
|
52
|
-
}));
|
53
|
-
|
54
|
-
function onSwitchToEditModeBegin(_x) {
|
55
|
-
return _onSwitchToEditModeBegin.apply(this, arguments);
|
56
|
-
}
|
57
|
-
|
58
|
-
return onSwitchToEditModeBegin;
|
59
|
-
}(),
|
60
|
-
onSwitchToEditMode: function () {
|
61
|
-
var _onSwitchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(topo) {
|
62
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
63
|
-
while (1) {
|
64
|
-
switch (_context2.prev = _context2.next) {
|
65
|
-
case 0:
|
66
|
-
_context2.next = 2;
|
67
|
-
return topo.resourceConfig.loadConfig();
|
68
|
-
|
69
|
-
case 2:
|
70
|
-
case "end":
|
71
|
-
return _context2.stop();
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}, _callee2);
|
75
|
-
}));
|
76
|
-
|
77
|
-
function onSwitchToEditMode(_x2) {
|
78
|
-
return _onSwitchToEditMode.apply(this, arguments);
|
79
|
-
}
|
80
|
-
|
81
|
-
return onSwitchToEditMode;
|
82
|
-
}(),
|
83
|
-
onSwitchToViewMode: function () {
|
84
|
-
var _onSwitchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(topo) {
|
85
|
-
var topoModDispatchers;
|
86
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
87
|
-
while (1) {
|
88
|
-
switch (_context3.prev = _context3.next) {
|
89
|
-
case 0:
|
90
|
-
topoModDispatchers = topo.store.getModelDispatchers('topoMod');
|
91
|
-
_context3.next = 3;
|
92
|
-
return topoModDispatchers.openTopoPage({
|
93
|
-
id: topo.id
|
94
|
-
});
|
95
|
-
|
96
|
-
case 3:
|
97
|
-
_context3.next = 5;
|
98
|
-
return topoModDispatchers.refreshTopoTree();
|
99
|
-
|
100
|
-
case 5:
|
101
|
-
case "end":
|
102
|
-
return _context3.stop();
|
103
|
-
}
|
104
|
-
}
|
105
|
-
}, _callee3);
|
106
|
-
}));
|
107
|
-
|
108
|
-
function onSwitchToViewMode(_x3) {
|
109
|
-
return _onSwitchToViewMode.apply(this, arguments);
|
110
|
-
}
|
111
|
-
|
112
|
-
return onSwitchToViewMode;
|
113
|
-
}()
|
33
|
+
}
|
114
34
|
})) || this;
|
115
35
|
_this.resourceConfig = null;
|
116
36
|
var menuCommands = createMenuCommands(_assertThisInitialized(_this));
|
@@ -131,25 +51,25 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
131
51
|
_proto.initData =
|
132
52
|
/*#__PURE__*/
|
133
53
|
function () {
|
134
|
-
var _initData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
54
|
+
var _initData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
135
55
|
var topoDispatchers;
|
136
|
-
return _regeneratorRuntime.wrap(function
|
56
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
137
57
|
while (1) {
|
138
|
-
switch (
|
58
|
+
switch (_context.prev = _context.next) {
|
139
59
|
case 0:
|
140
60
|
topoDispatchers = this.store.getModelDispatchers('topoCenter');
|
141
|
-
|
61
|
+
_context.next = 3;
|
142
62
|
return topoDispatchers.initData(params);
|
143
63
|
|
144
64
|
case 3:
|
145
65
|
case "end":
|
146
|
-
return
|
66
|
+
return _context.stop();
|
147
67
|
}
|
148
68
|
}
|
149
|
-
},
|
69
|
+
}, _callee, this);
|
150
70
|
}));
|
151
71
|
|
152
|
-
function initData(
|
72
|
+
function initData(_x) {
|
153
73
|
return _initData.apply(this, arguments);
|
154
74
|
}
|
155
75
|
|
@@ -168,22 +88,22 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
168
88
|
_proto.exit =
|
169
89
|
/*#__PURE__*/
|
170
90
|
function () {
|
171
|
-
var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
91
|
+
var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
172
92
|
var topoDispatchers;
|
173
|
-
return _regeneratorRuntime.wrap(function
|
93
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
174
94
|
while (1) {
|
175
|
-
switch (
|
95
|
+
switch (_context2.prev = _context2.next) {
|
176
96
|
case 0:
|
177
97
|
topoDispatchers = this.store.getModelDispatchers('topoCenter');
|
178
|
-
|
98
|
+
_context2.next = 3;
|
179
99
|
return topoDispatchers.exit();
|
180
100
|
|
181
101
|
case 3:
|
182
102
|
case "end":
|
183
|
-
return
|
103
|
+
return _context2.stop();
|
184
104
|
}
|
185
105
|
}
|
186
|
-
},
|
106
|
+
}, _callee2, this);
|
187
107
|
}));
|
188
108
|
|
189
109
|
function exit() {
|