bfg-common 1.5.869 → 1.5.871

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 (53) hide show
  1. package/assets/img/icons/icons-sprite-dark-5.svg +15 -2
  2. package/assets/img/icons/icons-sprite-light-5.svg +18 -5
  3. package/assets/localization/local_be.json +4 -1
  4. package/assets/localization/local_en.json +7 -4
  5. package/assets/localization/local_hy.json +4 -1
  6. package/assets/localization/local_kk.json +4 -1
  7. package/assets/localization/local_ru.json +10 -7
  8. package/assets/localization/local_zh.json +4 -1
  9. package/components/common/adapterManager/AdapterManagerNew.vue +39 -5
  10. package/components/common/adapterManager/addAdapterModal/AddAdapterModalNew.vue +3 -2
  11. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalNew.vue +3 -3
  12. package/components/common/adapterManager/ui/actions/moveDownAdapterButton/MoveDownAdapterButtonNew.vue +1 -0
  13. package/components/common/adapterManager/ui/actions/moveUpAdapterButton/MoveUpAdapterButtonNew.vue +1 -0
  14. package/components/common/adapterManager/ui/noSelectedAdapter/NoSelectedAdapterNew.vue +10 -4
  15. package/components/common/adapterManager/ui/secondTitle/SecondTitleNew.vue +15 -0
  16. package/components/common/adapterManager/ui/table/TableNew.vue +3 -2
  17. package/components/common/adapterManager/ui/table/adapters/AdaptersNew.vue +69 -36
  18. package/components/common/adapterManager/ui/table/header/HeaderNew.vue +5 -1
  19. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +218 -218
  20. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +19 -19
  21. package/components/common/diagramMain/modals/viewSettings/info/InfoNew.vue +17 -0
  22. package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettingsNew.vue +13 -8
  23. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +1 -1
  24. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/lib/config/optionsMetrics.ts +6 -1
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +20 -4
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/New.vue +2 -1
  27. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Old.vue +3 -2
  28. package/components/common/wizards/network/add/Add.vue +872 -872
  29. package/components/common/wizards/network/add/AddNew.vue +483 -476
  30. package/components/common/wizards/network/add/lib/config/initialData.ts +86 -86
  31. package/components/common/wizards/network/add/lib/config/selectSwitch.ts +237 -237
  32. package/components/common/wizards/network/add/lib/utils/utils.ts +9 -9
  33. package/components/common/wizards/network/add/mappers/mappers.ts +199 -199
  34. package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettings.vue +89 -84
  35. package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettingsNew.vue +3 -0
  36. package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettingsOld.vue +126 -126
  37. package/components/common/wizards/network/add/steps/createStandardSwitch/CreateStandardSwitch.vue +81 -81
  38. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettings.vue +144 -144
  39. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsNew.vue +48 -9
  40. package/components/common/wizards/network/add/steps/portProperties/PortProperties.vue +196 -193
  41. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesNew.vue +312 -294
  42. package/components/common/wizards/network/add/steps/readyComplete/ReadyComplete.vue +24 -24
  43. package/components/common/wizards/network/add/steps/selectConnectionType/SelectConnectionType.vue +34 -34
  44. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDevice.vue +187 -187
  45. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +455 -455
  46. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectNetwork.vue +63 -63
  47. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectStandardSwitch.vue +63 -63
  48. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectSwitch.vue +63 -63
  49. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectSwitch.vue +180 -180
  50. package/components/common/wizards/network/add/validations/common.ts +30 -30
  51. package/components/common/wizards/network/add/validations/networkValidation.ts +2 -2
  52. package/components/common/wizards/network/add/validations/portProperties.ts +115 -115
  53. package/package.json +2 -2
@@ -1,476 +1,483 @@
1
- <template>
2
- <div
3
- :class="{
4
- 'is-manager-step':
5
- props.wizard.selectedStepId === 2 || props.wizard.selectedStepId === 6,
6
- }"
7
- >
8
- <ui-wizard
9
- :show="props.show"
10
- :steps="props.wizard.steps"
11
- :selected-scheme="props.selectedScheme"
12
- :is-loading="props.wizard.wizardLoader.status"
13
- :title="localization.common.addNetworking"
14
- :sub-title="props.hostName"
15
- :texts="texts"
16
- test-id="add-networking-wizard"
17
- @change-steps="onChangeSteps"
18
- @hide="emits('hide')"
19
- @submit="emits('submit')"
20
- >
21
- <template #content="{ selectedStep }">
22
- <ui-wizard-block
23
- v-if="selectedStep.id === 0"
24
- :sub-title-height="selectConnectionTypeHeight"
25
- >
26
- <template #subTitle>
27
- <div ref="selectConnectionTypeBlock">
28
- <div class="subtitle-block flex flex-col">
29
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
30
- <ui-line margin="12px 0 0" />
31
- </div>
32
- </div>
33
- </template>
34
- <template #content>
35
- <common-wizards-network-add-steps-select-connection-type
36
- v-model="connectionTypeLocal"
37
- />
38
- </template>
39
- </ui-wizard-block>
40
-
41
- <ui-wizard-block
42
- v-if="selectedStep.id === 1"
43
- :sub-title-height="selectTargetDeviceHeight"
44
- >
45
- <template #subTitle>
46
- <div ref="selectTargetDeviceBlock">
47
- <div class="subtitle-block flex flex-col">
48
- <template
49
- v-for="(message, field) in selectedStep.fields"
50
- :key="field"
51
- >
52
- <ui-alert
53
- :messages="[message.alert]"
54
- test-id="select-target-device-alert"
55
- :class="{
56
- 'mb-4': selectedStep.fields.length - 1 === field,
57
- }"
58
- size="md"
59
- @hide="emits('hide-alert', selectedStep.id, field)"
60
- />
61
- </template>
62
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
63
- <ui-line margin="12px 0 0" />
64
- </div>
65
- </div>
66
- </template>
67
- <template #content>
68
- <common-wizards-network-add-steps-select-target-device
69
- :wizard="props.wizard"
70
- :target-device="props.targetDevice"
71
- :connection-type="connectionTypeLocal"
72
- :standard-switches-initial="props.standardSwitchesInitial"
73
- :messages-fields="selectedStep.fields"
74
- :alert-messages="props.alertMessages[selectedStep.id]"
75
- :selected-standard-switch-id="props.selectedStandardSwitchId"
76
- :selected-switch-id="props.selectedSwitchId"
77
- :is-get-existing-switches-loading="
78
- props.isGetExistingSwitchesLoading
79
- "
80
- @change-target-device="onChangeTargetDevice"
81
- />
82
- </template>
83
- </ui-wizard-block>
84
-
85
- <ui-wizard-block
86
- v-if="selectedStep.id === 2 || selectedStep.id === 6"
87
- :sub-title-height="createStandardSwitchHeight"
88
- >
89
- <template #subTitle>
90
- <div ref="createStandardSwitchBlock">
91
- <div class="subtitle-block flex flex-col">
92
- <template
93
- v-for="(message, field) in selectedStep.fields"
94
- :key="field"
95
- >
96
- <ui-alert
97
- :messages="[message.alert]"
98
- test-id="create-standard-switch-alert"
99
- :class="{
100
- 'mb-4': selectedStep.fields.length - 1 === field,
101
- }"
102
- size="md"
103
- @hide="emits('hide-alert', selectedStep.id, field)"
104
- />
105
- </template>
106
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
107
- <ui-line margin="12px 0 0" />
108
- </div>
109
- </div>
110
- </template>
111
- <template #content>
112
- <common-wizards-network-add-steps-create-standard-switch
113
- :free-adapters="props.freeAdapters"
114
- :added-adapters="props.addedAdapters"
115
- :core-adapters="props.coreAdapters"
116
- :adapter-status="props.adapterStatus"
117
- :adapters="props.adapters"
118
- :is-show-no-connected-active-adapters-modal="
119
- props.isShowNoConnectedActiveAdaptersModal
120
- "
121
- :is-show-no-active-adapters-modal="
122
- props.isShowNoActiveAdaptersModal
123
- "
124
- :is-dark-mode="props.isDarkMode"
125
- @get-free-adapters="onGetFreeAdapters"
126
- @change-added-adapters="onChangeAddedAdapters"
127
- @change-adapter-status="onChangeAdapterStatus"
128
- @confirm-no-active-adapters-modal="
129
- emits('confirm-no-active-adapters-modal')
130
- "
131
- @hide-no-connected-active-adapters-modal="
132
- emits('hide-no-connected-active-adapters-modal')
133
- "
134
- @hide-no-active-adapters-modal="
135
- emits('hide-no-active-adapters-modal')
136
- "
137
- />
138
- </template>
139
- </ui-wizard-block>
140
-
141
- <ui-wizard-block
142
- v-if="selectedStep.id === 3"
143
- :sub-title-height="portPropertiesHeight"
144
- >
145
- <template #subTitle>
146
- <div ref="portPropertiesBlock">
147
- <div class="subtitle-block flex flex-col">
148
- <template
149
- v-for="(message, field) in selectedStep.fields"
150
- :key="field"
151
- >
152
- <ui-alert
153
- :messages="[message.alert]"
154
- test-id="port-properties-alert"
155
- :class="{
156
- 'mb-4': selectedStep.fields.length - 1 === field,
157
- }"
158
- size="md"
159
- @hide="emits('hide-alert', selectedStep.id, field)"
160
- />
161
- </template>
162
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
163
- <ui-line margin="12px 0 0" />
164
- </div>
165
- </div>
166
- </template>
167
- <template #content>
168
- <common-wizards-network-add-steps-port-properties
169
- :wizard="props.wizard"
170
- :port-properties="props.portProperties"
171
- :mtu-from-switch="props.mtuFromSwitch"
172
- :project="props.project"
173
- :messages-fields="selectedStep.fields"
174
- :alert-messages="props.alertMessages[selectedStep.id]"
175
- :tcp-stacks="props.tcpStacks"
176
- :is-get-tcp-stack-loading="props.isGetTcpStackLoading"
177
- @change-gateway-flag="onChangeGatewayFlag"
178
- @change-port-properties="onChangePortProperties"
179
- />
180
- </template>
181
- </ui-wizard-block>
182
-
183
- <ui-wizard-block
184
- v-if="selectedStep.id === 4"
185
- :sub-title-height="ipFourSettingsHeight"
186
- >
187
- <template #subTitle>
188
- <div ref="ipFourSettingsBlock">
189
- <div class="subtitle-block flex flex-col">
190
- <template
191
- v-for="(message, field) in selectedStep.fields"
192
- :key="field"
193
- >
194
- <ui-alert
195
- :messages="[message.alert]"
196
- test-id="ip-four-settings-alert"
197
- :class="{
198
- 'mb-4': selectedStep.fields.length - 1 === field,
199
- }"
200
- size="md"
201
- @hide="emits('hide-alert', selectedStep.id, field)"
202
- />
203
- </template>
204
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
205
- <ui-line margin="12px 0 0" />
206
- </div>
207
- </div>
208
- </template>
209
- <template #content>
210
- <common-wizards-network-add-steps-ip-four-settings
211
- :wizard="props.wizard"
212
- :ip-four-settings="props.ipFourSettings"
213
- :messages-fields="selectedStep.fields"
214
- :alert-messages="props.alertMessages[selectedStep.id]"
215
- :tcp-stacks="props.tcpStacks"
216
- :tcp="props.portProperties.tcp"
217
- :gateway-flag="props.gatewayFlag"
218
- @change-gateway-flag="onChangeGatewayFlag"
219
- @change-ip-four-settings="onChangeIpFourSettings"
220
- />
221
- </template>
222
- </ui-wizard-block>
223
-
224
- <ui-wizard-block
225
- v-if="selectedStep.id === 5"
226
- :sub-title-height="connectionSettingsHeight"
227
- >
228
- <template #subTitle>
229
- <div ref="connectionSettingsBlock">
230
- <div class="subtitle-block flex flex-col">
231
- <template
232
- v-for="(message, field) in selectedStep.fields"
233
- :key="field"
234
- >
235
- <ui-alert
236
- :messages="[message.alert]"
237
- test-id="connection-settings-alert"
238
- :class="{
239
- 'mb-4': selectedStep.fields.length - 1 === field,
240
- }"
241
- size="md"
242
- @hide="emits('hide-alert', selectedStep.id, field)"
243
- />
244
- </template>
245
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
246
- <ui-line margin="12px 0 0" />
247
- </div>
248
- </div>
249
- </template>
250
- <template #content>
251
- <common-wizards-network-add-steps-connection-settings
252
- :wizard="props.wizard"
253
- :connection-settings="props.connectionSettings"
254
- :messages-fields="selectedStep.fields"
255
- :alert-messages="props.alertMessages[selectedStep.id]"
256
- @change-connection-settings="onChangeConnectionSettings"
257
- />
258
- </template>
259
- </ui-wizard-block>
260
-
261
- <ui-wizard-block
262
- v-if="selectedStep.id === 7"
263
- :sub-title-height="readyCompleteHeight"
264
- >
265
- <template #subTitle>
266
- <div ref="readyCompleteBlock">
267
- <div class="subtitle-block flex flex-col">
268
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
269
- <ui-line margin="12px 0 0" />
270
- </div>
271
- </div>
272
- </template>
273
- <template #content>
274
- <common-wizards-network-add-steps-ready-complete
275
- :ready-complete-fields="props.readyCompleteFields"
276
- />
277
- </template>
278
- </ui-wizard-block>
279
- </template>
280
- </ui-wizard>
281
- </div>
282
- </template>
283
-
284
- <script setup lang="ts">
285
- import { useElementSize } from '@vueuse/core'
286
- import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/atoms/wizard/lib/models/interfaces'
287
- import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
288
- import type {
289
- UI_I_Localization,
290
- UI_I_ItemsWithTotalCounts,
291
- } from '~/lib/models/interfaces'
292
- import type { UI_T_Project } from '~/lib/models/types'
293
- import type {
294
- UI_I_PortProperties,
295
- UI_I_IpFourSettings,
296
- UI_I_ConnectionSettings,
297
- UI_I_TargetDevice,
298
- UI_I_Switch,
299
- UI_I_ReadyCompleteFields,
300
- UI_I_TCPStack,
301
- } from '~/components/common/wizards/network/add/lib/models/interfaces'
302
- import type {
303
- UI_I_Adapter,
304
- UI_I_AdapterStatus,
305
- UI_I_SwitchAdapterItem,
306
- } from '~/components/common/diagramMain/lib/models/interfaces'
307
-
308
- const props = defineProps<{
309
- show: boolean
310
- wizard: Wizard
311
- selectedScheme: number[]
312
- hostName: string
313
- project: UI_T_Project
314
- connectionType: string
315
- targetDevice: UI_I_TargetDevice
316
- standardSwitchesInitial: UI_I_Switch[]
317
- alertMessages: string[][]
318
- selectedStandardSwitchId: string
319
- selectedSwitchId: string
320
- freeAdapters: UI_I_Adapter[]
321
- addedAdapters: string[]
322
- coreAdapters: string[]
323
- adapterStatus: UI_I_AdapterStatus
324
- adapters: UI_I_ItemsWithTotalCounts<UI_I_SwitchAdapterItem>
325
- isShowNoConnectedActiveAdaptersModal: boolean
326
- isShowNoActiveAdaptersModal: boolean
327
- isDarkMode: boolean
328
- portProperties: UI_I_PortProperties
329
- mtuFromSwitch: number
330
- tcpStacks: UI_I_TCPStack[]
331
- ipFourSettings: UI_I_IpFourSettings
332
- gatewayFlag: boolean
333
- connectionSettings: UI_I_ConnectionSettings
334
- readyCompleteFields: UI_I_ReadyCompleteFields[]
335
- isGetExistingSwitchesLoading: boolean
336
- isGetTcpStackLoading: boolean
337
- }>()
338
-
339
- const emits = defineEmits<{
340
- (event: 'update:connection-type', value: string): void
341
- (event: 'change-connection-settings', value: UI_I_ConnectionSettings): void
342
- (event: 'hide-alert', value: number, field: string): void
343
- (event: 'change-gateway-flag', value: boolean): void
344
- (event: 'change-ip-four-settings', value: UI_I_IpFourSettings): void
345
- (event: 'change-port-properties', value: UI_I_PortProperties): void
346
- (event: 'get-free-adapters', cb: () => void): void
347
- (event: 'change-added-adapters', value: string[]): void
348
- (event: 'change-adapter-status', value: UI_I_AdapterStatus): void
349
- (event: 'confirm-no-active-adapters-modal'): void
350
- (event: 'hide-no-connected-active-adapters-modal'): void
351
- (event: 'hide-no-active-adapters-modal'): void
352
- (event: 'change-target-device', value: UI_I_TargetDevice): void
353
- (event: 'change-steps', value: UI_I_WizardStep[]): void
354
- (event: 'hide'): void
355
- (event: 'submit'): void
356
- }>()
357
-
358
- const localization = computed<UI_I_Localization>(() => useLocal())
359
-
360
- const texts = computed<UI_I_WizardTexts>(() => ({
361
- cancel: localization.value.common.cancel,
362
- back: localization.value.common.backCap,
363
- processing: localization.value.common.processing,
364
- next: localization.value.common.next,
365
- finish: localization.value.common.create,
366
- incompleteTitle: localization.value.common.incompleteProcess,
367
- incompleteMessage: localization.value.common.incompleteProcessMessage,
368
- incompleteCancel: localization.value.common.cancel,
369
- incompleteLeave: localization.value.common.leave,
370
- step: localization.value.common.step,
371
- of: localization.value.common.of2,
372
- }))
373
-
374
- const connectionTypeLocal = computed<string>({
375
- get() {
376
- return props.connectionType
377
- },
378
- set(newValue: string) {
379
- emits('update:connection-type', newValue)
380
- },
381
- })
382
-
383
- const selectConnectionTypeBlock = ref<HTMLElement | null>(null)
384
- const { height: selectConnectionTypeHeight } = useElementSize(
385
- selectConnectionTypeBlock
386
- )
387
-
388
- const selectTargetDeviceBlock = ref<HTMLElement | null>(null)
389
- const { height: selectTargetDeviceHeight } = useElementSize(
390
- selectTargetDeviceBlock
391
- )
392
-
393
- const connectionSettingsBlock = ref<HTMLElement | null>(null)
394
- const { height: connectionSettingsHeight } = useElementSize(
395
- connectionSettingsBlock
396
- )
397
-
398
- const createStandardSwitchBlock = ref<HTMLElement | null>(null)
399
- const { height: createStandardSwitchHeight } = useElementSize(
400
- createStandardSwitchBlock
401
- )
402
-
403
- const portPropertiesBlock = ref<HTMLElement | null>(null)
404
- const { height: portPropertiesHeight } = useElementSize(portPropertiesBlock)
405
-
406
- const ipFourSettingsBlock = ref<HTMLElement | null>(null)
407
- const { height: ipFourSettingsHeight } = useElementSize(ipFourSettingsBlock)
408
-
409
- const readyCompleteBlock = ref<HTMLElement | null>(null)
410
- const { height: readyCompleteHeight } = useElementSize(readyCompleteBlock)
411
-
412
- const onChangeAddedAdapters = (addedAdaptersNew: string[]): void => {
413
- emits('change-added-adapters', addedAdaptersNew)
414
- }
415
-
416
- const onChangeAdapterStatus = (adapterStatusNew: UI_I_AdapterStatus): void => {
417
- emits('change-adapter-status', adapterStatusNew)
418
- }
419
-
420
- const onChangeTargetDevice = (newTargetDevice: UI_I_TargetDevice): void => {
421
- emits('change-target-device', newTargetDevice)
422
- }
423
-
424
- const onChangePortProperties = (newFields: UI_I_PortProperties): void => {
425
- emits('change-port-properties', newFields)
426
- }
427
-
428
- const onChangeIpFourSettings = (newFields: UI_I_IpFourSettings): void => {
429
- emits('change-ip-four-settings', newFields)
430
- }
431
-
432
- const onChangeGatewayFlag = (newValue: boolean) => {
433
- emits('change-gateway-flag', newValue)
434
- }
435
-
436
- const onChangeConnectionSettings = (
437
- newFields: UI_I_ConnectionSettings
438
- ): void => {
439
- emits('change-connection-settings', newFields)
440
- }
441
-
442
- const onGetFreeAdapters = (showModal: () => void): void => {
443
- emits('get-free-adapters', showModal)
444
- }
445
-
446
- const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
447
- emits('change-steps', value)
448
- }
449
- </script>
450
-
451
- <style scoped lang="scss">
452
- .is-manager-step {
453
- :deep(.ui-wizard-content-right-bottom) {
454
- width: calc(100% - min(320px, 29%) - 284px);
455
- }
456
- :deep(.ui-wizard-content-with-subtitle) {
457
- padding-right: 0;
458
- }
459
- }
460
-
461
- @media (max-width: 1084px) {
462
- .is-manager-step {
463
- :deep(.ui-wizard-content-right-bottom) {
464
- width: calc(100% - min(320px, 29%) - 16px);
465
- }
466
- }
467
- }
468
-
469
- :deep(.ui-alert-item) {
470
- margin-bottom: 12px;
471
-
472
- &.mb-4 {
473
- margin-bottom: 16px;
474
- }
475
- }
476
- </style>
1
+ <template>
2
+ <div
3
+ :class="{
4
+ 'is-manager-step':
5
+ props.wizard.selectedStepId === 2 || props.wizard.selectedStepId === 6,
6
+ }"
7
+ >
8
+ <ui-wizard
9
+ :show="props.show"
10
+ :steps="props.wizard.steps"
11
+ :selected-scheme="props.selectedScheme"
12
+ :is-loading="props.wizard.wizardLoader.status"
13
+ :title="localization.common.addNetworking"
14
+ :sub-title="props.hostName"
15
+ :texts="texts"
16
+ test-id="add-networking-wizard"
17
+ @change-steps="onChangeSteps"
18
+ @hide="emits('hide')"
19
+ @submit="emits('submit')"
20
+ >
21
+ <template #content="{ selectedStep }">
22
+ <ui-wizard-block
23
+ v-if="selectedStep.id === 0"
24
+ :sub-title-height="selectConnectionTypeHeight"
25
+ >
26
+ <template #subTitle>
27
+ <div ref="selectConnectionTypeBlock">
28
+ <div class="subtitle-block flex flex-col">
29
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
30
+ <ui-line margin="12px 0 0" />
31
+ </div>
32
+ </div>
33
+ </template>
34
+ <template #content>
35
+ <common-wizards-network-add-steps-select-connection-type
36
+ v-model="connectionTypeLocal"
37
+ />
38
+ </template>
39
+ </ui-wizard-block>
40
+
41
+ <ui-wizard-block
42
+ v-if="selectedStep.id === 1"
43
+ :sub-title-height="selectTargetDeviceHeight"
44
+ >
45
+ <template #subTitle>
46
+ <div ref="selectTargetDeviceBlock">
47
+ <div class="subtitle-block flex flex-col">
48
+ <template
49
+ v-for="(message, field, key) in selectedStep.fields"
50
+ :key="key"
51
+ >
52
+ <ui-alert
53
+ :messages="[message.alert]"
54
+ test-id="select-target-device-alert"
55
+ :class="{
56
+ 'mb-4':
57
+ props.alertMessages[selectedStep.id].length - 1 === key,
58
+ }"
59
+ size="md"
60
+ @hide="emits('hide-alert', selectedStep.id, field)"
61
+ />
62
+ </template>
63
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
64
+ <ui-line margin="12px 0 0" />
65
+ </div>
66
+ </div>
67
+ </template>
68
+ <template #content>
69
+ <common-wizards-network-add-steps-select-target-device
70
+ :wizard="props.wizard"
71
+ :target-device="props.targetDevice"
72
+ :connection-type="connectionTypeLocal"
73
+ :standard-switches-initial="props.standardSwitchesInitial"
74
+ :messages-fields="selectedStep.fields"
75
+ :alert-messages="props.alertMessages[selectedStep.id]"
76
+ :selected-standard-switch-id="props.selectedStandardSwitchId"
77
+ :selected-switch-id="props.selectedSwitchId"
78
+ :is-get-existing-switches-loading="
79
+ props.isGetExistingSwitchesLoading
80
+ "
81
+ @change-target-device="onChangeTargetDevice"
82
+ />
83
+ </template>
84
+ </ui-wizard-block>
85
+
86
+ <ui-wizard-block
87
+ v-if="selectedStep.id === 2 || selectedStep.id === 6"
88
+ :sub-title-height="createStandardSwitchHeight"
89
+ >
90
+ <template #subTitle>
91
+ <div ref="createStandardSwitchBlock">
92
+ <div class="subtitle-block flex flex-col">
93
+ <template
94
+ v-for="(message, field, key) in selectedStep.fields"
95
+ :key="key"
96
+ >
97
+ <ui-alert
98
+ :messages="[message.alert]"
99
+ test-id="create-standard-switch-alert"
100
+ :class="{
101
+ 'mb-4':
102
+ props.alertMessages[selectedStep.id].length - 1 === key,
103
+ }"
104
+ size="md"
105
+ @hide="emits('hide-alert', selectedStep.id, field)"
106
+ />
107
+ </template>
108
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
109
+ <ui-line margin="12px 0 0" />
110
+ </div>
111
+ </div>
112
+ </template>
113
+ <template #content>
114
+ <common-wizards-network-add-steps-create-standard-switch
115
+ :free-adapters="props.freeAdapters"
116
+ :added-adapters="props.addedAdapters"
117
+ :core-adapters="props.coreAdapters"
118
+ :adapter-status="props.adapterStatus"
119
+ :adapters="props.adapters"
120
+ :is-show-no-connected-active-adapters-modal="
121
+ props.isShowNoConnectedActiveAdaptersModal
122
+ "
123
+ :is-show-no-active-adapters-modal="
124
+ props.isShowNoActiveAdaptersModal
125
+ "
126
+ :is-dark-mode="props.isDarkMode"
127
+ @get-free-adapters="onGetFreeAdapters"
128
+ @change-added-adapters="onChangeAddedAdapters"
129
+ @change-adapter-status="onChangeAdapterStatus"
130
+ @confirm-no-active-adapters-modal="
131
+ emits('confirm-no-active-adapters-modal')
132
+ "
133
+ @hide-no-connected-active-adapters-modal="
134
+ emits('hide-no-connected-active-adapters-modal')
135
+ "
136
+ @hide-no-active-adapters-modal="
137
+ emits('hide-no-active-adapters-modal')
138
+ "
139
+ />
140
+ </template>
141
+ </ui-wizard-block>
142
+
143
+ <ui-wizard-block
144
+ v-if="selectedStep.id === 3"
145
+ :sub-title-height="portPropertiesHeight"
146
+ >
147
+ <template #subTitle>
148
+ <div ref="portPropertiesBlock">
149
+ <div class="subtitle-block flex flex-col">
150
+ <template
151
+ v-for="(message, field, key) in selectedStep.fields"
152
+ :key="key"
153
+ >
154
+ <ui-alert
155
+ :messages="[message.alert]"
156
+ test-id="port-properties-alert"
157
+ :class="{
158
+ 'mb-4':
159
+ props.alertMessages[selectedStep.id].length - 1 === key,
160
+ }"
161
+ size="md"
162
+ @hide="emits('hide-alert', selectedStep.id, field)"
163
+ />
164
+ </template>
165
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
166
+ <ui-line margin="12px 0 0" />
167
+ </div>
168
+ </div>
169
+ </template>
170
+ <template #content>
171
+ <common-wizards-network-add-steps-port-properties
172
+ :wizard="props.wizard"
173
+ :port-properties="props.portProperties"
174
+ :mtu-from-switch="props.mtuFromSwitch"
175
+ :project="props.project"
176
+ :messages-fields="selectedStep.fields"
177
+ :alert-messages="props.alertMessages[selectedStep.id]"
178
+ :tcp-stacks="props.tcpStacks"
179
+ :is-get-tcp-stack-loading="props.isGetTcpStackLoading"
180
+ :is-processing="props.wizard.wizardLoader.status"
181
+ @change-gateway-flag="onChangeGatewayFlag"
182
+ @change-port-properties="onChangePortProperties"
183
+ />
184
+ </template>
185
+ </ui-wizard-block>
186
+
187
+ <ui-wizard-block
188
+ v-if="selectedStep.id === 4"
189
+ :sub-title-height="ipFourSettingsHeight"
190
+ >
191
+ <template #subTitle>
192
+ <div ref="ipFourSettingsBlock">
193
+ <div class="subtitle-block flex flex-col">
194
+ <template
195
+ v-for="(message, field, key) in selectedStep.fields"
196
+ :key="key"
197
+ >
198
+ <ui-alert
199
+ :messages="[message.alert]"
200
+ test-id="ip-four-settings-alert"
201
+ :class="{
202
+ 'mb-4':
203
+ props.alertMessages[selectedStep.id].length - 1 === key,
204
+ }"
205
+ size="md"
206
+ @hide="emits('hide-alert', selectedStep.id, field)"
207
+ />
208
+ </template>
209
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
210
+ <ui-line margin="12px 0 0" />
211
+ </div>
212
+ </div>
213
+ </template>
214
+ <template #content>
215
+ <common-wizards-network-add-steps-ip-four-settings
216
+ :wizard="props.wizard"
217
+ :ip-four-settings="props.ipFourSettings"
218
+ :messages-fields="selectedStep.fields"
219
+ :alert-messages="props.alertMessages[selectedStep.id]"
220
+ :tcp-stacks="props.tcpStacks"
221
+ :tcp="props.portProperties.tcp"
222
+ :gateway-flag="props.gatewayFlag"
223
+ @change-gateway-flag="onChangeGatewayFlag"
224
+ @change-ip-four-settings="onChangeIpFourSettings"
225
+ />
226
+ </template>
227
+ </ui-wizard-block>
228
+
229
+ <ui-wizard-block
230
+ v-if="selectedStep.id === 5"
231
+ :sub-title-height="connectionSettingsHeight"
232
+ >
233
+ <template #subTitle>
234
+ <div ref="connectionSettingsBlock">
235
+ <div class="subtitle-block flex flex-col">
236
+ <template
237
+ v-for="(message, field, key) in selectedStep.fields"
238
+ :key="key"
239
+ >
240
+ <ui-alert
241
+ :messages="[message.alert]"
242
+ test-id="connection-settings-alert"
243
+ :class="{
244
+ 'mb-4':
245
+ props.alertMessages[selectedStep.id].length - 1 === key,
246
+ }"
247
+ size="md"
248
+ @hide="emits('hide-alert', selectedStep.id, field)"
249
+ />
250
+ </template>
251
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
252
+ <ui-line margin="12px 0 0" />
253
+ </div>
254
+ </div>
255
+ </template>
256
+ <template #content>
257
+ <common-wizards-network-add-steps-connection-settings
258
+ :wizard="props.wizard"
259
+ :connection-settings="props.connectionSettings"
260
+ :is-processing="props.wizard.wizardLoader.status"
261
+ :messages-fields="selectedStep.fields"
262
+ :alert-messages="props.alertMessages[selectedStep.id]"
263
+ @change-connection-settings="onChangeConnectionSettings"
264
+ />
265
+ </template>
266
+ </ui-wizard-block>
267
+
268
+ <ui-wizard-block
269
+ v-if="selectedStep.id === 7"
270
+ :sub-title-height="readyCompleteHeight"
271
+ >
272
+ <template #subTitle>
273
+ <div ref="readyCompleteBlock">
274
+ <div class="subtitle-block flex flex-col">
275
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
276
+ <ui-line margin="12px 0 0" />
277
+ </div>
278
+ </div>
279
+ </template>
280
+ <template #content>
281
+ <common-wizards-network-add-steps-ready-complete
282
+ :ready-complete-fields="props.readyCompleteFields"
283
+ />
284
+ </template>
285
+ </ui-wizard-block>
286
+ </template>
287
+ </ui-wizard>
288
+ </div>
289
+ </template>
290
+
291
+ <script setup lang="ts">
292
+ import { useElementSize } from '@vueuse/core'
293
+ import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/atoms/wizard/lib/models/interfaces'
294
+ import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
295
+ import type {
296
+ UI_I_Localization,
297
+ UI_I_ItemsWithTotalCounts,
298
+ } from '~/lib/models/interfaces'
299
+ import type { UI_T_Project } from '~/lib/models/types'
300
+ import type {
301
+ UI_I_PortProperties,
302
+ UI_I_IpFourSettings,
303
+ UI_I_ConnectionSettings,
304
+ UI_I_TargetDevice,
305
+ UI_I_Switch,
306
+ UI_I_ReadyCompleteFields,
307
+ UI_I_TCPStack,
308
+ } from '~/components/common/wizards/network/add/lib/models/interfaces'
309
+ import type {
310
+ UI_I_Adapter,
311
+ UI_I_AdapterStatus,
312
+ UI_I_SwitchAdapterItem,
313
+ } from '~/components/common/diagramMain/lib/models/interfaces'
314
+
315
+ const props = defineProps<{
316
+ show: boolean
317
+ wizard: Wizard
318
+ selectedScheme: number[]
319
+ hostName: string
320
+ project: UI_T_Project
321
+ connectionType: string
322
+ targetDevice: UI_I_TargetDevice
323
+ standardSwitchesInitial: UI_I_Switch[]
324
+ alertMessages: string[][]
325
+ selectedStandardSwitchId: string
326
+ selectedSwitchId: string
327
+ freeAdapters: UI_I_Adapter[]
328
+ addedAdapters: string[]
329
+ coreAdapters: string[]
330
+ adapterStatus: UI_I_AdapterStatus
331
+ adapters: UI_I_ItemsWithTotalCounts<UI_I_SwitchAdapterItem>
332
+ isShowNoConnectedActiveAdaptersModal: boolean
333
+ isShowNoActiveAdaptersModal: boolean
334
+ isDarkMode: boolean
335
+ portProperties: UI_I_PortProperties
336
+ mtuFromSwitch: number
337
+ tcpStacks: UI_I_TCPStack[]
338
+ ipFourSettings: UI_I_IpFourSettings
339
+ gatewayFlag: boolean
340
+ connectionSettings: UI_I_ConnectionSettings
341
+ readyCompleteFields: UI_I_ReadyCompleteFields[]
342
+ isGetExistingSwitchesLoading: boolean
343
+ isGetTcpStackLoading: boolean
344
+ }>()
345
+
346
+ const emits = defineEmits<{
347
+ (event: 'update:connection-type', value: string): void
348
+ (event: 'change-connection-settings', value: UI_I_ConnectionSettings): void
349
+ (event: 'hide-alert', value: number, field: string): void
350
+ (event: 'change-gateway-flag', value: boolean): void
351
+ (event: 'change-ip-four-settings', value: UI_I_IpFourSettings): void
352
+ (event: 'change-port-properties', value: UI_I_PortProperties): void
353
+ (event: 'get-free-adapters', cb: () => void): void
354
+ (event: 'change-added-adapters', value: string[]): void
355
+ (event: 'change-adapter-status', value: UI_I_AdapterStatus): void
356
+ (event: 'confirm-no-active-adapters-modal'): void
357
+ (event: 'hide-no-connected-active-adapters-modal'): void
358
+ (event: 'hide-no-active-adapters-modal'): void
359
+ (event: 'change-target-device', value: UI_I_TargetDevice): void
360
+ (event: 'change-steps', value: UI_I_WizardStep[]): void
361
+ (event: 'hide'): void
362
+ (event: 'submit'): void
363
+ }>()
364
+
365
+ const localization = computed<UI_I_Localization>(() => useLocal())
366
+
367
+ const texts = computed<UI_I_WizardTexts>(() => ({
368
+ cancel: localization.value.common.cancel,
369
+ back: localization.value.common.backCap,
370
+ processing: localization.value.common.processing,
371
+ next: localization.value.common.next,
372
+ finish: localization.value.common.create,
373
+ incompleteTitle: localization.value.common.incompleteProcess,
374
+ incompleteMessage: localization.value.common.incompleteProcessMessage,
375
+ incompleteCancel: localization.value.common.cancel,
376
+ incompleteLeave: localization.value.common.leave,
377
+ step: localization.value.common.step,
378
+ of: localization.value.common.of2,
379
+ }))
380
+
381
+ const connectionTypeLocal = computed<string>({
382
+ get() {
383
+ return props.connectionType
384
+ },
385
+ set(newValue: string) {
386
+ emits('update:connection-type', newValue)
387
+ },
388
+ })
389
+
390
+ const selectConnectionTypeBlock = ref<HTMLElement | null>(null)
391
+ const { height: selectConnectionTypeHeight } = useElementSize(
392
+ selectConnectionTypeBlock
393
+ )
394
+
395
+ const selectTargetDeviceBlock = ref<HTMLElement | null>(null)
396
+ const { height: selectTargetDeviceHeight } = useElementSize(
397
+ selectTargetDeviceBlock
398
+ )
399
+
400
+ const connectionSettingsBlock = ref<HTMLElement | null>(null)
401
+ const { height: connectionSettingsHeight } = useElementSize(
402
+ connectionSettingsBlock
403
+ )
404
+
405
+ const createStandardSwitchBlock = ref<HTMLElement | null>(null)
406
+ const { height: createStandardSwitchHeight } = useElementSize(
407
+ createStandardSwitchBlock
408
+ )
409
+
410
+ const portPropertiesBlock = ref<HTMLElement | null>(null)
411
+ const { height: portPropertiesHeight } = useElementSize(portPropertiesBlock)
412
+
413
+ const ipFourSettingsBlock = ref<HTMLElement | null>(null)
414
+ const { height: ipFourSettingsHeight } = useElementSize(ipFourSettingsBlock)
415
+
416
+ const readyCompleteBlock = ref<HTMLElement | null>(null)
417
+ const { height: readyCompleteHeight } = useElementSize(readyCompleteBlock)
418
+
419
+ const onChangeAddedAdapters = (addedAdaptersNew: string[]): void => {
420
+ emits('change-added-adapters', addedAdaptersNew)
421
+ }
422
+
423
+ const onChangeAdapterStatus = (adapterStatusNew: UI_I_AdapterStatus): void => {
424
+ emits('change-adapter-status', adapterStatusNew)
425
+ }
426
+
427
+ const onChangeTargetDevice = (newTargetDevice: UI_I_TargetDevice): void => {
428
+ emits('change-target-device', newTargetDevice)
429
+ }
430
+
431
+ const onChangePortProperties = (newFields: UI_I_PortProperties): void => {
432
+ emits('change-port-properties', newFields)
433
+ }
434
+
435
+ const onChangeIpFourSettings = (newFields: UI_I_IpFourSettings): void => {
436
+ emits('change-ip-four-settings', newFields)
437
+ }
438
+
439
+ const onChangeGatewayFlag = (newValue: boolean) => {
440
+ emits('change-gateway-flag', newValue)
441
+ }
442
+
443
+ const onChangeConnectionSettings = (
444
+ newFields: UI_I_ConnectionSettings
445
+ ): void => {
446
+ emits('change-connection-settings', newFields)
447
+ }
448
+
449
+ const onGetFreeAdapters = (showModal: () => void): void => {
450
+ emits('get-free-adapters', showModal)
451
+ }
452
+
453
+ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
454
+ emits('change-steps', value)
455
+ }
456
+ </script>
457
+
458
+ <style scoped lang="scss">
459
+ .is-manager-step {
460
+ :deep(.ui-wizard-content-right-bottom) {
461
+ width: calc(100% - min(320px, 29%) - 284px);
462
+ }
463
+ :deep(.ui-wizard-content-with-subtitle) {
464
+ padding-right: 0;
465
+ }
466
+ }
467
+
468
+ @media (max-width: 1084px) {
469
+ .is-manager-step {
470
+ :deep(.ui-wizard-content-right-bottom) {
471
+ width: calc(100% - min(320px, 29%) - 16px);
472
+ }
473
+ }
474
+ }
475
+
476
+ :deep(.ui-alert-item) {
477
+ margin-bottom: 12px;
478
+
479
+ &.mb-4 {
480
+ margin-bottom: 16px;
481
+ }
482
+ }
483
+ </style>