@riil-frontend/component-topology 9.0.0-a.36 → 9.0.0-a.38

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.
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import { iconFactory } from '@riil-frontend/component-topology-graph';
3
3
  import ResourceList from "../../../common/GroupNodeList/ResourceList";
4
- import { getLayerChildrenResourceElements } from "../../../../../../../utils/htElementDataUtil";
4
+ import { getLayerChildren } from "../../../../../../../utils/htElementUtils";
5
+ import { isResourceElement } from "../../../../../../../utils/htElementDataUtil";
5
6
  /**
6
7
  * 分层关联资源列表
7
8
  */
@@ -9,7 +10,7 @@ import { getLayerChildrenResourceElements } from "../../../../../../../utils/htE
9
10
  export default function LayerResourceList(props) {
10
11
  var topo = props.topo,
11
12
  layer = props.layer;
12
- var relateDataNodes = getLayerChildrenResourceElements(layer);
13
+ var relateDataNodes = getLayerChildren(layer).filter(isResourceElement);
13
14
  var data = relateDataNodes.map(function (node) {
14
15
  return {
15
16
  title: node.a('name'),
@@ -1,9 +1,9 @@
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 topoServer from '@riil-frontend/component-topology-common/es/services/topo';
5
- import rlog from '@riil-frontend/component-topology-utils/es/rlog';
6
- import { keyBy } from 'lodash';
4
+ import topoServer from "@riil-frontend/component-topology-common/es/services/topo";
5
+ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
6
+ import { keyBy } from "lodash";
7
7
  import { DEFAULT_NODE_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay";
8
8
  import { findItem } from "../../utils/topoData";
9
9
  import { queryCisByIds } from "../services";
@@ -12,12 +12,12 @@ import AttributeFormatter from "./attributeFormatter";
12
12
  import DictCache from "./cache/DictCache";
13
13
 
14
14
  function isGraphField(item) {
15
- return item.type === 'graph';
15
+ return item.type === "graph";
16
16
  }
17
17
 
18
18
  function filterUnExistedFields(fields, ciTypeMeta) {
19
19
  function isFieldExisted(item, ciTypeMeta) {
20
- return item.type === 'attribute' && ciTypeMeta.attributeMap[item.code] || item.type === 'metric' && ciTypeMeta.metricMap[item.code] || item.type !== 'attribute' && item.type !== 'metric';
20
+ return item.type === "attribute" && ciTypeMeta.attributeMap[item.code] || item.type === "metric" && ciTypeMeta.metricMap[item.code] || item.type !== "attribute" && item.type !== "metric";
21
21
  }
22
22
 
23
23
  return fields.filter(function (item) {
@@ -44,7 +44,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
44
44
  var _proto = AttributeMetricDisplay.prototype;
45
45
 
46
46
  _proto.getConfig = function getConfig() {
47
- var _this$topo$store$getM = this.topo.store.getModelState('displayConfig'),
47
+ var _this$topo$store$getM = this.topo.store.getModelState("displayConfig"),
48
48
  nodeTag = _this$topo$store$getM.nodeTag,
49
49
  nodeTip = _this$topo$store$getM.nodeTip,
50
50
  linkTag = _this$topo$store$getM.linkTag,
@@ -59,10 +59,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
59
59
  }
60
60
  /**
61
61
  * 获得节点资源类型的配置,只包含属性和指标字段
62
- *
63
- * @param {*} ciType
64
- * @param {*} config
65
- * @returns
62
+ *
63
+ * @param {*} ciType
64
+ * @param {*} config
65
+ * @returns
66
66
  */
67
67
  ;
68
68
 
@@ -94,9 +94,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
94
94
  }
95
95
  /**
96
96
  * 查询需要查询数据的连线
97
- *
98
- * @param {*} data
99
- * @returns
97
+ *
98
+ * @param {*} data
99
+ * @returns
100
100
  */
101
101
  ;
102
102
 
@@ -108,7 +108,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
108
108
 
109
109
  return [].concat(links.map(function (link) {
110
110
  return _extends({}, link, {
111
- type: 'edge'
111
+ type: "edge"
112
112
  });
113
113
  }));
114
114
  };
@@ -117,23 +117,48 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
117
117
  var _this = this;
118
118
 
119
119
  var _this$topo$dataModel$2 = this.topo.dataModel.getData(),
120
- nodes = _this$topo$dataModel$2.nodes;
120
+ nodes = _this$topo$dataModel$2.nodes; // console.log("getNodesTagTipConfig", nodes);
121
121
 
122
- return nodes.filter(function (node) {
123
- return !!node.ciType;
124
- }).map(function (node) {
125
- var ciType = node.ciType;
126
122
 
127
- var ciTypeConfig = _this.getNodeCiTypeConfig(ciType);
123
+ var nodeArr = [];
124
+ nodes.map(function (node) {
125
+ if (!!node.ciType) {
126
+ var ciType = node.ciType;
128
127
 
129
- return {
130
- type: 'node',
131
- id: node.id,
132
- ciType: ciType,
133
- tags: _this.filterCiFiledConfigItems(node, ciTypeConfig.tags),
134
- tips: _this.filterCiFiledConfigItems(node, ciTypeConfig.tips)
135
- };
136
- });
128
+ var ciTypeConfig = _this.getNodeCiTypeConfig(ciType);
129
+
130
+ nodeArr.push({
131
+ type: "node",
132
+ id: node.id,
133
+ ciType: ciType,
134
+ tags: _this.filterCiFiledConfigItems(node, ciTypeConfig.tags),
135
+ tips: _this.filterCiFiledConfigItems(node, ciTypeConfig.tips)
136
+ });
137
+ } else if (node.bindType === "ip") {
138
+ var _this$getConfig2 = _this.getConfig(),
139
+ nodeTag = _this$getConfig2.nodeTag,
140
+ nodeTip = _this$getConfig2.nodeTip;
141
+
142
+ console.log("nodeTag------------------------", nodeTag, nodeTip);
143
+
144
+ if (!nodeTag.isCustom) {
145
+ var hasIpv4 = Array.isArray(nodeTag.data) && (nodeTag === null || nodeTag === void 0 ? void 0 : nodeTag.data.find(function (item) {
146
+ return item.code === "ipv4_address";
147
+ }));
148
+ if (hasIpv4) nodeArr.push({
149
+ type: "node",
150
+ id: node.id,
151
+ tags: [{
152
+ type: "attribute",
153
+ code: "ipv4_address"
154
+ }],
155
+ tips: []
156
+ });
157
+ }
158
+ }
159
+ }); // console.log("nodeArr", nodeArr);
160
+
161
+ return nodeArr;
137
162
  } // eslint-disable-next-line class-methods-use-this
138
163
  ;
139
164
 
@@ -147,7 +172,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
147
172
 
148
173
  if (!isMonitoring(data)) {
149
174
  list = list.filter(function (item) {
150
- return item.type !== 'metric';
175
+ return item.type !== "metric";
151
176
  });
152
177
  }
153
178
 
@@ -156,7 +181,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
156
181
  ;
157
182
 
158
183
  _proto.getModelType = function getModelType(ci) {
159
- if (ci.ciType === 'network_link') {
184
+ if (ci.ciType === "network_link") {
160
185
  return ci.attributes.support_templates;
161
186
  }
162
187
 
@@ -164,15 +189,15 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
164
189
  }
165
190
  /**
166
191
  * 按链路类型获取对应的属性、指标配置
167
- * @param {*} link
168
- * @returns
192
+ * @param {*} link
193
+ * @returns
169
194
  */
170
195
  ;
171
196
 
172
197
  _proto.getLinkTagTipConfig = function getLinkTagTipConfig(link) {
173
- var _this$getConfig2 = this.getConfig(),
174
- linkTag = _this$getConfig2.linkTag,
175
- linkTip = _this$getConfig2.linkTip;
198
+ var _this$getConfig3 = this.getConfig(),
199
+ linkTag = _this$getConfig3.linkTag,
200
+ linkTip = _this$getConfig3.linkTip;
176
201
 
177
202
  var ciTypeMeta = this.topo.ciTyeCache.getCiTypeByCi(link);
178
203
  var modelType = this.getModelType(link);
@@ -196,9 +221,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
196
221
  return {
197
222
  tags: getItems(linkTagConfig),
198
223
  tagLinkArrow: {
199
- 1: 'both',
200
- 2: 'from',
201
- 3: 'to'
224
+ 1: "both",
225
+ 2: "from",
226
+ 3: "to"
202
227
  }[linkTagConfig === null || linkTagConfig === void 0 ? void 0 : linkTagConfig.type] || undefined,
203
228
  tips: getItems(linkTip || defaultLinkTipConfig)
204
229
  };
@@ -224,10 +249,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
224
249
  }
225
250
  /**
226
251
  * 获取资源的标注、悬浮框配置,只包含属性和指标字段。无权限的资源无配置
227
- *
252
+ *
228
253
  * @param {?*} data 可选参数
229
254
  * @param {?*} config 可选参数
230
- * @returns
255
+ * @returns
231
256
  */
232
257
  ;
233
258
 
@@ -240,6 +265,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
240
265
  var _this3 = this;
241
266
 
242
267
  return this.getResourceTagTipConfig().map(function (ciConfig) {
268
+ // console.log("ciConfig-----------", ciConfig);
243
269
  var fields = {
244
270
  ciType: ciConfig.ciType,
245
271
  type: ciConfig.type,
@@ -257,7 +283,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
257
283
  }
258
284
  }); // 增加概览需要的指标字段
259
285
 
260
- var overviewState = _this3.topo.store.getModelState('topoBaseInfoOverview');
286
+ var overviewState = _this3.topo.store.getModelState("topoBaseInfoOverview");
261
287
 
262
288
  if (overviewState.id === fields.id) {
263
289
  overviewState.metricCodes.forEach(function (code) {
@@ -278,7 +304,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
278
304
 
279
305
  _proto.getResourceMetricCodes = function getResourceMetricCodes() {
280
306
  var metricCodes = [];
281
- var resourceFields = this.getResourceFields();
307
+ var resourceFields = this.getResourceFields(); // console.log("getResourceMetricCodes", resourceFields);
308
+
282
309
  resourceFields.forEach(function (resource) {
283
310
  resource.metrics.forEach(function (metric) {
284
311
  if (metricCodes.indexOf(metric) === -1) {
@@ -290,18 +317,20 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
290
317
  }
291
318
  /**
292
319
  * 从配置获得节点名称是否显示
293
- * @param {*} node
294
- * @returns
320
+ * @param {*} node
321
+ * @returns
295
322
  */
296
323
  ;
297
324
 
298
325
  _proto.getNodeNameVisible = function getNodeNameVisible(node) {
326
+ var _nodeTag$data;
327
+
299
328
  if (!this.topo.isViewMode()) {
300
- return true;
329
+ return trueipv4_address;
301
330
  }
302
331
 
303
- var _this$getConfig3 = this.getConfig(),
304
- nodeTag = _this$getConfig3.nodeTag;
332
+ var _this$getConfig4 = this.getConfig(),
333
+ nodeTag = _this$getConfig4.nodeTag;
305
334
 
306
335
  var visible = true;
307
336
 
@@ -310,8 +339,17 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
310
339
  data = nodeTag.data;
311
340
  var items = (isCustom ? data[node.ciType] : data) || [];
312
341
  visible = !!items.filter(function (item) {
313
- return item.type === 'graph';
342
+ return item.type === "graph";
314
343
  }).length;
344
+ } // console.log("getNodeNameVisible--xxx", nodeTag);
345
+
346
+
347
+ var hasIpv4 = Array.isArray(nodeTag.data) && (nodeTag === null || nodeTag === void 0 ? void 0 : (_nodeTag$data = nodeTag.data) === null || _nodeTag$data === void 0 ? void 0 : _nodeTag$data.find(function (item) {
348
+ return item.code === "ipv4_address";
349
+ }));
350
+
351
+ if (node.bindType === "ip" && !hasIpv4) {
352
+ return true;
315
353
  }
316
354
 
317
355
  return visible;
@@ -322,6 +360,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
322
360
 
323
361
  var nodes = this.topo.dataModel.getNodes();
324
362
  return nodes.map(function (node) {
363
+ // console.log("getNodesNameVisible", node);
325
364
  return {
326
365
  id: node.id,
327
366
  visible: _this4.getNodeNameVisible(node)
@@ -338,16 +377,16 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
338
377
  this.getNodesNameVisible().forEach(function (_ref) {
339
378
  var id = _ref.id,
340
379
  visible = _ref.visible;
341
- var ele = dm.getDataByTag(id); //
380
+ var ele = dm.getDataByTag(id); //
342
381
 
343
382
  if (ele) {
344
- ele.a('isShowName', visible);
383
+ ele.a("isShowName", visible);
345
384
  }
346
385
  });
347
386
  }
348
387
  /**
349
388
  * 加载标注、悬浮框数据
350
- *
389
+ *
351
390
  * @param {array<{id, attributeMap: {}, metricMap: {}}>} data
352
391
  */
353
392
  ;
@@ -378,7 +417,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
378
417
 
379
418
  case 4:
380
419
  ciDatas = _context.sent;
381
- bizDispatchers = topo.store.getModelDispatchers('topoBizMod');
420
+ bizDispatchers = topo.store.getModelDispatchers("topoBizMod");
382
421
  _context.next = 8;
383
422
  return bizDispatchers.setAttrsAndMetrics(ciDatas);
384
423
 
@@ -406,7 +445,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
406
445
  /**
407
446
  * 加载标注、悬浮框数据
408
447
  * 业务拓扑使用
409
- *
448
+ *
410
449
  * @param {array<{id, attributes: [], attributeMap: {}, metrics: [], metricMap: {}}>} data
411
450
  */
412
451
  ;
@@ -438,8 +477,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
438
477
  }()
439
478
  /**
440
479
  * 临时由前端翻译引用属性名称
441
- * @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
442
- * @returns
480
+ * @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
481
+ * @returns
443
482
  */
444
483
  ;
445
484
 
@@ -499,12 +538,6 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
499
538
 
500
539
  case 8:
501
540
  refCiMap = _context3.sent;
502
- rlog.debug('translateRefAttribute', {
503
- ciRefAttributeMap: ciRefAttributeMap,
504
- refIds: refIds,
505
- refCiMap: refCiMap
506
- }); // 引用对象设置到数据
507
-
508
541
  return _context3.abrupt("return", ciDatas.map(function (ciData) {
509
542
  var id = ciData.id;
510
543
 
@@ -524,7 +557,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
524
557
  });
525
558
  }));
526
559
 
527
- case 11:
560
+ case 10:
528
561
  case "end":
529
562
  return _context3.stop();
530
563
  }
@@ -540,7 +573,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
540
573
  }()
541
574
  /**
542
575
  * 推送标注、悬浮框数据 => ht
543
- * @returns
576
+ * @returns
544
577
  */
545
578
  ;
546
579
 
@@ -553,7 +586,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
553
586
 
554
587
  var elementTagsAndTips = this.buildTagsTips() // 开锁状态下禁用悬停展示悬浮框
555
588
  .map(function (item) {
556
- var _topo$store$getModelS = topo.store.getModelState('lock'),
589
+ var _topo$store$getModelS = topo.store.getModelState("lock"),
557
590
  lock = _topo$store$getModelS.lock;
558
591
 
559
592
  return lock ? item : _extends({}, item, {
@@ -563,9 +596,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
563
596
  .map(function (item) {
564
597
  var tags = item.tags;
565
598
 
566
- if (item.type === 'edge') {
599
+ if (item.type === "edge") {
567
600
  var allNoValue = tags.data.filter(function (tItem) {
568
- return tItem.value === '- ';
601
+ return tItem.value === "- ";
569
602
  }).length === tags.data.length;
570
603
 
571
604
  if (allNoValue) {
@@ -576,30 +609,30 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
576
609
  return _extends({}, item, {
577
610
  tags: tags
578
611
  });
579
- });
580
- rlog.debug("AttributeMetricDisplay.updateTagsTips " + new Date().toLocaleString(), elementTagsAndTips);
612
+ }); // rlog.debug(`AttributeMetricDisplay.updateTagsTips ${new Date().toLocaleString()}`, elementTagsAndTips);
613
+
581
614
  var htTopo = topo.getHtTopo();
582
615
 
583
616
  if (htTopo) {
584
617
  var _topo$historyManager, _topo$historyManager2;
585
618
 
586
- (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
619
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, "加载标注");
587
620
  htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
588
- (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
621
+ (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, "加载标注");
589
622
  }
590
623
  }
591
624
  /**
592
625
  * 从store获取属性、指标数据
593
- * @returns
626
+ * @returns
594
627
  */
595
628
  ;
596
629
 
597
630
  _proto.getData = function getData() {
598
- return this.topo.store.getModelState('topoBizMod').attrsAndMetrics;
631
+ return this.topo.store.getModelState("topoBizMod").attrsAndMetrics;
599
632
  }
600
633
  /**
601
634
  * 构造标注、悬浮框数据
602
- * @returns
635
+ * @returns
603
636
  */
604
637
  ;
605
638
 
@@ -608,9 +641,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
608
641
 
609
642
  var data = this.getData(); // 获取标注、悬浮框配置
610
643
 
611
- var ciConfigs = this.getResourceTagTipConfig();
644
+ var ciConfigs = this.getResourceTagTipConfig(); // console.log("buildTagsTips---ciConfigs", ciConfigs);
645
+
612
646
  var ciTagsAndTips = ciConfigs.map(function (ciConfig) {
613
- var ciDataItem = findItem(data, 'id', ciConfig.id);
647
+ var ciDataItem = findItem(data, "id", ciConfig.id); // console.log("buildTagsTips-ciDataItem", ciDataItem);
614
648
 
615
649
  if (!ciDataItem) {
616
650
  return {
@@ -621,14 +655,15 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
621
655
  } // 获取ci数据
622
656
 
623
657
 
624
- var ciData = _extends({}, findItem(data, 'id', ciConfig.id), {
658
+ var ciData = _extends({}, findItem(data, "id", ciConfig.id), {
625
659
  ciType: ciConfig.ciType
626
660
  });
627
661
 
628
- var formatter = new AttributeFormatter(_this6.topo);
662
+ var formatter = new AttributeFormatter(_this6.topo); // console.log("AttributeFormatter-----", ciData, ciConfig);
663
+
629
664
  var tags = formatter.formatAttrs(ciConfig.tags, ciData); // 链路标注箭头
630
665
 
631
- if (ciConfig.type === 'edge') {
666
+ if (ciConfig.type === "edge") {
632
667
  tags = {
633
668
  data: tags,
634
669
  linkArrow: ciConfig.tagLinkArrow
@@ -641,7 +676,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
641
676
  tags: tags,
642
677
  tips: formatter.formatAttrs(ciConfig.tips, ciData)
643
678
  };
644
- });
679
+ }); // console.log("ciTagsAndTips", ciTagsAndTips);
680
+
645
681
  var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []); // 刷新标注、浮层
646
682
  // rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
647
683
 
@@ -24,7 +24,7 @@ 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 "9.0.0-a.36" === 'string' ? "9.0.0-a.36" : null;
27
+ var version = typeof "9.0.0-a.38" === 'string' ? "9.0.0-a.38" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -54,25 +54,56 @@ var AttributeFormatter = /*#__PURE__*/function () {
54
54
 
55
55
  _proto.commonTransform = function commonTransform(item, ciData, attrType) {
56
56
  var fieldCode = item.code;
57
- var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
58
- var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
57
+ console.log("commonTransform-item, ciData, attrType", item, ciData, attrType);
59
58
 
60
- if (attrType === 'attribute') {
61
- if (ciData[attrType + "Map"][fieldCode + "_object"]) {
62
- fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
59
+ if (ciData.ciType) {
60
+ var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
61
+ var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
62
+
63
+ if (attrType === "attribute") {
64
+ if (ciData[attrType + "Map"][fieldCode + "_object"]) {
65
+ fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
66
+ }
63
67
  }
64
- }
65
68
 
66
- return {
67
- type: item.type,
68
- code: item.code,
69
- // 属性code
70
- name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || '',
71
- // 属性名称
72
- value: formatMetric(fieldValue, fieldMeta),
73
- // 属性值
74
- originValue: fieldValue
75
- };
69
+ var obj = {
70
+ type: item.type,
71
+ code: item.code,
72
+ // 属性code
73
+ name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || "",
74
+ // 属性名称
75
+ value: formatMetric(fieldValue, fieldMeta),
76
+ // 属性值
77
+ originValue: fieldValue
78
+ };
79
+ return obj;
80
+ } else {
81
+ if (item.code === "ipv4_address" && ciData.bindType === "ip") {
82
+ return {
83
+ type: item.type,
84
+ code: item.code,
85
+ // 属性code
86
+ name: "IPv4地址",
87
+ // 属性名称
88
+ value: ciData.bindIp,
89
+ // 属性值
90
+ originValue: ciData.bindIp
91
+ };
92
+ } else {
93
+ var _ciData$attributes$di, _ciData$attributes, _ciData$attributes$di2, _ciData$attributes2;
94
+
95
+ return {
96
+ type: item.type,
97
+ code: item.code,
98
+ // 属性code
99
+ name: "显示名称",
100
+ // 属性名称
101
+ value: (_ciData$attributes$di = ciData === null || ciData === void 0 ? void 0 : (_ciData$attributes = ciData.attributes) === null || _ciData$attributes === void 0 ? void 0 : _ciData$attributes.display_name) !== null && _ciData$attributes$di !== void 0 ? _ciData$attributes$di : "",
102
+ // 属性值
103
+ originValue: (_ciData$attributes$di2 = ciData === null || ciData === void 0 ? void 0 : (_ciData$attributes2 = ciData.attributes) === null || _ciData$attributes2 === void 0 ? void 0 : _ciData$attributes2.display_name) !== null && _ciData$attributes$di2 !== void 0 ? _ciData$attributes$di2 : ""
104
+ };
105
+ }
106
+ }
76
107
  };
77
108
 
78
109
  _proto.attributeTransform = function attributeTransform(item, ciData) {
@@ -1,4 +1,4 @@
1
- import { getEdges } from "../../utils/htElementUtils";
1
+ import { getElements, isEdge } from "../../utils/htElementUtils";
2
2
  /**
3
3
  * 连线两端节点变更时更新显示。如果两端互相切换,切换两端样式
4
4
  * @param {*} topo
@@ -7,7 +7,7 @@ import { getEdges } from "../../utils/htElementUtils";
7
7
  export function fixLink(topo) {
8
8
  var linkDatas = topo.dataModel.getEdges();
9
9
  var dm = topo.getHtTopo().getGraphView().dm();
10
- var edges = getEdges(dm);
10
+ var edges = getElements(dm).filter(isEdge);
11
11
  edges.forEach(function (edge) {
12
12
  var source = edge.getSource();
13
13
  var target = edge.getTarget();
@@ -16,15 +16,20 @@ export function fixLink(topo) {
16
16
  }); // TODO 判断两端互相切换
17
17
  // const isChange =
18
18
 
19
- if (linkData && source.getTag() !== linkData.source) {
19
+ if (linkData && (source === null || source === void 0 ? void 0 : source.getTag()) !== linkData.source) {
20
20
  var node = dm.getDataByTag(linkData.source);
21
- edge.setSource(node);
21
+
22
+ if (node) {
23
+ edge.setSource(node);
24
+ }
22
25
  }
23
26
 
24
- if (linkData && linkData.target && target.getTag() !== linkData.target) {
27
+ if (linkData && linkData.target && (target === null || target === void 0 ? void 0 : target.getTag()) !== linkData.target) {
25
28
  var _node = dm.getDataByTag(linkData.target);
26
29
 
27
- edge.setTarget(_node);
30
+ if (_node) {
31
+ edge.setTarget(_node);
32
+ }
28
33
  } // TODO 两端互相切换,交换两端样式
29
34
 
30
35
  });
@@ -11,6 +11,8 @@ var _componentTopologyGraph = require("@riil-frontend/component-topology-graph")
11
11
 
12
12
  var _ResourceList = _interopRequireDefault(require("../../../common/GroupNodeList/ResourceList"));
13
13
 
14
+ var _htElementUtils = require("../../../../../../../utils/htElementUtils");
15
+
14
16
  var _htElementDataUtil = require("../../../../../../../utils/htElementDataUtil");
15
17
 
16
18
  /**
@@ -19,7 +21,7 @@ var _htElementDataUtil = require("../../../../../../../utils/htElementDataUtil")
19
21
  function LayerResourceList(props) {
20
22
  var topo = props.topo,
21
23
  layer = props.layer;
22
- var relateDataNodes = (0, _htElementDataUtil.getLayerChildrenResourceElements)(layer);
24
+ var relateDataNodes = (0, _htElementUtils.getLayerChildren)(layer).filter(_htElementDataUtil.isResourceElement);
23
25
  var data = relateDataNodes.map(function (node) {
24
26
  return {
25
27
  title: node.a('name'),