@riil-frontend/component-topology 2.15.3 → 2.15.6

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.
@@ -540,7 +540,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
540
540
  return _context3.abrupt("return", ciDatas.map(function (ciData) {
541
541
  var id = ciData.id;
542
542
 
543
- var attributeMap = _extends({}, ciData);
543
+ var attributeMap = _extends({}, ciData.attributeMap);
544
544
 
545
545
  ciRefAttributeMap[id].forEach(function (refAttrs) {
546
546
  var refCi = refCiMap[refAttrs.id];
@@ -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.3" === 'string' ? "2.15.3" : null;
21
+ var version = typeof "2.15.6" === 'string' ? "2.15.6" : null;
22
22
  console.info("\u62D3\u6251\u7248\u672C: " + version);
23
23
  var topoDebug = {};
24
24
  window.topoDebug = topoDebug;
@@ -57,7 +57,7 @@ var CiTyeCache = /*#__PURE__*/function () {
57
57
  var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(ciTypeIds) {
58
58
  var _this = this;
59
59
 
60
- var unLoadCiTypeIds, ciTypes, cache;
60
+ var unLoadCiTypeIds, ciTypeMetas, cache;
61
61
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
62
62
  while (1) {
63
63
  switch (_context2.prev = _context2.next) {
@@ -69,12 +69,16 @@ var CiTyeCache = /*#__PURE__*/function () {
69
69
  return topoService.ciInfo.batchQueryCiTypeInfo(unLoadCiTypeIds);
70
70
 
71
71
  case 3:
72
- ciTypes = _context2.sent;
72
+ ciTypeMetas = _context2.sent;
73
73
  cache = _extends({}, this.cache);
74
- ciTypes.forEach(function (ciTypeMeta) {
74
+ ciTypeMetas.forEach(function (ciTypeMeta) {
75
+ var attributes = ciTypeMeta.attributes || [];
76
+ var metrics = ciTypeMeta.metrics || [];
75
77
  cache[ciTypeMeta.code] = _extends({}, ciTypeMeta, {
76
- attributeMap: keyBy(ciTypeMeta.attributes || [], 'code'),
77
- metricMap: keyBy(ciTypeMeta.metrics || [], 'code')
78
+ attributes: attributes,
79
+ metrics: metrics,
80
+ attributeMap: keyBy(attributes, 'code'),
81
+ metricMap: keyBy(metrics, 'code')
78
82
  });
79
83
  });
80
84
  this.cache = cache;
@@ -60,7 +60,7 @@ export default function LindInfoPreview(props) {
60
60
  }, /*#__PURE__*/React.createElement(_Box, {
61
61
  className: styles.label
62
62
  }, field.label), /*#__PURE__*/React.createElement(_Box, {
63
- className: styles.labelValue,
63
+ className: field.name === "use" ? styles.uselabelValue : styles.labelValue,
64
64
  flex: 1
65
65
  }, getValue(field.name)));
66
66
  }); // <Collapse
@@ -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
 
@@ -273,13 +273,8 @@ export var combTopoData = function combTopoData(_ref2) {
273
273
  globalConfig = _ref2.globalConfig,
274
274
  ciTypeMap = _ref2.ciTypeMap,
275
275
  engine = _ref2.engine;
276
- // rlog.debug("combTopoData-接收到数据", result, engine, globalConfig);
277
- // 当前拓扑资源字典
278
- var ciDoc = {};
279
- var ciTypesDoc = {}; //
280
-
281
- var bindingCiSet = {};
282
276
 
277
+ // rlog.debug("combTopoData-接收到数据", result, engine, globalConfig);
283
278
  var config = _extends({
284
279
  type: "auto"
285
280
  }, result.config); // global
@@ -337,12 +332,74 @@ export var combTopoData = function combTopoData(_ref2) {
337
332
  var linkGroups = result.linkGroups.map(function (link) {
338
333
  var linkObj = tfLink(engine, link, result.nodes);
339
334
  return linkObj;
340
- }); // 所有资源
335
+ });
336
+ var topoData = {
337
+ config: config,
338
+ global: global,
339
+ groups: groups,
340
+ nodes: nodes,
341
+ linkGroups: linkGroups,
342
+ links: links,
343
+ serialize: result.serialize
344
+ }; // 所有资源
341
345
 
342
346
  var allCis = [].concat(nodes, links, linkGroups);
347
+
348
+ var resAndMetrics = _extends({
349
+ // topo所有ci的id集合
350
+ resIdsList: allCis.map(function (item) {
351
+ return item.id;
352
+ }),
353
+ ciTypes: getCiTypes(result),
354
+ // ci类型集合
355
+ ciTypeMap: ciTypeMap,
356
+ // ci类型模型map
357
+ metrics: [],
358
+ // 所有指标
359
+ metricsDoc: {},
360
+ //
361
+ attrsDoc: {},
362
+ allMetrics: Object.values(ciTypeMap),
363
+ allAttrs: Object.values(ciTypeMap),
364
+ globalConfig: globalConfig,
365
+ nodeIdsList: result.nodes.map(function (item) {
366
+ return {
367
+ ciId: item.id,
368
+ operation: item.operation
369
+ };
370
+ }),
371
+ linkIdsList: [].concat(result.links, result.linkGroups).map(function (linkObj) {
372
+ return {
373
+ ciId: linkObj.id,
374
+ operation: linkObj.operation
375
+ };
376
+ })
377
+ }, getCiModSet({
378
+ engine: engine,
379
+ allCis: allCis,
380
+ ciTypeMap: ciTypeMap,
381
+ globalConfig: globalConfig
382
+ })); // rlog.debug("combTopoData-格式化后数据", topoData, resAndMetrics);
383
+
384
+
385
+ return {
386
+ topoData: topoData,
387
+ resAndMetrics: resAndMetrics
388
+ };
389
+ };
390
+ export function getCiModSet(params) {
391
+ var engine = params.engine,
392
+ allCis = params.allCis,
393
+ ciTypeMap = params.ciTypeMap,
394
+ globalConfig = params.globalConfig; // 当前拓扑资源字典
395
+
396
+ var ciDoc = {};
397
+ var ciTypesDoc = {}; //
398
+
399
+ var bindingCiSet = {};
343
400
  var allCiModSet = {};
344
401
  var allLinkModSet = {};
345
- Object.keys(ciTypeMap).map(function (key) {
402
+ Object.keys(ciTypeMap).forEach(function (key) {
346
403
  var ciTypeObj = {};
347
404
  var linkKeyArr = [{
348
405
  code: "phy",
@@ -401,62 +458,19 @@ export var combTopoData = function combTopoData(_ref2) {
401
458
  });
402
459
  }
403
460
 
404
- var resAndMetrics = {
405
- // topo所有ci的id集合
406
- resIdsList: [].concat(result.nodes, result.links, result.linkGroups).map(function (item) {
407
- return item.id;
408
- }),
409
- nodeIdsList: result.nodes.map(function (item) {
410
- return {
411
- ciId: item.id,
412
- operation: item.operation
413
- };
414
- }),
415
- linkIdsList: [].concat(result.links, result.linkGroups).map(function (linkObj) {
416
- return {
417
- ciId: linkObj.id,
418
- operation: linkObj.operation
419
- };
420
- }),
421
- // alarmCiDoc, // 用于告警ciId的集合,因为链路的ciId不同于关系id(r开头) 弃用
461
+ return {
422
462
  ciDoc: ciDoc,
423
463
  // ci信息集合
424
- ciTypes: getCiTypes(result),
425
- // ci类型集合
426
464
  ciTypesDoc: ciTypesDoc,
427
465
  // 每种ci含有的ci
428
- ciTypeMap: ciTypeMap,
429
- // ci类型模型map
430
- allCiModSet: allCiModSet,
431
- // 资源类型含有属性和指标集合
432
- allLinkModSet: allLinkModSet,
433
- // 链路类型含有属性和指标集合
434
- metrics: [],
435
- // 所有指标
436
- metricsDoc: {},
437
- //
438
- attrsDoc: {},
439
466
  bindingCiSet: bindingCiSet,
440
467
  // 可能没用了
441
- allMetrics: Object.values(ciTypeMap),
442
- allAttrs: Object.values(ciTypeMap),
443
- globalConfig: globalConfig
444
- };
445
- var topoData = {
446
- config: config,
447
- global: global,
448
- groups: groups,
449
- nodes: nodes,
450
- linkGroups: linkGroups,
451
- links: links,
452
- serialize: result.serialize
453
- }; // rlog.debug("combTopoData-格式化后数据", topoData, resAndMetrics);
468
+ allCiModSet: allCiModSet,
469
+ // 资源类型含有属性和指标集合
470
+ allLinkModSet: allLinkModSet // 链路类型含有属性和指标集合
454
471
 
455
- return {
456
- topoData: topoData,
457
- resAndMetrics: resAndMetrics
458
472
  };
459
- };
473
+ }
460
474
  /**
461
475
  * 获得两个节点间的连线列表
462
476
  * @param {*} links
@@ -560,7 +560,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
560
560
 
561
561
  return _context3.abrupt("return", ciDatas.map(function (ciData) {
562
562
  var id = ciData.id;
563
- var attributeMap = (0, _extends2["default"])({}, ciData);
563
+ var attributeMap = (0, _extends2["default"])({}, ciData.attributeMap);
564
564
  ciRefAttributeMap[id].forEach(function (refAttrs) {
565
565
  var refCi = refCiMap[refAttrs.id];
566
566
 
@@ -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.3" === 'string' ? "2.15.3" : null;
47
+ var version = typeof "2.15.6" === 'string' ? "2.15.6" : 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, ciTypes, cache;
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
- ciTypes = _context2.sent;
84
+ ciTypeMetas = _context2.sent;
85
85
  cache = (0, _extends2["default"])({}, this.cache);
86
- ciTypes.forEach(function (ciTypeMeta) {
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
- attributeMap: (0, _keyBy["default"])(ciTypeMeta.attributes || [], 'code'),
89
- metricMap: (0, _keyBy["default"])(ciTypeMeta.metrics || [], 'code')
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;
@@ -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
@@ -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
 
@@ -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).map(function (key) {
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
- var resAndMetrics = {
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
- allMetrics: Object.values(ciTypeMap),
480
- allAttrs: Object.values(ciTypeMap),
481
- globalConfig: globalConfig
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",
3
+ "version": "2.15.6",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -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.3/build/index.html",
114
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.6/build/index.html",
115
115
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
116
116
  }