bfg-common 1.3.162 → 1.3.163

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.
@@ -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'
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.163",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",