bfg-common 1.3.195 → 1.3.196
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.
- package/components/common/adapterManager/AdapterManager.vue +6 -0
- package/components/common/adapterManager/ui/actions/ActionsBar.vue +2 -0
- package/components/common/adapterManager/ui/actions/RemoveAdapterButton.vue +2 -1
- package/components/common/diagramMain/DiagramMain.vue +3 -0
- package/components/common/wizards/network/add/Add.vue +58 -10
- package/components/common/wizards/network/add/lib/config/index.ts +1 -0
- package/components/common/wizards/network/add/lib/config/sendData.ts +24 -0
- package/components/common/wizards/network/add/modals/SelectSwitch.vue +7 -3
- package/components/common/wizards/network/add/steps/CreateStandardSwitch.vue +2 -0
- package/components/common/wizards/network/add/steps/SelectConnectionType.vue +2 -2
- package/components/common/wizards/network/add/steps/SelectedTargetDevice.vue +10 -6
- package/package.json +1 -1
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
:selected-is-header="selectedIsHeader"
|
|
33
33
|
:is-disabled-move-up="isDisabledMoveUp"
|
|
34
34
|
:is-disabled-move-down="isDisabledMoveDown"
|
|
35
|
+
:is-disabled-remove="isDisabledRemove"
|
|
35
36
|
@show-add-adapter-modal="onShowAddAdapterModal"
|
|
36
37
|
@remove-adapter="onRemove"
|
|
37
38
|
@move-up-adapter="onMoveUp"
|
|
@@ -162,6 +163,7 @@ const props = withDefaults(
|
|
|
162
163
|
adapters: UI_I_SwitchAdapters
|
|
163
164
|
initialData?: UI_I_ModalsInitialData
|
|
164
165
|
addedAdapters?: string[]
|
|
166
|
+
coreAdapters?: string[]
|
|
165
167
|
freeAdapters?: UI_I_Adapter[]
|
|
166
168
|
adapterStatus?: UI_I_AdapterStatus
|
|
167
169
|
withInitial?: boolean
|
|
@@ -184,6 +186,7 @@ const props = withDefaults(
|
|
|
184
186
|
withInitial: false,
|
|
185
187
|
freeAdapters: () => [],
|
|
186
188
|
addedAdapters: () => [],
|
|
189
|
+
coreAdapters: () => [],
|
|
187
190
|
adapters: () => ({
|
|
188
191
|
totalItems: 0,
|
|
189
192
|
totalPages: 0,
|
|
@@ -230,6 +233,9 @@ const hasSelectedAdapter = computed(
|
|
|
230
233
|
!selectedAdapterId.value.includes('header-')) ||
|
|
231
234
|
selectedAddAdapterId.value !== ''
|
|
232
235
|
)
|
|
236
|
+
const isDisabledRemove = computed(() =>
|
|
237
|
+
props.coreAdapters.includes(selectedAdapterId.value)
|
|
238
|
+
)
|
|
233
239
|
|
|
234
240
|
// Some checking variables for template
|
|
235
241
|
const selectedIsHeader = computed<boolean>(
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<common-adapter-manager-ui-actions-remove-adapter-button
|
|
12
12
|
:full-mode="props.fullMode"
|
|
13
13
|
:selected-is-header="props.selectedIsHeader"
|
|
14
|
+
:is-disabled-remove="props.isDisabledRemove"
|
|
14
15
|
@remove-adapter="onRemove"
|
|
15
16
|
/>
|
|
16
17
|
<common-adapter-manager-ui-actions-move-up-adapter-button
|
|
@@ -32,6 +33,7 @@ const props = defineProps<{
|
|
|
32
33
|
selectedIsHeader: boolean
|
|
33
34
|
isDisabledMoveUp: boolean
|
|
34
35
|
isDisabledMoveDown: boolean
|
|
36
|
+
isDisabledRemove: boolean
|
|
35
37
|
}>()
|
|
36
38
|
|
|
37
39
|
const emits = defineEmits<{
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:class="[
|
|
5
5
|
'action-link-container',
|
|
6
6
|
{
|
|
7
|
-
disabled: props.selectedIsHeader,
|
|
7
|
+
disabled: props.selectedIsHeader || props.isDisabledRemove,
|
|
8
8
|
},
|
|
9
9
|
]"
|
|
10
10
|
:title="localization.removeSelected"
|
|
@@ -21,6 +21,7 @@ import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
|
21
21
|
const props = defineProps<{
|
|
22
22
|
fullMode: boolean
|
|
23
23
|
selectedIsHeader: boolean
|
|
24
|
+
isDisabledRemove: boolean
|
|
24
25
|
}>()
|
|
25
26
|
|
|
26
27
|
// UI_I_Localization
|
|
@@ -201,6 +201,7 @@
|
|
|
201
201
|
:standard-switches-initial="props.standardSwitchesInitial"
|
|
202
202
|
:free-adapters="props.freeAdapters"
|
|
203
203
|
:is-dark-mode="props.isDarkMode"
|
|
204
|
+
:selected-standard-switch-id="selectedStandardSwitchId"
|
|
204
205
|
:selected-switch-id="selectedSwitchId"
|
|
205
206
|
@check-network-label="onCheckNetworkLabel"
|
|
206
207
|
@get-existing-standard-switches="onGetExistingStandardSwitches"
|
|
@@ -478,6 +479,7 @@ const onHideMigrateVmkernelAdapterModal = (): void => {
|
|
|
478
479
|
isShowMigrateVmkernelAdapterModal.value = false
|
|
479
480
|
}
|
|
480
481
|
|
|
482
|
+
const selectedStandardSwitchId = ref<string>('')
|
|
481
483
|
const selectedSwitchId = ref<string>('')
|
|
482
484
|
|
|
483
485
|
const onShowModal = (
|
|
@@ -526,6 +528,7 @@ const onShowModal = (
|
|
|
526
528
|
break
|
|
527
529
|
case 'add-networking':
|
|
528
530
|
isShowAddNetworkingModal.value = true
|
|
531
|
+
selectedStandardSwitchId.value = properties.switch_name
|
|
529
532
|
selectedSwitchId.value = properties.switch_name
|
|
530
533
|
break
|
|
531
534
|
case 'switch-view-settings':
|
|
@@ -32,14 +32,16 @@
|
|
|
32
32
|
:standard-switches-initial="props.standardSwitchesInitial"
|
|
33
33
|
:messages-fields="selectedStep.fields"
|
|
34
34
|
:alert-messages="alertMessages[1]"
|
|
35
|
+
:selected-standard-switch-id="props.selectedStandardSwitchId"
|
|
35
36
|
:selected-switch-id="props.selectedSwitchId"
|
|
36
37
|
@hide-alert="onHideAlert"
|
|
37
38
|
@change-target-device="onChangeTargetDevice"
|
|
38
39
|
/>
|
|
39
40
|
<common-wizards-network-add-steps-create-standard-switch
|
|
40
|
-
v-if="selectedStep.id === 2"
|
|
41
|
+
v-if="selectedStep.id === 2 || selectedStep.id === 6"
|
|
41
42
|
:free-adapters="props.freeAdapters"
|
|
42
43
|
:added-adapters="addedAdapters"
|
|
44
|
+
:core-adapters="coreAdapters"
|
|
43
45
|
:adapter-status="adapterStatus"
|
|
44
46
|
:adapters="props.adapters"
|
|
45
47
|
:is-show-no-connected-active-adapters-modal="
|
|
@@ -85,9 +87,9 @@
|
|
|
85
87
|
@change-connection-settings="onChangeConnectionSettings"
|
|
86
88
|
@hide-alert="onHideAlert"
|
|
87
89
|
/>
|
|
88
|
-
<common-wizards-network-add-steps-physical-adapter
|
|
89
|
-
v-if="selectedStep.id === 6"
|
|
90
|
-
|
|
90
|
+
<!-- <common-wizards-network-add-steps-physical-adapter-->
|
|
91
|
+
<!-- v-if="selectedStep.id === 6"-->
|
|
92
|
+
<!-- />-->
|
|
91
93
|
<common-wizards-network-add-steps-ready-complete
|
|
92
94
|
v-if="selectedStep.id === 7"
|
|
93
95
|
:ready-complete-fields="readyCompleteFields"
|
|
@@ -138,6 +140,7 @@ import {
|
|
|
138
140
|
targetDeviceInitial,
|
|
139
141
|
addNetworkingZeroOrFirstSchemeDataFunc,
|
|
140
142
|
addNetworkingSecondOrThirdSchemeDataFunc,
|
|
143
|
+
addNetworkingFourthOrFifthSchemeDataFunc,
|
|
141
144
|
} from '~/components/common/wizards/network/add/lib/config'
|
|
142
145
|
|
|
143
146
|
import {
|
|
@@ -157,6 +160,7 @@ const props = withDefaults(
|
|
|
157
160
|
freeAdapters: UI_I_Adapter[]
|
|
158
161
|
project?: UI_T_Project
|
|
159
162
|
isDarkMode?: boolean
|
|
163
|
+
selectedStandardSwitchId?: string
|
|
160
164
|
selectedSwitchId?: string
|
|
161
165
|
}>(),
|
|
162
166
|
{
|
|
@@ -164,6 +168,7 @@ const props = withDefaults(
|
|
|
164
168
|
freeAdapters: () => [],
|
|
165
169
|
project: 'procurator',
|
|
166
170
|
isDarkMode: false,
|
|
171
|
+
selectedStandardSwitchId: '',
|
|
167
172
|
selectedSwitchId: '',
|
|
168
173
|
}
|
|
169
174
|
)
|
|
@@ -197,12 +202,14 @@ const connectionTypeLocal = computed<string>({
|
|
|
197
202
|
set(newValue: string) {
|
|
198
203
|
wizard.resetAfterSelected()
|
|
199
204
|
connectionType.value = newValue
|
|
200
|
-
targetDevice.value.standardSwitch = props.
|
|
205
|
+
targetDevice.value.standardSwitch = props.selectedStandardSwitchId
|
|
206
|
+
targetDevice.value.switch = props.selectedSwitchId
|
|
201
207
|
},
|
|
202
208
|
})
|
|
203
209
|
|
|
204
210
|
// Step's content data (createStandardSwitch)
|
|
205
211
|
const addedAdapters = ref<string[]>([])
|
|
212
|
+
const coreAdapters = ref<string[]>([])
|
|
206
213
|
|
|
207
214
|
const onChangeAddedAdapters = (addedAdaptersNew: string[]): void => {
|
|
208
215
|
addedAdapters.value = addedAdaptersNew
|
|
@@ -271,16 +278,27 @@ const onHideAlert = (stepId: number): void => {
|
|
|
271
278
|
wizard.hideAlertMessagesByStepId(stepId)
|
|
272
279
|
}
|
|
273
280
|
|
|
281
|
+
let flagSwitch = ''
|
|
282
|
+
|
|
274
283
|
// Choosing Scheme
|
|
275
284
|
watch(
|
|
276
285
|
[connectionTypeLocal, targetDevice],
|
|
277
|
-
(newValues,
|
|
286
|
+
(newValues, oldValues) => {
|
|
278
287
|
const newCT = newValues[0] // -> newConnectionType
|
|
279
|
-
const oldCT =
|
|
288
|
+
const oldCT = oldValues[0] // -> oldConnectionType
|
|
280
289
|
const newTD = newValues[1] // -> newTargetDevice
|
|
281
|
-
|
|
290
|
+
const oldTD = oldValues[1] // -> oldTargetDevice
|
|
291
|
+
if (!oldTD || oldTD.selected !== newTD.selected) {
|
|
292
|
+
flagSwitch = ''
|
|
293
|
+
addedAdapters.value = []
|
|
294
|
+
adapterStatus.value = {
|
|
295
|
+
active: [],
|
|
296
|
+
standby: [],
|
|
297
|
+
unused: [],
|
|
298
|
+
}
|
|
299
|
+
}
|
|
282
300
|
if (newCT !== oldCT) {
|
|
283
|
-
newCT === '0' && props.
|
|
301
|
+
newCT === '0' && props.selectedStandardSwitchId
|
|
284
302
|
? (targetDevice.value.selected = '1')
|
|
285
303
|
: (targetDevice.value.selected = '0')
|
|
286
304
|
newCT === '1' && (targetDevice.value.selected = '1')
|
|
@@ -311,7 +329,25 @@ const onGetExistingStandardSwitches = (): void => {
|
|
|
311
329
|
watch(
|
|
312
330
|
() => wizard.selectedStepId,
|
|
313
331
|
(newSelectedStep: number) => {
|
|
314
|
-
if (newSelectedStep === 1)
|
|
332
|
+
if (newSelectedStep === 1) {
|
|
333
|
+
onGetExistingStandardSwitches()
|
|
334
|
+
}
|
|
335
|
+
if (newSelectedStep === 6 && flagSwitch !== targetDevice.value.switch) {
|
|
336
|
+
const nics = props.standardSwitchesInitial.find(
|
|
337
|
+
(sw) => sw.id === targetDevice.value.switch
|
|
338
|
+
).nics
|
|
339
|
+
adapterStatus.value = {
|
|
340
|
+
active: nics.active || [],
|
|
341
|
+
standby: nics.standby || [],
|
|
342
|
+
unused: nics.unused || [],
|
|
343
|
+
}
|
|
344
|
+
coreAdapters.value = [
|
|
345
|
+
...adapterStatus.value.active,
|
|
346
|
+
...adapterStatus.value.standby,
|
|
347
|
+
...adapterStatus.value.unused,
|
|
348
|
+
]
|
|
349
|
+
flagSwitch = targetDevice.value.switch
|
|
350
|
+
}
|
|
315
351
|
|
|
316
352
|
if (newSelectedStep !== 7) return // If last step
|
|
317
353
|
if (wizard.isSelectedScheme(0)) {
|
|
@@ -361,6 +397,7 @@ const reset = (): void => {
|
|
|
361
397
|
connectionSettings.value = useDeepCopy(connectionSettingsInitial)
|
|
362
398
|
portProperties.value = useDeepCopy(portPropertiesInitial)
|
|
363
399
|
ipFourSettings.value = useDeepCopy(ipFourSettingsInitial)
|
|
400
|
+
coreAdapters.value = []
|
|
364
401
|
addedAdapters.value = []
|
|
365
402
|
adapterStatus.value = {
|
|
366
403
|
active: [],
|
|
@@ -435,6 +472,17 @@ const checkFinal = async (): Promise<UI_I_ArbitraryObject<string>> => {
|
|
|
435
472
|
type = 'network'
|
|
436
473
|
}
|
|
437
474
|
|
|
475
|
+
if (wizard.isSelectedScheme(4) || wizard.isSelectedScheme(5)) {
|
|
476
|
+
sendData = addNetworkingFourthOrFifthSchemeDataFunc(
|
|
477
|
+
targetDevice.value.switch,
|
|
478
|
+
wizard.isSelectedScheme(4),
|
|
479
|
+
adapterStatus.value,
|
|
480
|
+
targetDevice.value.mtu
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
type = 'network'
|
|
484
|
+
}
|
|
485
|
+
|
|
438
486
|
return new Promise((resolve, _reject) =>
|
|
439
487
|
emits(
|
|
440
488
|
'add-networking-data-validate',
|
|
@@ -100,3 +100,27 @@ export const addNetworkingZeroOrFirstSchemeDataFunc = (
|
|
|
100
100
|
|
|
101
101
|
return sendData
|
|
102
102
|
}
|
|
103
|
+
|
|
104
|
+
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
|
+
: {
|
|
120
|
+
mtu: mtu,
|
|
121
|
+
nics: {
|
|
122
|
+
active: adapterStatus?.active || [],
|
|
123
|
+
standby: adapterStatus?.standby || [],
|
|
124
|
+
unused: adapterStatus?.unused || [],
|
|
125
|
+
},
|
|
126
|
+
}
|
|
@@ -87,8 +87,8 @@ const onHideErrorMessageAlert = (): void => {
|
|
|
87
87
|
isShowErrorMessageAlert.value = false
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
const onSelectRow = (
|
|
91
|
-
selectedRowData.value =
|
|
90
|
+
const onSelectRow = (_index: number, item: UI_I_SelectedSwitch[]): void => {
|
|
91
|
+
selectedRowData.value = item
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
const onSelectSwitch = (): void => {
|
|
@@ -115,4 +115,8 @@ const onHideModal = (): void => {
|
|
|
115
115
|
}
|
|
116
116
|
</script>
|
|
117
117
|
|
|
118
|
-
<style scoped lang="scss"
|
|
118
|
+
<style scoped lang="scss">
|
|
119
|
+
:deep(.table-wrap) {
|
|
120
|
+
height: 300px;
|
|
121
|
+
}
|
|
122
|
+
</style>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:adapters="props.adapters"
|
|
9
9
|
:free-adapters="props.freeAdapters"
|
|
10
10
|
:added-adapters="props.addedAdapters"
|
|
11
|
+
:core-adapters="props.coreAdapters"
|
|
11
12
|
:adapter-status="props.adapterStatus"
|
|
12
13
|
:is-dark-mode="props.isDarkMode"
|
|
13
14
|
@change-added-adapters="onChangeAddedAdapters"
|
|
@@ -46,6 +47,7 @@ const props = defineProps<{
|
|
|
46
47
|
freeAdapters: UI_I_Adapter[]
|
|
47
48
|
adapterStatus: UI_I_AdapterStatus
|
|
48
49
|
adapters: UI_I_SwitchAdapters
|
|
50
|
+
coreAdapters: string[]
|
|
49
51
|
isShowNoConnectedActiveAdaptersModal: boolean
|
|
50
52
|
isShowNoActiveAdaptersModal: boolean
|
|
51
53
|
isDarkMode: boolean
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div class="add-networking-radio-button-description">
|
|
33
33
|
{{ localization.portGroupHandlesVirtualMachineTraffic }}
|
|
34
34
|
</div>
|
|
35
|
-
<div class="radio">
|
|
35
|
+
<div class="radio disabled-on-time">
|
|
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">
|
|
47
|
+
<div class="add-networking-radio-button-description disabled-on-time">
|
|
48
48
|
{{ localization.physicalNetworkAdapterHandlesNetworkTraffic }}
|
|
49
49
|
</div>
|
|
50
50
|
</form>
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
width="576px"
|
|
266
266
|
height="468px"
|
|
267
267
|
:title="localization.selectSwitch"
|
|
268
|
-
:data="
|
|
268
|
+
:data="props.standardSwitchesInitial"
|
|
269
269
|
:show="isShowSwitchModal"
|
|
270
270
|
@select-switch="onSelectSwitch"
|
|
271
271
|
@hide="onHideSwitchModal"
|
|
@@ -305,9 +305,11 @@ const props = withDefaults(
|
|
|
305
305
|
alertMessages: string[]
|
|
306
306
|
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
307
307
|
wizard: Wizard
|
|
308
|
+
selectedStandardSwitchId?: string
|
|
308
309
|
selectedSwitchId?: string
|
|
309
310
|
}>(),
|
|
310
311
|
{
|
|
312
|
+
selectedStandardSwitchId: '',
|
|
311
313
|
selectedSwitchId: '',
|
|
312
314
|
}
|
|
313
315
|
)
|
|
@@ -369,11 +371,11 @@ const onShowModal = (value: string): void => {
|
|
|
369
371
|
}
|
|
370
372
|
|
|
371
373
|
// Switches selection functionality
|
|
372
|
-
const onSelectSwitch = (
|
|
373
|
-
fields.value.switch =
|
|
374
|
+
const onSelectSwitch = (selectedSwitchId: string): void => {
|
|
375
|
+
fields.value.switch = selectedSwitchId
|
|
374
376
|
}
|
|
375
|
-
const onSelectStandardSwitch = (
|
|
376
|
-
fields.value.standardSwitch =
|
|
377
|
+
const onSelectStandardSwitch = (selectedStandardSwitchId: string): void => {
|
|
378
|
+
fields.value.standardSwitch = selectedStandardSwitchId
|
|
377
379
|
}
|
|
378
380
|
const onSelectNetwork = (_selectedNetworkId: string): void => {
|
|
379
381
|
fields.value.network = ''
|
|
@@ -381,7 +383,9 @@ const onSelectNetwork = (_selectedNetworkId: string): void => {
|
|
|
381
383
|
|
|
382
384
|
onMounted(() => {
|
|
383
385
|
!fields.value.standardSwitch &&
|
|
384
|
-
(fields.value.standardSwitch = props.
|
|
386
|
+
(fields.value.standardSwitch = props.selectedStandardSwitchId)
|
|
387
|
+
|
|
388
|
+
!fields.value.switch && (fields.value.switch = props.selectedSwitchId)
|
|
385
389
|
})
|
|
386
390
|
|
|
387
391
|
const onHideAlert = (): void => {
|