bfg-common 1.3.221 → 1.3.222

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.
@@ -15,8 +15,7 @@ import {
15
15
 
16
16
  export const networkEditDataFunc = (
17
17
  networkData: UI_I_EditFieldsData,
18
- id: string = '',
19
- switchId: string = ''
18
+ initialData: UI_I_ModalsInitialData
20
19
  ): UI_I_NetworkEditSendData => {
21
20
  const { vlanId, networkLabel } =
22
21
  networkData.properties as UI_I_PropertiesFields
@@ -40,10 +39,24 @@ export const networkEditDataFunc = (
40
39
  const vlan: number =
41
40
  vlanId === 'None (0)' ? 0 : vlanId === 'All (4095)' ? 4095 : Number(vlanId)
42
41
 
43
- const security: API_UI_I_Security = {
44
- promiscuous: promiscuousMode.selected,
45
- mac_change: macAddressChanges.selected,
46
- forged_transmits: forgedTransmits.selected,
42
+ const security: API_UI_I_Security = {}
43
+
44
+ if (promiscuousMode.checked) {
45
+ security.promiscuous = promiscuousMode.selected
46
+ } else {
47
+ security.promiscuous_computed = promiscuousMode.selected
48
+ }
49
+
50
+ if (forgedTransmits.checked) {
51
+ security.forged_transmits = forgedTransmits.selected
52
+ } else {
53
+ security.forged_transmits_computed = forgedTransmits.selected
54
+ }
55
+
56
+ if (macAddressChanges.checked) {
57
+ security.mac_change = macAddressChanges.selected
58
+ } else {
59
+ security.mac_change_computed = macAddressChanges.selected
47
60
  }
48
61
 
49
62
  const shaping = {
@@ -54,17 +67,36 @@ export const networkEditDataFunc = (
54
67
  burst_size: burstSize,
55
68
  }
56
69
 
57
- const teaming: API_UI_I_Teaming = {
58
- mode: loadBalancing.selected,
59
- link_detection_mode: networkFailureDetection.selected,
60
- notify_switches: notifySwitches.selected,
61
- failback: failback.selected,
70
+ const teaming: API_UI_I_Teaming = {}
71
+
72
+ if (loadBalancing.checked) {
73
+ teaming.mode = loadBalancing.selected
74
+ } else {
75
+ teaming.mode_computed = loadBalancing.selected
76
+ }
77
+
78
+ if (networkFailureDetection.checked) {
79
+ teaming.link_detection_mode = networkFailureDetection.selected
80
+ } else {
81
+ teaming.link_detection_mode_computed = networkFailureDetection.selected
82
+ }
83
+
84
+ if (notifySwitches.checked) {
85
+ teaming.notify_switches = notifySwitches.selected
86
+ } else {
87
+ teaming.notify_switches_computed = notifySwitches.selected
88
+ }
89
+
90
+ if (failback.checked) {
91
+ teaming.failback = failback.selected
92
+ } else {
93
+ teaming.failback_computed = failback.selected
62
94
  }
63
95
 
64
96
  return {
65
- id,
97
+ id: initialData.id || '',
66
98
  name: networkLabel,
67
- switch: switchId,
99
+ switch: initialData.switch_name || '',
68
100
  nics: {
69
101
  active,
70
102
  standby,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.221",
4
+ "version": "1.3.222",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",