bfg-common 1.3.162 → 1.3.164

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.
@@ -159,7 +159,7 @@ import {
159
159
  UI_I_InvalidKeys,
160
160
  UI_I_SendDataVirtualHardware,
161
161
  UI_I_SendDataNewCdDvdDrive,
162
- UI_I_HardDisk,
162
+ // UI_I_HardDisk,
163
163
  UI_I_SendDataNewPciDevice,
164
164
  } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
165
165
  import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
@@ -261,23 +261,28 @@ const addHardDisk = (
261
261
  create = true,
262
262
  size = 90,
263
263
  source = '',
264
- type: UI_T_HardDiskType = 'new'
264
+ type: UI_T_HardDiskType = 'new',
265
+ provisioned_type?: number // При добавлении существующей
265
266
  ): void => {
266
267
  const newIndex = (hardDisksIndex.value.at(-1) ?? -1) + 1
267
268
  hardDisksIndex.value.push(newIndex)
268
269
  hardDisksType.value.push(type)
269
270
 
271
+ let provisionType = 'thick'
272
+ if (provisioned_type === 1) provisionType = 'thin'
273
+
270
274
  hardDisks.value.push({
271
275
  create,
272
276
  size,
273
277
  source,
274
278
  attach: true,
275
279
  boot_order: 0, // Убираем галочку
280
+ provision_type: provisionType
276
281
  })
277
282
  sendData()
278
283
  }
279
- const onAddExistHardDisk = (hardDisk: UI_I_HardDisk): void => {
280
- addHardDisk(false, $binary.bToGb(hardDisk.size), hardDisk.path, 'exist')
284
+ const onAddExistHardDisk = (file: UI_I_FileTreeNode): void => {
285
+ addHardDisk(false, $binary.bToGb(file.size), file.path, 'exist', file.provisioned_type)
281
286
  }
282
287
  const onRemoveHardDisk = (
283
288
  index: number,
@@ -395,6 +395,11 @@ watch(
395
395
  watch(
396
396
  () => props.hardDisk,
397
397
  (newValue) => {
398
+ // TODO refactoring
399
+ if (props.type === 'exist') {
400
+ diskProvisioning.value = newValue.provision_type || 'thick'
401
+ return
402
+ }
398
403
  if (props.type !== 'edit') return
399
404
 
400
405
  diskProvisioning.value = newValue.provision_type || 'thick'
@@ -110,10 +110,11 @@ const nvidiaGridProfile = ref<string>('')
110
110
  watch(
111
111
  props.pciDevice,
112
112
  (newValue) => {
113
- const passthroughDevice = props.passthroughDevices.find(
114
- (item) => item.address === newValue.address
115
- )
116
- passthroughDevice && (directPathIo.value = passthroughDevice) // Todo change
113
+ // const passthroughDevice = props.passthroughDevices.find(
114
+ // (item) => item.address === newValue.address
115
+ // )
116
+ // passthroughDevice && (directPathIo.value = passthroughDevice) // Todo change
117
+ newValue && (directPathIo.value = newValue)
117
118
  },
118
119
  { immediate: true }
119
120
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.162",
4
+ "version": "1.3.164",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",