@riil-frontend/component-topology 3.16.1 → 3.17.1

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.
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
20
20
  import PluginManager from "./PluginManager";
21
21
  import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
22
22
 
23
- var version = typeof "3.16.1" === 'string' ? "3.16.1" : null;
23
+ var version = typeof "3.17.1" === 'string' ? "3.17.1" : null;
24
24
  console.info("\u62D3\u6251\u7248\u672C: " + version);
25
25
  /**
26
26
  * 拓扑显示和编辑
@@ -135,10 +135,11 @@ function ResourceDetail(props) {
135
135
  type = data.type,
136
136
  ciType = data.ciType,
137
137
  ciName = data.ciName,
138
- operation = data.operation;
138
+ operation = data.operation,
139
+ permission = data.permission;
139
140
  if ( // 仅展示资源和链路的概览
140
141
  !['node', 'link', 'linkGroup'].includes(type) || // 没有权限不显示
141
- !operation || // 没有citype不显示
142
+ !operation && !(permission !== null && permission !== void 0 && permission.readable) || // 没有citype不显示
142
143
  !ciType) return;
143
144
  var htElement = topo.getDataModel().getDataByTag(id);
144
145
 
@@ -72,24 +72,35 @@ function AddLinkDrawer(props) {
72
72
  while (1) {
73
73
  switch (_context.prev = _context.next) {
74
74
  case 0:
75
- _context.next = 2;
76
- return service.getPortsById(id);
75
+ if (!(id === null)) {
76
+ _context.next = 2;
77
+ break;
78
+ }
79
+
80
+ return _context.abrupt("return", {
81
+ ports: [],
82
+ portsDoc: {}
83
+ });
77
84
 
78
85
  case 2:
86
+ _context.next = 4;
87
+ return service.getPortsById(id);
88
+
89
+ case 4:
79
90
  result = _context.sent;
80
- _context.next = 5;
91
+ _context.next = 7;
81
92
  return service.queryLinksByNodeId(id);
82
93
 
83
- case 5:
94
+ case 7:
84
95
  links = _context.sent;
85
96
  ifTypes = result.map(function (item) {
86
97
  return item.type;
87
98
  }); // console.log("端口类型列表", ifTypes);
88
99
 
89
- _context.next = 9;
100
+ _context.next = 11;
90
101
  return getInterfaceObject(ifTypes);
91
102
 
92
- case 9:
103
+ case 11:
93
104
  ifDoc = _context.sent;
94
105
  // console.log("端口类型字典", ifDoc);
95
106
  usedPorts = [];
@@ -123,7 +134,7 @@ function AddLinkDrawer(props) {
123
134
  portsDoc: portsDoc
124
135
  });
125
136
 
126
- case 16:
137
+ case 18:
127
138
  case "end":
128
139
  return _context.stop();
129
140
  }
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
48
48
  var _topoFactory = _interopRequireDefault(require("./topoFactory"));
49
49
 
50
50
  // eslint-disable-next-line no-undef
51
- var version = typeof "3.16.1" === 'string' ? "3.16.1" : null;
51
+ var version = typeof "3.17.1" === 'string' ? "3.17.1" : null;
52
52
  console.info("\u62D3\u6251\u7248\u672C: " + version);
53
53
  /**
54
54
  * 拓扑显示和编辑
@@ -158,10 +158,11 @@ function ResourceDetail(props) {
158
158
  type = data.type,
159
159
  ciType = data.ciType,
160
160
  ciName = data.ciName,
161
- operation = data.operation;
161
+ operation = data.operation,
162
+ permission = data.permission;
162
163
  if ( // 仅展示资源和链路的概览
163
164
  !['node', 'link', 'linkGroup'].includes(type) || // 没有权限不显示
164
- !operation || // 没有citype不显示
165
+ !operation && !(permission !== null && permission !== void 0 && permission.readable) || // 没有citype不显示
165
166
  !ciType) return;
166
167
  var htElement = topo.getDataModel().getDataByTag(id);
167
168
 
@@ -101,24 +101,35 @@ function AddLinkDrawer(props) {
101
101
  while (1) {
102
102
  switch (_context.prev = _context.next) {
103
103
  case 0:
104
- _context.next = 2;
105
- return _server["default"].getPortsById(id);
104
+ if (!(id === null)) {
105
+ _context.next = 2;
106
+ break;
107
+ }
108
+
109
+ return _context.abrupt("return", {
110
+ ports: [],
111
+ portsDoc: {}
112
+ });
106
113
 
107
114
  case 2:
115
+ _context.next = 4;
116
+ return _server["default"].getPortsById(id);
117
+
118
+ case 4:
108
119
  result = _context.sent;
109
- _context.next = 5;
120
+ _context.next = 7;
110
121
  return _server["default"].queryLinksByNodeId(id);
111
122
 
112
- case 5:
123
+ case 7:
113
124
  links = _context.sent;
114
125
  ifTypes = result.map(function (item) {
115
126
  return item.type;
116
127
  }); // console.log("端口类型列表", ifTypes);
117
128
 
118
- _context.next = 9;
129
+ _context.next = 11;
119
130
  return (0, _linkUtils.getInterfaceObject)(ifTypes);
120
131
 
121
- case 9:
132
+ case 11:
122
133
  ifDoc = _context.sent;
123
134
  // console.log("端口类型字典", ifDoc);
124
135
  usedPorts = [];
@@ -152,7 +163,7 @@ function AddLinkDrawer(props) {
152
163
  portsDoc: portsDoc
153
164
  });
154
165
 
155
- case 16:
166
+ case 18:
156
167
  case "end":
157
168
  return _context.stop();
158
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "3.16.1",
3
+ "version": "3.17.1",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -110,6 +110,6 @@
110
110
  "access": "public"
111
111
  },
112
112
  "license": "MIT",
113
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@3.16.1/build/index.html",
113
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@3.17.1/build/index.html",
114
114
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
115
115
  }