bfg-common 1.5.160 → 1.5.162

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.
@@ -56,7 +56,7 @@
56
56
  v-show="selectedStep.id === dynamicSteps.selectStorage"
57
57
  :storage-submit="storageSubmit"
58
58
  :datastore="props.datastore"
59
- :storage="vmSettings.storage"
59
+ :storage="vmForm.storage"
60
60
  :get-datastore-table-func="props.getDatastoreTableFunc"
61
61
  @submit="onChangeStorage"
62
62
  />
@@ -81,7 +81,7 @@
81
81
  v-model:guest-machine-type="vmSettings.guestMachineType"
82
82
  v-model:guest-os-family="vmSettings.guestOsFamily"
83
83
  v-model:guest-os-version="vmSettings.guestOsVersion"
84
- :storage="vmSettings.storage"
84
+ :storage="vmForm.storage"
85
85
  :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
86
86
  :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
87
87
  :networks-for-boot-options="virtualHardwareNetworksLocal"
@@ -161,9 +161,7 @@ import type {
161
161
  UI_I_PciDevice,
162
162
  UI_I_VmSettings,
163
163
  } from '~/lib/models/store/vm/interfaces'
164
- import type {
165
- UI_I_VmForm,
166
- } from '~/components/common/vm/actions/common/lib/models/interfaces'
164
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/common/lib/models/interfaces'
167
165
  import type {
168
166
  UI_I_ValidationReturn,
169
167
  UI_I_WizardStep,
@@ -608,7 +606,8 @@ const validateSendData = async (
608
606
  isPowerOnByDefault.value,
609
607
  localization.value,
610
608
  vmForm.value.locationPath, // для сферы
611
- computeResourcePath.value // для сферы
609
+ // computeResourcePath.value // для сферы
610
+ vmSettings.value.host_id // для сферы // TODO rollback
612
611
  )
613
612
 
614
613
  wizard.setLoader(false)
@@ -636,7 +635,8 @@ const onFinish = (): void => {
636
635
  isPowerOnByDefault.value,
637
636
  localization.value,
638
637
  vmForm.value.locationPath, // для сферы
639
- computeResourcePath.value, // для сферы
638
+ // computeResourcePath.value, // для сферы
639
+ vmSettings.value.host_id, // для сферы // TODO rollback
640
640
  false,
641
641
  newTaskForm.value,
642
642
  props.schedulerTask
@@ -657,9 +657,11 @@ const customizeHardwareSubmit = ref<null | Function>(null)
657
657
  const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
658
658
  const vmName = ref<string>(vmSettings.value?.name || '')
659
659
 
660
- const guestOsFamilies = ref<UI_I_OptionItem[]>(capabilities.value.guestOsFamilies)
660
+ const guestOsFamilies = ref<UI_I_OptionItem[]>(
661
+ capabilities.value.guestOsFamilies
662
+ )
661
663
  const guestOsVersions = ref<UI_I_ArbitraryObject<UI_I_OptionItem[]>>(
662
- capabilities.value.guestOsVersions
664
+ capabilities.value.guestOsVersions
663
665
  )
664
666
  const machineTypes = ref<UI_I_OptionItem[]>(capabilities.value.machineTypes)
665
667
 
@@ -686,6 +688,13 @@ watch(vmSettings, (newValue) => {
686
688
 
687
689
  if (newValue?.compatibility)
688
690
  vmForm.value.compatibility = newValue.compatibility
691
+
692
+ if (newValue?.storage) {
693
+ const datastore = props.datastore.find(
694
+ (item) => item.id === newValue.storage.id
695
+ )
696
+ if (datastore) vmForm.value.storage = datastore
697
+ }
689
698
  })
690
699
 
691
700
  const onHideModal = (): void => {
@@ -100,7 +100,7 @@ const props = defineProps<{
100
100
  hardDisk: UI_I_SendDataNewHardDisk
101
101
  type: UI_T_HardDiskType
102
102
  index: number
103
- errorValidationFields: UI_I_ErrorValidationField<string>[]
103
+ errorValidationFields: UI_I_ErrorValidationField[]
104
104
  getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
105
105
  datastore: UI_I_DatastoreTableItem[]
106
106
  isEdit: boolean
@@ -160,14 +160,17 @@ const label = computed<string>(() => {
160
160
  })
161
161
 
162
162
  const maxHardDisk = computed<number>(() => {
163
- if (props.type === 'exist') return $binary.gbToMb(props.hardDisk.size)
163
+ const hardDiskSizeMb = $binary.gbToMb(props.hardDisk.size)
164
+
165
+ if (props.type === 'exist') return hardDiskSizeMb
164
166
 
165
167
  if (!storage.value) return 0
168
+ const free = storage.value.capacity.free_mb || storage.value.capacity // TODO fix
166
169
 
167
170
  if (props.isEdit)
168
- return storage.value.capacity.free_mb + $binary.gbToMb(props.hardDisk.size)
171
+ return free + hardDiskSizeMb
169
172
 
170
- return storage.value.capacity.free_mb
173
+ return free
171
174
  })
172
175
  const hardDiskTypeErrorLocalText = computed<string>(() => {
173
176
  if (+sizeInMb.value > maxHardDisk.value) {
@@ -52,7 +52,6 @@
52
52
  <script setup lang="ts">
53
53
  import type {
54
54
  UI_I_Pagination,
55
- UI_I_TablePayload,
56
55
  } from '~/lib/models/table/interfaces'
57
56
  import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
58
57
  import type { UI_I_Localization } from '~/lib/models/interfaces'
@@ -70,7 +69,6 @@ const pagination = defineModel<UI_I_Pagination>('pagination', {
70
69
 
71
70
  const props = defineProps<{
72
71
  datastore: UI_I_DatastoreTableItem[]
73
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
74
72
  errors: string[]
75
73
  selectedStorage: UI_I_DatastoreTableItem | null
76
74
  hideCompatibility?: boolean
@@ -4,7 +4,6 @@
4
4
  v-model:selected-row="selectedRow"
5
5
  v-model:pagination="pagination"
6
6
  :datastore="props.datastore"
7
- :get-datastore-table-func="props.getDatastoreTableFunc"
8
7
  :errors="errors"
9
8
  :selected-storage="selectedStorage"
10
9
  :hide-compatibility="props.hideCompatibility"
@@ -17,7 +16,6 @@
17
16
  v-model:selected-row="selectedRow"
18
17
  v-model:pagination="pagination"
19
18
  :datastore="props.datastore"
20
- :get-datastore-table-func="props.getDatastoreTableFunc"
21
19
  :errors="errors"
22
20
  :selected-storage="selectedStorage"
23
21
  :hide-compatibility="props.hideCompatibility"
@@ -63,7 +63,6 @@
63
63
 
64
64
  <script setup lang="ts">
65
65
  import type { UI_I_DataTable } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
66
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
67
66
  import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
68
67
  import type { UI_I_Localization } from '~/lib/models/interfaces'
69
68
  import {
@@ -76,7 +75,6 @@ const selectedRow = defineModel<number | null>('selectedRow')
76
75
 
77
76
  const props = defineProps<{
78
77
  datastore: UI_I_DatastoreTableItem[]
79
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
80
78
  errors: string[]
81
79
  selectedStorage: UI_I_DatastoreTableItem | null
82
80
  hideCompatibility?: boolean
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.160",
4
+ "version": "1.5.162",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -34,7 +34,7 @@
34
34
  "@nuxtjs/eslint-config-typescript": "^12.0.0",
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
- "bfg-nuxt-3-graph": "1.0.22",
37
+ "bfg-nuxt-3-graph": "1.0.23",
38
38
  "bfg-uikit": "1.0.416",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"