bfg-common 1.3.203 → 1.3.205

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.
@@ -6,41 +6,45 @@ import {
6
6
  UI_I_TargetDevice,
7
7
  UI_I_AddNetworkingSecondOrThirdSchemeDataSend,
8
8
  } from '~/components/common/wizards/network/add/lib/models/interfaces'
9
- import { UI_I_AdapterStatus } from '~/components/common/diagramMain/lib/models/interfaces'
9
+ import {
10
+ UI_I_AdapterStatus,
11
+ UI_I_DiagramData,
12
+ } from '~/components/common/diagramMain/lib/models/interfaces'
13
+ import { makeSwitchSendData } from '~/components/common/diagramMain/lib/utils/utils'
10
14
 
11
15
  export const addNetworkingSecondOrThirdSchemeDataFunc = (
12
- connectionSettings: UI_I_ConnectionSettings,
13
- targetDevice: UI_I_TargetDevice,
14
- vlan: number,
15
- isSecondScheme: boolean = false,
16
- adapterStatus?: UI_I_AdapterStatus
16
+ connectionSettings: UI_I_ConnectionSettings,
17
+ targetDevice: UI_I_TargetDevice,
18
+ vlan: number,
19
+ isSecondScheme: boolean = false,
20
+ adapterStatus?: UI_I_AdapterStatus
17
21
  ): UI_I_AddNetworkingSecondOrThirdSchemeDataSend =>
18
- isSecondScheme
19
- ? {
20
- vlan,
21
- name: connectionSettings.networkLabel,
22
- switch: targetDevice.standardSwitch,
23
- }
24
- : {
25
- vlan,
26
- name: connectionSettings.networkLabel,
27
- new_switch: {
28
- mtu: targetDevice.selected === '3' ? targetDevice.mtu : undefined,
29
- nics: {
30
- active: adapterStatus?.active || [],
31
- standby: adapterStatus?.standby || [],
32
- unused: adapterStatus?.unused || [],
22
+ isSecondScheme
23
+ ? {
24
+ vlan,
25
+ name: connectionSettings.networkLabel,
26
+ switch: targetDevice.standardSwitch,
27
+ }
28
+ : {
29
+ vlan,
30
+ name: connectionSettings.networkLabel,
31
+ new_switch: {
32
+ mtu: targetDevice.selected === '3' ? targetDevice.mtu : undefined,
33
+ nics: {
34
+ active: adapterStatus?.active || [],
35
+ standby: adapterStatus?.standby || [],
36
+ unused: adapterStatus?.unused || [],
37
+ },
33
38
  },
34
- },
35
- }
39
+ }
36
40
 
37
41
  export const addNetworkingZeroOrFirstSchemeDataFunc = (
38
- targetDevice: UI_I_TargetDevice,
39
- vlan: number,
40
- portProperties: UI_I_PortProperties,
41
- ipFourSettings: UI_I_IpFourSettings,
42
- isFirstScheme?: boolean,
43
- adapterStatus?: UI_I_AdapterStatus
42
+ targetDevice: UI_I_TargetDevice,
43
+ vlan: number,
44
+ portProperties: UI_I_PortProperties,
45
+ ipFourSettings: UI_I_IpFourSettings,
46
+ isFirstScheme?: boolean,
47
+ adapterStatus?: UI_I_AdapterStatus
44
48
  ): UI_I_AddNetworkingZeroOrFirstSchemeDataSend => {
45
49
  const sendData: UI_I_AddNetworkingZeroOrFirstSchemeDataSend = {
46
50
  switch: targetDevice.selected === '1' ? targetDevice.standardSwitch : '',
@@ -68,8 +72,8 @@ export const addNetworkingZeroOrFirstSchemeDataFunc = (
68
72
  net_mask: ipFourSettings.static.subnetMask,
69
73
  gateway_override: ipFourSettings.static.defaultGateway.override,
70
74
  gateway: ipFourSettings.static.defaultGateway.override
71
- ? ipFourSettings.static.defaultGateway.value
72
- : '',
75
+ ? ipFourSettings.static.defaultGateway.value
76
+ : '',
73
77
  },
74
78
  }
75
79
 
@@ -87,36 +91,45 @@ export const addNetworkingZeroOrFirstSchemeDataFunc = (
87
91
  const isAutoIp: boolean = ipFourSettings.ipSettings === '0'
88
92
 
89
93
  sendData.tcp_config = isAutoIp
90
- ? { auto: true }
91
- : {
94
+ ? { auto: true }
95
+ : {
92
96
  auto: false,
93
97
  ipv4: ipFourSettings.static.ipFourAddress,
94
98
  net_mask: ipFourSettings.static.subnetMask,
95
99
  gateway_override: ipFourSettings.static.defaultGateway.override,
96
100
  gateway: ipFourSettings.static.defaultGateway.override
97
- ? ipFourSettings.static.defaultGateway.value
98
- : '',
101
+ ? ipFourSettings.static.defaultGateway.value
102
+ : '',
99
103
  }
100
104
 
101
105
  return sendData
102
106
  }
103
107
 
104
108
  export const addNetworkingFourthOrFifthSchemeDataFunc = (
105
- switchId: string,
106
- isFourthScheme: boolean = false,
107
- adapterStatus: UI_I_AdapterStatus,
108
- mtu?: number
109
- ): any =>
110
- isFourthScheme
111
- ? {
112
- id: switchId,
113
- nics: {
114
- active: adapterStatus?.active || [],
115
- standby: adapterStatus?.standby || [],
116
- unused: adapterStatus?.unused || [],
117
- },
118
- }
119
- : {
109
+ switchId: string,
110
+ isFourthScheme: boolean = false,
111
+ adapterStatus: UI_I_AdapterStatus,
112
+ switchData: UI_I_DiagramData[] | null,
113
+ mtu?: number
114
+ ): any => {
115
+ let data: UI_I_DiagramData | null = null
116
+ if (switchData) {
117
+ data = switchData.find(
118
+ (d: UI_I_DiagramData) => d.diagramName === switchId
119
+ ) as UI_I_DiagramData
120
+ }
121
+
122
+ return isFourthScheme
123
+ ? makeSwitchSendData(data as UI_I_DiagramData, adapterStatus)
124
+ : // {
125
+ // id: switchId,
126
+ // nics: {
127
+ // active: adapterStatus?.active || [],
128
+ // standby: adapterStatus?.standby || [],
129
+ // unused: adapterStatus?.unused || [],
130
+ // },
131
+ // }
132
+ {
120
133
  mtu: mtu,
121
134
  nics: {
122
135
  active: adapterStatus?.active || [],
@@ -124,3 +137,4 @@ export const addNetworkingFourthOrFifthSchemeDataFunc = (
124
137
  unused: adapterStatus?.unused || [],
125
138
  },
126
139
  }
140
+ }
@@ -154,6 +154,19 @@ export interface UI_I_AddNetworkingSecondOrThirdSchemeDataSend {
154
154
  }
155
155
  }
156
156
 
157
+ export interface UI_I_AddNetworkingFourthOrFifthSchemeDataSend {
158
+ name: string
159
+ switch?: string | undefined
160
+ new_switch?: {
161
+ mtu: number | undefined
162
+ nics: {
163
+ active: string[]
164
+ standby: string[]
165
+ unused: string[]
166
+ }
167
+ }
168
+ }
169
+
157
170
  export interface UI_I_VlanIdData {
158
171
  text: string
159
172
  value: string
@@ -179,30 +192,32 @@ export interface UI_I_ReadyCompleteFirstColumn {
179
192
  export interface UI_I_AddNetworkingEmits {
180
193
  (event: 'hide'): void
181
194
  (
182
- event: 'add-networking-data-validate',
183
- networkData:
184
- | UI_I_AddNetworkingSecondOrThirdSchemeDataSend
185
- | UI_I_AddNetworkingZeroOrFirstSchemeDataSend,
186
- type: string,
187
- setValidation: (err_arg: UI_I_ArbitraryObject<string>) => void
195
+ event: 'add-networking-data-validate',
196
+ networkData:
197
+ | UI_I_AddNetworkingSecondOrThirdSchemeDataSend
198
+ | UI_I_AddNetworkingZeroOrFirstSchemeDataSend
199
+ | UI_I_AddNetworkingFourthOrFifthSchemeDataSend,
200
+ type: string,
201
+ setValidation: (err_arg: UI_I_ArbitraryObject<string>) => void
188
202
  ): void
189
203
  (
190
- event: 'send-add-networking-data',
191
- schemeData:
192
- | UI_I_AddNetworkingSecondOrThirdSchemeDataSend
193
- | UI_I_AddNetworkingZeroOrFirstSchemeDataSend,
194
- type: string,
195
- hideSendNetworkDataLoader: () => void,
196
- onHideAddNetworkingModal: () => void
204
+ event: 'send-add-networking-data',
205
+ schemeData:
206
+ | UI_I_AddNetworkingSecondOrThirdSchemeDataSend
207
+ | UI_I_AddNetworkingZeroOrFirstSchemeDataSend
208
+ | UI_I_AddNetworkingFourthOrFifthSchemeDataSend,
209
+ type: string,
210
+ hideSendNetworkDataLoader: () => void,
211
+ onHideAddNetworkingModal: () => void
197
212
  ): void
198
213
  (event: 'get-existing-standard-switches', cb: () => void): void
199
214
  (event: 'get-free-adapters', cb: () => void): void
200
215
  (
201
- event: 'check-network-label',
202
- networkLabel: string,
203
- cb: (error_message: string) => void
216
+ event: 'check-network-label',
217
+ networkLabel: string,
218
+ cb: (error_message: string) => void
204
219
  ): void
205
- (event: 'get-tcp-stacks', cb: () => void): void
220
+ (event: 'get-tcp-stacks'): void
206
221
  }
207
222
 
208
223
  export interface UI_I_TCPStack {
@@ -32,7 +32,7 @@
32
32
  <div class="add-networking-radio-button-description">
33
33
  {{ localization.portGroupHandlesVirtualMachineTraffic }}
34
34
  </div>
35
- <div class="radio disabled-on-time">
35
+ <div class="radio">
36
36
  <input
37
37
  id="physical-adapter"
38
38
  type="radio"
@@ -44,7 +44,7 @@
44
44
  {{ localization.physicalNetworkAdapter }}
45
45
  </label>
46
46
  </div>
47
- <div class="add-networking-radio-button-description disabled-on-time">
47
+ <div class="add-networking-radio-button-description">
48
48
  {{ localization.physicalNetworkAdapterHandlesNetworkTraffic }}
49
49
  </div>
50
50
  </form>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.203",
4
+ "version": "1.3.205",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",