bfg-common 1.5.708 → 1.5.710

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 (105) hide show
  1. package/assets/img/icons/icons-sprite-dark-1.svg +2 -3
  2. package/assets/img/icons/icons-sprite-light-1.svg +3 -4
  3. package/assets/localization/local_be.json +47 -3
  4. package/assets/localization/local_en.json +47 -3
  5. package/assets/localization/local_hy.json +47 -3
  6. package/assets/localization/local_kk.json +47 -3
  7. package/assets/localization/local_ru.json +49 -5
  8. package/assets/localization/local_zh.json +47 -3
  9. package/assets/scss/common/icons/icons-1.scss +1 -1
  10. package/assets/scss/common/icons/icons-2.scss +18 -0
  11. package/assets/scss/common/theme.scss +2 -0
  12. package/assets/scss/components/auth.scss +32 -5
  13. package/components/atoms/dropdown/tree/Tree.vue +2 -0
  14. package/components/atoms/switch/Switch.vue +7 -1
  15. package/components/atoms/wizard/Wizard.vue +1 -1
  16. package/components/common/certificate/Certificate.vue +27 -0
  17. package/components/common/certificate/CertificateInfo.vue +139 -0
  18. package/components/common/certificate/Tools.vue +59 -0
  19. package/components/common/certificate/lib/config/tabsPannel.ts +22 -0
  20. package/components/common/certificate/lib/models/interfaces.ts +9 -0
  21. package/components/common/certificate/lib/models/types.ts +1 -0
  22. package/components/common/certificate/modals/renew/New.vue +64 -0
  23. package/components/common/certificate/modals/renew/Old.vue +122 -0
  24. package/components/common/certificate/modals/renew/Renew.vue +67 -0
  25. package/components/common/help/navbar/left/lib/utils/constructAccordion.ts +2 -1
  26. package/components/common/help/navbar/right/Right.vue +86 -23
  27. package/components/common/layout/theHeader/modals/reconnect/ReconnectOld.vue +2 -0
  28. package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePassword.vue +12 -21
  29. package/components/common/layout/theHeader/userMenu/modals/changePassword/New.vue +36 -43
  30. package/components/common/layout/theHeader/userMenu/modals/changePassword/Old.vue +0 -2
  31. package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/utils.ts +1 -1
  32. package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesNew.vue +13 -0
  33. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +8 -15
  34. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/{ChangeLanguageNew.vue → New.vue} +1 -2
  35. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/{ChangeLanguageOld.vue → Old.vue} +0 -2
  36. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +8 -7
  37. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/{DefaultConsoleNew.vue → New.vue} +3 -3
  38. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/{DefaultConsoleOld.vue → Old.vue} +2 -2
  39. package/components/common/layout/theHeader/userMenu/modals/preferences/inventory/Inventory.vue +7 -8
  40. package/components/common/layout/theHeader/userMenu/modals/preferences/inventory/{InventoryNew.vue → New.vue} +3 -2
  41. package/components/common/layout/theHeader/userMenu/modals/preferences/inventory/{InventoryOld.vue → Old.vue} +2 -2
  42. package/components/common/layout/theHeader/userMenu/modals/preferences/security/New.vue +277 -12
  43. package/components/common/layout/theHeader/userMenu/modals/preferences/security/Old.vue +30 -56
  44. package/components/common/layout/theHeader/userMenu/modals/preferences/security/Security.vue +65 -6
  45. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/{TimeFormatNew.vue → New.vue} +3 -3
  46. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/{TimeFormatOld.vue → Old.vue} +2 -2
  47. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +8 -8
  48. package/components/common/layout/theHeader/userMenu/modals/preferences/view/{ViewNew.vue → New.vue} +12 -3
  49. package/components/common/layout/theHeader/userMenu/modals/preferences/view/{ViewOld.vue → Old.vue} +2 -2
  50. package/components/common/layout/theHeader/userMenu/modals/preferences/view/View.vue +8 -7
  51. package/components/common/monitor/advanced/graphView/GraphView.vue +8 -0
  52. package/components/common/monitor/advanced/tools/Tools.vue +5 -1
  53. package/components/common/pages/auth/TheFooter.vue +104 -0
  54. package/components/common/pages/files/lib/models/enums.ts +10 -0
  55. package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +7 -2
  56. package/components/common/pages/hardwareHealth/tableView/TableView.vue +8 -0
  57. package/components/common/pages/hardwareHealth/tableView/lib/config/sensorTable.ts +13 -1
  58. package/components/common/pages/hardwareHealth/toolsPanel/lib/config/actionsPanel.ts +4 -4
  59. package/components/common/pages/tasks/table/expandDetails/ExpandDetails.vue +1 -1
  60. package/components/common/qr/Qr.vue +69 -0
  61. package/components/common/split/horizontal/New.vue +0 -2
  62. package/components/common/split/vertical/New.vue +2 -1
  63. package/components/common/vm/actions/add/New.vue +1 -1
  64. package/components/common/vm/actions/add/Old.vue +1 -1
  65. package/components/common/vm/actions/clone/old/Old.vue +1 -0
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/New.vue +10 -34
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/Old.vue +15 -37
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +49 -50
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/coresPerSocket/CoresPerSocket.vue +1 -1
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces.ts +3 -1
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +13 -7
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/New.vue +7 -4
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +52 -45
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/Old.vue +5 -8
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +1 -3
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/New.vue +2 -2
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/Old.vue +2 -2
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +1 -1
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/New.vue +1 -2
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/Old.vue +1 -2
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/New.vue +1 -1
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +1 -1
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/Old.vue +1 -1
  84. package/components/common/vm/actions/common/select/options/Old.vue +1 -2
  85. package/components/common/wizards/common/compatibility/New.vue +1 -1
  86. package/components/common/wizards/common/compatibility/Old.vue +1 -1
  87. package/components/common/wizards/datastore/add/lib/config/createDatastore.ts +1 -0
  88. package/components/common/wizards/datastore/add/lib/models/interfaces.ts +1 -0
  89. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +5 -0
  90. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceOld.vue +5 -0
  91. package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/AdvancedOptions.vue +43 -0
  92. package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/New.vue +114 -0
  93. package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/Old.vue +114 -0
  94. package/components/common/wizards/datastore/add/steps/nameAndDevice/table/old/Old.vue +2 -3
  95. package/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails.ts +8 -1
  96. package/components/common/wizards/vm/migrate/lib/models/enums.ts +2 -2
  97. package/components/common/wizards/vm/migrate/steps/selectStorage/SelectStorage.vue +4 -4
  98. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/lib/config/diskTable.ts +6 -2
  99. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/old/lib/config/diskTable.ts +18 -12
  100. package/composables/useEnvLanguage.ts +7 -8
  101. package/lib/models/interfaces.ts +1 -0
  102. package/package.json +3 -4
  103. package/plugins/date.ts +14 -37
  104. package/store/main/getters.ts +2 -2
  105. package/components/common/qrcode/Qrcode.vue +0 -56
@@ -85,6 +85,7 @@
85
85
  :index="props.hardDisksIndex[key]"
86
86
  :type="props.hardDisksType[key]"
87
87
  :main-storage="props.storage"
88
+ :main-storage-free="props.storageFree"
88
89
  :error-validation-fields="props.errorValidationFields"
89
90
  :get-datastore-table-func="props.getDatastoreTableFunc"
90
91
  :datastore="props.datastore"
@@ -97,12 +98,6 @@
97
98
  emits('remove-hard-disk', [props.hardDisksIndex[key], item])
98
99
  "
99
100
  @roll-back="emits('roll-back-hard-disk', props.hardDisksIndex[key])"
100
- @send-data="
101
- emits('send-data-new-hard-disk-method', [
102
- $event,
103
- props.hardDisksIndex[key],
104
- ])
105
- "
106
101
  @invalid="
107
102
  emits('set-invalid-hard-disk', [
108
103
  $event,
@@ -246,30 +241,21 @@
246
241
  </div>
247
242
  <template v-if="props.passthroughDevices || props.mediatedDevices">
248
243
  <common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device
249
- v-for="(item, key) in props.pciDevices"
244
+ v-for="(item, key) in model.passthrough_pci_devices"
245
+ v-model:address="item.address"
246
+ v-model:vendor-name="item.vendor_name"
247
+ v-model:class-name="item.class_name"
248
+ v-model:device-name="item.device_name"
249
+ v-model:mediated-device="item.mediated_device"
250
+ v-model:mediated-device-uuid="item.mediated_device_uuid"
250
251
  :key="props.pciDevicesIndex[key]"
251
252
  :index="props.pciDevicesIndex[key]"
252
- :pci-device="item"
253
- :error-validation-fields="props.errorValidationFields"
254
253
  :passthrough-devices="props.passthroughDevices"
255
254
  :mediated-devices="props.mediatedDevices"
256
255
  :type="props.pciDevicesType[key]"
257
256
  :is-edit="props.isEdit"
258
257
  :state="props.state"
259
258
  @remove="emits('remove-pci-device', props.pciDevicesIndex[key])"
260
- @send-data="
261
- emits('send-data-pci-devices-method', [
262
- $event,
263
- props.pciDevicesIndex[key],
264
- ])
265
- "
266
- @invalid="
267
- emits('set-invalid-pci-device', [
268
- $event,
269
- props.pciDevicesIndex[key],
270
- ])
271
- "
272
- @remove-error-by-title="emits('remove-error-by-title', $event)"
273
259
  />
274
260
  </template>
275
261
  <common-vm-actions-common-customize-hardware-virtual-hardware-video-card
@@ -318,8 +304,10 @@ import type {
318
304
  } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
319
305
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
320
306
  import type {
307
+ UI_T_CdDvdType,
321
308
  UI_T_HardDiskType,
322
309
  UI_T_NetworkType,
310
+ UI_T_PciDeviceType,
323
311
  } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
324
312
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
325
313
  import type {
@@ -349,6 +337,7 @@ const props = withDefaults(
349
337
  files: UI_I_FileTreeNode[]
350
338
  isEdit: boolean
351
339
  storage: UI_I_DatastoreTableItem | null
340
+ storageFree: number
352
341
  project: UI_T_Project
353
342
  maxMemory: number
354
343
  cpuModels: UI_I_OptionItem[]
@@ -360,10 +349,10 @@ const props = withDefaults(
360
349
  hardDisksType: UI_T_HardDiskType[]
361
350
  networksIndex: number[]
362
351
  hardDisksIndex: number[]
363
- pciDevicesType: UI_T_NetworkType[]
352
+ pciDevicesType: UI_T_PciDeviceType[]
364
353
  isShowFileModal: boolean
365
354
  pciDevicesIndex: number[]
366
- cdDvdDrivesType: UI_T_NetworkType[]
355
+ cdDvdDrivesType: UI_T_CdDvdType[]
367
356
  cdDvdDrivesIndex: number[]
368
357
  errorValidationFields: UI_I_ErrorValidationField[]
369
358
  getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
@@ -371,7 +360,6 @@ const props = withDefaults(
371
360
  cpu?: API_UI_I_VmEditCpu
372
361
  state?: string | number
373
362
  videoCard?: UI_I_SendDataVideoCard
374
- pciDevices?: UI_I_SendDataNewPciDevice[]
375
363
  guestMachineType?: UI_I_OptionItem | null
376
364
  passthroughDevices?: UI_I_PciDevice[]
377
365
  mediatedDevices?: UI_I_MediatedDevice[]
@@ -382,10 +370,9 @@ const props = withDefaults(
382
370
  cpu: undefined,
383
371
  state: undefined,
384
372
  videoCard: undefined,
385
- pciDevices: undefined,
386
373
  guestMachineType: undefined,
387
- passthroughDevices: undefined,
388
- mediatedDevices: undefined,
374
+ passthroughDevices: () => [],
375
+ mediatedDevices: () => [],
389
376
  vmCpuHelpTextSecond: undefined,
390
377
  computeResource: undefined,
391
378
  }
@@ -410,16 +397,7 @@ const emits = defineEmits<{
410
397
  (event: 'set-invalid-hard-disk', value: [boolean, number]): void
411
398
  (event: 'remove-error-by-title', value: string): void
412
399
  (event: 'roll-back-cd-dvd-drive', value: number): void
413
- (event: 'set-invalid-pci-device', value: [boolean, number]): void
414
400
  (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
415
- (
416
- event: 'send-data-pci-devices-method',
417
- value: [UI_I_SendDataNewPciDevice, number]
418
- ): void
419
- (
420
- event: 'send-data-new-hard-disk-method',
421
- value: [UI_I_SendDataNewHardDisk, number]
422
- ): void
423
401
  (
424
402
  event: 'send-data-new-cd-dvd-drive-method',
425
403
  value: [UI_I_SendDataNewCdDvdDrive, number]
@@ -9,6 +9,7 @@
9
9
  :files="props.files"
10
10
  :is-edit="props.isEdit"
11
11
  :storage="props.storage"
12
+ :storage-free="storageFree"
12
13
  :project="props.project"
13
14
  :max-memory="props.maxMemory"
14
15
  :cpu-models="props.cpuModels"
@@ -29,7 +30,6 @@
29
30
  :get-datastore-table-func="getDatastoreTableFunc"
30
31
  :state="state"
31
32
  :video-card="videoCard"
32
- :pci-devices="pciDevicesLocal"
33
33
  :guest-machine-type="guestMachineType"
34
34
  :passthrough-devices="passthroughDevices"
35
35
  :mediated-devices="mediatedDevices"
@@ -53,9 +53,7 @@
53
53
  @set-invalid-hard-disk="onSetInvalidHardDisk(...$event)"
54
54
  @remove-error-by-title="emits('remove-error-by-title', $event)"
55
55
  @roll-back-cd-dvd-drive="onRollBackCdDvdDrive"
56
- @set-invalid-pci-device="onSetInvalidPciDevice(...$event)"
57
56
  @get-active-device-child="emits('get-active-device-child', $event)"
58
- @send-data-pci-devices-method="onSendDataPciDevicesMethod(...$event)"
59
57
  @send-data-new-hard-disk-method="onSendDataNewHardDiskMethod(...$event)"
60
58
  @send-data-new-cd-dvd-drive-method="sendDataNewCdDvdDriveMethod(...$event)"
61
59
  />
@@ -118,7 +116,7 @@ const props = withDefaults(
118
116
  hardDisks?: UI_I_SendDataNewHardDisk[] | null
119
117
  cdDvdDrives?: UI_I_SendDataNewCdDvdDrive[] | null
120
118
  videoCard?: UI_I_SendDataVideoCard
121
- pciDevices?: UI_I_SendDataNewPciDevice[]
119
+ // pciDevices?: UI_I_SendDataNewPciDevice[]
122
120
  passthroughDevices?: UI_I_PciDevice[]
123
121
  mediatedDevices?: UI_I_MediatedDevice[]
124
122
  guestMachineType?: UI_I_OptionItem | null
@@ -131,7 +129,7 @@ const props = withDefaults(
131
129
  hardDisks: undefined,
132
130
  cdDvdDrives: undefined,
133
131
  videoCard: undefined,
134
- pciDevices: undefined,
132
+ // pciDevices: undefined,
135
133
  passthroughDevices: undefined,
136
134
  mediatedDevices: undefined,
137
135
  guestMachineType: undefined,
@@ -219,6 +217,24 @@ if (!model.value.disk_devices?.length) {
219
217
  // { immediate: true }
220
218
  // )
221
219
 
220
+ const getDisksSize = (): number => {
221
+ return (
222
+ model.value.disk_devices.reduce(
223
+ (acum, disk) => (acum += disk.size || 0),
224
+ 0
225
+ ) || 0
226
+ )
227
+ }
228
+ const initialDisksSize = getDisksSize()
229
+ const storageFree = computed<number>(() => {
230
+ if (!props.storage) return 0
231
+ const free = (props.storage.capacity.free_mb || props.storage.free) as number // TODO fix
232
+
233
+ const disksSize = getDisksSize()
234
+
235
+ return free + initialDisksSize - (disksSize - initialDisksSize)
236
+ })
237
+
222
238
  const addHardDisk = (
223
239
  create = true,
224
240
  size = 92_160, // 90GB
@@ -501,30 +517,46 @@ const defaultPciDevice: UI_I_SendDataNewPciDevice = {
501
517
  }
502
518
  const pciDevicesIndex = ref<number[]>([0])
503
519
  const pciDevicesType = ref<('new' | 'edit' | 'removed')[]>(['new'])
504
- const pciDevicesLocal = ref<UI_I_SendDataNewPciDevice[]>([])
505
- watch(
506
- () => props.pciDevices,
507
- (newValue) => {
508
- if ((!props.isEdit && !props.isClone) || !newValue) return
520
+ // const pciDevicesLocal = ref<UI_I_SendDataNewPciDevice[]>([])
521
+ if (!model.value.passthrough_pci_devices?.length) {
522
+ pciDevicesIndex.value = []
523
+ pciDevicesType.value = []
524
+ } else {
525
+ model.value.passthrough_pci_devices.forEach((_disk, _index, array) => {
526
+ if (!props.isEdit && !props.isClone) return
509
527
 
510
- const count = newValue?.length || 0
528
+ const count = array.length
511
529
  pciDevicesIndex.value = [...Array(count).keys()]
512
- pciDevicesLocal.value = newValue || []
513
530
  if (props.isEdit) {
514
531
  pciDevicesType.value = Array(count).fill('edit')
515
532
  } else if (props.isClone) {
516
- pciDevicesType.value = Array(count).fill('new')
533
+ pciDevicesType.value = Array(count).fill('clone') // before been new
517
534
  }
518
- },
519
- { immediate: true }
520
- )
535
+ })
536
+ }
537
+ // watch(
538
+ // () => props.pciDevices,
539
+ // (newValue) => {
540
+ // if ((!props.isEdit && !props.isClone) || !newValue) return
541
+ //
542
+ // const count = newValue?.length || 0
543
+ // pciDevicesIndex.value = [...Array(count).keys()]
544
+ // pciDevicesLocal.value = newValue || []
545
+ // if (props.isEdit) {
546
+ // pciDevicesType.value = Array(count).fill('edit')
547
+ // } else if (props.isClone) {
548
+ // pciDevicesType.value = Array(count).fill('new')
549
+ // }
550
+ // },
551
+ // { immediate: true }
552
+ // )
521
553
 
522
554
  const addPciDevice = (): void => {
523
555
  const newIndex = (pciDevicesIndex.value.at(-1) ?? -1) + 1
524
556
  pciDevicesIndex.value.push(newIndex)
525
557
  pciDevicesType.value.push('new')
526
558
 
527
- pciDevicesLocal.value.push(useDeepCopy(defaultPciDevice))
559
+ // pciDevicesLocal.value.push(useDeepCopy(defaultPciDevice))
528
560
  model.value.passthrough_pci_devices.push(useDeepCopy(defaultPciDevice))
529
561
  }
530
562
  const onRemovePciDevice = (index: number): void => {
@@ -538,13 +570,6 @@ const onRemovePciDevice = (index: number): void => {
538
570
  model.value.passthrough_pci_devices.filter((_pciDevice, key: number) => {
539
571
  return removeIndex !== key
540
572
  })
541
- pciDevicesLocal.value = pciDevicesLocal.value.filter(
542
- (_pciDevice, key: number) => {
543
- return removeIndex !== key
544
- }
545
- )
546
-
547
- delete newPciDeviceInvalidKeys.value[index]
548
573
  }
549
574
 
550
575
  const isShowFileModal = ref<boolean>(false)
@@ -591,14 +616,6 @@ const sendDataNewCdDvdDriveMethod = (
591
616
  model.value.disk_devices[cdromIndexStart + index]?.boot_order || 0,
592
617
  }
593
618
  }
594
- const onSendDataPciDevicesMethod = (
595
- data: UI_I_SendDataNewPciDevice,
596
- index: number
597
- ): void => {
598
- model.value.passthrough_pci_devices[index] = {
599
- ...data,
600
- }
601
- }
602
619
 
603
620
  const onSetInvalidHardDisk = (invalid: boolean, index: number): void => {
604
621
  newHardDiskInvalidKeys.value[index] = invalid
@@ -608,15 +625,10 @@ const onSetInvalidNetwork = (invalid: boolean, key: number): void => {
608
625
  newNetworkInvalidKeys.value[key] = invalid
609
626
  }
610
627
 
611
- const onSetInvalidPciDevice = (invalid: boolean, key: number): void => {
612
- newPciDeviceInvalidKeys.value[key] = invalid
613
- }
614
-
615
628
  const memoryInvalid = ref<boolean>(false)
616
629
  const videoCardInvalid = ref<boolean>(false)
617
630
  const newHardDiskInvalidKeys = ref<UI_I_InvalidKeys>({})
618
631
  const newNetworkInvalidKeys = ref<UI_I_InvalidKeys>({})
619
- const newPciDeviceInvalidKeys = ref<UI_I_InvalidKeys>({})
620
632
 
621
633
  watch(
622
634
  [
@@ -624,7 +636,6 @@ watch(
624
636
  memoryInvalid,
625
637
  newHardDiskInvalidKeys,
626
638
  newNetworkInvalidKeys,
627
- newPciDeviceInvalidKeys,
628
639
  videoCardInvalid,
629
640
  ],
630
641
  () => {
@@ -657,18 +668,6 @@ watch(
657
668
  ' ' +
658
669
  (+key + 1)
659
670
  })
660
- // let pciDevice = ''
661
- // Object.keys(newPciDeviceInvalidKeys.value).forEach((key) => {
662
- // if (!newPciDeviceInvalidKeys.value[+key]) {
663
- // return
664
- // }
665
- //
666
- // pciDevice +=
667
- // (pciDevice ? ', ' : '') +
668
- // localization.value.common.pciDevice +
669
- // ' ' +
670
- // (+key + 1)
671
- // })
672
671
 
673
672
  emits('invalid', [cpu, memory, newHardDisk, newNetwork, videoCard])
674
673
  },
@@ -61,7 +61,7 @@ watch(
61
61
  () => {
62
62
  // !socketOptions.value.includes(selectedCorePerSocketLocal.value) &&
63
63
  !props.disabled &&
64
- (selectedCorePerSocketLocal.value = socketOptions.value.at(-1) || 1)
64
+ (selectedCorePerSocketLocal.value = socketOptions.value.at(-1) || 1)
65
65
  },
66
66
  { deep: true }
67
67
  )
@@ -105,9 +105,11 @@ export interface UI_I_SendDataNewCdDvdDrive {
105
105
  }
106
106
  export interface UI_I_SendDataNewPciDevice {
107
107
  address: string
108
+ vendor_name: string
108
109
  class_name: string
109
110
  device_name: string
110
- vendor_name: string
111
+ mediated_device: boolean
112
+ mediated_device_uuid?: string
111
113
  }
112
114
 
113
115
  export interface UI_I_HardDisk {
@@ -115,6 +115,7 @@ const detach = defineModel<boolean>('detach', { required: true })
115
115
  const props = withDefaults(
116
116
  defineProps<{
117
117
  mainStorage: UI_I_DatastoreTableItem | null
118
+ mainStorageFree: number
118
119
  // hardDisk: UI_I_SendDataNewHardDisk
119
120
  type: UI_T_HardDiskType
120
121
  index: number
@@ -196,17 +197,22 @@ const label = computed<string>(() => {
196
197
  })
197
198
 
198
199
  const maxHardDisk = computed<number>(() => {
199
- // const hardDiskSizeMb = $binary.gbToMb(props.hardDisk.size)
200
-
200
+ // // const hardDiskSizeMb = $binary.gbToMb(props.hardDisk.size)
201
+ //
202
+ // if (props.type === 'exist') return initialSize
203
+ //
204
+ // if (!storageLocal.value) return 0
205
+ // const free = (storageLocal.value.capacity.free_mb ||
206
+ // storageLocal.value.free) as number // TODO fix
207
+ //
208
+ // if (props.type === 'edit') return free + initialSize
209
+ //
210
+ // return free
201
211
  if (props.type === 'exist') return initialSize
202
212
 
203
213
  if (!storageLocal.value) return 0
204
- const free = (storageLocal.value.capacity.free_mb ||
205
- storageLocal.value.capacity) as number // TODO fix
206
-
207
- if (props.isEdit) return free + initialSize
208
214
 
209
- return free
215
+ return props.mainStorageFree + size.value
210
216
  })
211
217
  const hardDiskTypeErrorLocalText = computed<string>(() => {
212
218
  if (size.value > maxHardDisk.value) {
@@ -46,12 +46,15 @@
46
46
  />
47
47
  </template>
48
48
 
49
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device-note />
49
+ <common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device-note
50
+ :pci-device-index="props.index"
51
+ />
50
52
  </template>
51
53
  </ui-stack-block>
52
54
  </template>
53
55
 
54
56
  <script setup lang="ts">
57
+ import type { UI_I_Option } from '~/components/atoms/select/lib/models/interfaces'
55
58
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
56
59
  import type { UI_T_PciDeviceType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
57
60
  import type {
@@ -62,13 +65,13 @@ import type {
62
65
  const selectedType = defineModel<UI_I_OptionItem>('selectedType', {
63
66
  required: true,
64
67
  })
65
- const directPathIo = defineModel<UI_I_PciDevice>('directPathIo', {
68
+ const directPathIo = defineModel<string>('directPathIo', {
66
69
  required: true,
67
70
  })
68
- const dynamicDirectPathIo = defineModel<string>('dynamicDirectPathIo', {
71
+ const dynamicDirectPathIo = defineModel<UI_I_PciDevice>('dynamicDirectPathIo', {
69
72
  required: true,
70
73
  })
71
- const nvidiaGridProfile = defineModel<string>('nvidiaGridProfile', {
74
+ const nvidiaGridProfile = defineModel<UI_I_Option | null>('nvidiaGridProfile', {
72
75
  required: true,
73
76
  })
74
77
 
@@ -29,23 +29,27 @@ import type {
29
29
  import type { UI_I_Option } from '~/components/atoms/select/lib/models/interfaces'
30
30
  import { pciDeviceTypeOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/lib/config/options'
31
31
 
32
+ const address = defineModel<string>('address')
33
+ const vendorName = defineModel<string>('vendorName')
34
+ const className = defineModel<string>('className')
35
+ const deviceName = defineModel<string>('deviceName')
36
+ const mediatedDevice = defineModel<boolean>('mediatedDevice')
37
+ const mediatedDeviceUuid = defineModel<string>('mediatedDeviceUuid')
38
+
32
39
  const props = withDefaults(
33
40
  defineProps<{
34
41
  index: number
35
- pciDevice: UI_I_SendDataNewPciDevice
36
42
  passthroughDevices: UI_I_PciDevice[]
37
43
  mediatedDevices: UI_I_MediatedDevice[]
38
44
  type: UI_T_PciDeviceType
39
45
  isEdit: boolean
40
46
  state?: string | number
41
- // errorValidationFields: UI_I_ErrorValidationField<string>[]
42
47
  }>(),
43
48
  {
44
49
  state: undefined,
45
50
  }
46
51
  )
47
52
  const emits = defineEmits<{
48
- (event: 'send-data', value: UI_I_SendDataNewPciDevice): void
49
53
  (event: 'remove'): void
50
54
  }>()
51
55
 
@@ -64,7 +68,8 @@ const isRunning = computed<boolean>(() => {
64
68
  })
65
69
 
66
70
  const isRemovable = computed<boolean>(() => {
67
- return !props.isEdit || !isRunning.value
71
+ // return !props.isEdit || !isRunning.value
72
+ return props.type !== 'edit' || !isRunning.value
68
73
  })
69
74
 
70
75
  const label = computed<string>(() => {
@@ -75,16 +80,17 @@ const label = computed<string>(() => {
75
80
  })
76
81
 
77
82
  const selectedLabel = computed<string>(() => {
78
- if (props.pciDevice.address) {
79
- return `${props.pciDevice.address} | ${props.pciDevice.device_name}`
83
+ if (address.value) {
84
+ return `${address.value} | ${deviceName.value}`
80
85
  }
81
86
  switch (selectedType.value.value) {
82
87
  case 'direct_path_io':
83
- return `${directPathIo.value?.address} | ${directPathIo.value?.device_name}`
88
+ return directPathIo.value
89
+ // return `${directPathIo.value?.address} | ${directPathIo.value?.device_name}`
84
90
  case 'dynamic_direct_path_io':
85
91
  return `${dynamicDirectPathIo.value?.address} | ${dynamicDirectPathIo.value?.device_name}`
86
92
  default:
87
- return nvidiaGridProfile.value?.text
93
+ return nvidiaGridProfile.value?.text || ''
88
94
  }
89
95
  })
90
96
 
@@ -99,47 +105,43 @@ pciDeviceTypeOptions.value.forEach((option) => {
99
105
  if (!option.disabled) selectedType.value = option
100
106
  })
101
107
 
102
- const directPathIo = ref<string>('') /// TODO
108
+ const directPathIo = ref<string>('')
103
109
  const dynamicDirectPathIo = ref<UI_I_PciDevice>(props.passthroughDevices[0])
104
110
  const nvidiaGridProfile = ref<UI_I_Option | null>(null)
105
111
 
106
- watch(
107
- [() => props.pciDevice, () => props.mediatedDevices],
108
- ([newValue1]) => {
109
- // const passthroughDevice = props.passthroughDevices.find(
110
- // (item) => item.address === newValue.address
111
- // )
112
- // passthroughDevice && (directPathIo.value = passthroughDevice) // Todo change
113
- if (newValue1) {
114
- // directPathIo.value = newValue1
115
- const passthroughDevice = props.passthroughDevices.find((device) => {
116
- return (
117
- device.class_name + '_' + device.address ===
118
- newValue1.class_name + '_' + newValue1.address
119
- )
120
- })
121
- if (passthroughDevice) {
122
- dynamicDirectPathIo.value = passthroughDevice
123
- }
112
+ const setData = (): void => {
113
+ const passthroughDevice = props.passthroughDevices.find((device) => {
114
+ return (
115
+ device.class_name + '_' + device.address ===
116
+ className.value + '_' + address.value
117
+ )
118
+ })
119
+ if (passthroughDevice) {
120
+ dynamicDirectPathIo.value = passthroughDevice
121
+ }
124
122
 
125
- const mediatedDevice = props.mediatedDevices.find((device) => {
126
- return (
127
- device.profile_name + '_' + device.root_device ===
128
- newValue1.class_name + '_' + newValue1.address
129
- )
130
- })
131
- if (mediatedDevice) {
132
- nvidiaGridProfile.value = {
133
- text: mediatedDevice.human_readable,
134
- value: mediatedDevice.profile_name + '_' + mediatedDevice.root_device,
135
- }
136
-
137
- selectedType.value =
138
- pciDeviceTypeOptions.value.find(
139
- (option) => option.value === 'nvidia_grid'
140
- ) || selectedType.value
141
- }
123
+ const mediatedDevice = props.mediatedDevices.find((device) => {
124
+ return (
125
+ device.profile_name + '_' + device.root_device ===
126
+ className.value + '_' + address.value
127
+ )
128
+ })
129
+ if (mediatedDevice) {
130
+ nvidiaGridProfile.value = {
131
+ text: mediatedDevice.human_readable,
132
+ value: mediatedDevice.profile_name + '_' + mediatedDevice.root_device,
142
133
  }
134
+
135
+ selectedType.value =
136
+ pciDeviceTypeOptions.value.find(
137
+ (option) => option.value === 'nvidia_grid'
138
+ ) || selectedType.value
139
+ }
140
+ }
141
+ watch(
142
+ () => props.mediatedDevices,
143
+ () => {
144
+ setData() // for edit
143
145
  },
144
146
  { immediate: true, deep: true }
145
147
  )
@@ -190,7 +192,12 @@ const sendData = computed<UI_I_SendDataNewPciDevice>(() => {
190
192
  watch(
191
193
  sendData,
192
194
  (newValue) => {
193
- emits('send-data', props.type === 'edit' ? props.pciDevice : newValue)
195
+ address.value = newValue.address
196
+ vendorName.value = newValue.vendor_name
197
+ className.value = newValue.class_name
198
+ deviceName.value = newValue.device_name
199
+ mediatedDevice.value = newValue.mediated_device
200
+ mediatedDeviceUuid.value = newValue.mediated_device_uuid || ''
194
201
  },
195
202
  { immediate: true }
196
203
  )
@@ -56,6 +56,7 @@
56
56
  </template>
57
57
 
58
58
  <script setup lang="ts">
59
+ import type { UI_I_Option } from '~/components/atoms/select/lib/models/interfaces'
59
60
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
60
61
  import type { UI_T_PciDeviceType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
61
62
  import type {
@@ -66,13 +67,13 @@ import type {
66
67
  const selectedType = defineModel<UI_I_OptionItem>('selectedType', {
67
68
  required: true,
68
69
  })
69
- const directPathIo = defineModel<UI_I_PciDevice>('directPathIo', {
70
+ const directPathIo = defineModel<string>('directPathIo', {
70
71
  required: true,
71
72
  })
72
- const dynamicDirectPathIo = defineModel<string>('dynamicDirectPathIo', {
73
+ const dynamicDirectPathIo = defineModel<UI_I_PciDevice>('dynamicDirectPathIo', {
73
74
  required: true,
74
75
  })
75
- const nvidiaGridProfile = defineModel<string>('nvidiaGridProfile', {
76
+ const nvidiaGridProfile = defineModel<UI_I_Option | null>('nvidiaGridProfile', {
76
77
  required: true,
77
78
  })
78
79
 
@@ -91,8 +92,4 @@ const emits = defineEmits<{
91
92
  }>()
92
93
  </script>
93
94
 
94
- <style scoped lang="scss">
95
- #network-connect {
96
- margin-right: 4px;
97
- }
98
- </style>
95
+ <style scoped lang="scss"></style>
@@ -7,9 +7,7 @@
7
7
  </template>
8
8
 
9
9
  <script lang="ts" setup>
10
- import type { UI_I_ConfigureAllPciDevicesItem } from '~/lib/models/store/host/interfaces'
11
-
12
- const model = defineModel<UI_I_ConfigureAllPciDevicesItem>({ required: true })
10
+ const model = defineModel<string>({ required: true })
13
11
 
14
12
  const props = defineProps<{
15
13
  pciDeviceIndex: number
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <ui-stack-block
3
- :has-children="false"
4
- :test-id="`pci-device-direct-path-io-stack-block-${props.pciDeviceIndex}`"
3
+ :has-children="false"
4
+ :test-id="`pci-device-direct-path-io-stack-block-${props.pciDeviceIndex}`"
5
5
  >
6
6
  <template #stackBlockKey>
7
7
  {{ localization.common.pciDevice }}
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div>
3
3
  <atoms-stack-block
4
- :has-children="false"
5
- :test-id="`pci-device-direct-path-io-stack-block-${props.pciDeviceIndex}`"
4
+ :has-children="false"
5
+ :test-id="`pci-device-direct-path-io-stack-block-${props.pciDeviceIndex}`"
6
6
  >
7
7
  <template #stackBlockContent>
8
8
  <input
@@ -10,7 +10,7 @@
10
10
  <script lang="ts" setup>
11
11
  import type { UI_I_PciDevice } from '~/lib/models/store/vm/interfaces'
12
12
 
13
- const model = defineModel<string>({ required: true })
13
+ const model = defineModel<UI_I_PciDevice>({ required: true })
14
14
 
15
15
  const props = defineProps<{
16
16
  pciDeviceIndex: number
@@ -21,10 +21,9 @@
21
21
 
22
22
  <script lang="ts" setup>
23
23
  import type { UI_I_Localization } from '~/lib/models/interfaces'
24
- import type { UI_I_ConfigureAllPciDevicesItem } from '~/lib/models/store/host/interfaces'
25
24
  import type { UI_I_PciDevice } from '~/lib/models/store/vm/interfaces'
26
25
 
27
- const model = defineModel<UI_I_ConfigureAllPciDevicesItem>()
26
+ const model = defineModel<UI_I_PciDevice>()
28
27
 
29
28
  const props = defineProps<{
30
29
  pciDeviceIndex: number