@riil-frontend/component-topology 10.0.36 → 10.0.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.
Files changed (26) hide show
  1. package/build/index.js +1 -1
  2. package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +1 -2
  3. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +1 -2
  4. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +3 -3
  5. package/es/core/hooks/useGraphAlarmDisplay.js +2 -2
  6. package/es/core/hooks/useTopoEdit.js +11 -14
  7. package/es/core/models/Alarm.js +16 -17
  8. package/es/core/models/TopoApp.js +1 -1
  9. package/es/core/store/models/topoConfig.js +10 -11
  10. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +2 -2
  11. package/es/networkTopo/getTopoData.js +2 -2
  12. package/es/networkTopo/models/IpNodeTagsTipsBuilder.js +2 -2
  13. package/es/utils/topoData.js +21 -3
  14. package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +1 -2
  15. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +1 -2
  16. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +3 -3
  17. package/lib/core/hooks/useGraphAlarmDisplay.js +2 -2
  18. package/lib/core/hooks/useTopoEdit.js +11 -14
  19. package/lib/core/models/Alarm.js +16 -17
  20. package/lib/core/models/TopoApp.js +1 -1
  21. package/lib/core/store/models/topoConfig.js +10 -11
  22. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +2 -2
  23. package/lib/networkTopo/getTopoData.js +2 -2
  24. package/lib/networkTopo/models/IpNodeTagsTipsBuilder.js +2 -2
  25. package/lib/utils/topoData.js +21 -3
  26. package/package.json +2 -2
@@ -92,7 +92,7 @@ function _addLinkData() {
92
92
 
93
93
  case 4:
94
94
  networkLinks = _context.sent;
95
- console.log("如果是网络链路,补充详情信息", networkLinks);
95
+ // console.log("如果是网络链路,补充详情信息", networkLinks);
96
96
  otherLinks = links.filter(function (link) {
97
97
  return link.ciType !== 'network_link';
98
98
  });
@@ -101,7 +101,7 @@ function _addLinkData() {
101
101
  linkGroups: []
102
102
  }));
103
103
 
104
- case 8:
104
+ case 7:
105
105
  case "end":
106
106
  return _context.stop();
107
107
  }
@@ -37,8 +37,8 @@ var IpNodeTagsTipsBuilder = /*#__PURE__*/function () {
37
37
  });
38
38
  var topo = this.topo;
39
39
  var dm = this.topo.getDataModel();
40
- var config = topo.attributeMetricDisplay.getConfig();
41
- console.log("getIpNodeTagsAndTips", config, ipNodes);
40
+ var config = topo.attributeMetricDisplay.getConfig(); // console.log("getIpNodeTagsAndTips", config, ipNodes);
41
+
42
42
  var tagDatas = config.nodeTag && !config.nodeTag.isCustom ? config.nodeTag.data : [];
43
43
  var tipDatas = config.nodeTip && !config.nodeTip.isCustom ? config.nodeTip.data : [];
44
44
  var tagHasIpv4 = tagDatas.filter(function (item) {
@@ -156,13 +156,31 @@ function parseTopoData(result) {
156
156
 
157
157
  return (0, _extends2["default"])({}, result, {
158
158
  groups: result.groups || [],
159
- nodes: result.nodes || [],
160
- links: result.links || [],
159
+ nodes: (result.nodes || []).map(parsePermission),
160
+ links: (result.links || []).map(parsePermission),
161
161
  linkGroups: result.linkGroups || [],
162
162
  global: (0, _extends2["default"])({}, otherGlobal, {
163
163
  extraConfig: JSON.parse(((_result$global = result.global) === null || _result$global === void 0 ? void 0 : _result$global.extraConfig) || "{}")
164
164
  })
165
- });
165
+ }); // 如果没有权限字段,则增加
166
+
167
+ function parsePermission(data) {
168
+ if (data.permission) {
169
+ return data;
170
+ }
171
+
172
+ return (0, _extends2["default"])({}, data, {
173
+ permission: parseBasicPermission(data === null || data === void 0 ? void 0 : data.operation)
174
+ });
175
+ }
176
+
177
+ function parseBasicPermission(operation) {
178
+ return {
179
+ readable: !!operation,
180
+ writeable: ['write', 'delete'].includes(operation),
181
+ deleteable: ['delete'].includes(operation)
182
+ };
183
+ }
166
184
  }
167
185
 
168
186
  function buildTopoGraphData() {// TODO 构造拓扑图数据移到这里
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "10.0.36",
3
+ "version": "10.0.38",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@10.0.36/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@10.0.38/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }