bfg-common 1.0.4 → 1.0.5

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.
@@ -46,9 +46,7 @@
46
46
  @show-compute-resource-tree="
47
47
  emits('show-compute-resource-tree', $event)
48
48
  "
49
- @select-compute-resource-tree="
50
- emits('select-compute-resource-tree', $event)
51
- "
49
+ @select-compute-resource-tree="onSelectComputeResourceTree"
52
50
  @clear-compute-resource-tree="
53
51
  emits('clear-compute-resource-tree', $event)
54
52
  "
@@ -285,6 +283,8 @@ const emits = defineEmits<{
285
283
  (event: 'clear-compute-resource-tree'): void // для сферы
286
284
  }>()
287
285
 
286
+ const { $recursion } = useNuxtApp()
287
+
288
288
  const localization = computed<UI_I_Localization>(() => useLocal())
289
289
 
290
290
  const stepPosition = ref<number>(0)
@@ -307,6 +307,7 @@ const vmForm = ref<UI_I_VmForm>({
307
307
  guestOsVersion: null,
308
308
  computeResource: null,
309
309
  storage: null,
310
+ locationPath: '',
310
311
  dataCenter: null,
311
312
  })
312
313
  const vmFormCash = ref<UI_I_VmFormCash>({
@@ -321,11 +322,25 @@ const onChangeNameAndNext = (name: string, node: UI_I_TreeNode): void => {
321
322
  if (hasChanges) checkLocalChangeAndChangeStepStatus()
322
323
 
323
324
  vmForm.value.name = name
325
+ vmForm.value.locationPath = $recursion.createAbsolutePathRecursion(
326
+ node,
327
+ 'id',
328
+ 'parent'
329
+ )
324
330
  vmForm.value.dataCenter = node
325
331
  vmFormCash.value.dataCenterId = node?.id || null
326
332
  onNext(true)
327
333
  }
328
334
  // Для сферы
335
+ const computeResourcePath = ref<string>('')
336
+ const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
337
+ emits('select-compute-resource-tree', node)
338
+ computeResourcePath.value = $recursion.createAbsolutePathRecursion(
339
+ node,
340
+ 'id',
341
+ 'parent'
342
+ )
343
+ }
329
344
  const changeComputeResourceAndNext = (node: UI_I_TreeNode): void => {
330
345
  const hasChanges =
331
346
  `${node.type}${node.id}` !== vmFormCash.value.computeResourceTypeAndId
@@ -410,7 +425,9 @@ const validateSendData = (): void => {
410
425
  virtualHardwareHardDisks.value,
411
426
  virtualHardwareCdDvdDrives.value,
412
427
  isPowerOnByDefault.value,
413
- localization.value
428
+ localization.value,
429
+ vmForm.value.locationPath, // для сферы
430
+ computeResourcePath.value // для сферы
414
431
  )
415
432
  .then((data) => {
416
433
  loading.value = false
@@ -487,7 +504,8 @@ const checkSubmit = (force = false): boolean => {
487
504
  if (
488
505
  (props.project === 'sphere'
489
506
  ? stepPosition.value === 3
490
- : stepPosition.value === 2) && !force
507
+ : stepPosition.value === 2) &&
508
+ !force
491
509
  ) {
492
510
  storageSubmit.value++
493
511
  return false
@@ -495,7 +513,8 @@ const checkSubmit = (force = false): boolean => {
495
513
  if (
496
514
  (props.project === 'sphere'
497
515
  ? stepPosition.value === 6
498
- : stepPosition.value === 5) && !force
516
+ : stepPosition.value === 5) &&
517
+ !force
499
518
  ) {
500
519
  customizeHardwareSubmit.value++
501
520
  return false
@@ -16,6 +16,7 @@ export interface UI_I_VmForm {
16
16
  guestOsFamily: UI_I_OptionItem | null
17
17
  guestOsVersion: UI_I_OptionItem | null
18
18
  computeResource: UI_I_TreeNode | null
19
+ locationPath: string
19
20
  dataCenter: UI_I_TreeNode | null
20
21
  }
21
22
  export interface UI_I_VmFormCash {
@@ -59,5 +59,6 @@ export type UI_T_AddVmFinishFunc<T = void> = (
59
59
  virtualHardwareCdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null,
60
60
  isPowerOnByDefault: boolean,
61
61
  localization: UI_I_Localization,
62
- isValidation?: boolean
62
+ locationPath?: string, // для сферы
63
+ computeResourcePath?: string // для сферы
63
64
  ) => Promise<T>
@@ -79,6 +79,8 @@ export interface UI_I_VmSettings {
79
79
  export interface UI_I_CreateVmPayload {
80
80
  start: boolean
81
81
  pvm: UI_I_CreateVmData
82
+ location?: string // для сферы
83
+ compute_resource?: string // для сферы
82
84
  }
83
85
 
84
86
  export interface UI_I_EditVmPayload {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",