bfg-common 1.5.245 → 1.5.246

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