@riil-frontend/component-topology 5.0.0-alpha.12 → 5.0.0-alpha.13

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.
@@ -21,7 +21,7 @@ import PluginManager from "./PluginManager";
21
21
  import topoFactory from "./topoFactory";
22
22
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig"; // eslint-disable-next-line no-undef
23
23
 
24
- var version = typeof "5.0.0-alpha.12" === 'string' ? "5.0.0-alpha.12" : null;
24
+ var version = typeof "5.0.0-alpha.13" === 'string' ? "5.0.0-alpha.13" : null;
25
25
  console.info("\u62D3\u6251\u7248\u672C: " + version);
26
26
  /**
27
27
  * 拓扑显示和编辑
@@ -205,7 +205,7 @@ function ResourceDetail(props) {
205
205
  data: resourceData,
206
206
  topo: topo
207
207
  }),
208
- visible: (_topo$viewProps = topo.viewProps) === null || _topo$viewProps === void 0 ? void 0 : (_topo$viewProps$viewe = _topo$viewProps.viewerProps) === null || _topo$viewProps$viewe === void 0 ? void 0 : (_topo$viewProps$viewe2 = _topo$viewProps$viewe.topoContext) === null || _topo$viewProps$viewe2 === void 0 ? void 0 : _topo$viewProps$viewe2.isNetworkTopo
208
+ visible: activeData.type === 'node' && ((_topo$viewProps = topo.viewProps) === null || _topo$viewProps === void 0 ? void 0 : (_topo$viewProps$viewe = _topo$viewProps.viewerProps) === null || _topo$viewProps$viewe === void 0 ? void 0 : (_topo$viewProps$viewe2 = _topo$viewProps$viewe.topoContext) === null || _topo$viewProps$viewe2 === void 0 ? void 0 : _topo$viewProps$viewe2.isNetworkTopo)
209
209
  }].filter(function (item) {
210
210
  return item.visible !== false;
211
211
  });
@@ -63,6 +63,23 @@ export default function EditLinkInfo(props) {
63
63
  var fieldOnChange = function fieldOnChange(name, value) {
64
64
  var newValues = field.getValues();
65
65
  rlog.debug("Field-onChange", newValues, name, value);
66
+
67
+ if (isAdd && sourceValue.portsDoc[newValues["source_id"]] && targetValue.portsDoc[newValues["destination_id"]]) {
68
+ var obj = {
69
+ 'FastEthernet': 'Fa',
70
+ 'GigabitEthernet': 'Gi',
71
+ 'TwoGigabitEthernet': 'Tw',
72
+ 'FiveGigabitEthernet': 'Fi',
73
+ 'TenGigabitEthernet': 'Te',
74
+ 'TwentyFiveGigE': 'Twe',
75
+ 'FortyGigabitEthernet': 'Fo',
76
+ 'XGigabitEthernet': 'Te',
77
+ 'Ten-GigabitEthernet': 'Te'
78
+ };
79
+ var str = newValues['network_link.source_ipv4 '] + '(' + obj[sourceValue.portsDoc[newValues["source_id"]].label.split(' ')[0]] + ' ' + sourceValue.portsDoc[newValues["source_id"]].label.split(' ')[1] + ') - ' + newValues['network_link.destination_ipv4 '] + '(' + obj[targetValue.portsDoc[newValues["destination_id"]].label.split(' ')[0]] + ' ' + targetValue.portsDoc[newValues["destination_id"]].label.split(' ')[1] + ')';
80
+ field.setValue('display_name', str);
81
+ }
82
+
66
83
  setValus(newValues);
67
84
  };
68
85
 
@@ -122,6 +139,7 @@ export default function EditLinkInfo(props) {
122
139
  var targetId = nowValues["destination_id"];
123
140
  var sourceRb = (_sourceValue$portsDoc = (_sourceValue$portsDoc2 = sourceValue.portsDoc[sourceId]) === null || _sourceValue$portsDoc2 === void 0 ? void 0 : _sourceValue$portsDoc2.ratedBandwidth) !== null && _sourceValue$portsDoc !== void 0 ? _sourceValue$portsDoc : 0;
124
141
  var targetRb = (_targetValue$portsDoc = (_targetValue$portsDoc2 = targetValue.portsDoc[targetId]) === null || _targetValue$portsDoc2 === void 0 ? void 0 : _targetValue$portsDoc2.ratedBandwidth) !== null && _targetValue$portsDoc !== void 0 ? _targetValue$portsDoc : 0;
142
+ console.log(sourceRb, targetRb, 'sourceRbQZQ');
125
143
  var actualBandwidth = 0;
126
144
 
127
145
  if (sourceRb && targetRb) {
@@ -50,7 +50,7 @@ var _topoFactory = _interopRequireDefault(require("./topoFactory"));
50
50
  var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTagTipConfig"));
51
51
 
52
52
  // eslint-disable-next-line no-undef
53
- var version = typeof "5.0.0-alpha.12" === 'string' ? "5.0.0-alpha.12" : null;
53
+ var version = typeof "5.0.0-alpha.13" === 'string' ? "5.0.0-alpha.13" : null;
54
54
  console.info("\u62D3\u6251\u7248\u672C: " + version);
55
55
  /**
56
56
  * 拓扑显示和编辑
@@ -230,7 +230,7 @@ function ResourceDetail(props) {
230
230
  data: resourceData,
231
231
  topo: topo
232
232
  }),
233
- visible: (_topo$viewProps = topo.viewProps) === null || _topo$viewProps === void 0 ? void 0 : (_topo$viewProps$viewe = _topo$viewProps.viewerProps) === null || _topo$viewProps$viewe === void 0 ? void 0 : (_topo$viewProps$viewe2 = _topo$viewProps$viewe.topoContext) === null || _topo$viewProps$viewe2 === void 0 ? void 0 : _topo$viewProps$viewe2.isNetworkTopo
233
+ visible: activeData.type === 'node' && ((_topo$viewProps = topo.viewProps) === null || _topo$viewProps === void 0 ? void 0 : (_topo$viewProps$viewe = _topo$viewProps.viewerProps) === null || _topo$viewProps$viewe === void 0 ? void 0 : (_topo$viewProps$viewe2 = _topo$viewProps$viewe.topoContext) === null || _topo$viewProps$viewe2 === void 0 ? void 0 : _topo$viewProps$viewe2.isNetworkTopo)
234
234
  }].filter(function (item) {
235
235
  return item.visible !== false;
236
236
  });
@@ -91,6 +91,22 @@ function EditLinkInfo(props) {
91
91
 
92
92
  _rlog["default"].debug("Field-onChange", newValues, name, value);
93
93
 
94
+ if (isAdd && sourceValue.portsDoc[newValues["source_id"]] && targetValue.portsDoc[newValues["destination_id"]]) {
95
+ var obj = {
96
+ 'FastEthernet': 'Fa',
97
+ 'GigabitEthernet': 'Gi',
98
+ 'TwoGigabitEthernet': 'Tw',
99
+ 'FiveGigabitEthernet': 'Fi',
100
+ 'TenGigabitEthernet': 'Te',
101
+ 'TwentyFiveGigE': 'Twe',
102
+ 'FortyGigabitEthernet': 'Fo',
103
+ 'XGigabitEthernet': 'Te',
104
+ 'Ten-GigabitEthernet': 'Te'
105
+ };
106
+ var str = newValues['network_link.source_ipv4 '] + '(' + obj[sourceValue.portsDoc[newValues["source_id"]].label.split(' ')[0]] + ' ' + sourceValue.portsDoc[newValues["source_id"]].label.split(' ')[1] + ') - ' + newValues['network_link.destination_ipv4 '] + '(' + obj[targetValue.portsDoc[newValues["destination_id"]].label.split(' ')[0]] + ' ' + targetValue.portsDoc[newValues["destination_id"]].label.split(' ')[1] + ')';
107
+ field.setValue('display_name', str);
108
+ }
109
+
94
110
  setValus(newValues);
95
111
  };
96
112
 
@@ -150,6 +166,7 @@ function EditLinkInfo(props) {
150
166
  var targetId = nowValues["destination_id"];
151
167
  var sourceRb = (_sourceValue$portsDoc = (_sourceValue$portsDoc2 = sourceValue.portsDoc[sourceId]) === null || _sourceValue$portsDoc2 === void 0 ? void 0 : _sourceValue$portsDoc2.ratedBandwidth) !== null && _sourceValue$portsDoc !== void 0 ? _sourceValue$portsDoc : 0;
152
168
  var targetRb = (_targetValue$portsDoc = (_targetValue$portsDoc2 = targetValue.portsDoc[targetId]) === null || _targetValue$portsDoc2 === void 0 ? void 0 : _targetValue$portsDoc2.ratedBandwidth) !== null && _targetValue$portsDoc !== void 0 ? _targetValue$portsDoc : 0;
169
+ console.log(sourceRb, targetRb, 'sourceRbQZQ');
153
170
  var actualBandwidth = 0;
154
171
 
155
172
  if (sourceRb && targetRb) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "5.0.0-alpha.12",
3
+ "version": "5.0.0-alpha.13",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -115,6 +115,6 @@
115
115
  "access": "public"
116
116
  },
117
117
  "license": "MIT",
118
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@5.0.0-alpha.12/build/index.html",
118
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@5.0.0-alpha.13/build/index.html",
119
119
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
120
120
  }