bfg-common 1.4.656 → 1.4.657

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.
Files changed (38) hide show
  1. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  2. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  3. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  4. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  5. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  6. package/components/common/browse/lib/models/interfaces.ts +5 -5
  7. package/components/common/diagramMain/Header.vue +211 -211
  8. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  9. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  10. package/components/common/diagramMain/lib/models/types.ts +21 -21
  11. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  12. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
  13. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  14. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
  15. package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
  16. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  17. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  18. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  19. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  20. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +398 -398
  21. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  22. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  23. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
  24. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  25. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  26. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  27. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  28. package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +537 -537
  29. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  30. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  31. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  32. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  33. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  34. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  35. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  36. package/components/common/diagramMain/port/Ports.vue +47 -47
  37. package/components/common/wizards/network/add/lib/config/steps.ts +464 -464
  38. package/package.json +1 -1
@@ -1,537 +1,537 @@
1
- <template>
2
- <atoms-wizard
3
- v-model:show="props.show"
4
- :wizard="wizard"
5
- :selected-scheme="selectedScheme"
6
- :title="title"
7
- :localization="localization"
8
- :class="[
9
- 'migrate-vm-kernel-modal',
10
- {
11
- 'is-dark': props.isDarkMode,
12
- },
13
- ]"
14
- @change-steps="onChangeSteps"
15
- @hide="onHide"
16
- @submit="onSubmit"
17
- >
18
- <template #modalBody="{ selectedStep }">
19
- <common-diagram-main-modals-migrate-vmkernel-adapter-steps-select-vmkernel-adapter
20
- v-if="selectedStep.id === 0"
21
- :vmkernel-adapter="vmkernelAdapter"
22
- :table-data="filteredNetworksList"
23
- :alert-messages="alertMessages[0]"
24
- @hide-alert="onHideAlert"
25
- @change-vmkernel-adapter="onChangeMigrateVmkernelAdapter"
26
- />
27
- <common-diagram-main-modals-migrate-vmkernel-adapter-steps-connection-settings
28
- v-if="selectedStep.id === 1"
29
- :connection-settings="connectionSettings"
30
- :messages-fields="selectedStep.fields"
31
- :alert-messages="alertMessages[1]"
32
- :wizard="wizard"
33
- @hide-alert="onHideAlert"
34
- @change-connection-settings="onChangeConnectionSettings"
35
- />
36
- <common-diagram-main-modals-migrate-vmkernel-adapter-steps-vmkernel-adapter-ready-complete
37
- v-if="selectedStep.id === 2"
38
- :data="readyCompleteData"
39
- />
40
- </template>
41
- </atoms-wizard>
42
- </template>
43
-
44
- <script setup lang="ts">
45
- import type { UI_I_Localization } from '~/lib/models/interfaces'
46
- import type {
47
- UI_I_Network,
48
- UI_I_VmkernelAdapterTableData,
49
- } from '~/components/common/diagramMain/lib/models/interfaces'
50
- import type {
51
- UI_I_ConnectionSettings,
52
- UI_I_SelectVmkernelAdapter,
53
- } from '~/components/common/wizards/network/add/lib/models/interfaces'
54
- import type {
55
- UI_I_WizardStep,
56
- UI_I_ValidationReturn,
57
- } from '~/components/atoms/wizard/lib/models/interfaces'
58
- import type {
59
- UI_I_MigrateVmkernelAdapterEmits,
60
- UI_I_MigrationVmkernelAdapterReadyComplete,
61
- } from '~/components/common/diagramMain/lib/models/interfaces'
62
- import { UI_E_MigrationValidationFields } from '~/components/common/diagramMain/lib/models/enums'
63
- import {
64
- stepsFunc,
65
- stepsSchemeInitial,
66
- } from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps'
67
- import {
68
- checkNetworkAsync,
69
- checkConnectionSettingsSync,
70
- checkSelectedVmSync,
71
- } from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations'
72
- import Wizard from '~/components/atoms/wizard/lib/utils/utils'
73
- import { readyCompleteInitial } from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps'
74
-
75
- const props = withDefaults(
76
- defineProps<{
77
- show: boolean
78
- switchName?: string
79
- networksList?: UI_I_Network[]
80
- switchNetworks?: UI_I_Network[]
81
- isDarkMode: boolean
82
- isMigrateAdapterLoading?: boolean
83
- }>(),
84
- {
85
- switchName: '',
86
- networksList: () => [],
87
- switchNetworks: () => [],
88
- isMigrateAdapterLoading: false,
89
- }
90
- )
91
-
92
- const emits = defineEmits<UI_I_MigrateVmkernelAdapterEmits>()
93
-
94
- const localization = computed<UI_I_Localization>(() => useLocal())
95
-
96
- const wizard: Wizard = new Wizard(
97
- stepsFunc(localization.value),
98
- stepsSchemeInitial
99
- )
100
- const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
101
- const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
102
-
103
- const hostname = ref<string>('')
104
- const title = computed<string>(
105
- () =>
106
- `${hostname.value} - ${localization.value.common.migrateVmKernelNetworkAdapterTo} ${props.switchName}`
107
- )
108
-
109
- const connectionSettings = ref<UI_I_ConnectionSettings>({
110
- networkLabel: 'VM Network',
111
- vlanId: 'None (0)',
112
- })
113
-
114
- const vmkernelAdapter = ref<UI_I_SelectVmkernelAdapter>({
115
- vm: '',
116
- })
117
-
118
- const readyCompleteData =
119
- ref<UI_I_MigrationVmkernelAdapterReadyComplete>(readyCompleteInitial)
120
-
121
- const validationFunc = async (
122
- value: UI_I_WizardStep[],
123
- currentStep: UI_I_WizardStep,
124
- nextStep: UI_I_WizardStep
125
- ): Promise<UI_I_ValidationReturn> => {
126
- let stepHasError = false
127
-
128
- if (wizard.isValidateForStep(0, currentStep.id, nextStep.id)) {
129
- const selectVmkernelAdapterValidation = checkSelectedVmSync(
130
- localization.value,
131
- vmkernelAdapter.value,
132
- wizard,
133
- value
134
- )
135
-
136
- value = selectVmkernelAdapterValidation.newValue
137
-
138
- stepHasError = stepHasError || selectVmkernelAdapterValidation.stepHasError
139
- }
140
-
141
- if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
142
- const labelValidation = await checkNetworkAsync(
143
- value,
144
- connectionSettings.value.networkLabel,
145
- 1,
146
- UI_E_MigrationValidationFields.CONNECTION_SETTINGS_NETWORK,
147
- emits,
148
- localization.value,
149
- wizard
150
- )
151
-
152
- value = labelValidation.newValue
153
-
154
- const connectionSettingsValidation = checkConnectionSettingsSync(
155
- localization.value,
156
- connectionSettings.value,
157
- wizard,
158
- value
159
- )
160
-
161
- value = connectionSettingsValidation.newValue
162
-
163
- stepHasError =
164
- stepHasError ||
165
- labelValidation.stepHasError ||
166
- connectionSettingsValidation.stepHasError
167
- }
168
-
169
- return {
170
- newValue: value,
171
- stepHasError,
172
- }
173
- }
174
-
175
- const finalValidationFunc = async (
176
- value: UI_I_WizardStep[]
177
- ): Promise<UI_I_ValidationReturn> => {
178
- let stepHasError = false
179
-
180
- // wizard.setLoader(true)
181
-
182
- // wizard.setLoader(false)
183
- return {
184
- stepHasError,
185
- newValue: value,
186
- }
187
- }
188
-
189
- const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
190
- wizard.changeSteps(value, validationFunc, finalValidationFunc)
191
-
192
- const filteredNetworksList = ref<UI_I_VmkernelAdapterTableData[]>([])
193
-
194
- watch(
195
- () => wizard.selectedStepId,
196
- (newSelectedStepId: number) => {
197
- if (newSelectedStepId !== 2) return
198
-
199
- const from = filteredNetworksList.value.find(
200
- (network) => network.name === vmkernelAdapter.value.vm
201
- )
202
-
203
- readyCompleteData.value = {
204
- vm: vmkernelAdapter.value.vm,
205
- currentSettings: {
206
- switch: from?.switch || '',
207
- network: from?.networkLabel || '',
208
- },
209
- newSettings: {
210
- switch: props.switchName,
211
- network: connectionSettings.value.networkLabel,
212
- },
213
- vlanId: connectionSettings.value.vlanId,
214
- }
215
- }
216
- )
217
-
218
- watch(
219
- () => props.switchNetworks,
220
- (netsOnSwitch: UI_I_Network[]) => {
221
- const vmKernelNetworksIdOnSwitch = netsOnSwitch
222
- .filter((net: UI_I_Network) => net.networkType === '1')
223
- .map((net: UI_I_Network) => net.id)
224
-
225
- filteredNetworksList.value = props.networksList
226
- .filter(
227
- (net: UI_I_Network) =>
228
- net.networkType === '1' &&
229
- !vmKernelNetworksIdOnSwitch.includes(net.id)
230
- )
231
- .map((net: UI_I_Network, index: number) => ({
232
- name: net.sysx?.id || '',
233
- networkLabel: net.title,
234
- switch: net.switchName || '',
235
- ipAddress: net.sysx?.ipv4_settings.ipv4 || '--',
236
- tcp: net.sysx?.tcp_stack
237
- ? localization.value[net.sysx?.tcp_stack]
238
- : '--',
239
- id: `${net.sysx?.id || ''}-${index}`,
240
- }))
241
- },
242
- { deep: true, immediate: true }
243
- )
244
-
245
- const onChangeConnectionSettings = (
246
- newFields: UI_I_ConnectionSettings
247
- ): void => {
248
- connectionSettings.value = newFields
249
- }
250
-
251
- const onChangeMigrateVmkernelAdapter = (
252
- newFields: UI_I_SelectVmkernelAdapter
253
- ): void => {
254
- vmkernelAdapter.value = newFields
255
- }
256
-
257
- const reset = (): void => {
258
- wizard.reset()
259
- connectionSettings.value = {
260
- networkLabel: 'VM Network',
261
- vlanId: 'None (0)',
262
- }
263
- vmkernelAdapter.value = {
264
- vm: '',
265
- }
266
- }
267
-
268
- const onHideAlert = (stepId: number): void => {
269
- wizard.hideAlertMessagesByStepId(stepId)
270
- }
271
-
272
- const onHide = (): void => {
273
- emits('hide')
274
- reset()
275
- }
276
-
277
- const onSubmit = (): void => {
278
- onHide()
279
- }
280
-
281
- watch(
282
- () => props.isMigrateAdapterLoading,
283
- (newValue: boolean) => {
284
- wizard.setLoader(newValue)
285
- },
286
- { immediate: true }
287
- )
288
-
289
- onMounted(() => {
290
- hostname.value = location.hostname
291
- })
292
- </script>
293
-
294
- <style scoped lang="scss">
295
- .main-step-container {
296
- display: flex;
297
- }
298
-
299
- :deep(.modal) {
300
- & > .modal-dialog > .modal-content > .modal-body {
301
- height: calc(100% - 110px);
302
- }
303
- }
304
- .step-items-container {
305
- width: 230px;
306
- padding: 10px 5px 10px 6px;
307
- li {
308
- display: flex;
309
- margin: 0;
310
- height: 24.8px;
311
- span {
312
- width: 16px;
313
- }
314
- }
315
-
316
- .step-item {
317
- margin: 0;
318
- height: 24.8px;
319
- padding-left: 5px;
320
- // 0-Disabled
321
- &.status-0 {
322
- height: 24.8px;
323
- overflow: hidden;
324
- text-overflow: ellipsis;
325
- white-space: nowrap;
326
- border-bottom: 1px solid transparent;
327
- width: 189px;
328
- line-height: 24px;
329
- display: inline-block;
330
- text-decoration: none;
331
- font-weight: 700;
332
- color: #999;
333
- cursor: default;
334
- }
335
- // 1-Selected
336
- &.status-1 {
337
- background-color: #29414e;
338
- color: #ffffff;
339
- border-bottom: 1px solid transparent;
340
- overflow: hidden;
341
- text-overflow: ellipsis;
342
- white-space: nowrap;
343
- border-radius: 5px;
344
- cursor: default;
345
- width: 189px;
346
- line-height: 24px;
347
- display: inline-block;
348
- text-decoration: none;
349
- font-weight: 700;
350
- }
351
- // 2-Active
352
- &.status-2 {
353
- overflow: hidden;
354
- text-overflow: ellipsis;
355
- white-space: nowrap;
356
- border-bottom: 1px solid transparent;
357
- width: 189px;
358
- line-height: 24px;
359
- cursor: pointer;
360
- display: inline-block;
361
- text-decoration: none;
362
- font-weight: 700;
363
- color: #333;
364
- &:hover {
365
- color: #454545;
366
- background-color: #e8e8e8;
367
- border-bottom: 1px solid #666666;
368
- border-radius: 5px;
369
- }
370
- }
371
- // 3-Complete
372
- &.status-3 {
373
- overflow: hidden;
374
- text-overflow: ellipsis;
375
- white-space: nowrap;
376
- border-bottom: 1px solid transparent;
377
- width: 189px;
378
- line-height: 24px;
379
- display: inline-block;
380
- text-decoration: none;
381
- font-weight: 700;
382
- color: #333;
383
- cursor: pointer;
384
- &:hover {
385
- color: #454545;
386
- background-color: #e8e8e8;
387
- border-bottom: 1px solid #666666;
388
- text-decoration: none;
389
- border-radius: 5px;
390
- }
391
- }
392
- // 4-ActiveSelected
393
- &.status-4 {
394
- background-color: #29414e;
395
- color: #ffffff;
396
- border-bottom: 1px solid transparent;
397
- overflow: hidden;
398
- text-overflow: ellipsis;
399
- white-space: nowrap;
400
- border-radius: 5px;
401
- cursor: default;
402
- width: 189px;
403
- line-height: 24px;
404
- display: inline-block;
405
- text-decoration: none;
406
- font-weight: 700;
407
- }
408
- }
409
- }
410
- :deep(.with-underline) {
411
- & > .modal-dialog > .modal-content > .modal-header {
412
- border-bottom: 1px solid #a6a6a6;
413
- padding: 0;
414
- }
415
- & > .modal-dialog > .modal-content > .modal-body {
416
- height: calc(100% - 87px);
417
- }
418
- }
419
- :deep(.wizard-content-container.add-networking-step) {
420
- .danger-not-valid {
421
- border: 2px solid red;
422
- border-bottom: 1px solid #db2100;
423
- }
424
- .tooltip-field {
425
- margin-right: 12px;
426
- }
427
-
428
- .horizontal-flex-container {
429
- margin-bottom: 5px;
430
- min-height: 36px;
431
- display: flex;
432
- flex-direction: row;
433
- }
434
- .property-label-group {
435
- width: 140px;
436
- }
437
- .disabled {
438
- opacity: 0.4;
439
- pointer-events: none;
440
- }
441
-
442
- .wizard-content-port {
443
- .margin-left-property-value-group {
444
- margin-left: 10px;
445
- }
446
-
447
- .property-value-group {
448
- padding-left: 23px;
449
- }
450
- .horizontal-flex-container {
451
- min-height: 24px;
452
- margin-bottom: 0;
453
- }
454
-
455
- .radio {
456
- min-height: 39px;
457
- margin: 10px 0;
458
- }
459
-
460
- .form-block {
461
- margin: 12px 0 24px 0;
462
- padding-left: 23px;
463
-
464
- &.form-block-ipv {
465
- input[type='text'] {
466
- width: 143px;
467
- }
468
-
469
- .horizontal-flex-container > label {
470
- margin-right: 50px;
471
- }
472
- }
473
- }
474
-
475
- .edit-vmkernel-adapter-section {
476
- padding-top: 12px;
477
-
478
- label {
479
- input[type='checkbox'] {
480
- margin-right: 4px;
481
- transform: translateY(1px);
482
- }
483
- }
484
-
485
- .horizontal-flex-container {
486
- margin-bottom: 5px;
487
- }
488
- }
489
- .port-properties-network-label {
490
- width: 280px;
491
- }
492
- .port-properties-padding {
493
- padding-top: 8px;
494
- }
495
- .port-properties-mtu-selector {
496
- margin-right: 12px;
497
- }
498
- .port-properties-mtu-container {
499
- display: flex;
500
- }
501
- select {
502
- height: 24px;
503
- }
504
- }
505
- .nw-property-value-group {
506
- display: inline;
507
- }
508
- }
509
-
510
- .migrate-vm-kernel-modal.is-dark {
511
- :deep(.wizard-content-container) {
512
- .ready-complete-container {
513
- background-color: var(--pannel-bg-color);
514
- margin-top: 12px;
515
-
516
- span {
517
- color: var(--description-color);
518
- }
519
- }
520
-
521
- .property-label-group {
522
- color: var(--main-color-mode2);
523
- }
524
- .flex-property-label-group {
525
- color: var(--main-color-mode2);
526
- }
527
- .flex-property-value-group {
528
- select {
529
- color: #fff;
530
- }
531
- }
532
- .wizard-content-header-area .title {
533
- color: #adbbc4;
534
- }
535
- }
536
- }
537
- </style>
1
+ <template>
2
+ <atoms-wizard
3
+ v-model:show="props.show"
4
+ :wizard="wizard"
5
+ :selected-scheme="selectedScheme"
6
+ :title="title"
7
+ :localization="localization"
8
+ :class="[
9
+ 'migrate-vm-kernel-modal',
10
+ {
11
+ 'is-dark': props.isDarkMode,
12
+ },
13
+ ]"
14
+ @change-steps="onChangeSteps"
15
+ @hide="onHide"
16
+ @submit="onSubmit"
17
+ >
18
+ <template #modalBody="{ selectedStep }">
19
+ <common-diagram-main-modals-migrate-vmkernel-adapter-steps-select-vmkernel-adapter
20
+ v-if="selectedStep.id === 0"
21
+ :vmkernel-adapter="vmkernelAdapter"
22
+ :table-data="filteredNetworksList"
23
+ :alert-messages="alertMessages[0]"
24
+ @hide-alert="onHideAlert"
25
+ @change-vmkernel-adapter="onChangeMigrateVmkernelAdapter"
26
+ />
27
+ <common-diagram-main-modals-migrate-vmkernel-adapter-steps-connection-settings
28
+ v-if="selectedStep.id === 1"
29
+ :connection-settings="connectionSettings"
30
+ :messages-fields="selectedStep.fields"
31
+ :alert-messages="alertMessages[1]"
32
+ :wizard="wizard"
33
+ @hide-alert="onHideAlert"
34
+ @change-connection-settings="onChangeConnectionSettings"
35
+ />
36
+ <common-diagram-main-modals-migrate-vmkernel-adapter-steps-vmkernel-adapter-ready-complete
37
+ v-if="selectedStep.id === 2"
38
+ :data="readyCompleteData"
39
+ />
40
+ </template>
41
+ </atoms-wizard>
42
+ </template>
43
+
44
+ <script setup lang="ts">
45
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
46
+ import type {
47
+ UI_I_Network,
48
+ UI_I_VmkernelAdapterTableData,
49
+ } from '~/components/common/diagramMain/lib/models/interfaces'
50
+ import type {
51
+ UI_I_ConnectionSettings,
52
+ UI_I_SelectVmkernelAdapter,
53
+ } from '~/components/common/wizards/network/add/lib/models/interfaces'
54
+ import type {
55
+ UI_I_WizardStep,
56
+ UI_I_ValidationReturn,
57
+ } from '~/components/atoms/wizard/lib/models/interfaces'
58
+ import type {
59
+ UI_I_MigrateVmkernelAdapterEmits,
60
+ UI_I_MigrationVmkernelAdapterReadyComplete,
61
+ } from '~/components/common/diagramMain/lib/models/interfaces'
62
+ import { UI_E_MigrationValidationFields } from '~/components/common/diagramMain/lib/models/enums'
63
+ import {
64
+ stepsFunc,
65
+ stepsSchemeInitial,
66
+ } from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps'
67
+ import {
68
+ checkNetworkAsync,
69
+ checkConnectionSettingsSync,
70
+ checkSelectedVmSync,
71
+ } from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations'
72
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
73
+ import { readyCompleteInitial } from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps'
74
+
75
+ const props = withDefaults(
76
+ defineProps<{
77
+ show: boolean
78
+ switchName?: string
79
+ networksList?: UI_I_Network[]
80
+ switchNetworks?: UI_I_Network[]
81
+ isDarkMode: boolean
82
+ isMigrateAdapterLoading?: boolean
83
+ }>(),
84
+ {
85
+ switchName: '',
86
+ networksList: () => [],
87
+ switchNetworks: () => [],
88
+ isMigrateAdapterLoading: false,
89
+ }
90
+ )
91
+
92
+ const emits = defineEmits<UI_I_MigrateVmkernelAdapterEmits>()
93
+
94
+ const localization = computed<UI_I_Localization>(() => useLocal())
95
+
96
+ const wizard: Wizard = new Wizard(
97
+ stepsFunc(localization.value),
98
+ stepsSchemeInitial
99
+ )
100
+ const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
101
+ const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
102
+
103
+ const hostname = ref<string>('')
104
+ const title = computed<string>(
105
+ () =>
106
+ `${hostname.value} - ${localization.value.common.migrateVmKernelNetworkAdapterTo} ${props.switchName}`
107
+ )
108
+
109
+ const connectionSettings = ref<UI_I_ConnectionSettings>({
110
+ networkLabel: 'VM Network',
111
+ vlanId: 'None (0)',
112
+ })
113
+
114
+ const vmkernelAdapter = ref<UI_I_SelectVmkernelAdapter>({
115
+ vm: '',
116
+ })
117
+
118
+ const readyCompleteData =
119
+ ref<UI_I_MigrationVmkernelAdapterReadyComplete>(readyCompleteInitial)
120
+
121
+ const validationFunc = async (
122
+ value: UI_I_WizardStep[],
123
+ currentStep: UI_I_WizardStep,
124
+ nextStep: UI_I_WizardStep
125
+ ): Promise<UI_I_ValidationReturn> => {
126
+ let stepHasError = false
127
+
128
+ if (wizard.isValidateForStep(0, currentStep.id, nextStep.id)) {
129
+ const selectVmkernelAdapterValidation = checkSelectedVmSync(
130
+ localization.value,
131
+ vmkernelAdapter.value,
132
+ wizard,
133
+ value
134
+ )
135
+
136
+ value = selectVmkernelAdapterValidation.newValue
137
+
138
+ stepHasError = stepHasError || selectVmkernelAdapterValidation.stepHasError
139
+ }
140
+
141
+ if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
142
+ const labelValidation = await checkNetworkAsync(
143
+ value,
144
+ connectionSettings.value.networkLabel,
145
+ 1,
146
+ UI_E_MigrationValidationFields.CONNECTION_SETTINGS_NETWORK,
147
+ emits,
148
+ localization.value,
149
+ wizard
150
+ )
151
+
152
+ value = labelValidation.newValue
153
+
154
+ const connectionSettingsValidation = checkConnectionSettingsSync(
155
+ localization.value,
156
+ connectionSettings.value,
157
+ wizard,
158
+ value
159
+ )
160
+
161
+ value = connectionSettingsValidation.newValue
162
+
163
+ stepHasError =
164
+ stepHasError ||
165
+ labelValidation.stepHasError ||
166
+ connectionSettingsValidation.stepHasError
167
+ }
168
+
169
+ return {
170
+ newValue: value,
171
+ stepHasError,
172
+ }
173
+ }
174
+
175
+ const finalValidationFunc = async (
176
+ value: UI_I_WizardStep[]
177
+ ): Promise<UI_I_ValidationReturn> => {
178
+ let stepHasError = false
179
+
180
+ // wizard.setLoader(true)
181
+
182
+ // wizard.setLoader(false)
183
+ return {
184
+ stepHasError,
185
+ newValue: value,
186
+ }
187
+ }
188
+
189
+ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
190
+ wizard.changeSteps(value, validationFunc, finalValidationFunc)
191
+
192
+ const filteredNetworksList = ref<UI_I_VmkernelAdapterTableData[]>([])
193
+
194
+ watch(
195
+ () => wizard.selectedStepId,
196
+ (newSelectedStepId: number) => {
197
+ if (newSelectedStepId !== 2) return
198
+
199
+ const from = filteredNetworksList.value.find(
200
+ (network) => network.name === vmkernelAdapter.value.vm
201
+ )
202
+
203
+ readyCompleteData.value = {
204
+ vm: vmkernelAdapter.value.vm,
205
+ currentSettings: {
206
+ switch: from?.switch || '',
207
+ network: from?.networkLabel || '',
208
+ },
209
+ newSettings: {
210
+ switch: props.switchName,
211
+ network: connectionSettings.value.networkLabel,
212
+ },
213
+ vlanId: connectionSettings.value.vlanId,
214
+ }
215
+ }
216
+ )
217
+
218
+ watch(
219
+ () => props.switchNetworks,
220
+ (netsOnSwitch: UI_I_Network[]) => {
221
+ const vmKernelNetworksIdOnSwitch = netsOnSwitch
222
+ .filter((net: UI_I_Network) => net.networkType === '1')
223
+ .map((net: UI_I_Network) => net.id)
224
+
225
+ filteredNetworksList.value = props.networksList
226
+ .filter(
227
+ (net: UI_I_Network) =>
228
+ net.networkType === '1' &&
229
+ !vmKernelNetworksIdOnSwitch.includes(net.id)
230
+ )
231
+ .map((net: UI_I_Network, index: number) => ({
232
+ name: net.sysx?.id || '',
233
+ networkLabel: net.title,
234
+ switch: net.switchName || '',
235
+ ipAddress: net.sysx?.ipv4_settings.ipv4 || '--',
236
+ tcp: net.sysx?.tcp_stack
237
+ ? localization.value[net.sysx?.tcp_stack]
238
+ : '--',
239
+ id: `${net.sysx?.id || ''}-${index}`,
240
+ }))
241
+ },
242
+ { deep: true, immediate: true }
243
+ )
244
+
245
+ const onChangeConnectionSettings = (
246
+ newFields: UI_I_ConnectionSettings
247
+ ): void => {
248
+ connectionSettings.value = newFields
249
+ }
250
+
251
+ const onChangeMigrateVmkernelAdapter = (
252
+ newFields: UI_I_SelectVmkernelAdapter
253
+ ): void => {
254
+ vmkernelAdapter.value = newFields
255
+ }
256
+
257
+ const reset = (): void => {
258
+ wizard.reset()
259
+ connectionSettings.value = {
260
+ networkLabel: 'VM Network',
261
+ vlanId: 'None (0)',
262
+ }
263
+ vmkernelAdapter.value = {
264
+ vm: '',
265
+ }
266
+ }
267
+
268
+ const onHideAlert = (stepId: number): void => {
269
+ wizard.hideAlertMessagesByStepId(stepId)
270
+ }
271
+
272
+ const onHide = (): void => {
273
+ emits('hide')
274
+ reset()
275
+ }
276
+
277
+ const onSubmit = (): void => {
278
+ onHide()
279
+ }
280
+
281
+ watch(
282
+ () => props.isMigrateAdapterLoading,
283
+ (newValue: boolean) => {
284
+ wizard.setLoader(newValue)
285
+ },
286
+ { immediate: true }
287
+ )
288
+
289
+ onMounted(() => {
290
+ hostname.value = location.hostname
291
+ })
292
+ </script>
293
+
294
+ <style scoped lang="scss">
295
+ .main-step-container {
296
+ display: flex;
297
+ }
298
+
299
+ :deep(.modal) {
300
+ & > .modal-dialog > .modal-content > .modal-body {
301
+ height: calc(100% - 110px);
302
+ }
303
+ }
304
+ .step-items-container {
305
+ width: 230px;
306
+ padding: 10px 5px 10px 6px;
307
+ li {
308
+ display: flex;
309
+ margin: 0;
310
+ height: 24.8px;
311
+ span {
312
+ width: 16px;
313
+ }
314
+ }
315
+
316
+ .step-item {
317
+ margin: 0;
318
+ height: 24.8px;
319
+ padding-left: 5px;
320
+ // 0-Disabled
321
+ &.status-0 {
322
+ height: 24.8px;
323
+ overflow: hidden;
324
+ text-overflow: ellipsis;
325
+ white-space: nowrap;
326
+ border-bottom: 1px solid transparent;
327
+ width: 189px;
328
+ line-height: 24px;
329
+ display: inline-block;
330
+ text-decoration: none;
331
+ font-weight: 700;
332
+ color: #999;
333
+ cursor: default;
334
+ }
335
+ // 1-Selected
336
+ &.status-1 {
337
+ background-color: #29414e;
338
+ color: #ffffff;
339
+ border-bottom: 1px solid transparent;
340
+ overflow: hidden;
341
+ text-overflow: ellipsis;
342
+ white-space: nowrap;
343
+ border-radius: 5px;
344
+ cursor: default;
345
+ width: 189px;
346
+ line-height: 24px;
347
+ display: inline-block;
348
+ text-decoration: none;
349
+ font-weight: 700;
350
+ }
351
+ // 2-Active
352
+ &.status-2 {
353
+ overflow: hidden;
354
+ text-overflow: ellipsis;
355
+ white-space: nowrap;
356
+ border-bottom: 1px solid transparent;
357
+ width: 189px;
358
+ line-height: 24px;
359
+ cursor: pointer;
360
+ display: inline-block;
361
+ text-decoration: none;
362
+ font-weight: 700;
363
+ color: #333;
364
+ &:hover {
365
+ color: #454545;
366
+ background-color: #e8e8e8;
367
+ border-bottom: 1px solid #666666;
368
+ border-radius: 5px;
369
+ }
370
+ }
371
+ // 3-Complete
372
+ &.status-3 {
373
+ overflow: hidden;
374
+ text-overflow: ellipsis;
375
+ white-space: nowrap;
376
+ border-bottom: 1px solid transparent;
377
+ width: 189px;
378
+ line-height: 24px;
379
+ display: inline-block;
380
+ text-decoration: none;
381
+ font-weight: 700;
382
+ color: #333;
383
+ cursor: pointer;
384
+ &:hover {
385
+ color: #454545;
386
+ background-color: #e8e8e8;
387
+ border-bottom: 1px solid #666666;
388
+ text-decoration: none;
389
+ border-radius: 5px;
390
+ }
391
+ }
392
+ // 4-ActiveSelected
393
+ &.status-4 {
394
+ background-color: #29414e;
395
+ color: #ffffff;
396
+ border-bottom: 1px solid transparent;
397
+ overflow: hidden;
398
+ text-overflow: ellipsis;
399
+ white-space: nowrap;
400
+ border-radius: 5px;
401
+ cursor: default;
402
+ width: 189px;
403
+ line-height: 24px;
404
+ display: inline-block;
405
+ text-decoration: none;
406
+ font-weight: 700;
407
+ }
408
+ }
409
+ }
410
+ :deep(.with-underline) {
411
+ & > .modal-dialog > .modal-content > .modal-header {
412
+ border-bottom: 1px solid #a6a6a6;
413
+ padding: 0;
414
+ }
415
+ & > .modal-dialog > .modal-content > .modal-body {
416
+ height: calc(100% - 87px);
417
+ }
418
+ }
419
+ :deep(.wizard-content-container.add-networking-step) {
420
+ .danger-not-valid {
421
+ border: 2px solid red;
422
+ border-bottom: 1px solid #db2100;
423
+ }
424
+ .tooltip-field {
425
+ margin-right: 12px;
426
+ }
427
+
428
+ .horizontal-flex-container {
429
+ margin-bottom: 5px;
430
+ min-height: 36px;
431
+ display: flex;
432
+ flex-direction: row;
433
+ }
434
+ .property-label-group {
435
+ width: 140px;
436
+ }
437
+ .disabled {
438
+ opacity: 0.4;
439
+ pointer-events: none;
440
+ }
441
+
442
+ .wizard-content-port {
443
+ .margin-left-property-value-group {
444
+ margin-left: 10px;
445
+ }
446
+
447
+ .property-value-group {
448
+ padding-left: 23px;
449
+ }
450
+ .horizontal-flex-container {
451
+ min-height: 24px;
452
+ margin-bottom: 0;
453
+ }
454
+
455
+ .radio {
456
+ min-height: 39px;
457
+ margin: 10px 0;
458
+ }
459
+
460
+ .form-block {
461
+ margin: 12px 0 24px 0;
462
+ padding-left: 23px;
463
+
464
+ &.form-block-ipv {
465
+ input[type='text'] {
466
+ width: 143px;
467
+ }
468
+
469
+ .horizontal-flex-container > label {
470
+ margin-right: 50px;
471
+ }
472
+ }
473
+ }
474
+
475
+ .edit-vmkernel-adapter-section {
476
+ padding-top: 12px;
477
+
478
+ label {
479
+ input[type='checkbox'] {
480
+ margin-right: 4px;
481
+ transform: translateY(1px);
482
+ }
483
+ }
484
+
485
+ .horizontal-flex-container {
486
+ margin-bottom: 5px;
487
+ }
488
+ }
489
+ .port-properties-network-label {
490
+ width: 280px;
491
+ }
492
+ .port-properties-padding {
493
+ padding-top: 8px;
494
+ }
495
+ .port-properties-mtu-selector {
496
+ margin-right: 12px;
497
+ }
498
+ .port-properties-mtu-container {
499
+ display: flex;
500
+ }
501
+ select {
502
+ height: 24px;
503
+ }
504
+ }
505
+ .nw-property-value-group {
506
+ display: inline;
507
+ }
508
+ }
509
+
510
+ .migrate-vm-kernel-modal.is-dark {
511
+ :deep(.wizard-content-container) {
512
+ .ready-complete-container {
513
+ background-color: var(--pannel-bg-color);
514
+ margin-top: 12px;
515
+
516
+ span {
517
+ color: var(--description-color);
518
+ }
519
+ }
520
+
521
+ .property-label-group {
522
+ color: var(--main-color-mode2);
523
+ }
524
+ .flex-property-label-group {
525
+ color: var(--main-color-mode2);
526
+ }
527
+ .flex-property-value-group {
528
+ select {
529
+ color: #fff;
530
+ }
531
+ }
532
+ .wizard-content-header-area .title {
533
+ color: #adbbc4;
534
+ }
535
+ }
536
+ }
537
+ </style>