bfg-common 1.5.240 → 1.5.241

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 (122) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/components/atoms/TheIcon3.vue +50 -50
  3. package/components/atoms/perPage/PerPage.vue +58 -58
  4. package/components/atoms/stack/StackBlock.vue +185 -185
  5. package/components/atoms/table/dataGrid/DataGrid.vue +1717 -1717
  6. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  7. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  8. package/components/atoms/table/info/lib/models/interfaces.ts +10 -10
  9. package/components/atoms/tabs/VerticalTabs.vue +105 -105
  10. package/components/common/backup/storage/actions/add/Add.vue +247 -247
  11. package/components/common/backup/storage/actions/add/New.vue +281 -281
  12. package/components/common/backup/storage/actions/add/Old.vue +114 -114
  13. package/components/common/backup/storage/actions/add/lib/config/steps.ts +168 -168
  14. package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigure.vue +41 -41
  15. package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigureNew.vue +294 -294
  16. package/components/common/backup/storage/actions/add/steps/readyComplete/ReadyComplete.vue +45 -45
  17. package/components/common/backup/storage/actions/add/steps/readyComplete/lib/config/propertiesDetails.ts +242 -242
  18. package/components/common/backup/storage/actions/delete/Delete.vue +65 -65
  19. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  20. package/components/common/context/lib/models/interfaces.ts +31 -31
  21. package/components/common/diagramMain/DiagramMain.vue +897 -897
  22. package/components/common/diagramMain/Header.vue +214 -214
  23. package/components/common/layout/theHeader/helpMenu/About.vue +82 -82
  24. package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewOld.vue +112 -112
  25. package/components/common/monitor/overview/OverviewOld.vue +139 -139
  26. package/components/common/pages/home/headline/Headline.vue +45 -45
  27. package/components/common/pages/home/headline/HeadlineOld.vue +42 -42
  28. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  29. package/components/common/pages/home/widgets/Widgets.vue +49 -49
  30. package/components/common/pages/home/widgets/WidgetsNew.vue +86 -86
  31. package/components/common/pages/home/widgets/WidgetsOld.vue +34 -34
  32. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  33. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  34. package/components/common/pages/home/widgets/vms/Vms.vue +26 -26
  35. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  36. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  37. package/components/common/pages/packages/Packages.vue +208 -208
  38. package/components/common/pages/shortcuts/block/BlockOld.vue +68 -68
  39. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  40. package/components/common/recursionTree/RecursionTree.vue +223 -223
  41. package/components/common/select/button/ButtonDropdown.vue +108 -108
  42. package/components/common/spiceConsole/Drawer.vue +377 -377
  43. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  44. package/components/common/vm/actions/add/folderTreeView/FolderTreeView.vue +72 -72
  45. package/components/common/vm/actions/add/folderTreeView/New.vue +40 -40
  46. package/components/common/vm/actions/add/folderTreeView/Old.vue +50 -50
  47. package/components/common/vm/actions/clone/lib/config/steps.ts +291 -291
  48. package/components/common/vm/actions/clone/toTemplate/lib/config/steps.ts +116 -116
  49. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +319 -319
  50. package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +219 -219
  51. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +100 -100
  52. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +232 -232
  53. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +168 -168
  54. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
  55. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +78 -78
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +50 -50
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/TooltipNew.vue +154 -154
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +307 -307
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +382 -382
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +151 -151
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationNew.vue +73 -73
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationOld.vue +83 -83
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/StorageModalNew.vue +0 -1
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +94 -94
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +205 -205
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +66 -66
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +62 -62
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +76 -76
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +84 -84
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/InputDevicesNew.vue +40 -40
  81. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +145 -145
  82. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  83. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  84. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  85. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +31 -31
  86. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +31 -31
  87. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  88. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  89. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +128 -128
  90. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  91. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +39 -39
  92. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
  93. package/components/common/vm/actions/common/lib/utils/capabilities.ts +52 -52
  94. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  95. package/components/common/vm/actions/common/select/computeResource/treeView/New.vue +44 -44
  96. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +118 -118
  97. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  98. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  99. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  100. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  101. package/components/common/vm/actions/common/select/storage/Storage.vue +0 -2
  102. package/components/common/vm/actions/common/select/storage/new/New.vue +1 -2
  103. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  104. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  105. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  106. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +220 -220
  107. package/components/common/wizards/vm/migrate/lib/config/steps.ts +157 -157
  108. package/components/common/wizards/vm/migrate/lib/validations.ts +68 -68
  109. package/components/common/wizards/vm/migrate/select/computeResource/tableView/TableView.vue +135 -135
  110. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  111. package/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable.ts +91 -91
  112. package/composables/productNameLocal.ts +30 -30
  113. package/composables/useAppVersion.ts +21 -21
  114. package/package.json +1 -1
  115. package/plugins/date.ts +233 -233
  116. package/plugins/panelStates.ts +70 -70
  117. package/plugins/text.ts +59 -59
  118. package/public/spice-console/lib/images/bitmap.js +203 -203
  119. package/public/spice-console/network/spicechannel.js +387 -387
  120. package/store/main/mutations.ts +7 -7
  121. package/store/main/state.ts +7 -7
  122. package/store/tasks/mappers/recentTasks.ts +64 -64
@@ -1,281 +1,281 @@
1
- <template>
2
- <ui-wizard
3
- show
4
- :steps="props.wizard.steps"
5
- :selected-scheme="props.selectedScheme"
6
- :is-loading="props.wizard.wizardLoader.status"
7
- :title="props.title"
8
- :texts="texts"
9
- test-id="add-datastore-wizard"
10
- @change-steps="onChangeSteps"
11
- @hide="onHideModal"
12
- @submit="onCreateDatastore"
13
- >
14
- <template #content="{ selectedStep }">
15
- <ui-wizard-block
16
- v-if="selectedStep.id === dynamicSteps.type"
17
- :sub-title-height="height0"
18
- >
19
- <template #subTitle>
20
- <div ref="subTitleBlock0">
21
- <div class="subtitle-block flex-row">
22
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
23
-
24
- <common-wizards-datastore-add-steps-common-tooltip-info
25
- id="datastore-type-subtitle-tooltip"
26
- :description="localization.common.datastoreTypeHelpDesc"
27
- />
28
- </div>
29
- </div>
30
- </template>
31
- <template #content>
32
- <common-backup-storage-actions-add-steps-type-mode
33
- v-if="selectedStep.id === dynamicSteps.type"
34
- v-model="formModelLocal.type_code"
35
- />
36
- </template>
37
- </ui-wizard-block>
38
-
39
- <ui-wizard-block
40
- v-if="selectedStep.id === dynamicSteps.name"
41
- :sub-title-height="height1"
42
- >
43
- <template #subTitle>
44
- <div ref="subTitleBlock1">
45
- <div class="subtitle-block">
46
- <ui-alert
47
- v-if="props.alertMessages[dynamicSteps.name].length"
48
- test-id="add-host-connection-settings-error-alert"
49
- type="error"
50
- size="md"
51
- :messages="props.alertMessages[dynamicSteps.name]"
52
- class="subtitle-block__alert"
53
- />
54
-
55
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
56
- </div>
57
- </div>
58
- </template>
59
- <template #content>
60
- <common-backup-storage-actions-add-steps-name
61
- v-if="selectedStep.id === dynamicSteps.name"
62
- v-model="formModelLocal"
63
- :project="props.project"
64
- :messages-fields="selectedStep.fields"
65
- />
66
- </template>
67
- </ui-wizard-block>
68
-
69
- <ui-wizard-block
70
- v-if="selectedStep.id === dynamicSteps.nameAndConfigure"
71
- :sub-title-height="height2"
72
- >
73
- <template #subTitle>
74
- <div ref="subTitleBlock2">
75
- <div class="subtitle-block">
76
- <ui-alert
77
- v-if="props.alertMessages[dynamicSteps.nameAndConfigure].length"
78
- test-id="add-host-connection-settings-error-alert"
79
- type="error"
80
- size="md"
81
- :messages="props.alertMessages[dynamicSteps.nameAndConfigure]"
82
- class="subtitle-block__alert"
83
- />
84
-
85
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
86
- </div>
87
- </div>
88
- </template>
89
- <template #content>
90
- <common-backup-storage-actions-add-steps-name-and-configure
91
- v-if="selectedStep.id === dynamicSteps.nameAndConfigure"
92
- v-model="formModelLocal"
93
- :project="props.project"
94
- :messages-fields="selectedStep.fields"
95
- />
96
- </template>
97
- </ui-wizard-block>
98
-
99
- <ui-wizard-block
100
- v-if="selectedStep.id === dynamicSteps.storage"
101
- :sub-title-height="height3"
102
- >
103
- <template #subTitle>
104
- <div ref="subTitleBlock3">
105
- <div class="subtitle-block">
106
- <ui-alert
107
- v-if="props.alertMessages[dynamicSteps.storage].length"
108
- test-id="add-host-accessibility-error-alert"
109
- type="error"
110
- size="md"
111
- :messages="props.alertMessages[dynamicSteps.storage]"
112
- class="subtitle-block__alert"
113
- />
114
-
115
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
116
- </div>
117
- </div>
118
- </template>
119
- <template #content>
120
- <common-vm-actions-common-select-storage
121
- :datastore="props.datastore"
122
- :get-datastore-table-func="props.getDatastoreTableFunc"
123
- hide-compatibility
124
- hide-alert
125
- class="storage-datatable h-full"
126
- @change-storage="onChangeStorage"
127
- />
128
- </template>
129
- </ui-wizard-block>
130
-
131
- <ui-wizard-block
132
- v-if="selectedStep.id === dynamicSteps.hostAccessibility"
133
- :sub-title-height="height4"
134
- >
135
- <template #subTitle>
136
- <div ref="subTitleBlock4">
137
- <div class="subtitle-block">
138
- <ui-alert
139
- v-if="
140
- props.alertMessages[dynamicSteps.hostAccessibility].length
141
- "
142
- test-id="add-host-accessibility-error-alert"
143
- type="error"
144
- size="md"
145
- :messages="props.alertMessages[dynamicSteps.hostAccessibility]"
146
- class="subtitle-block__alert"
147
- />
148
-
149
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
150
- </div>
151
- </div>
152
- </template>
153
- <template #content>
154
- <common-backup-storage-actions-add-steps-host-accessibility
155
- v-if="selectedStep.id === dynamicSteps.hostAccessibility"
156
- v-model="formModelLocal.hosts"
157
- :alert-messages="
158
- props.alertMessages[dynamicSteps.hostAccessibility]
159
- "
160
- :hosts="props.hosts"
161
- />
162
- </template>
163
- </ui-wizard-block>
164
-
165
- <ui-wizard-block
166
- v-if="selectedStep.id === dynamicSteps.readyComplete"
167
- :sub-title-height="height5"
168
- >
169
- <template #subTitle>
170
- <div ref="subTitleBlock5">
171
- <div class="subtitle-block">
172
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
173
- </div>
174
- </div>
175
- </template>
176
- <template #content>
177
- <common-backup-storage-actions-add-steps-ready-complete
178
- v-if="selectedStep.id === dynamicSteps.readyComplete"
179
- :form="formModelLocal"
180
- :project="props.project"
181
- :hosts="props.hosts"
182
- :datastore="props.datastore"
183
- />
184
- </template>
185
- </ui-wizard-block>
186
- </template>
187
- </ui-wizard>
188
- </template>
189
-
190
- <script setup lang="ts">
191
- import { useElementSize } from '@vueuse/core'
192
- import type {
193
- UI_I_WizardStep,
194
- UI_I_WizardTexts,
195
- } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
196
- import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
197
- import type { UI_I_Localization } from '~/lib/models/interfaces'
198
- import type { UI_T_Project } from '~/lib/models/types'
199
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
200
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
201
- import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
202
- import { dynamicSteps } from '~/components/common/backup/storage/actions/add/lib/config/steps'
203
-
204
- const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
205
- const props = defineProps<{
206
- project: UI_T_Project
207
- wizard: Wizard
208
- selectedScheme: number[]
209
- alertMessages: string[][]
210
- title: string
211
- datastore: UI_I_DatastoreTableItem[]
212
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
213
- hosts?: any[]
214
- }>()
215
- const emits = defineEmits<{
216
- (event: 'change-steps', value: UI_I_WizardStep[]): void
217
- (event: 'change-storage', value: UI_I_WizardStep[]): void
218
- (event: 'hide'): void
219
- (event: 'submit', value: any): void
220
- }>()
221
-
222
- const localization = computed<UI_I_Localization>(() => useLocal())
223
-
224
- const texts = computed<UI_I_WizardTexts>(() => ({
225
- cancel: localization.value.common.cancel,
226
- back: localization.value.common.backCap,
227
- processing: localization.value.common.processing,
228
- next: localization.value.common.next,
229
- finish: localization.value.common.add,
230
- incompleteTitle: localization.value.common.incompleteProcess,
231
- incompleteMessage: localization.value.common.incompleteProcessMessage,
232
- incompleteCancel: localization.value.common.cancel,
233
- incompleteLeave: localization.value.common.leave,
234
- step: localization.value.common.step,
235
- of: localization.value.common.of2,
236
- }))
237
-
238
- const subTitleBlock0 = ref<HTMLElement | null>(null)
239
- const { height: height0 } = useElementSize(subTitleBlock0)
240
-
241
- const subTitleBlock1 = ref<HTMLElement | null>(null)
242
- const { height: height1 } = useElementSize(subTitleBlock1)
243
-
244
- const subTitleBlock2 = ref<HTMLElement | null>(null)
245
- const { height: height2 } = useElementSize(subTitleBlock2)
246
-
247
- const subTitleBlock3 = ref<HTMLElement | null>(null)
248
- const { height: height3 } = useElementSize(subTitleBlock3)
249
-
250
- const subTitleBlock4 = ref<HTMLElement | null>(null)
251
- const { height: height4 } = useElementSize(subTitleBlock4)
252
-
253
- const subTitleBlock5 = ref<HTMLElement | null>(null)
254
- const { height: height5 } = useElementSize(subTitleBlock5)
255
-
256
- const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
257
- emits('change-steps', value)
258
- const onChangeStorage = async (value: UI_I_WizardStep[]): Promise<void> =>
259
- emits('change-storage', value)
260
-
261
- const onHideModal = (): void => emits('hide')
262
- const onCreateDatastore = (): void => emits('submit')
263
- </script>
264
-
265
- <style scoped lang="scss">
266
- .subtitle-block {
267
- display: flex;
268
- flex-direction: column;
269
- row-gap: 16px;
270
- border-bottom: 1px solid var(--wizard-line);
271
- padding-bottom: 12px;
272
-
273
- &.flex-row {
274
- flex-direction: row;
275
- }
276
-
277
- :deep(&__alert) {
278
- padding: 10px 12px;
279
- }
280
- }
281
- </style>
1
+ <template>
2
+ <ui-wizard
3
+ show
4
+ :steps="props.wizard.steps"
5
+ :selected-scheme="props.selectedScheme"
6
+ :is-loading="props.wizard.wizardLoader.status"
7
+ :title="props.title"
8
+ :texts="texts"
9
+ test-id="add-datastore-wizard"
10
+ @change-steps="onChangeSteps"
11
+ @hide="onHideModal"
12
+ @submit="onCreateDatastore"
13
+ >
14
+ <template #content="{ selectedStep }">
15
+ <ui-wizard-block
16
+ v-if="selectedStep.id === dynamicSteps.type"
17
+ :sub-title-height="height0"
18
+ >
19
+ <template #subTitle>
20
+ <div ref="subTitleBlock0">
21
+ <div class="subtitle-block flex-row">
22
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
23
+
24
+ <common-wizards-datastore-add-steps-common-tooltip-info
25
+ id="datastore-type-subtitle-tooltip"
26
+ :description="localization.common.datastoreTypeHelpDesc"
27
+ />
28
+ </div>
29
+ </div>
30
+ </template>
31
+ <template #content>
32
+ <common-backup-storage-actions-add-steps-type-mode
33
+ v-if="selectedStep.id === dynamicSteps.type"
34
+ v-model="formModelLocal.type_code"
35
+ />
36
+ </template>
37
+ </ui-wizard-block>
38
+
39
+ <ui-wizard-block
40
+ v-if="selectedStep.id === dynamicSteps.name"
41
+ :sub-title-height="height1"
42
+ >
43
+ <template #subTitle>
44
+ <div ref="subTitleBlock1">
45
+ <div class="subtitle-block">
46
+ <ui-alert
47
+ v-if="props.alertMessages[dynamicSteps.name].length"
48
+ test-id="add-host-connection-settings-error-alert"
49
+ type="error"
50
+ size="md"
51
+ :messages="props.alertMessages[dynamicSteps.name]"
52
+ class="subtitle-block__alert"
53
+ />
54
+
55
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
56
+ </div>
57
+ </div>
58
+ </template>
59
+ <template #content>
60
+ <common-backup-storage-actions-add-steps-name
61
+ v-if="selectedStep.id === dynamicSteps.name"
62
+ v-model="formModelLocal"
63
+ :project="props.project"
64
+ :messages-fields="selectedStep.fields"
65
+ />
66
+ </template>
67
+ </ui-wizard-block>
68
+
69
+ <ui-wizard-block
70
+ v-if="selectedStep.id === dynamicSteps.nameAndConfigure"
71
+ :sub-title-height="height2"
72
+ >
73
+ <template #subTitle>
74
+ <div ref="subTitleBlock2">
75
+ <div class="subtitle-block">
76
+ <ui-alert
77
+ v-if="props.alertMessages[dynamicSteps.nameAndConfigure].length"
78
+ test-id="add-host-connection-settings-error-alert"
79
+ type="error"
80
+ size="md"
81
+ :messages="props.alertMessages[dynamicSteps.nameAndConfigure]"
82
+ class="subtitle-block__alert"
83
+ />
84
+
85
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
86
+ </div>
87
+ </div>
88
+ </template>
89
+ <template #content>
90
+ <common-backup-storage-actions-add-steps-name-and-configure
91
+ v-if="selectedStep.id === dynamicSteps.nameAndConfigure"
92
+ v-model="formModelLocal"
93
+ :project="props.project"
94
+ :messages-fields="selectedStep.fields"
95
+ />
96
+ </template>
97
+ </ui-wizard-block>
98
+
99
+ <ui-wizard-block
100
+ v-if="selectedStep.id === dynamicSteps.storage"
101
+ :sub-title-height="height3"
102
+ >
103
+ <template #subTitle>
104
+ <div ref="subTitleBlock3">
105
+ <div class="subtitle-block">
106
+ <ui-alert
107
+ v-if="props.alertMessages[dynamicSteps.storage].length"
108
+ test-id="add-host-accessibility-error-alert"
109
+ type="error"
110
+ size="md"
111
+ :messages="props.alertMessages[dynamicSteps.storage]"
112
+ class="subtitle-block__alert"
113
+ />
114
+
115
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
116
+ </div>
117
+ </div>
118
+ </template>
119
+ <template #content>
120
+ <common-vm-actions-common-select-storage
121
+ :datastore="props.datastore"
122
+ :get-datastore-table-func="props.getDatastoreTableFunc"
123
+ hide-compatibility
124
+ hide-alert
125
+ class="storage-datatable h-full"
126
+ @change-storage="onChangeStorage"
127
+ />
128
+ </template>
129
+ </ui-wizard-block>
130
+
131
+ <ui-wizard-block
132
+ v-if="selectedStep.id === dynamicSteps.hostAccessibility"
133
+ :sub-title-height="height4"
134
+ >
135
+ <template #subTitle>
136
+ <div ref="subTitleBlock4">
137
+ <div class="subtitle-block">
138
+ <ui-alert
139
+ v-if="
140
+ props.alertMessages[dynamicSteps.hostAccessibility].length
141
+ "
142
+ test-id="add-host-accessibility-error-alert"
143
+ type="error"
144
+ size="md"
145
+ :messages="props.alertMessages[dynamicSteps.hostAccessibility]"
146
+ class="subtitle-block__alert"
147
+ />
148
+
149
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
150
+ </div>
151
+ </div>
152
+ </template>
153
+ <template #content>
154
+ <common-backup-storage-actions-add-steps-host-accessibility
155
+ v-if="selectedStep.id === dynamicSteps.hostAccessibility"
156
+ v-model="formModelLocal.hosts"
157
+ :alert-messages="
158
+ props.alertMessages[dynamicSteps.hostAccessibility]
159
+ "
160
+ :hosts="props.hosts"
161
+ />
162
+ </template>
163
+ </ui-wizard-block>
164
+
165
+ <ui-wizard-block
166
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
167
+ :sub-title-height="height5"
168
+ >
169
+ <template #subTitle>
170
+ <div ref="subTitleBlock5">
171
+ <div class="subtitle-block">
172
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
173
+ </div>
174
+ </div>
175
+ </template>
176
+ <template #content>
177
+ <common-backup-storage-actions-add-steps-ready-complete
178
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
179
+ :form="formModelLocal"
180
+ :project="props.project"
181
+ :hosts="props.hosts"
182
+ :datastore="props.datastore"
183
+ />
184
+ </template>
185
+ </ui-wizard-block>
186
+ </template>
187
+ </ui-wizard>
188
+ </template>
189
+
190
+ <script setup lang="ts">
191
+ import { useElementSize } from '@vueuse/core'
192
+ import type {
193
+ UI_I_WizardStep,
194
+ UI_I_WizardTexts,
195
+ } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
196
+ import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
197
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
198
+ import type { UI_T_Project } from '~/lib/models/types'
199
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
200
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
201
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
202
+ import { dynamicSteps } from '~/components/common/backup/storage/actions/add/lib/config/steps'
203
+
204
+ const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
205
+ const props = defineProps<{
206
+ project: UI_T_Project
207
+ wizard: Wizard
208
+ selectedScheme: number[]
209
+ alertMessages: string[][]
210
+ title: string
211
+ datastore: UI_I_DatastoreTableItem[]
212
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
213
+ hosts?: any[]
214
+ }>()
215
+ const emits = defineEmits<{
216
+ (event: 'change-steps', value: UI_I_WizardStep[]): void
217
+ (event: 'change-storage', value: UI_I_WizardStep[]): void
218
+ (event: 'hide'): void
219
+ (event: 'submit', value: any): void
220
+ }>()
221
+
222
+ const localization = computed<UI_I_Localization>(() => useLocal())
223
+
224
+ const texts = computed<UI_I_WizardTexts>(() => ({
225
+ cancel: localization.value.common.cancel,
226
+ back: localization.value.common.backCap,
227
+ processing: localization.value.common.processing,
228
+ next: localization.value.common.next,
229
+ finish: localization.value.common.add,
230
+ incompleteTitle: localization.value.common.incompleteProcess,
231
+ incompleteMessage: localization.value.common.incompleteProcessMessage,
232
+ incompleteCancel: localization.value.common.cancel,
233
+ incompleteLeave: localization.value.common.leave,
234
+ step: localization.value.common.step,
235
+ of: localization.value.common.of2,
236
+ }))
237
+
238
+ const subTitleBlock0 = ref<HTMLElement | null>(null)
239
+ const { height: height0 } = useElementSize(subTitleBlock0)
240
+
241
+ const subTitleBlock1 = ref<HTMLElement | null>(null)
242
+ const { height: height1 } = useElementSize(subTitleBlock1)
243
+
244
+ const subTitleBlock2 = ref<HTMLElement | null>(null)
245
+ const { height: height2 } = useElementSize(subTitleBlock2)
246
+
247
+ const subTitleBlock3 = ref<HTMLElement | null>(null)
248
+ const { height: height3 } = useElementSize(subTitleBlock3)
249
+
250
+ const subTitleBlock4 = ref<HTMLElement | null>(null)
251
+ const { height: height4 } = useElementSize(subTitleBlock4)
252
+
253
+ const subTitleBlock5 = ref<HTMLElement | null>(null)
254
+ const { height: height5 } = useElementSize(subTitleBlock5)
255
+
256
+ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
257
+ emits('change-steps', value)
258
+ const onChangeStorage = async (value: UI_I_WizardStep[]): Promise<void> =>
259
+ emits('change-storage', value)
260
+
261
+ const onHideModal = (): void => emits('hide')
262
+ const onCreateDatastore = (): void => emits('submit')
263
+ </script>
264
+
265
+ <style scoped lang="scss">
266
+ .subtitle-block {
267
+ display: flex;
268
+ flex-direction: column;
269
+ row-gap: 16px;
270
+ border-bottom: 1px solid var(--wizard-line);
271
+ padding-bottom: 12px;
272
+
273
+ &.flex-row {
274
+ flex-direction: row;
275
+ }
276
+
277
+ :deep(&__alert) {
278
+ padding: 10px 12px;
279
+ }
280
+ }
281
+ </style>