bfg-common 1.3.180 → 1.3.181
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.
|
@@ -508,14 +508,14 @@ interface API_UI_I_ListIndex {
|
|
|
508
508
|
|
|
509
509
|
export interface API_UI_I_SwitchItem {
|
|
510
510
|
id: string
|
|
511
|
-
state
|
|
511
|
+
state?: API_UI_I_State
|
|
512
512
|
index?: API_UI_I_ListIndex
|
|
513
513
|
mtu: number
|
|
514
514
|
security: API_UI_I_Security
|
|
515
515
|
shaping: API_UI_I_Shaping
|
|
516
516
|
teaming: API_UI_I_Teaming
|
|
517
517
|
nics: UI_I_AdapterStatus
|
|
518
|
-
networks
|
|
518
|
+
networks: string[]
|
|
519
519
|
|
|
520
520
|
num_ports?: string // TODO MAMMA MIA, WHERE IS IIIIIT?
|
|
521
521
|
}
|
|
@@ -3,12 +3,14 @@ import {
|
|
|
3
3
|
UI_I_SelectedPort,
|
|
4
4
|
UI_I_NetworksWithPositions,
|
|
5
5
|
UI_I_AdaptersWithPositions,
|
|
6
|
-
UI_I_SwitchLine,
|
|
7
6
|
UI_I_SelectedSwitchPositions,
|
|
8
7
|
UI_I_DiagramDataFull,
|
|
9
8
|
UI_I_AdaptersHeight,
|
|
10
9
|
UI_I_Adapter,
|
|
11
10
|
UI_I_AdaptersPositions,
|
|
11
|
+
UI_I_AdapterStatus,
|
|
12
|
+
UI_I_NetworkFull,
|
|
13
|
+
API_UI_I_SwitchItem,
|
|
12
14
|
} from '~/components/common/diagramMain/lib/models/interfaces'
|
|
13
15
|
import {
|
|
14
16
|
UI_E_NetworkType,
|
|
@@ -216,3 +218,33 @@ export const getAdaptersPositions = (
|
|
|
216
218
|
adapters,
|
|
217
219
|
}
|
|
218
220
|
}
|
|
221
|
+
|
|
222
|
+
export const makeSwitchSendData = (
|
|
223
|
+
data: UI_I_DiagramDataFull,
|
|
224
|
+
adapterStatus: UI_I_AdapterStatus
|
|
225
|
+
): API_UI_I_SwitchItem => {
|
|
226
|
+
return {
|
|
227
|
+
id: data.id,
|
|
228
|
+
mtu: data.networking.mtu,
|
|
229
|
+
networks: data.networks.map((network: UI_I_NetworkFull) => network.title),
|
|
230
|
+
nics: adapterStatus,
|
|
231
|
+
security: {
|
|
232
|
+
promiscuous: data.networking.securityPolicy[0].value,
|
|
233
|
+
forged_transmits: data.networking.securityPolicy[1].value,
|
|
234
|
+
mac_change: data.networking.securityPolicy[2].value,
|
|
235
|
+
},
|
|
236
|
+
teaming: {
|
|
237
|
+
notify_switches: data.networking.nicTeamingPolicy[0].value,
|
|
238
|
+
mode: data.networking.nicTeamingPolicy[1].value,
|
|
239
|
+
link_detection_mode: data.networking.nicTeamingPolicy[2].value,
|
|
240
|
+
failback: data.networking.nicTeamingPolicy[3].value,
|
|
241
|
+
},
|
|
242
|
+
shaping: {
|
|
243
|
+
inherit: false,
|
|
244
|
+
enabled: !!data.networking.shapingPolicy[0].value,
|
|
245
|
+
average_bw: data.networking.average_bw,
|
|
246
|
+
peak_bw: data.networking.peak_bw,
|
|
247
|
+
burst_size: data.networking.burst_size,
|
|
248
|
+
},
|
|
249
|
+
}
|
|
250
|
+
}
|