bfg-common 1.5.60 → 1.5.62

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 (31) hide show
  1. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  2. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  3. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  4. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  5. package/assets/localization/local_be.json +5 -2
  6. package/assets/localization/local_en.json +5 -2
  7. package/assets/localization/local_hy.json +5 -2
  8. package/assets/localization/local_kk.json +5 -2
  9. package/assets/localization/local_ru.json +5 -2
  10. package/assets/localization/local_zh.json +5 -2
  11. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/lib/utils/optionsActions.ts +32 -28
  12. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/utils.ts +1040 -1040
  13. package/components/common/monitor/advanced/tools/lib/config/advancedToolbar.ts +146 -130
  14. package/components/common/vm/actions/add/Add.vue +205 -194
  15. package/components/common/vm/actions/add/New.vue +429 -0
  16. package/components/common/vm/actions/add/Old.vue +371 -0
  17. package/components/common/vm/actions/add/lib/config/steps.ts +19 -3
  18. package/components/common/vm/actions/clone/toTemplate/ToTemplate.vue +29 -37
  19. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +5 -5
  20. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +3 -3
  21. package/components/common/vm/actions/common/select/createType/CreateType.vue +15 -51
  22. package/components/common/vm/actions/common/select/createType/New.vue +84 -0
  23. package/components/common/vm/actions/common/select/createType/Old.vue +70 -0
  24. package/components/common/vm/actions/common/select/createType/lib/config/items.ts +24 -4
  25. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -0
  26. package/components/common/vm/actions/common/select/name/Name.vue +24 -93
  27. package/components/common/vm/actions/common/select/name/New.vue +143 -0
  28. package/components/common/vm/actions/common/select/name/Old.vue +119 -0
  29. package/components/common/vm/actions/common/select/template/Template.vue +2 -3
  30. package/components/common/vm/actions/common/select/template/TemplateTreeView.vue +1 -1
  31. package/package.json +1 -1
@@ -0,0 +1,371 @@
1
+ <template>
2
+ <div class="add-vm">
3
+ <atoms-wizard
4
+ show
5
+ :wizard="props.wizard"
6
+ :selected-scheme="props.selectedScheme"
7
+ :title="localization.common.newVirtualMachine2"
8
+ :localization="localization"
9
+ test-id="new-virtual-machine-wizard"
10
+ @change-steps="emits('change-steps', $event)"
11
+ @hide="emits('hide')"
12
+ @submit="emits('finish')"
13
+ >
14
+ <template #modalBody="{ selectedStep }">
15
+ <div class="add-vm-content">
16
+ <common-vm-actions-common-select-create-type
17
+ v-show="selectedStep.id === dynamicSteps.creationType"
18
+ v-model="selectedCreateType"
19
+ :import-from-v-m-warev-sphere="props.importFromVMWarevSphere"
20
+ />
21
+ <common-vm-actions-common-select-template
22
+ v-show="selectedStep.id === dynamicSteps.selectTemplate"
23
+ :template-submit="props.templateSubmit"
24
+ :templates-tree="props.templatesTree"
25
+ @submit="emits('change-template', $event)"
26
+ />
27
+ <common-vm-actions-common-select-name
28
+ v-show="
29
+ selectedStep.id === dynamicSteps.selectName ||
30
+ selectedStep.id === dynamicSteps.selectNameFolder
31
+ "
32
+ :show="
33
+ selectedStep.id === dynamicSteps.selectName ||
34
+ selectedStep.id === dynamicSteps.selectNameFolder
35
+ "
36
+ :name-form-submit="props.nameFormSubmit"
37
+ :project="props.project"
38
+ :data-center="props.dataCenter"
39
+ @submit="emits('change-name', $event)"
40
+ @check-name="emits('check-name', $event)"
41
+ />
42
+ <!-- change-name ...$event -->
43
+ <common-vm-actions-common-select-compute-resource
44
+ v-if="props.isSphere"
45
+ v-show="selectedStep.id === dynamicSteps.selectComputeResource"
46
+ v-model="vmForm.computeResource"
47
+ :compute-resource-submit="props.computeResourceSubmit"
48
+ :data-center="vmForm.dataCenter"
49
+ :compute-resource="props.computeResource"
50
+ :compute-resource-tree="props.computeResourceTree"
51
+ @submit="emits('change-compute-resource', $event)"
52
+ @select-compute-resource-tree="
53
+ emits('select-compute-resource-tree', $event)
54
+ "
55
+ @get-compute-resource-tree="
56
+ emits('get-compute-resource-tree', $event)
57
+ "
58
+ @show-compute-resource-tree="
59
+ emits('show-compute-resource-tree', $event)
60
+ "
61
+ @clear-compute-resource-tree="emits('clear-compute-resource-tree')"
62
+ />
63
+ <common-vm-actions-common-select-storage
64
+ v-show="selectedStep.id === dynamicSteps.selectStorage"
65
+ :storage-submit="props.storageSubmit"
66
+ :datastore="props.datastore"
67
+ :storage="props.vmtSettings?.storage"
68
+ :get-datastore-table-func="props.getDatastoreTableFunc"
69
+ @submit="emits('change-storage', $event)"
70
+ />
71
+ <common-vm-actions-common-select-options
72
+ v-show="selectedStep.id === dynamicSteps.selectOptions"
73
+ @change="emits('change-select-options', $event)"
74
+ />
75
+ <common-vm-actions-common-select-compatibility
76
+ v-show="selectedStep.id === dynamicSteps.compatibility"
77
+ :options="props.compatibility"
78
+ :error-validation-fields="props.errorValidationFields"
79
+ @change="emits('change-compatibility', $event)"
80
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
81
+ />
82
+ <common-vm-actions-common-select-os
83
+ v-show="
84
+ selectedStep.id === dynamicSteps.selectGuestOSMachineType ||
85
+ selectedStep.id === dynamicSteps.selectGuestOS
86
+ "
87
+ v-model:machine-type="vmForm.guestMachineType"
88
+ v-model:guest-os-family="vmForm.guestOsFamily"
89
+ v-model:guest-os-version="vmForm.guestOsVersion"
90
+ :families-options="props.guestOsFamilies"
91
+ :versions-options="props.guestOsVersions"
92
+ :machine-types-options="props.machineTypes"
93
+ :error-validation-fields="props.errorValidationFields"
94
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
95
+ />
96
+ <common-vm-actions-common-customize-hardware
97
+ v-show="selectedStep.id === dynamicSteps.customizeHardware"
98
+ :project="props.project"
99
+ :vm-name="vmForm.name"
100
+ :guest-machine-type="vmForm.guestMachineType"
101
+ :guest-os-family="vmForm.guestOsFamily"
102
+ :guest-os-version="vmForm.guestOsVersion"
103
+ :storage="vmForm.storage"
104
+ :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
105
+ :cd-dvd-drives-for-boot-options="
106
+ props.virtualHardwareCdDvdDrivesLocal
107
+ "
108
+ :networks-for-boot-options="props.virtualHardwareNetworksLocal"
109
+ :cd-dvd-drives="props.virtualHardwareCdDvdDrivesLocal"
110
+ :customize-hardware-submit="props.customizeHardwareSubmit"
111
+ :max-cpus="props.maxCpus"
112
+ :max-memory="props.maxMemory"
113
+ :cpu-models="props.cpuModels"
114
+ :selected-nav-item="props.selectedNavItem"
115
+ :nodes="props.nodes"
116
+ :files="props.files"
117
+ :networks-table="props.networksTable"
118
+ :error-validation-fields="props.errorValidationFields"
119
+ :get-datastore-table-func="props.getDatastoreTableFunc"
120
+ :datastore="props.datastore"
121
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
122
+ :passthrough-devices="props.passthroughDevices"
123
+ :mediated-devices="props.mediatedDevices"
124
+ :compute-resource="vmForm.computeResource"
125
+ @change-boot-order="emits('change-boot-order', $event)"
126
+ @send-data="emits('change-customize-hardware', $event)"
127
+ @get-storage="emits('get-storage', $event)"
128
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
129
+ @get-active-device-child="emits('get-active-device-child', $event)"
130
+ @show-datastore-child="emits('show-datastore-child', $event)"
131
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
132
+ @get-networks-table="emits('get-networks-table', $event)"
133
+ @get-pci-devices="emits('get-pci-devices')"
134
+ />
135
+ <common-vm-actions-common-customize-hardware
136
+ v-if="props.vmtSettings"
137
+ v-show="selectedStep.id === dynamicSteps.customizeHardwareTemplate"
138
+ :project="props.project"
139
+ :vm-name="vmForm.name"
140
+ :guest-machine-type="vmForm.guestMachineType"
141
+ :guest-os-family="vmForm.guestOsFamily"
142
+ :guest-os-version="vmForm.guestOsVersion"
143
+ :storage="vmForm.storage"
144
+ :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
145
+ :cd-dvd-drives-for-boot-options="
146
+ props.virtualHardwareCdDvdDrivesLocal
147
+ "
148
+ :networks-for-boot-options="props.virtualHardwareNetworksLocal"
149
+ :cd-dvd-drives="props.vmtSettings.cdDvdDrives || []"
150
+ :hard-disks="props.vmtSettings.hardDisks || []"
151
+ :networks="props.vmtSettings.networks || []"
152
+ :customize-hardware-submit="props.customizeHardwareSubmit"
153
+ :max-cpus="props.maxCpus"
154
+ :max-memory="props.maxMemory"
155
+ :cpu-models="props.cpuModels"
156
+ :cpu="props.vmtSettings.cpu"
157
+ :memory="props.vmtSettings.memory"
158
+ :video-card="props.vmtSettings.videoCard"
159
+ :usb-controller="props.vmtSettings.usbController"
160
+ :pci-devices="props.vmtSettings.pciDevices"
161
+ :hard-disks-for-edit="props.vmtSettings.hardDisks || []"
162
+ :options="props.vmtSettings.options"
163
+ :selected-nav-item="props.selectedNavItem"
164
+ :nodes="props.nodes"
165
+ :files="props.files"
166
+ :networks-table="props.networksTable"
167
+ :error-validation-fields="props.errorValidationFields"
168
+ :get-datastore-table-func="props.getDatastoreTableFunc"
169
+ :datastore="props.datastore"
170
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
171
+ :passthrough-devices="props.passthroughDevices"
172
+ :mediated-devices="props.mediatedDevices"
173
+ :compute-resource="vmForm.computeResource"
174
+ is-clone
175
+ @change-boot-order="emits('change-boot-order', $event)"
176
+ @send-data="emits('change-customize-hardware', $event)"
177
+ @get-storage="emits('get-storage', $event)"
178
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
179
+ @get-active-device-child="emits('get-active-device-child', $event)"
180
+ @show-datastore-child="emits('show-datastore-child', $event)"
181
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
182
+ @get-networks-table="emits('get-networks-table', $event)"
183
+ @get-pci-devices="emits('get-pci-devices')"
184
+ />
185
+ <common-ready-to-complete
186
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
187
+ :data="props.readyCompleteTableInfo"
188
+ />
189
+ <span
190
+ v-if="selectedStep.id > dynamicSteps.compatibility"
191
+ class="vm-hardware-version"
192
+ >{{ props.compatibilityInfo }}</span
193
+ >
194
+ </div>
195
+ </template>
196
+
197
+ <template #modalFooterContent>
198
+ <div v-if="props.isShowPowerOn" class="power-on-by-default-wrap">
199
+ <input
200
+ id="power-on-by-default"
201
+ v-model="isPowerOnByDefault"
202
+ data-id="power-on-by-default"
203
+ type="checkbox"
204
+ />
205
+ <label for="power-on-by-default" class="label-text-normal">{{
206
+ localization.common.powerOnByDefault
207
+ }}</label>
208
+ </div>
209
+ </template>
210
+ </atoms-wizard>
211
+ </div>
212
+ </template>
213
+
214
+ <script setup lang="ts">
215
+ import type {
216
+ UI_I_Localization,
217
+ UI_I_ArbitraryObject,
218
+ } from '~/lib/models/interfaces'
219
+ import type { UI_T_Project } from '~/lib/models/types'
220
+ import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
221
+ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
222
+ import type {
223
+ UI_I_DatastoreTableItem,
224
+ UI_I_FolderOrFileTreePayload,
225
+ } from '~/lib/models/store/storage/interfaces'
226
+ import type {
227
+ API_UI_I_Error,
228
+ UI_I_ErrorValidationField,
229
+ } from '~/lib/models/store/interfaces'
230
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
231
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
232
+ import type {
233
+ // UI_T_AddVmFinishFunc,
234
+ UI_T_SelectedNavItem,
235
+ } from '~/components/common/vm/actions/common/lib/models/types'
236
+ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
237
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
238
+ import type {
239
+ // UI_I_Capabilities,
240
+ UI_I_VmForm,
241
+ } from '~/components/common/vm/actions/common/lib/models/interfaces'
242
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
243
+ import type {
244
+ UI_I_SendDataNewCdDvdDrive,
245
+ UI_I_SendDataNewHardDisk,
246
+ UI_I_SendDataNewNetwork,
247
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
248
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
249
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
250
+ import type {
251
+ UI_I_MediatedDevice,
252
+ UI_I_PciDevice,
253
+ UI_I_VmSettings,
254
+ } from '~/lib/models/store/vm/interfaces'
255
+ import { dynamicSteps } from '~/components/common/vm/actions/add/lib/config/steps'
256
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
257
+
258
+ const vmForm = defineModel<UI_I_VmForm>('vmForm', {
259
+ required: true,
260
+ })
261
+ const selectedCreateType = defineModel<string>('selectedCreateType', {
262
+ required: true,
263
+ })
264
+ const isPowerOnByDefault = defineModel<boolean>('isPowerOnByDefault', {
265
+ required: true,
266
+ })
267
+
268
+ const props = defineProps<{
269
+ project: UI_T_Project
270
+ nodes: UI_I_FileTreeNode[]
271
+ files: UI_I_FileTreeNode[]
272
+ networksTable: UI_I_NetworkTableItem[]
273
+ datastore: UI_I_DatastoreTableItem[]
274
+ errorValidationFields: UI_I_ErrorValidationField[]
275
+ readyCompleteTableInfo: UI_I_TableInfoItem[]
276
+ vmCpuHelpTextSecond: string
277
+ importFromVMWarevSphere: string
278
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
279
+ passthroughDevices: UI_I_PciDevice[]
280
+ mediatedDevices: UI_I_MediatedDevice[]
281
+ templatesTree: UI_I_TreeNode[]
282
+ wizard: Wizard
283
+ selectedScheme: number[]
284
+ templateSubmit: null | Function
285
+ nameFormSubmit: null | Function
286
+ storageSubmit: null | Function
287
+ customizeHardwareSubmit: null | Function
288
+ isSphere: boolean
289
+ compatibility: UI_I_OptionItem[]
290
+ guestOsFamilies: UI_I_OptionItem[]
291
+ guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
292
+ machineTypes: UI_I_OptionItem[]
293
+ virtualHardwareHardDisksLocal: UI_I_SendDataNewHardDisk[] | null
294
+ virtualHardwareCdDvdDrivesLocal: UI_I_SendDataNewCdDvdDrive[] | null
295
+ virtualHardwareNetworksLocal: UI_I_SendDataNewNetwork[] | null
296
+ maxCpus: number
297
+ maxMemory: number
298
+ cpuModels: UI_I_OptionItem[]
299
+ selectedNavItem: UI_T_SelectedNavItem
300
+ compatibilityInfo: string
301
+ isShowPowerOn: boolean
302
+ computeResourceSubmit?: null | Function // для сферы
303
+ dataCenter?: UI_I_TreeNode // для сферы
304
+ computeResource?: UI_I_TreeNode // для сферы
305
+ computeResourceTree?: UI_I_TreeNode[] // для сферы
306
+ vmtSettings?: UI_I_VmSettings | null // для шаблонов
307
+ }>()
308
+
309
+ const emits = defineEmits<{
310
+ (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
311
+ (event: 'get-storage', value: UI_I_TablePayload): void
312
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
313
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
314
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
315
+ (event: 'remove-error-by-title', value: string): void
316
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
317
+ (event: 'get-pci-devices'): void
318
+ (event: 'change-steps', value: UI_I_WizardStep[]): void
319
+ (event: 'finish'): void
320
+ (event: 'change-template', value: UI_I_TreeNode): void
321
+ (event: 'change-name', value: [string, UI_I_TreeNode | null]): void
322
+ (
323
+ event: 'check-name',
324
+ value: [[string, UI_I_TreeNode | null], (error: any) => void]
325
+ ): void
326
+ (event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
327
+ (event: 'change-select-options', value: string[]): void
328
+ (event: 'change-compatibility', value: UI_I_OptionItem): void
329
+ (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
330
+ (
331
+ event: 'change-customize-hardware',
332
+ value: UI_I_SendDataCustomizeHardware
333
+ ): void
334
+ (event: 'hide'): void
335
+ (event: 'clear-compute-resource-tree'): void // для сферы
336
+ (event: 'change-compute-resource', value: UI_I_TreeNode): void // для сферы
337
+ (event: 'select-compute-resource-tree', value: UI_I_TreeNode): void // для сферы
338
+ (
339
+ event: 'get-compute-resource-tree',
340
+ value: { id: string | number; cb: () => void }
341
+ ): void // для сферы
342
+ (event: 'show-compute-resource-tree', value: UI_I_TreeNode): void // для сферы
343
+ }>()
344
+
345
+ const localization = computed<UI_I_Localization>(() => useLocal())
346
+ </script>
347
+
348
+ <style scoped lang="scss">
349
+ :deep(.modal-body) {
350
+ display: flex;
351
+ flex-direction: column;
352
+ }
353
+ .add-vm-content {
354
+ display: flex;
355
+ flex-direction: column;
356
+ flex: 1;
357
+ }
358
+ .vm-hardware-version {
359
+ align-self: flex-end;
360
+ margin-top: auto;
361
+ }
362
+ .power-on-by-default-wrap {
363
+ display: flex;
364
+ align-items: center;
365
+ margin-right: auto;
366
+
367
+ input {
368
+ margin-right: 6px;
369
+ }
370
+ }
371
+ </style>
@@ -14,7 +14,8 @@ export const dynamicSteps = {
14
14
  selectGuestOSMachineType: 8,
15
15
  selectGuestOS: 9,
16
16
  customizeHardware: 10,
17
- readyComplete: 11,
17
+ customizeHardwareTemplate: 11,
18
+ readyComplete: 12,
18
19
  }
19
20
 
20
21
  export const stepsFunc = (
@@ -169,6 +170,21 @@ export const stepsFunc = (
169
170
  },
170
171
  },
171
172
  },
173
+ {
174
+ id: dynamicSteps.customizeHardwareTemplate,
175
+ stepName: '',
176
+ title: localization.common.customizeHardware,
177
+ subTitle: localization.common.configureVirtualMachineHardware,
178
+ status: UI_E_WIZARD_STATUS.INACTIVE,
179
+ isValid: true,
180
+ testId: 'vm-select-customize-hardware',
181
+ fields: {
182
+ customizeHardware: {
183
+ field: '',
184
+ alert: '',
185
+ },
186
+ },
187
+ },
172
188
  {
173
189
  id: dynamicSteps.readyComplete,
174
190
  stepName: '',
@@ -230,7 +246,7 @@ export const stepsSchemeInitial = [
230
246
  dynamicSteps.selectName,
231
247
  dynamicSteps.selectStorage,
232
248
  dynamicSteps.selectOptions,
233
- dynamicSteps.customizeHardware,
249
+ dynamicSteps.customizeHardwareTemplate,
234
250
  dynamicSteps.readyComplete,
235
251
  ],
236
252
  // Deploy from template with Customize the operating system and this virtual machine's hardware (Procurator)
@@ -241,7 +257,7 @@ export const stepsSchemeInitial = [
241
257
  dynamicSteps.selectStorage,
242
258
  dynamicSteps.selectOptions,
243
259
  dynamicSteps.selectGuestOSMachineType,
244
- dynamicSteps.customizeHardware,
260
+ dynamicSteps.customizeHardwareTemplate,
245
261
  dynamicSteps.readyComplete,
246
262
  ],
247
263
  ]
@@ -11,8 +11,8 @@
11
11
  @submit="onFinish"
12
12
  >
13
13
  <template #modalBody="{ selectedStep }">
14
- <atoms-loader v-show="!vmSettings" id="loader" />
15
- <div v-if="vmSettings" class="vm-context">
14
+ <atoms-loader v-show="!vmSettingsLocal" id="loader" />
15
+ <div v-if="vmSettingsLocal" class="vm-context">
16
16
  <common-pages-scheduled-tasks-modals-common-new-task-form
17
17
  v-show="selectedStep.id === dynamicSteps.scheduledTasks"
18
18
  v-model="newTaskForm"
@@ -31,35 +31,35 @@
31
31
  v-show="selectedStep.id === dynamicSteps.selectStorage"
32
32
  :storage-submit="storageSubmit"
33
33
  :datastore="props.datastore"
34
- :storage="vmSettings.storage"
34
+ :storage="vmSettingsLocal.storage"
35
35
  :get-datastore-table-func="props.getDatastoreTableFunc"
36
36
  @submit="onChangeStorage"
37
37
  />
38
38
  <common-vm-actions-common-customize-hardware
39
39
  v-show="selectedStep.id === dynamicSteps.customizeHardware"
40
40
  v-model:vm-name="vmName"
41
- v-model:guest-machine-type="vmSettings.guestMachineType"
42
- v-model:guest-os-family="vmSettings.guestOsFamily"
43
- v-model:guest-os-version="vmSettings.guestOsVersion"
44
- :storage="vmSettings.storage"
41
+ v-model:guest-machine-type="vmSettingsLocal.guestMachineType"
42
+ v-model:guest-os-family="vmSettingsLocal.guestOsFamily"
43
+ v-model:guest-os-version="vmSettingsLocal.guestOsVersion"
44
+ :storage="vmSettingsLocal.storage"
45
45
  :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
46
46
  :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
47
47
  :networks-for-boot-options="virtualHardwareNetworksLocal"
48
- :cd-dvd-drives="vmSettings.cdDvdDrives"
49
- :hard-disks="vmSettings.hardDisks"
50
- :networks="vmSettings.networks"
48
+ :cd-dvd-drives="vmSettingsLocal.cdDvdDrives"
49
+ :hard-disks="vmSettingsLocal.hardDisks"
50
+ :networks="vmSettingsLocal.networks"
51
51
  :customize-hardware-submit="customizeHardwareSubmit"
52
- :max-cpus="vmSettings.maxCpus"
53
- :max-memory="vmSettings.maxMemory"
54
- :cpu-models="vmSettings.cpuModels"
55
- :cpu="vmSettings.cpu"
56
- :memory="vmSettings.memory"
57
- :video-card="vmSettings.videoCard"
58
- :usb-controller="vmSettings.usbController"
59
- :pci-devices="vmSettings.pciDevices"
52
+ :max-cpus="vmSettingsLocal.maxCpus"
53
+ :max-memory="vmSettingsLocal.maxMemory"
54
+ :cpu-models="vmSettingsLocal.cpuModels"
55
+ :cpu="vmSettingsLocal.cpu"
56
+ :memory="vmSettingsLocal.memory"
57
+ :video-card="vmSettingsLocal.videoCard"
58
+ :usb-controller="vmSettingsLocal.usbController"
59
+ :pci-devices="vmSettingsLocal.pciDevices"
60
60
  :selected-nav-item="selectedNavItem"
61
- :hard-disks-for-edit="vmSettings.hardDisks"
62
- :options="vmSettings.options"
61
+ :hard-disks-for-edit="vmSettingsLocal.hardDisks"
62
+ :options="vmSettingsLocal.options"
63
63
  :nodes="props.nodes"
64
64
  :files="props.files"
65
65
  :networks-table="props.networksTable"
@@ -120,7 +120,7 @@ import type {
120
120
  } from '~/lib/models/store/vm/interfaces'
121
121
  import type {
122
122
  I_DynamicSteps,
123
- UI_I_VmForm,
123
+ // UI_I_VmForm,
124
124
  } from '~/components/common/vm/actions/clone/toTemplate/lib/models/interfaces'
125
125
  import type {
126
126
  UI_I_ValidationReturn,
@@ -396,23 +396,15 @@ const checkCustomizeHardware = async (
396
396
  }
397
397
 
398
398
  const storageIdCash = ref<string | null>(null)
399
- const vmForm = ref<UI_I_VmForm>({
400
- name: '',
401
- storage: null,
402
- options: [],
403
- })
404
399
  const onChangeName = (name: string): void => {
405
- vmForm.value.name = name
400
+ vmSettingsLocal.value && (vmSettingsLocal.value.name = name)
406
401
  }
407
402
  const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
408
403
  if (!storage) return
409
404
 
410
- vmForm.value.storage = storage
405
+ vmSettingsLocal.value && (vmSettingsLocal.value.storage = storage)
411
406
  storageIdCash.value = storage.id
412
407
  }
413
- const onChangeSelectOptions = (options: string[]): void => {
414
- vmForm.value.options = options
415
- }
416
408
  const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
417
409
  const onChangeCustomizeHardware = (
418
410
  data: UI_I_SendDataCustomizeHardware
@@ -452,7 +444,7 @@ const isPowerOnByDefault = ref<boolean>(true)
452
444
  watch(
453
445
  () => props.vmNameInWizard,
454
446
  (newValue) => {
455
- vmForm.value.name = newValue
447
+ vmSettingsLocal.value && (vmSettingsLocal.value.name = newValue)
456
448
  }
457
449
  )
458
450
 
@@ -463,7 +455,7 @@ const validateSendData = async (
463
455
  let stepHasError = false
464
456
 
465
457
  const data = await props.validateSendDataFunc(
466
- vmForm.value,
458
+ vmSettingsLocal.value,
467
459
  virtualHardwareCpu.value,
468
460
  virtualHardwareMemory.value,
469
461
  customizeHardware.value,
@@ -489,7 +481,7 @@ const onFinish = (): void => {
489
481
  wizard.setLoader(false)
490
482
  props
491
483
  .finishFunc(
492
- vmForm.value,
484
+ vmSettingsLocal.value,
493
485
  virtualHardwareCpu.value,
494
486
  virtualHardwareMemory.value,
495
487
  customizeHardware.value,
@@ -515,9 +507,9 @@ const storageSubmit = ref<null | Function>(null)
515
507
  const selectOptionsSubmit = ref<number>(0)
516
508
  const customizeHardwareSubmit = ref<null | Function>(null)
517
509
 
518
- const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
519
- const vmName = ref<string>(vmSettings.value?.name || '')
520
- watch(vmSettings, (newValue) => {
510
+ const vmSettingsLocal = computed<UI_I_VmSettings | null>(() => props.vmSettings)
511
+ const vmName = ref<string>(vmSettingsLocal.value?.name || '')
512
+ watch(vmSettingsLocal, (newValue) => {
521
513
  vmName.value = newValue?.name || ''
522
514
  })
523
515
 
@@ -63,7 +63,7 @@ const apiErrorLocal = computed<string>(() => {
63
63
  )
64
64
  })
65
65
 
66
- const maxShares = 10_000
66
+ const maxShares = 262_144
67
67
  const sharesOptions = computed<UI_I_OptionItem[]>(() => {
68
68
  return sharesOptionsFunc(localization.value, maxShares)
69
69
  })
@@ -73,7 +73,7 @@ const sharesTypeOptions = ref<UI_I_OptionItem[]>(
73
73
  )
74
74
 
75
75
  const isDisabledShares = computed<boolean>(
76
- () => sharesTypeLocal.value !== '1' || props.disabled
76
+ () => sharesTypeLocal.value !== '2' || props.disabled
77
77
  )
78
78
  const sharesLocal = computed<string>({
79
79
  get() {
@@ -93,14 +93,14 @@ const sharesTypeLocal = computed<string>({
93
93
  })
94
94
  const onChangeSharesType = (event: UI_I_HTMLSelectElement): void => {
95
95
  const value = event.target.value
96
- if (value === '1') return
96
+ if (value === '2') return
97
97
  sharesLocal.value = event.target.value
98
98
  }
99
99
 
100
100
  const sharesErrorLocalText = computed<string>(() => {
101
- if (+sharesLocal.value < 1 || +sharesLocal.value > maxShares) {
101
+ if (+sharesLocal.value < 2 || +sharesLocal.value > maxShares) {
102
102
  return localization.value.common.sharesMustBe
103
- .replace('{0}', '1')
103
+ .replace('{0}', '2')
104
104
  .replace('{1}', maxShares + '')
105
105
  }
106
106
 
@@ -7,8 +7,8 @@ export const sharesOptionsFunc = (
7
7
  ): UI_I_OptionItem[] => {
8
8
  return [
9
9
  {
10
- text: `${localization.common.minimum} 1`,
11
- value: 1,
10
+ text: `${localization.common.minimum} 2`,
11
+ value: 2,
12
12
  },
13
13
  {
14
14
  text: `${localization.common.maximum} ${maxShares}`,
@@ -23,6 +23,6 @@ export const sharesTypeOptionsFunc = (
23
23
  { text: localization.common.low, value: '1000' },
24
24
  { text: localization.common.normal, value: '2000' },
25
25
  { text: localization.common.high, value: '4000' },
26
- { text: localization.common.custom, value: '1' },
26
+ { text: localization.common.custom, value: '2' },
27
27
  ]
28
28
  }