@riil-frontend/component-topology 2.15.2 → 2.15.3
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 +7 -7
- 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/models/topoMod.js +5 -2
- 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/models/topoMod.js +5 -2
- package/package.json +3 -3
|
@@ -4,4 +4,5 @@ export var RESOURCE_LIMIT_TYPES = [// 网络设备
|
|
|
4
4
|
'linux', 'windows', // 数据库
|
|
5
5
|
'oracle', 'asm_disk_group', 'oracle_rac', // 中间件
|
|
6
6
|
'tomcat', // 业务
|
|
7
|
-
'app', 'service'
|
|
7
|
+
'app', 'service', // 虚拟化
|
|
8
|
+
'virtual_mgmt_node', 'virtual_data_center', 'virtual_cluster', 'virtual_storage', 'virtual_vm', 'virtual_host', 'virtual_switch'];
|
|
@@ -3,6 +3,7 @@ import os from '@riil-frontend/component-topology-graph/es/icons/ciTypeIcons/os'
|
|
|
3
3
|
import db from '@riil-frontend/component-topology-graph/es/icons/ciTypeIcons/db';
|
|
4
4
|
import appMiddleware from '@riil-frontend/component-topology-graph/es/icons/ciTypeIcons/app_middleware';
|
|
5
5
|
import businessSystem from '@riil-frontend/component-topology-graph/es/icons/ciTypeIcons/business_system';
|
|
6
|
+
import virtual from '@riil-frontend/component-topology-graph/es/icons/ciTypeIcons/virtual';
|
|
6
7
|
export default function getNetworkTopoCiTypeIcons() {
|
|
7
|
-
return [].concat(network(), os(), db(), appMiddleware(), businessSystem());
|
|
8
|
+
return [].concat(network(), os(), db(), appMiddleware(), businessSystem(), virtual());
|
|
8
9
|
}
|
|
@@ -3,10 +3,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import topoServer from '@riil-frontend/component-topology-common/es/services/topo';
|
|
5
5
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
6
|
+
import { keyBy } from 'lodash';
|
|
6
7
|
import groupBy from 'lodash/groupBy';
|
|
7
8
|
import { DEFAULT_LINK_TAG_COMMON_CONFIG, DEFAULT_NODE_TAG_COMMON_CONFIG, DEFAULT_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay";
|
|
8
9
|
import { getEdgeGroupByNodeTags } from "../../utils/htElementUtils";
|
|
9
10
|
import { findItem } from "../../utils/topoData";
|
|
11
|
+
import { queryCisByIds } from "../services";
|
|
10
12
|
import AttributeFormatter from "./attributeFormatter";
|
|
11
13
|
import DictCache from "./cache/DictCache";
|
|
12
14
|
|
|
@@ -292,23 +294,27 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
292
294
|
}
|
|
293
295
|
|
|
294
296
|
return visible;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* 根据配置执行节点名称显示隐藏
|
|
298
|
-
*/
|
|
299
|
-
;
|
|
297
|
+
};
|
|
300
298
|
|
|
301
|
-
_proto.
|
|
299
|
+
_proto.getNodesNameVisible = function getNodesNameVisible() {
|
|
302
300
|
var _this3 = this;
|
|
303
301
|
|
|
304
|
-
var dm = this.topo.getDataModel();
|
|
305
302
|
var nodes = this.topo.store.getModelState('topoMod').data.nodes;
|
|
306
|
-
nodes.map(function (node) {
|
|
303
|
+
return nodes.map(function (node) {
|
|
307
304
|
return {
|
|
308
305
|
id: node.id,
|
|
309
306
|
visible: _this3.getNodeNameVisible(node)
|
|
310
307
|
};
|
|
311
|
-
})
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* 根据配置执行节点名称显示隐藏
|
|
312
|
+
*/
|
|
313
|
+
;
|
|
314
|
+
|
|
315
|
+
_proto.updateNodesNameVisible = function updateNodesNameVisible() {
|
|
316
|
+
var dm = this.topo.getDataModel();
|
|
317
|
+
this.getNodesNameVisible().forEach(function (_ref3) {
|
|
312
318
|
var id = _ref3.id,
|
|
313
319
|
visible = _ref3.visible;
|
|
314
320
|
dm.getDataByTag(id).a('isShowName', visible);
|
|
@@ -431,25 +437,37 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
431
437
|
/*#__PURE__*/
|
|
432
438
|
function () {
|
|
433
439
|
var _loadAttributeAndMetric = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
|
|
434
|
-
var topo, bizDispatchers;
|
|
440
|
+
var topo, ciDatas, bizDispatchers;
|
|
435
441
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
436
442
|
while (1) {
|
|
437
443
|
switch (_context2.prev = _context2.next) {
|
|
438
444
|
case 0:
|
|
439
445
|
// rlog.debug('AttributeMetricDisplay.loadAttributeAndMetric', data);
|
|
440
|
-
topo = this.topo;
|
|
441
|
-
|
|
446
|
+
topo = this.topo; // 设置ciType
|
|
447
|
+
|
|
448
|
+
ciDatas = data.map(function (item) {
|
|
449
|
+
return _extends({
|
|
450
|
+
ciType: topo.dataModel.getDataById(item.id).ciType
|
|
451
|
+
}, item);
|
|
452
|
+
}); // 翻译引用属性
|
|
453
|
+
|
|
442
454
|
_context2.next = 4;
|
|
443
|
-
return
|
|
455
|
+
return this.translateRefAttribute(ciDatas);
|
|
444
456
|
|
|
445
457
|
case 4:
|
|
446
|
-
|
|
458
|
+
ciDatas = _context2.sent;
|
|
459
|
+
bizDispatchers = topo.store.getModelDispatchers('topoBizMod');
|
|
460
|
+
_context2.next = 8;
|
|
461
|
+
return bizDispatchers.setAttrsAndMetrics(ciDatas);
|
|
462
|
+
|
|
463
|
+
case 8:
|
|
464
|
+
_context2.next = 10;
|
|
447
465
|
return DictCache.init();
|
|
448
466
|
|
|
449
|
-
case
|
|
467
|
+
case 10:
|
|
450
468
|
this.updateTagsTips();
|
|
451
469
|
|
|
452
|
-
case
|
|
470
|
+
case 11:
|
|
453
471
|
case "end":
|
|
454
472
|
return _context2.stop();
|
|
455
473
|
}
|
|
@@ -463,6 +481,95 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
463
481
|
|
|
464
482
|
return loadAttributeAndMetric;
|
|
465
483
|
}()
|
|
484
|
+
/**
|
|
485
|
+
* 临时由前端翻译引用属性名称
|
|
486
|
+
* @param {*} ciDatas
|
|
487
|
+
* @returns
|
|
488
|
+
*/
|
|
489
|
+
;
|
|
490
|
+
|
|
491
|
+
_proto.translateRefAttribute =
|
|
492
|
+
/*#__PURE__*/
|
|
493
|
+
function () {
|
|
494
|
+
var _translateRefAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(ciDatas) {
|
|
495
|
+
var _this5 = this;
|
|
496
|
+
|
|
497
|
+
var refIdMap, ciRefAttributeMap, refIds, refCis, refCiMap;
|
|
498
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
499
|
+
while (1) {
|
|
500
|
+
switch (_context3.prev = _context3.next) {
|
|
501
|
+
case 0:
|
|
502
|
+
// 查找引用字段及值
|
|
503
|
+
refIdMap = {};
|
|
504
|
+
ciRefAttributeMap = {};
|
|
505
|
+
ciDatas.forEach(function (ciData) {
|
|
506
|
+
var id = ciData.id,
|
|
507
|
+
ciType = ciData.ciType,
|
|
508
|
+
attributeMap = ciData.attributeMap;
|
|
509
|
+
ciRefAttributeMap[id] = [];
|
|
510
|
+
|
|
511
|
+
_this5.topo.ciTyeCache.getCiType(ciType).attributes.filter(function (attributeMeta) {
|
|
512
|
+
return !!attributeMeta.refCi;
|
|
513
|
+
}).forEach(function (attributeMeta) {
|
|
514
|
+
var refId = attributeMap[attributeMeta.code];
|
|
515
|
+
|
|
516
|
+
if (refId && !refIdMap[refId]) {
|
|
517
|
+
refIdMap[refId] = true;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
ciRefAttributeMap[id].push({
|
|
521
|
+
attrCode: attributeMeta.code,
|
|
522
|
+
id: refId
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
});
|
|
526
|
+
refIds = Object.keys(refIdMap); // 查询引用对象
|
|
527
|
+
|
|
528
|
+
_context3.next = 6;
|
|
529
|
+
return queryCisByIds(refIds);
|
|
530
|
+
|
|
531
|
+
case 6:
|
|
532
|
+
refCis = _context3.sent;
|
|
533
|
+
refCiMap = keyBy(refCis, 'id');
|
|
534
|
+
rlog.debug('translateRefAttribute', {
|
|
535
|
+
ciRefAttributeMap: ciRefAttributeMap,
|
|
536
|
+
refIds: refIds,
|
|
537
|
+
refCiMap: refCiMap
|
|
538
|
+
}); // 引用对象设置到数据
|
|
539
|
+
|
|
540
|
+
return _context3.abrupt("return", ciDatas.map(function (ciData) {
|
|
541
|
+
var id = ciData.id;
|
|
542
|
+
|
|
543
|
+
var attributeMap = _extends({}, ciData);
|
|
544
|
+
|
|
545
|
+
ciRefAttributeMap[id].forEach(function (refAttrs) {
|
|
546
|
+
var refCi = refCiMap[refAttrs.id];
|
|
547
|
+
|
|
548
|
+
if (refCi) {
|
|
549
|
+
attributeMap[refAttrs.attrCode + "_object"] = {
|
|
550
|
+
displayName: refCi.attributes.display_name
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
return _extends({}, ciData, {
|
|
555
|
+
attributeMap: attributeMap
|
|
556
|
+
});
|
|
557
|
+
}));
|
|
558
|
+
|
|
559
|
+
case 10:
|
|
560
|
+
case "end":
|
|
561
|
+
return _context3.stop();
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}, _callee3);
|
|
565
|
+
}));
|
|
566
|
+
|
|
567
|
+
function translateRefAttribute(_x2) {
|
|
568
|
+
return _translateRefAttribute.apply(this, arguments);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return translateRefAttribute;
|
|
572
|
+
}()
|
|
466
573
|
/**
|
|
467
574
|
* 推送标注、悬浮框数据 => ht
|
|
468
575
|
* @returns
|
|
@@ -538,7 +645,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
538
645
|
;
|
|
539
646
|
|
|
540
647
|
_proto.getEdgeGroupTagsAndTips = function getEdgeGroupTagsAndTips(data, ciConfigs) {
|
|
541
|
-
var
|
|
648
|
+
var _this6 = this;
|
|
542
649
|
|
|
543
650
|
// 查询没有关联链路的连线组及对应子链路列表
|
|
544
651
|
var _this$topo$store$getM2 = this.topo.store.getModelState('topoMod').data,
|
|
@@ -605,7 +712,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
605
712
|
var edgeGroupsTagsTips = Object.keys(groupMap) // 过滤非连线组
|
|
606
713
|
.filter(function (groupId) {
|
|
607
714
|
var linkChildren = groupMap[groupId];
|
|
608
|
-
var edgeGroup = getEdgeGroupByNodeTags(
|
|
715
|
+
var edgeGroup = getEdgeGroupByNodeTags(_this6.topo.getDataModel(), linkChildren[0].source, linkChildren[0].target);
|
|
609
716
|
return !!edgeGroup;
|
|
610
717
|
}).map(function (groupId) {
|
|
611
718
|
var linkChildren = groupMap[groupId]; // 查询配置,过滤不在范围内的属性
|
|
@@ -650,7 +757,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
650
757
|
}); // console.error(groupId, {config, linkChildrenData, mergeData})
|
|
651
758
|
// 构造标注、悬浮框数据
|
|
652
759
|
|
|
653
|
-
var formatter = new AttributeFormatter(
|
|
760
|
+
var formatter = new AttributeFormatter(_this6.topo);
|
|
654
761
|
return {
|
|
655
762
|
type: 'edgeGroup',
|
|
656
763
|
edgeGroupId: groupId,
|
|
@@ -18,7 +18,7 @@ import DataModel from "./DataModel";
|
|
|
18
18
|
import GraphDataModel from "./GraphDataModel";
|
|
19
19
|
import { updateEdgeExpanded } from "../utils/edgeUtil"; // eslint-disable-next-line no-undef
|
|
20
20
|
|
|
21
|
-
var version = typeof "2.15.
|
|
21
|
+
var version = typeof "2.15.3" === 'string' ? "2.15.3" : null;
|
|
22
22
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
23
23
|
var topoDebug = {};
|
|
24
24
|
window.topoDebug = topoDebug;
|
package/es/models/topoMod.js
CHANGED
|
@@ -427,6 +427,10 @@ export default function (topoApp) {
|
|
|
427
427
|
customIcons = _yield$Promise$all[1];
|
|
428
428
|
rlog.debug("topoMod.initTopoData Ci属性指标元数据", ciTypeMap);
|
|
429
429
|
globalConfig = result.global.extraConfig;
|
|
430
|
+
_context6.next = 47;
|
|
431
|
+
return dispatch.displayConfig.setConfig(globalConfig);
|
|
432
|
+
|
|
433
|
+
case 47:
|
|
430
434
|
_combTopoData = combTopoData({
|
|
431
435
|
engine: topoApp,
|
|
432
436
|
data: result,
|
|
@@ -445,7 +449,6 @@ export default function (topoApp) {
|
|
|
445
449
|
});
|
|
446
450
|
|
|
447
451
|
dispatch.topoBizMod.combBatchCiInfo(resAndMetrics);
|
|
448
|
-
dispatch.displayConfig.setConfig(globalConfig);
|
|
449
452
|
dispatch.background.init(globalConfig); // TODO 优化打开拓扑图显示告警速度:打开拓扑图立即请求告警
|
|
450
453
|
|
|
451
454
|
if (getAlarmSwitch(topoData)) {
|
|
@@ -457,7 +460,7 @@ export default function (topoApp) {
|
|
|
457
460
|
rlog.info("topoMod.initTopoData 初始化拓扑图数据完成. 耗时: ", endTime.diff(startTime, "seconds", true));
|
|
458
461
|
topoApp.options.onLoad();
|
|
459
462
|
|
|
460
|
-
case
|
|
463
|
+
case 56:
|
|
461
464
|
case "end":
|
|
462
465
|
return _context6.stop();
|
|
463
466
|
}
|
|
@@ -8,5 +8,6 @@ var RESOURCE_LIMIT_TYPES = [// 网络设备
|
|
|
8
8
|
'linux', 'windows', // 数据库
|
|
9
9
|
'oracle', 'asm_disk_group', 'oracle_rac', // 中间件
|
|
10
10
|
'tomcat', // 业务
|
|
11
|
-
'app', 'service'
|
|
11
|
+
'app', 'service', // 虚拟化
|
|
12
|
+
'virtual_mgmt_node', 'virtual_data_center', 'virtual_cluster', 'virtual_storage', 'virtual_vm', 'virtual_host', 'virtual_switch'];
|
|
12
13
|
exports.RESOURCE_LIMIT_TYPES = RESOURCE_LIMIT_TYPES;
|
|
@@ -15,6 +15,8 @@ var _app_middleware = _interopRequireDefault(require("@riil-frontend/component-t
|
|
|
15
15
|
|
|
16
16
|
var _business_system = _interopRequireDefault(require("@riil-frontend/component-topology-graph/es/icons/ciTypeIcons/business_system"));
|
|
17
17
|
|
|
18
|
+
var _virtual = _interopRequireDefault(require("@riil-frontend/component-topology-graph/es/icons/ciTypeIcons/virtual"));
|
|
19
|
+
|
|
18
20
|
function getNetworkTopoCiTypeIcons() {
|
|
19
|
-
return [].concat((0, _network["default"])(), (0, _os["default"])(), (0, _db["default"])(), (0, _app_middleware["default"])(), (0, _business_system["default"])());
|
|
21
|
+
return [].concat((0, _network["default"])(), (0, _os["default"])(), (0, _db["default"])(), (0, _app_middleware["default"])(), (0, _business_system["default"])(), (0, _virtual["default"])());
|
|
20
22
|
}
|
|
@@ -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.3" === 'string' ? "2.15.3" : null;
|
|
48
48
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
49
49
|
var topoDebug = {};
|
|
50
50
|
window.topoDebug = topoDebug;
|
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
|
}
|
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.3",
|
|
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.3/build/index.html",
|
|
115
115
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
116
116
|
}
|