@riil-frontend/component-topology 10.0.37 → 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.
@@ -116,9 +116,9 @@ export default function useGraphAlarmDisplay(options) {
116
116
  }).filter(function (item) {
117
117
  return !!item;
118
118
  });
119
- rlog.debug("\u5173\u8054\u62D3\u6251\u544A\u8B66\uFF1A\u63A8\u9001ht " + Object.keys(relateTopoAlarms).length, {
119
+ rlog.debug('关联拓扑告警:推送ht', {
120
120
  all: relateTopoAlarm,
121
- graphAlarm: relateTopoAlarms
121
+ relateTopoAlarms: relateTopoAlarms
122
122
  }); // 更新到ht拓扑
123
123
 
124
124
  topo.view.loadAlarm([].concat(finalAlarms, relateTopoAlarms));
@@ -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 "10.0.37" === 'string' ? "10.0.37" : null;
27
+ var version = typeof "10.0.38" === 'string' ? "10.0.38" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -77,7 +77,7 @@ function _addLinkData() {
77
77
 
78
78
  case 4:
79
79
  networkLinks = _context.sent;
80
- console.log("如果是网络链路,补充详情信息", networkLinks);
80
+ // console.log("如果是网络链路,补充详情信息", networkLinks);
81
81
  otherLinks = links.filter(function (link) {
82
82
  return link.ciType !== 'network_link';
83
83
  });
@@ -86,7 +86,7 @@ function _addLinkData() {
86
86
  linkGroups: []
87
87
  }));
88
88
 
89
- case 8:
89
+ case 7:
90
90
  case "end":
91
91
  return _context.stop();
92
92
  }
@@ -116,13 +116,31 @@ export function parseTopoData(result) {
116
116
 
117
117
  return _extends({}, result, {
118
118
  groups: result.groups || [],
119
- nodes: result.nodes || [],
120
- links: result.links || [],
119
+ nodes: (result.nodes || []).map(parsePermission),
120
+ links: (result.links || []).map(parsePermission),
121
121
  linkGroups: result.linkGroups || [],
122
122
  global: _extends({}, otherGlobal, {
123
123
  extraConfig: JSON.parse(((_result$global = result.global) === null || _result$global === void 0 ? void 0 : _result$global.extraConfig) || "{}")
124
124
  })
125
- });
125
+ }); // 如果没有权限字段,则增加
126
+
127
+ function parsePermission(data) {
128
+ if (data.permission) {
129
+ return data;
130
+ }
131
+
132
+ return _extends({}, data, {
133
+ permission: parseBasicPermission(data === null || data === void 0 ? void 0 : data.operation)
134
+ });
135
+ }
136
+
137
+ function parseBasicPermission(operation) {
138
+ return {
139
+ readable: !!operation,
140
+ writeable: ['write', 'delete'].includes(operation),
141
+ deleteable: ['delete'].includes(operation)
142
+ };
143
+ }
126
144
  }
127
145
  export function buildTopoGraphData() {// TODO 构造拓扑图数据移到这里
128
146
  }
@@ -127,9 +127,9 @@ function useGraphAlarmDisplay(options) {
127
127
  return !!item;
128
128
  });
129
129
 
130
- _rlog["default"].debug("\u5173\u8054\u62D3\u6251\u544A\u8B66\uFF1A\u63A8\u9001ht " + Object.keys(relateTopoAlarms).length, {
130
+ _rlog["default"].debug('关联拓扑告警:推送ht', {
131
131
  all: relateTopoAlarm,
132
- graphAlarm: relateTopoAlarms
132
+ relateTopoAlarms: relateTopoAlarms
133
133
  }); // 更新到ht拓扑
134
134
 
135
135
 
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
56
56
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
57
57
 
58
58
  // eslint-disable-next-line no-undef
59
- var version = typeof "10.0.37" === 'string' ? "10.0.37" : null;
59
+ var version = typeof "10.0.38" === 'string' ? "10.0.38" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -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
  }
@@ -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.37",
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.37/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@10.0.38/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }