@riil-frontend/component-topology 2.15.2 → 2.15.5
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 +23 -23
- package/es/components/collapse/Panel.module.scss +3 -0
- package/es/constants/ResourceTypeLimit.js +2 -1
- package/es/core/common/icons/networkTopoCiTypeIcons.js +2 -1
- package/es/core/models/AttributeMetricDisplay.js +126 -19
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiTyeCache.js +9 -5
- package/es/models/topoMod.js +5 -2
- package/es/topoCenter/components/editor/propertyViews/edge/link/LindInfoPreview.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/LindInfoPreview.module.scss +11 -1
- package/es/utils/topoData.js +70 -56
- package/lib/components/collapse/Panel.module.scss +3 -0
- package/lib/constants/ResourceTypeLimit.js +2 -1
- package/lib/core/common/icons/networkTopoCiTypeIcons.js +3 -1
- package/lib/core/models/AttributeMetricDisplay.js +128 -19
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiTyeCache.js +9 -5
- package/lib/models/topoMod.js +5 -2
- package/lib/topoCenter/components/editor/propertyViews/edge/link/LindInfoPreview.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/link/LindInfoPreview.module.scss +11 -1
- package/lib/utils/topoData.js +71 -57
- package/package.json +3 -3
|
@@ -15,6 +15,8 @@ var _topo = _interopRequireDefault(require("@riil-frontend/component-topology-co
|
|
|
15
15
|
|
|
16
16
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
|
17
17
|
|
|
18
|
+
var _lodash = require("lodash");
|
|
19
|
+
|
|
18
20
|
var _groupBy = _interopRequireDefault(require("lodash/groupBy"));
|
|
19
21
|
|
|
20
22
|
var _ResourceInfoDisplay = require("../../constants/ResourceInfoDisplay");
|
|
@@ -23,6 +25,8 @@ var _htElementUtils = require("../../utils/htElementUtils");
|
|
|
23
25
|
|
|
24
26
|
var _topoData = require("../../utils/topoData");
|
|
25
27
|
|
|
28
|
+
var _services = require("../services");
|
|
29
|
+
|
|
26
30
|
var _attributeFormatter = _interopRequireDefault(require("./attributeFormatter"));
|
|
27
31
|
|
|
28
32
|
var _DictCache = _interopRequireDefault(require("./cache/DictCache"));
|
|
@@ -309,23 +313,27 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
309
313
|
}
|
|
310
314
|
|
|
311
315
|
return visible;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* 根据配置执行节点名称显示隐藏
|
|
315
|
-
*/
|
|
316
|
-
;
|
|
316
|
+
};
|
|
317
317
|
|
|
318
|
-
_proto.
|
|
318
|
+
_proto.getNodesNameVisible = function getNodesNameVisible() {
|
|
319
319
|
var _this3 = this;
|
|
320
320
|
|
|
321
|
-
var dm = this.topo.getDataModel();
|
|
322
321
|
var nodes = this.topo.store.getModelState('topoMod').data.nodes;
|
|
323
|
-
nodes.map(function (node) {
|
|
322
|
+
return nodes.map(function (node) {
|
|
324
323
|
return {
|
|
325
324
|
id: node.id,
|
|
326
325
|
visible: _this3.getNodeNameVisible(node)
|
|
327
326
|
};
|
|
328
|
-
})
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* 根据配置执行节点名称显示隐藏
|
|
331
|
+
*/
|
|
332
|
+
;
|
|
333
|
+
|
|
334
|
+
_proto.updateNodesNameVisible = function updateNodesNameVisible() {
|
|
335
|
+
var dm = this.topo.getDataModel();
|
|
336
|
+
this.getNodesNameVisible().forEach(function (_ref3) {
|
|
329
337
|
var id = _ref3.id,
|
|
330
338
|
visible = _ref3.visible;
|
|
331
339
|
dm.getDataByTag(id).a('isShowName', visible);
|
|
@@ -448,25 +456,37 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
448
456
|
/*#__PURE__*/
|
|
449
457
|
function () {
|
|
450
458
|
var _loadAttributeAndMetric = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(data) {
|
|
451
|
-
var topo, bizDispatchers;
|
|
459
|
+
var topo, ciDatas, bizDispatchers;
|
|
452
460
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
453
461
|
while (1) {
|
|
454
462
|
switch (_context2.prev = _context2.next) {
|
|
455
463
|
case 0:
|
|
456
464
|
// rlog.debug('AttributeMetricDisplay.loadAttributeAndMetric', data);
|
|
457
|
-
topo = this.topo;
|
|
458
|
-
|
|
465
|
+
topo = this.topo; // 设置ciType
|
|
466
|
+
|
|
467
|
+
ciDatas = data.map(function (item) {
|
|
468
|
+
return (0, _extends2["default"])({
|
|
469
|
+
ciType: topo.dataModel.getDataById(item.id).ciType
|
|
470
|
+
}, item);
|
|
471
|
+
}); // 翻译引用属性
|
|
472
|
+
|
|
459
473
|
_context2.next = 4;
|
|
460
|
-
return
|
|
474
|
+
return this.translateRefAttribute(ciDatas);
|
|
461
475
|
|
|
462
476
|
case 4:
|
|
463
|
-
|
|
477
|
+
ciDatas = _context2.sent;
|
|
478
|
+
bizDispatchers = topo.store.getModelDispatchers('topoBizMod');
|
|
479
|
+
_context2.next = 8;
|
|
480
|
+
return bizDispatchers.setAttrsAndMetrics(ciDatas);
|
|
481
|
+
|
|
482
|
+
case 8:
|
|
483
|
+
_context2.next = 10;
|
|
464
484
|
return _DictCache["default"].init();
|
|
465
485
|
|
|
466
|
-
case
|
|
486
|
+
case 10:
|
|
467
487
|
this.updateTagsTips();
|
|
468
488
|
|
|
469
|
-
case
|
|
489
|
+
case 11:
|
|
470
490
|
case "end":
|
|
471
491
|
return _context2.stop();
|
|
472
492
|
}
|
|
@@ -480,6 +500,95 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
480
500
|
|
|
481
501
|
return loadAttributeAndMetric;
|
|
482
502
|
}()
|
|
503
|
+
/**
|
|
504
|
+
* 临时由前端翻译引用属性名称
|
|
505
|
+
* @param {*} ciDatas
|
|
506
|
+
* @returns
|
|
507
|
+
*/
|
|
508
|
+
;
|
|
509
|
+
|
|
510
|
+
_proto.translateRefAttribute =
|
|
511
|
+
/*#__PURE__*/
|
|
512
|
+
function () {
|
|
513
|
+
var _translateRefAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(ciDatas) {
|
|
514
|
+
var _this5 = this;
|
|
515
|
+
|
|
516
|
+
var refIdMap, ciRefAttributeMap, refIds, refCis, refCiMap;
|
|
517
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
518
|
+
while (1) {
|
|
519
|
+
switch (_context3.prev = _context3.next) {
|
|
520
|
+
case 0:
|
|
521
|
+
// 查找引用字段及值
|
|
522
|
+
refIdMap = {};
|
|
523
|
+
ciRefAttributeMap = {};
|
|
524
|
+
ciDatas.forEach(function (ciData) {
|
|
525
|
+
var id = ciData.id,
|
|
526
|
+
ciType = ciData.ciType,
|
|
527
|
+
attributeMap = ciData.attributeMap;
|
|
528
|
+
ciRefAttributeMap[id] = [];
|
|
529
|
+
|
|
530
|
+
_this5.topo.ciTyeCache.getCiType(ciType).attributes.filter(function (attributeMeta) {
|
|
531
|
+
return !!attributeMeta.refCi;
|
|
532
|
+
}).forEach(function (attributeMeta) {
|
|
533
|
+
var refId = attributeMap[attributeMeta.code];
|
|
534
|
+
|
|
535
|
+
if (refId && !refIdMap[refId]) {
|
|
536
|
+
refIdMap[refId] = true;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
ciRefAttributeMap[id].push({
|
|
540
|
+
attrCode: attributeMeta.code,
|
|
541
|
+
id: refId
|
|
542
|
+
});
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
refIds = Object.keys(refIdMap); // 查询引用对象
|
|
546
|
+
|
|
547
|
+
_context3.next = 6;
|
|
548
|
+
return (0, _services.queryCisByIds)(refIds);
|
|
549
|
+
|
|
550
|
+
case 6:
|
|
551
|
+
refCis = _context3.sent;
|
|
552
|
+
refCiMap = (0, _lodash.keyBy)(refCis, 'id');
|
|
553
|
+
|
|
554
|
+
_rlog["default"].debug('translateRefAttribute', {
|
|
555
|
+
ciRefAttributeMap: ciRefAttributeMap,
|
|
556
|
+
refIds: refIds,
|
|
557
|
+
refCiMap: refCiMap
|
|
558
|
+
}); // 引用对象设置到数据
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
return _context3.abrupt("return", ciDatas.map(function (ciData) {
|
|
562
|
+
var id = ciData.id;
|
|
563
|
+
var attributeMap = (0, _extends2["default"])({}, ciData);
|
|
564
|
+
ciRefAttributeMap[id].forEach(function (refAttrs) {
|
|
565
|
+
var refCi = refCiMap[refAttrs.id];
|
|
566
|
+
|
|
567
|
+
if (refCi) {
|
|
568
|
+
attributeMap[refAttrs.attrCode + "_object"] = {
|
|
569
|
+
displayName: refCi.attributes.display_name
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
return (0, _extends2["default"])({}, ciData, {
|
|
574
|
+
attributeMap: attributeMap
|
|
575
|
+
});
|
|
576
|
+
}));
|
|
577
|
+
|
|
578
|
+
case 10:
|
|
579
|
+
case "end":
|
|
580
|
+
return _context3.stop();
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}, _callee3);
|
|
584
|
+
}));
|
|
585
|
+
|
|
586
|
+
function translateRefAttribute(_x2) {
|
|
587
|
+
return _translateRefAttribute.apply(this, arguments);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
return translateRefAttribute;
|
|
591
|
+
}()
|
|
483
592
|
/**
|
|
484
593
|
* 推送标注、悬浮框数据 => ht
|
|
485
594
|
* @returns
|
|
@@ -556,7 +665,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
556
665
|
;
|
|
557
666
|
|
|
558
667
|
_proto.getEdgeGroupTagsAndTips = function getEdgeGroupTagsAndTips(data, ciConfigs) {
|
|
559
|
-
var
|
|
668
|
+
var _this6 = this;
|
|
560
669
|
|
|
561
670
|
// 查询没有关联链路的连线组及对应子链路列表
|
|
562
671
|
var _this$topo$store$getM2 = this.topo.store.getModelState('topoMod').data,
|
|
@@ -623,7 +732,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
623
732
|
var edgeGroupsTagsTips = Object.keys(groupMap) // 过滤非连线组
|
|
624
733
|
.filter(function (groupId) {
|
|
625
734
|
var linkChildren = groupMap[groupId];
|
|
626
|
-
var edgeGroup = (0, _htElementUtils.getEdgeGroupByNodeTags)(
|
|
735
|
+
var edgeGroup = (0, _htElementUtils.getEdgeGroupByNodeTags)(_this6.topo.getDataModel(), linkChildren[0].source, linkChildren[0].target);
|
|
627
736
|
return !!edgeGroup;
|
|
628
737
|
}).map(function (groupId) {
|
|
629
738
|
var linkChildren = groupMap[groupId]; // 查询配置,过滤不在范围内的属性
|
|
@@ -668,7 +777,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
668
777
|
}); // console.error(groupId, {config, linkChildrenData, mergeData})
|
|
669
778
|
// 构造标注、悬浮框数据
|
|
670
779
|
|
|
671
|
-
var formatter = new _attributeFormatter["default"](
|
|
780
|
+
var formatter = new _attributeFormatter["default"](_this6.topo);
|
|
672
781
|
return {
|
|
673
782
|
type: 'edgeGroup',
|
|
674
783
|
edgeGroupId: groupId,
|
|
@@ -44,7 +44,7 @@ var _GraphDataModel = _interopRequireDefault(require("./GraphDataModel"));
|
|
|
44
44
|
var _edgeUtil = require("../utils/edgeUtil");
|
|
45
45
|
|
|
46
46
|
// eslint-disable-next-line no-undef
|
|
47
|
-
var version = typeof "2.15.
|
|
47
|
+
var version = typeof "2.15.5" === 'string' ? "2.15.5" : null;
|
|
48
48
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
49
49
|
var topoDebug = {};
|
|
50
50
|
window.topoDebug = topoDebug;
|
|
@@ -69,7 +69,7 @@ var CiTyeCache = /*#__PURE__*/function () {
|
|
|
69
69
|
var _load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(ciTypeIds) {
|
|
70
70
|
var _this = this;
|
|
71
71
|
|
|
72
|
-
var unLoadCiTypeIds,
|
|
72
|
+
var unLoadCiTypeIds, ciTypeMetas, cache;
|
|
73
73
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
74
74
|
while (1) {
|
|
75
75
|
switch (_context2.prev = _context2.next) {
|
|
@@ -81,12 +81,16 @@ var CiTyeCache = /*#__PURE__*/function () {
|
|
|
81
81
|
return _topo["default"].ciInfo.batchQueryCiTypeInfo(unLoadCiTypeIds);
|
|
82
82
|
|
|
83
83
|
case 3:
|
|
84
|
-
|
|
84
|
+
ciTypeMetas = _context2.sent;
|
|
85
85
|
cache = (0, _extends2["default"])({}, this.cache);
|
|
86
|
-
|
|
86
|
+
ciTypeMetas.forEach(function (ciTypeMeta) {
|
|
87
|
+
var attributes = ciTypeMeta.attributes || [];
|
|
88
|
+
var metrics = ciTypeMeta.metrics || [];
|
|
87
89
|
cache[ciTypeMeta.code] = (0, _extends2["default"])({}, ciTypeMeta, {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
attributes: attributes,
|
|
91
|
+
metrics: metrics,
|
|
92
|
+
attributeMap: (0, _keyBy["default"])(attributes, 'code'),
|
|
93
|
+
metricMap: (0, _keyBy["default"])(metrics, 'code')
|
|
90
94
|
});
|
|
91
95
|
});
|
|
92
96
|
this.cache = cache;
|
package/lib/models/topoMod.js
CHANGED
|
@@ -450,6 +450,10 @@ function _default(topoApp) {
|
|
|
450
450
|
_rlog["default"].debug("topoMod.initTopoData Ci属性指标元数据", ciTypeMap);
|
|
451
451
|
|
|
452
452
|
globalConfig = result.global.extraConfig;
|
|
453
|
+
_context6.next = 47;
|
|
454
|
+
return dispatch.displayConfig.setConfig(globalConfig);
|
|
455
|
+
|
|
456
|
+
case 47:
|
|
453
457
|
_combTopoData = (0, _topoData.combTopoData)({
|
|
454
458
|
engine: topoApp,
|
|
455
459
|
data: result,
|
|
@@ -468,7 +472,6 @@ function _default(topoApp) {
|
|
|
468
472
|
});
|
|
469
473
|
|
|
470
474
|
dispatch.topoBizMod.combBatchCiInfo(resAndMetrics);
|
|
471
|
-
dispatch.displayConfig.setConfig(globalConfig);
|
|
472
475
|
dispatch.background.init(globalConfig); // TODO 优化打开拓扑图显示告警速度:打开拓扑图立即请求告警
|
|
473
476
|
|
|
474
477
|
if ((0, _topoData.getAlarmSwitch)(topoData)) {
|
|
@@ -482,7 +485,7 @@ function _default(topoApp) {
|
|
|
482
485
|
|
|
483
486
|
topoApp.options.onLoad();
|
|
484
487
|
|
|
485
|
-
case
|
|
488
|
+
case 56:
|
|
486
489
|
case "end":
|
|
487
490
|
return _context6.stop();
|
|
488
491
|
}
|
|
@@ -77,7 +77,7 @@ function LindInfoPreview(props) {
|
|
|
77
77
|
}, /*#__PURE__*/_react["default"].createElement(_box["default"], {
|
|
78
78
|
className: _LindInfoPreviewModule["default"].label
|
|
79
79
|
}, field.label), /*#__PURE__*/_react["default"].createElement(_box["default"], {
|
|
80
|
-
className: _LindInfoPreviewModule["default"].labelValue,
|
|
80
|
+
className: field.name === "use" ? _LindInfoPreviewModule["default"].uselabelValue : _LindInfoPreviewModule["default"].labelValue,
|
|
81
81
|
flex: 1
|
|
82
82
|
}, getValue(field.name)));
|
|
83
83
|
}); // <Collapse
|
package/lib/topoCenter/components/editor/propertyViews/edge/link/LindInfoPreview.module.scss
CHANGED
|
@@ -13,8 +13,18 @@
|
|
|
13
13
|
|
|
14
14
|
.labelValue {
|
|
15
15
|
max-width: 160px;
|
|
16
|
-
overflow-y: scroll;
|
|
17
16
|
max-height: 200px;
|
|
17
|
+
overflow-x: hidden;
|
|
18
|
+
overflow-wrap: break-word;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.uselabelValue {
|
|
22
|
+
max-width: 160px;
|
|
23
|
+
max-height: 200px;
|
|
24
|
+
overflow-y: scroll;
|
|
25
|
+
overflow-x: hidden;
|
|
26
|
+
overflow-wrap: break-word;
|
|
27
|
+
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
|
package/lib/utils/topoData.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.findItemIndex = exports.findItem = exports.combTopoData = exports.combSa
|
|
|
8
8
|
exports.formatGroup = formatGroup;
|
|
9
9
|
exports.formatGroups = formatGroups;
|
|
10
10
|
exports.getAlarmSwitch = getAlarmSwitch;
|
|
11
|
+
exports.getCiModSet = getCiModSet;
|
|
11
12
|
exports.getCiTypes = getCiTypes;
|
|
12
13
|
exports.getLinksBetweenTwoNodes = getLinksBetweenTwoNodes;
|
|
13
14
|
exports.parseTopoData = parseTopoData;
|
|
@@ -315,11 +316,6 @@ var combTopoData = function combTopoData(_ref2) {
|
|
|
315
316
|
ciTypeMap = _ref2.ciTypeMap,
|
|
316
317
|
engine = _ref2.engine;
|
|
317
318
|
// rlog.debug("combTopoData-接收到数据", result, engine, globalConfig);
|
|
318
|
-
// 当前拓扑资源字典
|
|
319
|
-
var ciDoc = {};
|
|
320
|
-
var ciTypesDoc = {}; //
|
|
321
|
-
|
|
322
|
-
var bindingCiSet = {};
|
|
323
319
|
var config = (0, _extends2["default"])({
|
|
324
320
|
type: "auto"
|
|
325
321
|
}, result.config); // global
|
|
@@ -375,12 +371,75 @@ var combTopoData = function combTopoData(_ref2) {
|
|
|
375
371
|
var linkGroups = result.linkGroups.map(function (link) {
|
|
376
372
|
var linkObj = tfLink(engine, link, result.nodes);
|
|
377
373
|
return linkObj;
|
|
378
|
-
});
|
|
374
|
+
});
|
|
375
|
+
var topoData = {
|
|
376
|
+
config: config,
|
|
377
|
+
global: global,
|
|
378
|
+
groups: groups,
|
|
379
|
+
nodes: nodes,
|
|
380
|
+
linkGroups: linkGroups,
|
|
381
|
+
links: links,
|
|
382
|
+
serialize: result.serialize
|
|
383
|
+
}; // 所有资源
|
|
379
384
|
|
|
380
385
|
var allCis = [].concat(nodes, links, linkGroups);
|
|
386
|
+
var resAndMetrics = (0, _extends2["default"])({
|
|
387
|
+
// topo所有ci的id集合
|
|
388
|
+
resIdsList: allCis.map(function (item) {
|
|
389
|
+
return item.id;
|
|
390
|
+
}),
|
|
391
|
+
ciTypes: getCiTypes(result),
|
|
392
|
+
// ci类型集合
|
|
393
|
+
ciTypeMap: ciTypeMap,
|
|
394
|
+
// ci类型模型map
|
|
395
|
+
metrics: [],
|
|
396
|
+
// 所有指标
|
|
397
|
+
metricsDoc: {},
|
|
398
|
+
//
|
|
399
|
+
attrsDoc: {},
|
|
400
|
+
allMetrics: Object.values(ciTypeMap),
|
|
401
|
+
allAttrs: Object.values(ciTypeMap),
|
|
402
|
+
globalConfig: globalConfig,
|
|
403
|
+
nodeIdsList: result.nodes.map(function (item) {
|
|
404
|
+
return {
|
|
405
|
+
ciId: item.id,
|
|
406
|
+
operation: item.operation
|
|
407
|
+
};
|
|
408
|
+
}),
|
|
409
|
+
linkIdsList: [].concat(result.links, result.linkGroups).map(function (linkObj) {
|
|
410
|
+
return {
|
|
411
|
+
ciId: linkObj.id,
|
|
412
|
+
operation: linkObj.operation
|
|
413
|
+
};
|
|
414
|
+
})
|
|
415
|
+
}, getCiModSet({
|
|
416
|
+
engine: engine,
|
|
417
|
+
allCis: allCis,
|
|
418
|
+
ciTypeMap: ciTypeMap,
|
|
419
|
+
globalConfig: globalConfig
|
|
420
|
+
})); // rlog.debug("combTopoData-格式化后数据", topoData, resAndMetrics);
|
|
421
|
+
|
|
422
|
+
return {
|
|
423
|
+
topoData: topoData,
|
|
424
|
+
resAndMetrics: resAndMetrics
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
exports.combTopoData = combTopoData;
|
|
429
|
+
|
|
430
|
+
function getCiModSet(params) {
|
|
431
|
+
var engine = params.engine,
|
|
432
|
+
allCis = params.allCis,
|
|
433
|
+
ciTypeMap = params.ciTypeMap,
|
|
434
|
+
globalConfig = params.globalConfig; // 当前拓扑资源字典
|
|
435
|
+
|
|
436
|
+
var ciDoc = {};
|
|
437
|
+
var ciTypesDoc = {}; //
|
|
438
|
+
|
|
439
|
+
var bindingCiSet = {};
|
|
381
440
|
var allCiModSet = {};
|
|
382
441
|
var allLinkModSet = {};
|
|
383
|
-
Object.keys(ciTypeMap).
|
|
442
|
+
Object.keys(ciTypeMap).forEach(function (key) {
|
|
384
443
|
var ciTypeObj = {};
|
|
385
444
|
var linkKeyArr = [{
|
|
386
445
|
code: "phy",
|
|
@@ -439,62 +498,19 @@ var combTopoData = function combTopoData(_ref2) {
|
|
|
439
498
|
});
|
|
440
499
|
}
|
|
441
500
|
|
|
442
|
-
|
|
443
|
-
// topo所有ci的id集合
|
|
444
|
-
resIdsList: [].concat(result.nodes, result.links, result.linkGroups).map(function (item) {
|
|
445
|
-
return item.id;
|
|
446
|
-
}),
|
|
447
|
-
nodeIdsList: result.nodes.map(function (item) {
|
|
448
|
-
return {
|
|
449
|
-
ciId: item.id,
|
|
450
|
-
operation: item.operation
|
|
451
|
-
};
|
|
452
|
-
}),
|
|
453
|
-
linkIdsList: [].concat(result.links, result.linkGroups).map(function (linkObj) {
|
|
454
|
-
return {
|
|
455
|
-
ciId: linkObj.id,
|
|
456
|
-
operation: linkObj.operation
|
|
457
|
-
};
|
|
458
|
-
}),
|
|
459
|
-
// alarmCiDoc, // 用于告警ciId的集合,因为链路的ciId不同于关系id(r开头) 弃用
|
|
501
|
+
return {
|
|
460
502
|
ciDoc: ciDoc,
|
|
461
503
|
// ci信息集合
|
|
462
|
-
ciTypes: getCiTypes(result),
|
|
463
|
-
// ci类型集合
|
|
464
504
|
ciTypesDoc: ciTypesDoc,
|
|
465
505
|
// 每种ci含有的ci
|
|
466
|
-
ciTypeMap: ciTypeMap,
|
|
467
|
-
// ci类型模型map
|
|
468
|
-
allCiModSet: allCiModSet,
|
|
469
|
-
// 资源类型含有属性和指标集合
|
|
470
|
-
allLinkModSet: allLinkModSet,
|
|
471
|
-
// 链路类型含有属性和指标集合
|
|
472
|
-
metrics: [],
|
|
473
|
-
// 所有指标
|
|
474
|
-
metricsDoc: {},
|
|
475
|
-
//
|
|
476
|
-
attrsDoc: {},
|
|
477
506
|
bindingCiSet: bindingCiSet,
|
|
478
507
|
// 可能没用了
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
};
|
|
483
|
-
var topoData = {
|
|
484
|
-
config: config,
|
|
485
|
-
global: global,
|
|
486
|
-
groups: groups,
|
|
487
|
-
nodes: nodes,
|
|
488
|
-
linkGroups: linkGroups,
|
|
489
|
-
links: links,
|
|
490
|
-
serialize: result.serialize
|
|
491
|
-
}; // rlog.debug("combTopoData-格式化后数据", topoData, resAndMetrics);
|
|
508
|
+
allCiModSet: allCiModSet,
|
|
509
|
+
// 资源类型含有属性和指标集合
|
|
510
|
+
allLinkModSet: allLinkModSet // 链路类型含有属性和指标集合
|
|
492
511
|
|
|
493
|
-
return {
|
|
494
|
-
topoData: topoData,
|
|
495
|
-
resAndMetrics: resAndMetrics
|
|
496
512
|
};
|
|
497
|
-
}
|
|
513
|
+
}
|
|
498
514
|
/**
|
|
499
515
|
* 获得两个节点间的连线列表
|
|
500
516
|
* @param {*} links
|
|
@@ -504,8 +520,6 @@ var combTopoData = function combTopoData(_ref2) {
|
|
|
504
520
|
*/
|
|
505
521
|
|
|
506
522
|
|
|
507
|
-
exports.combTopoData = combTopoData;
|
|
508
|
-
|
|
509
523
|
function getLinksBetweenTwoNodes(links, id1, id2) {
|
|
510
524
|
return links.filter(function (link) {
|
|
511
525
|
return link.source === id1 && link.target === id2 || link.target === id1 && link.source === id2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.5",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@riil-frontend/component-table-filter-tags": "latest",
|
|
70
70
|
"@riil-frontend/component-table-layout": "^2.0.2",
|
|
71
71
|
"@riil-frontend/component-topology-common": "^1.0.9",
|
|
72
|
-
"@riil-frontend/component-topology-graph": "^2.5.
|
|
72
|
+
"@riil-frontend/component-topology-graph": "^2.5.1",
|
|
73
73
|
"@riil-frontend/css": "^2.0.2",
|
|
74
74
|
"@riil-frontend/hooks": "latest",
|
|
75
75
|
"@riil-frontend/next-collapse": "^1.0.1-a.0",
|
|
@@ -111,6 +111,6 @@
|
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
113
113
|
"license": "MIT",
|
|
114
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.
|
|
114
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.5/build/index.html",
|
|
115
115
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
116
116
|
}
|