@riil-frontend/component-topology 4.0.0-beta.9 → 4.0.2

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.
Files changed (177) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +32 -32
  5. package/es/components/BatchAttrMetric/setting.js +47 -7
  6. package/es/components/Drawer/Drawer.js +60 -0
  7. package/es/components/Drawer/index.js +1 -59
  8. package/es/constants/ResourceInfoDisplay.js +1 -4
  9. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +31 -1
  10. package/es/core/components/AlarmListPanel/hooks/useAlarmList.js +34 -0
  11. package/es/core/components/AlarmListPanel/index.js +27 -24
  12. package/es/core/components/AlarmListPanel/index.module.scss +46 -16
  13. package/es/core/components/DisplaySettingDrawer/EdgeFlow.js +4 -6
  14. package/es/core/components/DisplaySettingDrawer/EdgeFlowDirection.js +4 -6
  15. package/es/core/components/DisplaySettingDrawer/NodeTag.js +3 -5
  16. package/es/core/components/DisplaySettingDrawer/NodeTip.js +4 -5
  17. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -1
  18. package/es/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSetting.js +25 -0
  19. package/es/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSettingDrawer.js +8 -0
  20. package/es/core/components/TopoView/topoView.js +25 -1
  21. package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +4 -2
  22. package/es/core/editor/components/settings/propertyViews/group/DataTab/RelateData.js +0 -7
  23. package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +13 -12
  24. package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +4 -1
  25. package/es/core/editor/components/settings/propertyViews/group/{DataTab/ClusterGroupRelateData → cluster}/ClusterGroupRelateData.js +22 -9
  26. package/es/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +2 -5
  27. package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +21 -0
  28. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +5 -0
  29. package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +3 -1
  30. package/es/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +36 -0
  31. package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +2 -2
  32. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +3 -5
  33. package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  34. package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +28 -0
  35. package/es/core/models/AttributeMetricDisplay.js +28 -10
  36. package/es/core/models/TopoApp.js +12 -7
  37. package/es/core/models/TopoGraphView.js +3 -1
  38. package/es/core/models/attributeFormatter/index.js +2 -26
  39. package/es/core/models/cache/{CiTyeCache.js → CiTypeCache.js} +3 -1
  40. package/es/core/models/tagstips/ElementTagTipConfig.js +132 -0
  41. package/es/core/models/tagstips/utils.js +44 -0
  42. package/es/core/models/utils/linkUtils.js +3 -1
  43. package/es/core/services/topo.js +30 -0
  44. package/es/core/utils/edgeUtil.js +8 -0
  45. package/es/core/utils/graphLinkUtil.js +22 -0
  46. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -1
  47. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +24 -2
  48. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.module.scss +1 -1
  49. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +7 -101
  50. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +13 -3
  51. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +166 -89
  52. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +7 -14
  53. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +38 -13
  54. package/es/core/viewer/components/titlebar/BasicTools.js +5 -2
  55. package/es/core/viewer/components/titlebar/widgets/NodesDragSwitch.js +4 -2
  56. package/es/hooks/useAlarm.js +59 -0
  57. package/es/hooks/useEventData.js +20 -0
  58. package/es/hooks/useGraphAlarmDisplay.js +68 -18
  59. package/es/hooks/useManageStatus.js +0 -34
  60. package/es/hooks/useResourceConfig.js +6 -13
  61. package/es/hooks/useSelection.js +2 -4
  62. package/es/hooks/useTopoEdit.js +90 -37
  63. package/es/models/topoAlarm.js +8 -9
  64. package/es/models/topoMod.js +16 -8
  65. package/es/style.js +1 -0
  66. package/es/topoCenter/components/TopoView.js +6 -1
  67. package/es/topoCenter/components/Topology.js +7 -1
  68. package/es/topoCenter/components/editor/propertyViews/LayerRelatedResourceList.js +2 -2
  69. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +35 -15
  70. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +11 -2
  71. package/es/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +24 -0
  72. package/es/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +23 -0
  73. package/es/topoCenter/components/viewer/displaySetting/LinkTagV2.js +87 -0
  74. package/es/topoCenter/getTopoData.js +18 -6
  75. package/es/topoCenter/hooks/editor/useGroupSortResources.js +16 -0
  76. package/es/topoCenter/hooks/useEdgeExpand.js +25 -0
  77. package/es/topoCenter/hooks/useLinkDynamicStyle.js +1 -1
  78. package/es/topoCenter/hooks/useTopoEdit.js +3 -0
  79. package/es/topoCenter/models/LinkDynamicStyleExecutor.js +38 -10
  80. package/es/topoCenter/models/TopoCenter.js +3 -11
  81. package/es/topoCenter/store/functionAuth.js +2 -0
  82. package/es/topoCenter/utils/SortResourcesUtil.js +3 -3
  83. package/es/topoCenter/utils/exportData.js +13 -7
  84. package/es/topoCenter/utils/linkUtil.js +8 -0
  85. package/es/utils/ResourceConfigUtil.js +4 -5
  86. package/es/utils/clusterUtil.js +27 -2
  87. package/es/utils/htElementDataUtil.js +22 -1
  88. package/es/utils/htElementUtils.js +22 -9
  89. package/es/utils/showGraphManageStatusUtil.js +67 -0
  90. package/es/utils/topoData.js +57 -32
  91. package/lib/components/BatchAttrMetric/setting.js +47 -6
  92. package/lib/components/Drawer/Drawer.js +73 -0
  93. package/lib/components/Drawer/index.js +2 -64
  94. package/lib/constants/ResourceInfoDisplay.js +1 -4
  95. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +31 -1
  96. package/lib/core/components/AlarmListPanel/hooks/useAlarmList.js +40 -0
  97. package/lib/core/components/AlarmListPanel/index.js +30 -24
  98. package/lib/core/components/AlarmListPanel/index.module.scss +46 -16
  99. package/lib/core/components/DisplaySettingDrawer/EdgeFlow.js +4 -6
  100. package/lib/core/components/DisplaySettingDrawer/EdgeFlowDirection.js +4 -6
  101. package/lib/core/components/DisplaySettingDrawer/NodeTag.js +3 -6
  102. package/lib/core/components/DisplaySettingDrawer/NodeTip.js +4 -6
  103. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -1
  104. package/lib/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSetting.js +39 -0
  105. package/lib/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSettingDrawer.js +17 -0
  106. package/lib/core/components/TopoView/topoView.js +28 -1
  107. package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +4 -2
  108. package/lib/core/editor/components/settings/propertyViews/group/DataTab/RelateData.js +0 -8
  109. package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +13 -13
  110. package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +5 -1
  111. package/lib/core/editor/components/settings/propertyViews/group/{DataTab/ClusterGroupRelateData → cluster}/ClusterGroupRelateData.js +23 -9
  112. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +2 -5
  113. package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +31 -0
  114. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +6 -0
  115. package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +3 -1
  116. package/lib/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +52 -0
  117. package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +3 -3
  118. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +3 -5
  119. package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +5 -2
  120. package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +37 -0
  121. package/lib/core/models/AttributeMetricDisplay.js +28 -10
  122. package/lib/core/models/TopoApp.js +10 -5
  123. package/lib/core/models/TopoGraphView.js +3 -1
  124. package/lib/core/models/attributeFormatter/index.js +2 -26
  125. package/lib/core/models/cache/{CiTyeCache.js → CiTypeCache.js} +3 -1
  126. package/lib/core/models/tagstips/ElementTagTipConfig.js +142 -0
  127. package/lib/core/models/tagstips/utils.js +59 -0
  128. package/lib/core/models/utils/linkUtils.js +3 -1
  129. package/lib/core/services/topo.js +40 -0
  130. package/lib/core/utils/edgeUtil.js +12 -0
  131. package/lib/core/utils/graphLinkUtil.js +27 -0
  132. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -1
  133. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +25 -2
  134. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.module.scss +1 -1
  135. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +7 -101
  136. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +13 -3
  137. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +166 -89
  138. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +7 -14
  139. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +38 -13
  140. package/lib/core/viewer/components/titlebar/BasicTools.js +6 -2
  141. package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitch.js +4 -2
  142. package/lib/hooks/useAlarm.js +61 -0
  143. package/lib/hooks/useEventData.js +28 -0
  144. package/lib/hooks/useGraphAlarmDisplay.js +69 -18
  145. package/lib/hooks/useManageStatus.js +0 -34
  146. package/lib/hooks/useResourceConfig.js +6 -12
  147. package/lib/hooks/useSelection.js +1 -5
  148. package/lib/hooks/useTopoEdit.js +94 -36
  149. package/lib/models/topoAlarm.js +8 -9
  150. package/lib/models/topoMod.js +15 -8
  151. package/lib/style.js +1 -0
  152. package/lib/topoCenter/components/TopoView.js +8 -1
  153. package/lib/topoCenter/components/Topology.js +8 -1
  154. package/lib/topoCenter/components/editor/propertyViews/LayerRelatedResourceList.js +1 -1
  155. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +35 -14
  156. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +11 -2
  157. package/lib/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +35 -0
  158. package/lib/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +23 -0
  159. package/lib/topoCenter/components/viewer/displaySetting/LinkTagV2.js +102 -0
  160. package/lib/topoCenter/getTopoData.js +19 -6
  161. package/lib/topoCenter/hooks/editor/useGroupSortResources.js +21 -0
  162. package/lib/topoCenter/hooks/useEdgeExpand.js +33 -0
  163. package/lib/topoCenter/hooks/useLinkDynamicStyle.js +1 -1
  164. package/lib/topoCenter/hooks/useTopoEdit.js +3 -0
  165. package/lib/topoCenter/models/LinkDynamicStyleExecutor.js +38 -9
  166. package/lib/topoCenter/models/TopoCenter.js +3 -12
  167. package/lib/topoCenter/store/functionAuth.js +2 -0
  168. package/lib/topoCenter/utils/SortResourcesUtil.js +3 -3
  169. package/lib/topoCenter/utils/exportData.js +14 -7
  170. package/lib/topoCenter/utils/linkUtil.js +15 -0
  171. package/lib/utils/ResourceConfigUtil.js +4 -4
  172. package/lib/utils/clusterUtil.js +34 -2
  173. package/lib/utils/htElementDataUtil.js +38 -1
  174. package/lib/utils/htElementUtils.js +24 -9
  175. package/lib/utils/showGraphManageStatusUtil.js +78 -0
  176. package/lib/utils/topoData.js +59 -32
  177. package/package.json +5 -5
@@ -82,8 +82,10 @@ var CiTyeCache = /*#__PURE__*/function () {
82
82
  source_id: '源端口',
83
83
  destination_id: '目的端口'
84
84
  }[attr.code] || attr.name;
85
+ var userVisible = ['source_id', 'destination_id'].indexOf(attr.code) !== -1 ? true : attr.userVisible;
85
86
  return _extends({}, attr, {
86
- name: name
87
+ name: name,
88
+ userVisible: userVisible
87
89
  });
88
90
  });
89
91
  var metrics = ciTypeMeta.metrics || [];
@@ -0,0 +1,132 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import { getLinkMtCodes, getMonitorTemplateCodesFromTopoData, getMtCodeCiTypeMap, getNodeMtCodes } from "./utils";
4
+ import { getMetricsByMonitorTemplateCodes } from "../../services/topo";
5
+
6
+ var ElementTagTipConfig = /*#__PURE__*/function () {
7
+ function ElementTagTipConfig(topo) {
8
+ this.topoData = void 0;
9
+ this.mtCodes = void 0;
10
+ this.mtMetricsMap = void 0;
11
+ this.mtCiTypeMap = void 0;
12
+ this.topo = topo;
13
+ }
14
+
15
+ var _proto = ElementTagTipConfig.prototype;
16
+
17
+ _proto.init = /*#__PURE__*/function () {
18
+ var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topoData) {
19
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
20
+ while (1) {
21
+ switch (_context.prev = _context.next) {
22
+ case 0:
23
+ this.topoData = topoData;
24
+ this.mtCodes = getMonitorTemplateCodesFromTopoData(topoData);
25
+ _context.next = 4;
26
+ return getMetricsByMonitorTemplateCodes(this.mtCodes);
27
+
28
+ case 4:
29
+ this.mtMetricsMap = _context.sent;
30
+ this.mtCiTypeMap = getMtCodeCiTypeMap(topoData);
31
+
32
+ case 6:
33
+ case "end":
34
+ return _context.stop();
35
+ }
36
+ }
37
+ }, _callee, this);
38
+ }));
39
+
40
+ function init(_x) {
41
+ return _init.apply(this, arguments);
42
+ }
43
+
44
+ return init;
45
+ }()
46
+ /**
47
+ * 获得节点字段配置项map
48
+ */
49
+ ;
50
+
51
+ _proto.getNodeFiedldMap = function getNodeFiedldMap() {
52
+ var mtCodes = getNodeMtCodes(this.topoData);
53
+ return this.getFiedldMapByType(mtCodes, 'node');
54
+ }
55
+ /**
56
+ * 获得节点字段配置项map
57
+ */
58
+ ;
59
+
60
+ _proto.getLinkFidldMap = function getLinkFidldMap() {
61
+ var mtCodes = getLinkMtCodes(this.topoData);
62
+ return this.getFiedldMapByType(mtCodes, 'link');
63
+ };
64
+
65
+ _proto.getFiedldMapByType = function getFiedldMapByType(mtCodes, type) {
66
+ var _this = this;
67
+
68
+ var map = {};
69
+ mtCodes.forEach(function (mtCode) {
70
+ var ciType = _this.mtCiTypeMap[mtCode];
71
+
72
+ var attributes = _this.topo.ciTyeCache.getCiType(ciType).attributes.filter(function (attr) {
73
+ return !!attr.userVisible;
74
+ });
75
+
76
+ var metrics = _this.getMtMetricModels(mtCode);
77
+
78
+ var extItems = type === 'node' ? [{
79
+ lavel: '图片名称',
80
+ value: 'graph:name'
81
+ }, {
82
+ lavel: '资源类型',
83
+ value: 'ciType:name'
84
+ }] : [];
85
+ map[mtCode] = [].concat(extItems, attributes.map(function (item) {
86
+ return {
87
+ type: 'attribute',
88
+ label: item.name,
89
+ value: "attribute:" + item.code,
90
+ data: item
91
+ };
92
+ }), metrics.map(function (item) {
93
+ return {
94
+ type: 'metric',
95
+ label: item.name,
96
+ value: "metric:" + item.code,
97
+ data: item
98
+ };
99
+ }));
100
+ });
101
+ return map;
102
+ };
103
+
104
+ _proto.getMtMetricModels = function getMtMetricModels(mtCode) {
105
+ var _this2 = this;
106
+
107
+ var ciType = this.mtCiTypeMap[mtCode];
108
+ var ciTypeModel = this.topo.ciTyeCache.getCiType(ciType);
109
+ var metrics = ciTypeModel.metrics.filter(function (m) {
110
+ return !!_this2.mtMetricsMap[mtCode][m.code];
111
+ });
112
+ return metrics;
113
+ };
114
+
115
+ _proto.getMtMetricModelMap = function getMtMetricModelMap(mtCode) {
116
+ var metricModels = this.getMtMetricModelMap(mtCode);
117
+ var map = {};
118
+ metricModels.forEach(function (item) {
119
+ map[item.code] = item;
120
+ });
121
+ return map;
122
+ };
123
+
124
+ _proto.getMetricModel = function getMetricModel(mtCode, metricCode) {
125
+ return this.getMtMetricModelMap(mtCode)[metricCode];
126
+ };
127
+
128
+ return ElementTagTipConfig;
129
+ }();
130
+
131
+ export { ElementTagTipConfig as default };
132
+ ;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * 获得监控模板code
3
+ * @param {*} data
4
+ * @returns
5
+ */
6
+ export function getMonitorTemplateCodeFromCiData(data) {
7
+ var _data$attributes;
8
+
9
+ // eslint-disable-next-line camelcase
10
+ return (_data$attributes = data.attributes) === null || _data$attributes === void 0 ? void 0 : _data$attributes.support_templates;
11
+ }
12
+ export function getMtCodes(cis) {
13
+ var codes = [];
14
+ cis.forEach(function (ci) {
15
+ var code = getMonitorTemplateCodeFromCiData(ci);
16
+
17
+ if (code && codes.indexOf(code) === -1) {
18
+ codes.push(code);
19
+ }
20
+ });
21
+ return codes;
22
+ }
23
+ export function getNodeMtCodes(data) {
24
+ var nodes = data.nodes;
25
+ return getMtCodes(nodes);
26
+ }
27
+ export function getLinkMtCodes(data) {
28
+ var links = data.links;
29
+ return getMtCodes(links);
30
+ }
31
+ export function getMonitorTemplateCodesFromTopoData(data) {
32
+ return [].concat(getNodeMtCodes(data), getLinkMtCodes(data));
33
+ }
34
+ export function getMtCodeCiTypeMap(data) {
35
+ var nodes = data.nodes,
36
+ links = data.links;
37
+ var map = {};
38
+ var cis = [].concat(nodes, links);
39
+ cis.forEach(function (ci) {
40
+ var mtCode = getMonitorTemplateCodeFromCiData(ci);
41
+ map[mtCode] = ci.ciType;
42
+ });
43
+ return map;
44
+ }
@@ -136,7 +136,9 @@ function _getLinksDetail() {
136
136
  case 10:
137
137
  interfaceCis = _context2.sent;
138
138
  _context2.next = 13;
139
- return getInterfaceObject(interfaceTypes);
139
+ return getInterfaceObject(interfaceTypes.filter(function (item) {
140
+ return item !== 'ip';
141
+ }));
140
142
 
141
143
  case 13:
142
144
  interfaceDoc = _context2.sent;
@@ -0,0 +1,30 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import { request } from '@riil-frontend/component-topology-utils';
4
+ export function getMetricsByMonitorTemplateCodes(_x) {
5
+ return _getMetricsByMonitorTemplateCodes.apply(this, arguments);
6
+ }
7
+
8
+ function _getMetricsByMonitorTemplateCodes() {
9
+ _getMetricsByMonitorTemplateCodes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mtCodes) {
10
+ var result;
11
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
12
+ while (1) {
13
+ switch (_context.prev = _context.next) {
14
+ case 0:
15
+ _context.next = 2;
16
+ return request.post('/topo/v1/api/attributes/metricByTemplateCode', mtCodes);
17
+
18
+ case 2:
19
+ result = _context.sent;
20
+ return _context.abrupt("return", result);
21
+
22
+ case 4:
23
+ case "end":
24
+ return _context.stop();
25
+ }
26
+ }
27
+ }, _callee);
28
+ }));
29
+ return _getMetricsByMonitorTemplateCodes.apply(this, arguments);
30
+ }
@@ -1,8 +1,10 @@
1
+ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
1
2
  /**
2
3
  * 根据配置更新连线展开折叠状态
3
4
  *
4
5
  * @param {*} topo
5
6
  */
7
+
6
8
  export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
7
9
  var htTopo = topo.getHtTopo();
8
10
 
@@ -15,7 +17,13 @@ export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
15
17
 
16
18
  if (expandAllEdges === false) {
17
19
  htTopo.collapseAllEdgeGroups();
20
+ rlog.debug('updateEdgeExpanded 折叠');
18
21
  } else {
19
22
  htTopo.expandAllEdgeGroups();
23
+ rlog.debug('updateEdgeExpanded 展开');
24
+ }
25
+
26
+ if (topo.linkDynamicStyleExecutor) {
27
+ topo.linkDynamicStyleExecutor.execute();
20
28
  }
21
29
  };
@@ -0,0 +1,22 @@
1
+ import { getEdges } from "../../utils/htElementUtils";
2
+ /**
3
+ * 链路另一端变更后更新另一端,另一端不存在删除线
4
+ * @param {*} topo
5
+ */
6
+
7
+ export function fixLink(topo) {
8
+ var linkDatas = topo.dataModel.getEdges();
9
+ var dm = topo.getHtTopo().getGraphView().dm();
10
+ var edges = getEdges(dm);
11
+ edges.forEach(function (edge) {
12
+ var source = edge.getSource();
13
+ var linkData = linkDatas.find(function (data) {
14
+ return data.id === edge.getTag();
15
+ });
16
+
17
+ if (linkData && source.getTag() !== linkData.source) {
18
+ var node = dm.getDataByTag(linkData.source);
19
+ edge.setSource(node);
20
+ }
21
+ });
22
+ }
@@ -204,7 +204,7 @@ function ResourceDetail(props) {
204
204
  return tabBodys.length === 1 ? /*#__PURE__*/React.createElement(ResourceOverview, _extends({}, props, activeData, {
205
205
  userId: userId,
206
206
  style: {
207
- 'overflow-y': 'auto',
207
+ overflowY: 'auto',
208
208
  height: '100%'
209
209
  }
210
210
  })) : /*#__PURE__*/React.createElement(Tab, {
@@ -10,6 +10,7 @@ import useSortablePlugin from '@ahooksjs/use-sortable-plugin';
10
10
  import { commonQueryCiDataByIds } from "../../../../../services/cmdb";
11
11
  import { queryLatestMetrics } from "../../../../../services/cmdb/metric";
12
12
  import styles from "./ClusterMemberTable.module.scss";
13
+ import Link from "../../../../../../components/Link";
13
14
  export default function ClusterChildrenTable(props) {
14
15
  var data = props.data,
15
16
  topo = props.topo;
@@ -90,7 +91,20 @@ export default function ClusterChildrenTable(props) {
90
91
  plugins: plugins
91
92
  }),
92
93
  tableProps = _useNextTable.tableProps,
93
- paginationProps = _useNextTable.paginationProps;
94
+ paginationProps = _useNextTable.paginationProps; // url 处理,UICBB 的地址需截取前缀
95
+
96
+
97
+ function formatUrl(url) {
98
+ var _window, _window$location;
99
+
100
+ var prefix = '/default/pagecenter';
101
+
102
+ if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
103
+ return url.split(prefix)[1];
104
+ } else {
105
+ return url;
106
+ }
107
+ }
94
108
  /**
95
109
  * Table列数据
96
110
  */
@@ -102,7 +116,15 @@ export default function ClusterChildrenTable(props) {
102
116
  dataIndex: 'attributes.display_name',
103
117
  // sortable: true,
104
118
  lock: true,
105
- width: 160
119
+ width: 160,
120
+ cell: function cell(vallue, index, item) {
121
+ var link = "/default/pagecenter/resDetail/view/" + item.id + "?resId=" + item.id + "&domainCode=" + item.typeObject.domain + "&title=" + vallue + "&ciCode=" + item.typeCode; // 资源跳转链接
122
+
123
+ return /*#__PURE__*/React.createElement(Link, {
124
+ title: vallue || "",
125
+ to: formatUrl(link)
126
+ }, vallue || "-");
127
+ }
106
128
  }, {
107
129
  id: '2',
108
130
  title: 'IP地址',
@@ -4,7 +4,7 @@
4
4
 
5
5
  :global {
6
6
  .pagination-content > div {
7
- padding-bottom: 0;
7
+ padding-bottom: 16px;
8
8
  }
9
9
  }
10
10
  }
@@ -16,14 +16,12 @@ function formatUrl(url) {
16
16
 
17
17
  function AttributeItem(props) {
18
18
  var style = props.style,
19
- key = props.key,
20
19
  label = props.label,
21
20
  contentTitle = props.contentTitle,
22
21
  children = props.children;
23
22
  return /*#__PURE__*/React.createElement("div", {
24
23
  className: styles.item,
25
- style: style || {},
26
- key: key
24
+ style: style || {}
27
25
  }, /*#__PURE__*/React.createElement("span", {
28
26
  className: styles.label
29
27
  }, label + ':'), /*#__PURE__*/React.createElement("span", {
@@ -35,109 +33,17 @@ function AttributeItem(props) {
35
33
  function BaseInfoContent(props) {
36
34
  var topo = props.topo,
37
35
  type = props.type,
38
- data = props.data; // const itemCols = {
39
- // node: [
40
- // {
41
- // label: "资源名称:",
42
- // objKey: "resource",
43
- // render(valueData, key) {
44
- // const { display_name, link } = valueData;
45
- // return (
46
- // <AttributeItem
47
- // key={key}
48
- // label="资源名称:"
49
- // contentTitle={display_name}
50
- // >
51
- // {valueData ? (
52
- // <Link className={styles.link} to={formatUrl(link)}>
53
- // {display_name || "-"}
54
- // </Link>
55
- // ) : (
56
- // "-"
57
- // )}
58
- // </AttributeItem>
59
- // );
60
- // },
61
- // },
62
- // {
63
- // label: "IP地址:",
64
- // objKey: "ipv4_address",
65
- // },
66
- // {
67
- // label: "资产编号:",
68
- // objKey: "asset_number",
69
- // },
70
- // {
71
- // label: "资源类型:",
72
- // objKey: "ciName",
73
- // },
74
- // {
75
- // label: "资源位置:",
76
- // objKey: "res_address",
77
- // },
78
- // // {
79
- // // label: '负责人:',
80
- // // objKey: 'principal'
81
- // // },
82
- // ],
83
- // link: [
84
- // {
85
- // label: "链路带宽:",
86
- // objKey: "rated_bandwidth",
87
- // style: { width: "100%" },
88
- // },
89
- // {
90
- // label: "源IP地址:",
91
- // objKey: "source_ipv4",
92
- // },
93
- // {
94
- // label: "目的IP地址:",
95
- // objKey: "destination_ipv4",
96
- // },
97
- // {
98
- // label: "源端口:",
99
- // objKey: "source_Interface",
100
- // },
101
- // {
102
- // label: "目的端口:",
103
- // objKey: "destination_Interface",
104
- // },
105
- // {
106
- // label: "连接方式:",
107
- // objKey: "network_link.connect_type",
108
- // },
109
- // ],
110
- // };
111
- // return (
112
- // <>
113
- // {itemCols[type]?.map(({ label, objKey, style, render }, key) => {
114
- // return data[objKey] === false ? (
115
- // ""
116
- // ) : render ? (
117
- // render(data[objKey], key)
118
- // ) : (
119
- // <AttributeItem
120
- // key={key}
121
- // label={label}
122
- // style={style || {}}
123
- // contentTitle={data[objKey]}
124
- // >
125
- // {data[objKey] || "-"}
126
- // </AttributeItem>
127
- // );
128
- // })}
129
- // </>
130
- // );
131
-
36
+ data = props.data;
132
37
  return data.map(function (_ref) {
133
38
  var dataIndex = _ref.dataIndex,
134
39
  title = _ref.title,
135
- value = _ref.value;
40
+ value = _ref.value,
41
+ contentTitle = _ref.contentTitle;
136
42
  return /*#__PURE__*/React.createElement(AttributeItem, {
137
43
  key: dataIndex,
138
- label: title // style={style || {}}
139
- // contentTitle={data[objKey]}
140
-
44
+ dataIndex: dataIndex,
45
+ label: title,
46
+ contentTitle: contentTitle
141
47
  }, value || "-");
142
48
  });
143
49
  } // 基本信息
@@ -10,18 +10,28 @@ export default function BaseInfoBlock(props) {
10
10
  ciTypeMeta = props.ciTypeMeta,
11
11
  headerExtra = props.headerExtra,
12
12
  renderContent = props.renderContent,
13
- baseInfo = props.baseInfo;
13
+ baseInfo = props.baseInfo,
14
+ isAppTopo = props.isAppTopo;
14
15
  var id = data.id,
15
16
  ciType = data.ciType,
16
17
  type = data.type,
17
18
  name = data.name;
19
+ console.log('111 data', data);
18
20
  return /*#__PURE__*/React.createElement(BlockBox, {
19
21
  headerTitle: "\u57FA\u672C\u4FE1\u606F",
20
- headerExtra: headerExtra ? headerExtra(props) : ciType === 'network_link' && /*#__PURE__*/React.createElement(SingleResourceStrategyLink, {
22
+ headerExtra: /*#__PURE__*/React.createElement("div", {
23
+ style: {
24
+ display: 'flex'
25
+ }
26
+ }, !isAppTopo && ciType === 'network_link' ? /*#__PURE__*/React.createElement("div", {
27
+ style: {
28
+ lineHeight: '28px'
29
+ }
30
+ }, /*#__PURE__*/React.createElement(SingleResourceStrategyLink, {
21
31
  id: id,
22
32
  ciType: ciType,
23
33
  name: name
24
- })
34
+ })) : '', headerExtra ? headerExtra(props) : '')
25
35
  }, loading ? /*#__PURE__*/React.createElement(_Loading, {
26
36
  style: {
27
37
  width: '100%',