bfg-common 1.5.39 → 1.5.41

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.
@@ -2332,7 +2332,8 @@
2332
2332
  "backCap": "Назад",
2333
2333
  "processing": "Апрацоўка",
2334
2334
  "incompleteProcess": "Незавершаны працэс!",
2335
- "incompleteProcessMessage": "Хочаце пакінуць гэтую старонку? Ваш прагрэс будзе страчаны, і вам трэба будзе пачаць спачатку."
2335
+ "incompleteProcessMessage": "Хочаце пакінуць гэтую старонку? Ваш прагрэс будзе страчаны, і вам трэба будзе пачаць спачатку.",
2336
+ "notAvailable": "Не даступны"
2336
2337
  },
2337
2338
  "auth": {
2338
2339
  "welcomeTo": "Сардэчна запрашаем у",
@@ -2336,7 +2336,8 @@
2336
2336
  "backCap": "Back",
2337
2337
  "processing": "Processing",
2338
2338
  "incompleteProcess": "Incomplete Process!",
2339
- "incompleteProcessMessage": "Are you sure you want to leave this page? Your progress will be lost, and you’ll need to start over."
2339
+ "incompleteProcessMessage": "Are you sure you want to leave this page? Your progress will be lost, and you’ll need to start over.",
2340
+ "notAvailable": "Not Available"
2340
2341
  },
2341
2342
  "auth": {
2342
2343
  "welcomeTo": "Welcome to",
@@ -2336,7 +2336,8 @@
2336
2336
  "backCap": "Վերադառնալ",
2337
2337
  "processing": "Մշակում",
2338
2338
  "incompleteProcess": "Անավարտ գործընթաց",
2339
- "incompleteProcessMessage": "Վստա՞հ եք, որ ցանկանում եք լքել այս էջը: Ձեր առաջընթացը կկորչի, և դուք պետք է նորից սկսեք:"
2339
+ "incompleteProcessMessage": "Վստա՞հ եք, որ ցանկանում եք լքել այս էջը: Ձեր առաջընթացը կկորչի, և դուք պետք է նորից սկսեք:",
2340
+ "notAvailable": "Հասանելի չէ"
2340
2341
  },
2341
2342
  "auth": {
2342
2343
  "welcomeTo": "Բարի գալուստ",
@@ -2335,7 +2335,8 @@
2335
2335
  "backCap": "Артқа",
2336
2336
  "processing": "Өңдеу",
2337
2337
  "incompleteProcess": "Аяқталмаған Процесс!",
2338
- "incompleteProcessMessage": "Сіз бұл беттен кеткіңіз келетініне сенімдісіз бе? Сіздің жетістіктеріңіз жоғалады және сіз бәрін басынан бастауыңыз керек."
2338
+ "incompleteProcessMessage": "Сіз бұл беттен кеткіңіз келетініне сенімдісіз бе? Сіздің жетістіктеріңіз жоғалады және сіз бәрін басынан бастауыңыз керек.",
2339
+ "notAvailable": "Жоқ"
2339
2340
  },
2340
2341
  "auth": {
2341
2342
  "welcomeTo": "Қош келдіңіз",
@@ -2337,7 +2337,8 @@
2337
2337
  "backCap": "Назад",
2338
2338
  "processing": "Обработка",
2339
2339
  "incompleteProcess": "Незавершенный процесс!",
2340
- "incompleteProcessMessage": "Вы уверены, что хотите покинуть эту страницу? Ваш прогресс будет потерян, и вам нужно будет начать сначала."
2340
+ "incompleteProcessMessage": "Вы уверены, что хотите покинуть эту страницу? Ваш прогресс будет потерян, и вам нужно будет начать сначала.",
2341
+ "notAvailable": "Не доступен"
2341
2342
  },
2342
2343
  "auth": {
2343
2344
  "welcomeTo": "Добро пожаловать в",
@@ -2333,7 +2333,8 @@
2333
2333
  "backCap": "返回",
2334
2334
  "processing": "处理过程",
2335
2335
  "incompleteProcess": "不完整的过程!",
2336
- "incompleteProcessMessage": "你确定要离开这一页吗? 你的进步将丢失,你需要重新开始。"
2336
+ "incompleteProcessMessage": "你确定要离开这一页吗? 你的进步将丢失,你需要重新开始。",
2337
+ "notAvailable": "暂时没有"
2337
2338
  },
2338
2339
  "auth": {
2339
2340
  "welcomeTo": "欢迎来到",
@@ -2349,7 +2350,6 @@
2349
2350
  "loginErrorText": "无效的用户名或密码",
2350
2351
  "loginAccessErrorText": "您无法访问进入系统",
2351
2352
  "tooManyLoginAttempts": "太多的失败尝试授权。稍后再尝试。"
2352
-
2353
2353
  },
2354
2354
  "home": {
2355
2355
  "objectsWithMostAlerts": "警报最多的对象",
@@ -7,5 +7,8 @@ export interface UI_I_ResourceBlock {
7
7
  data: UI_I_ProgressWidgetData
8
8
  usedTitle: string
9
9
  capacityTitle: string
10
- status: string
10
+ status: {
11
+ available: string
12
+ notAvailable: string
13
+ }
11
14
  }
@@ -42,7 +42,10 @@ export const constructResourceMeter = (
42
42
  },
43
43
  usedTitle: localization.common.used,
44
44
  capacityTitle: localization.common.capacity,
45
- status: localization.common.available,
45
+ status: {
46
+ available: localization.common.available,
47
+ notAvailable: localization.common.notAvailable,
48
+ },
46
49
  }
47
50
  }) || []
48
51
  )
@@ -21,6 +21,7 @@
21
21
  <common-vm-actions-common-select-template
22
22
  v-show="selectedStep.id === dynamicSteps.selectTemplate"
23
23
  :template-submit="templateSubmit"
24
+ :templates-tree="props.templatesTree"
24
25
  @submit="onChangeTemplate"
25
26
  />
26
27
  <common-vm-actions-common-select-name
@@ -230,6 +231,7 @@ const props = defineProps<{
230
231
  passthroughDevices: UI_I_PciDevice[]
231
232
  mediatedDevices: UI_I_MediatedDevice[]
232
233
  vmNameInWizard: string
234
+ templatesTree: UI_I_TreeNode[]
233
235
  capabilities?: UI_I_Capabilities
234
236
  dataCenter?: UI_I_TreeNode // для сферы
235
237
  computeResource?: UI_I_TreeNode // для сферы
@@ -553,6 +555,8 @@ const vmForm = ref<UI_I_VmForm>({
553
555
  locationPath: '',
554
556
  dataCenter: null,
555
557
  })
558
+
559
+ // TODO remove (not used)
556
560
  const vmFormCash = ref<UI_I_VmFormCash>({
557
561
  dataCenterId: null,
558
562
  computeResourceTypeAndId: null,
@@ -20,13 +20,38 @@
20
20
  class="new-task-form"
21
21
  />
22
22
  <common-vm-actions-common-select-name
23
- v-show="selectedStep.id === dynamicSteps.selectName"
24
- :show="selectedStep.id === dynamicSteps.selectName"
23
+ v-show="
24
+ selectedStep.id === dynamicSteps.selectName ||
25
+ selectedStep.id === dynamicSteps.selectNameFolder
26
+ "
27
+ :show="
28
+ selectedStep.id === dynamicSteps.selectName ||
29
+ selectedStep.id === dynamicSteps.selectNameFolder
30
+ "
25
31
  :name-form-submit="nameFormSubmit"
26
32
  :project="props.project"
33
+ :data-center="props.dataCenter"
27
34
  @submit="onChangeName(...$event)"
28
35
  @check-name="emits('check-name', $event)"
29
36
  />
37
+ <common-vm-actions-common-select-compute-resource
38
+ v-if="isSphere"
39
+ v-show="selectedStep.id === dynamicSteps.selectComputeResource"
40
+ v-model="computeResource"
41
+ :compute-resource-submit="computeResourceSubmit"
42
+ :data-center="vmForm.dataCenter"
43
+ :compute-resource="props.computeResource"
44
+ :compute-resource-tree="props.computeResourceTree"
45
+ @submit="onChangeComputeResource"
46
+ @select-compute-resource-tree="onSelectComputeResourceTree"
47
+ @get-compute-resource-tree="
48
+ emits('get-compute-resource-tree', $event)
49
+ "
50
+ @show-compute-resource-tree="
51
+ emits('show-compute-resource-tree', $event)
52
+ "
53
+ @clear-compute-resource-tree="emits('clear-compute-resource-tree')"
54
+ />
30
55
  <common-vm-actions-common-select-storage
31
56
  v-show="selectedStep.id === dynamicSteps.selectStorage"
32
57
  :storage-submit="storageSubmit"
@@ -41,9 +66,9 @@
41
66
  />
42
67
  <common-vm-actions-common-select-os
43
68
  v-show="selectedStep.id === dynamicSteps.selectGuestOSMachineType"
44
- v-model:machine-type="guestMachineType"
45
- v-model:guest-os-family="guestOsFamily"
46
- v-model:guest-os-version="guestOsVersion"
69
+ v-model:machine-type="vmForm.guestMachineType"
70
+ v-model:guest-os-family="vmForm.guestOsFamily"
71
+ v-model:guest-os-version="vmForm.guestOsVersion"
47
72
  :families-options="guestOsFamilies"
48
73
  :versions-options="guestOsVersions"
49
74
  :machine-types-options="machineTypes"
@@ -137,9 +162,8 @@ import type {
137
162
  UI_I_VmSettings,
138
163
  } from '~/lib/models/store/vm/interfaces'
139
164
  import type {
140
- // I_DynamicSteps,
141
165
  UI_I_VmForm,
142
- } from '~/components/common/vm/actions/clone/lib/models/interfaces'
166
+ } from '~/components/common/vm/actions/common/lib/models/interfaces'
143
167
  import type {
144
168
  UI_I_ValidationReturn,
145
169
  UI_I_WizardStep,
@@ -147,6 +171,7 @@ import type {
147
171
  import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
148
172
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
149
173
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
174
+ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
150
175
  import {
151
176
  stepsSchemeInitial,
152
177
  stepsFunc,
@@ -176,6 +201,9 @@ const props = defineProps<{
176
201
  capabilities?: UI_I_Capabilities
177
202
  schedulerTask?: any // TODO надо interface переместить глобално
178
203
  selectedVirtualMachine?: UI_I_Capabilities
204
+ dataCenter?: UI_I_TreeNode // для сферы
205
+ computeResource?: UI_I_TreeNode // для сферы
206
+ computeResourceTree?: UI_I_TreeNode[] // для сферы
179
207
  }>()
180
208
 
181
209
  const emits = defineEmits<{
@@ -188,10 +216,21 @@ const emits = defineEmits<{
188
216
  (event: 'get-networks-table', value: UI_I_TablePayload): void
189
217
  (event: 'get-pci-devices'): void
190
218
  (event: 'hide'): void
219
+ (
220
+ event: 'get-compute-resource-tree',
221
+ value: { id: string | number; cb: () => void }
222
+ ): void // для сферы
223
+ (event: 'show-compute-resource-tree', value: UI_I_TreeNode): void // для сферы
224
+ (event: 'select-compute-resource-tree', value: UI_I_TreeNode): void // для сферы
225
+ (event: 'clear-compute-resource-tree'): void // для сферы
191
226
  }>()
192
227
 
228
+ const { $recursion } = useNuxtApp()
229
+
193
230
  const localization = computed<UI_I_Localization>(() => useLocal())
194
231
 
232
+ const isSphere = computed<boolean>(() => props.project === 'sphere')
233
+
195
234
  const isScheduledTasks = computed<boolean>(
196
235
  () => props.schedulerTask.isSchedulerTask
197
236
  )
@@ -229,9 +268,11 @@ const wizard: Wizard = new Wizard(
229
268
  watch(
230
269
  isScheduledTasks,
231
270
  (newValue) => {
232
- wizard.changeScheme(newValue ? 4 : 0)
233
- if (!newValue) {
234
- wizard.selectStepHard(1)
271
+ if (newValue) {
272
+ wizard.changeScheme(isSphere ? 12 : 4)
273
+ } else {
274
+ wizard.changeScheme(isSphere ? 8 : 0)
275
+ wizard.selectStepHard(isSphere ? 2 : 1)
235
276
  }
236
277
  },
237
278
  { immediate: true }
@@ -270,7 +311,7 @@ const validationFunc = async (
270
311
  wizard.setLoader(true)
271
312
  if (
272
313
  wizard.isValidateForStep(
273
- dynamicSteps.selectName,
314
+ isSphere.value ? dynamicSteps.selectNameFolder : dynamicSteps.selectName,
274
315
  currentStep.id,
275
316
  nextStep.id
276
317
  )
@@ -279,6 +320,18 @@ const validationFunc = async (
279
320
 
280
321
  value = nameValidation.newValue
281
322
  stepHasError = stepHasError || nameValidation.stepHasError
323
+ } else if (
324
+ isSphere.value &&
325
+ wizard.isValidateForStep(
326
+ dynamicSteps.selectComputeResource,
327
+ currentStep.id,
328
+ nextStep.id
329
+ )
330
+ ) {
331
+ const computeResourceValidation = await checkComputeResource(value)
332
+
333
+ value = computeResourceValidation.newValue
334
+ stepHasError = stepHasError || computeResourceValidation.stepHasError
282
335
  } else if (
283
336
  wizard.isValidateForStep(
284
337
  dynamicSteps.selectStorage,
@@ -318,14 +371,17 @@ const checkName = async (
318
371
  let stepHasError = false
319
372
 
320
373
  return new Promise((resolve) => {
374
+ const step = isSphere.value
375
+ ? dynamicSteps.selectNameFolder
376
+ : dynamicSteps.selectName
321
377
  nameFormSubmit.value = (isValid: boolean) => {
322
378
  if (!isValid) {
323
- stepHasError = wizard.setValidation(dynamicSteps.selectName, 'name', {
379
+ stepHasError = wizard.setValidation(step, 'name', {
324
380
  fieldMessage: 'aaa',
325
381
  alertMessage: 'aaa',
326
382
  })
327
- } else if (wizard.hasMessage(dynamicSteps.selectName, 'name')) {
328
- value = wizard.removeValidation(dynamicSteps.selectName, 'name', value)
383
+ } else if (wizard.hasMessage(step, 'name')) {
384
+ value = wizard.removeValidation(step, 'name', value)
329
385
  }
330
386
 
331
387
  resolve({
@@ -336,6 +392,40 @@ const checkName = async (
336
392
  }
337
393
  })
338
394
  }
395
+ const checkComputeResource = async (
396
+ value: UI_I_WizardStep[]
397
+ ): Promise<UI_I_ValidationReturn> => {
398
+ let stepHasError = false
399
+
400
+ return new Promise((resolve) => {
401
+ computeResourceSubmit.value = (isValid: boolean) => {
402
+ if (!isValid) {
403
+ stepHasError = wizard.setValidation(
404
+ dynamicSteps.selectComputeResource,
405
+ 'computeResource',
406
+ {
407
+ fieldMessage: 'aaa',
408
+ alertMessage: 'aaa',
409
+ }
410
+ )
411
+ } else if (
412
+ wizard.hasMessage(dynamicSteps.selectComputeResource, 'computeResource')
413
+ ) {
414
+ value = wizard.removeValidation(
415
+ dynamicSteps.selectComputeResource,
416
+ 'computeResource',
417
+ value
418
+ )
419
+ }
420
+
421
+ resolve({
422
+ stepHasError,
423
+ newValue: value,
424
+ })
425
+ computeResourceSubmit.value = null
426
+ }
427
+ })
428
+ }
339
429
  const checkStorage = async (
340
430
  value: UI_I_WizardStep[]
341
431
  ): Promise<UI_I_ValidationReturn> => {
@@ -403,20 +493,34 @@ const checkCustomizeHardware = async (
403
493
  })
404
494
  }
405
495
 
406
- const storageIdCash = ref<string | null>(null)
407
496
  const vmForm = ref<UI_I_VmForm>({
408
497
  name: '',
498
+ compatibility: '',
499
+ guestMachineType: null,
500
+ guestOsFamily: null,
501
+ guestOsVersion: null,
502
+ computeResource: null,
409
503
  storage: null,
504
+ locationPath: '',
505
+ dataCenter: null,
410
506
  options: [],
411
507
  })
412
- const onChangeName = (name: string): void => {
508
+ const onChangeName = (name: string, node: UI_I_TreeNode): void => {
413
509
  vmForm.value.name = name
510
+ if (isSphere.value) {
511
+ vmForm.value.locationPath = node.id
512
+ vmForm.value.dataCenter = $recursion.findParentByValue(
513
+ node,
514
+ 'datacenter',
515
+ 'type',
516
+ 'parent'
517
+ )
518
+ }
414
519
  }
415
520
  const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
416
521
  if (!storage) return
417
522
 
418
523
  vmForm.value.storage = storage
419
- storageIdCash.value = storage.id
420
524
  }
421
525
  const onChangeSelectOptions = (options: string[]): void => {
422
526
  vmForm.value.options = options
@@ -424,13 +528,21 @@ const onChangeSelectOptions = (options: string[]): void => {
424
528
  options.includes('customize-os') &&
425
529
  options.includes('customize-hardware')
426
530
  ) {
427
- wizard.changeScheme(isScheduledTasks.value ? 7 : 3)
531
+ let procuratorSchame = isScheduledTasks.value ? 7 : 3
532
+ let sphereSchame = isScheduledTasks.value ? 15 : 11
533
+ wizard.changeScheme(isSphere.value ? sphereSchame : procuratorSchame)
428
534
  } else if (options.includes('customize-os')) {
429
- wizard.changeScheme(isScheduledTasks.value ? 5 : 1)
535
+ let procuratorSchame = isScheduledTasks.value ? 5 : 1
536
+ let sphereSchame = isScheduledTasks.value ? 13 : 9
537
+ wizard.changeScheme(isSphere.value ? sphereSchame : procuratorSchame)
430
538
  } else if (options.includes('customize-hardware')) {
431
- wizard.changeScheme(isScheduledTasks.value ? 6 : 2)
539
+ let procuratorSchame = isScheduledTasks.value ? 6 : 2
540
+ let sphereSchame = isScheduledTasks.value ? 14 : 10
541
+ wizard.changeScheme(isSphere.value ? sphereSchame : procuratorSchame)
432
542
  } else {
433
- wizard.changeScheme(isScheduledTasks.value ? 4 : 0)
543
+ let procuratorSchame = isScheduledTasks.value ? 4 : 0
544
+ let sphereSchame = isScheduledTasks.value ? 12 : 8
545
+ wizard.changeScheme(isSphere.value ? sphereSchame : procuratorSchame)
434
546
  }
435
547
  }
436
548
  const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
@@ -491,7 +603,9 @@ const validateSendData = async (
491
603
  virtualHardwareHardDisks.value,
492
604
  virtualHardwareCdDvdDrives.value,
493
605
  isPowerOnByDefault.value,
494
- localization.value
606
+ localization.value,
607
+ vmForm.value.locationPath, // для сферы
608
+ computeResourcePath.value // для сферы
495
609
  )
496
610
 
497
611
  wizard.setLoader(false)
@@ -518,6 +632,8 @@ const onFinish = (): void => {
518
632
  virtualHardwareCdDvdDrives.value,
519
633
  isPowerOnByDefault.value,
520
634
  localization.value,
635
+ vmForm.value.locationPath, // для сферы
636
+ computeResourcePath.value, // для сферы
521
637
  false,
522
638
  newTaskForm.value,
523
639
  props.schedulerTask
@@ -531,28 +647,42 @@ const onFinish = (): void => {
531
647
  const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
532
648
 
533
649
  const nameFormSubmit = ref<null | Function>(null)
650
+ const computeResourceSubmit = ref<null | Function>(null)
534
651
  const storageSubmit = ref<null | Function>(null)
535
652
  const customizeHardwareSubmit = ref<null | Function>(null)
536
653
 
537
654
  const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
538
655
  const vmName = ref<string>(vmSettings.value?.name || '')
539
656
 
540
- const guestMachineType = ref<UI_I_OptionItem | null>(null)
541
- const guestOsFamily = ref<UI_I_OptionItem | null>(null)
542
- const guestOsVersion = ref<UI_I_OptionItem | null>(null)
543
-
544
657
  const guestOsFamilies = ref<UI_I_OptionItem[]>(capabilities.guestOsFamilies)
545
658
  const guestOsVersions = ref<UI_I_ArbitraryObject<UI_I_OptionItem[]>>(
546
659
  capabilities.guestOsVersions
547
660
  )
548
661
  const machineTypes = ref<UI_I_OptionItem[]>(capabilities.machineTypes)
549
662
 
663
+ const computeResource = ref<UI_I_TreeNode | null>(null)
664
+ const onChangeComputeResource = (node: UI_I_TreeNode): void => {
665
+ computeResource.value = node
666
+ }
667
+ // // Для сферы
668
+ const computeResourcePath = ref<string>('')
669
+ const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
670
+ emits('select-compute-resource-tree', node)
671
+ computeResourcePath.value = node.id
672
+ }
673
+
550
674
  watch(vmSettings, (newValue) => {
551
675
  vmName.value = newValue?.name || ''
552
676
 
553
- if (newValue?.guestOsFamily) guestOsFamily.value = newValue.guestOsFamily
554
- if (newValue?.guestMachineType) guestMachineType.value = newValue.guestMachineType
555
- if (newValue?.guestOsVersion) guestOsVersion.value = newValue.guestOsVersion
677
+ if (newValue?.guestOsFamily)
678
+ vmForm.value.guestOsFamily = newValue.guestOsFamily
679
+ if (newValue?.guestMachineType)
680
+ vmForm.value.guestMachineType = newValue.guestMachineType
681
+ if (newValue?.guestOsVersion)
682
+ vmForm.value.guestOsVersion = newValue.guestOsVersion
683
+
684
+ if (newValue?.compatibility)
685
+ vmForm.value.compatibility = newValue.compatibility
556
686
  })
557
687
 
558
688
  const onHideModal = (): void => {
@@ -5,11 +5,13 @@ import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
5
5
  export const dynamicSteps = {
6
6
  scheduledTasks: 0,
7
7
  selectName: 1,
8
- selectStorage: 2,
9
- selectOptions: 3,
10
- selectGuestOSMachineType: 4,
11
- customizeHardware: 5,
12
- readyComplete: 6,
8
+ selectNameFolder: 2,
9
+ selectComputeResource: 3,
10
+ selectStorage: 4,
11
+ selectOptions: 5,
12
+ selectGuestOSMachineType: 6,
13
+ customizeHardware: 7,
14
+ readyComplete: 8,
13
15
  }
14
16
 
15
17
  export const stepsFunc = (
@@ -41,6 +43,38 @@ export const stepsFunc = (
41
43
  },
42
44
  },
43
45
  },
46
+ // Sphere
47
+ {
48
+ id: dynamicSteps.selectNameFolder,
49
+ stepName: '',
50
+ title: localization.common.selectNameFolder,
51
+ subTitle: localization.common.specifyUniqueNameTargetLocation,
52
+ status: UI_E_WIZARD_STATUS.INACTIVE,
53
+ isValid: true,
54
+ testId: 'vm-select-name-folder',
55
+ fields: {
56
+ name: {
57
+ field: '',
58
+ alert: '',
59
+ },
60
+ },
61
+ },
62
+ // Sphere
63
+ {
64
+ id: dynamicSteps.selectComputeResource,
65
+ stepName: '',
66
+ title: localization.common.selectComputeResource,
67
+ subTitle: localization.common.selectDestinationComputeResourceOperation,
68
+ status: UI_E_WIZARD_STATUS.INACTIVE,
69
+ isValid: true,
70
+ testId: 'vm-select-compute-resource',
71
+ fields: {
72
+ computeResource: {
73
+ field: '',
74
+ alert: '',
75
+ },
76
+ },
77
+ },
44
78
  {
45
79
  id: dynamicSteps.selectStorage,
46
80
  stepName: '',
@@ -107,6 +141,7 @@ export const stepsFunc = (
107
141
  }
108
142
 
109
143
  export const stepsSchemeInitial = [
144
+ // Procurator
110
145
  // 0
111
146
  [
112
147
  dynamicSteps.selectName,
@@ -175,4 +210,82 @@ export const stepsSchemeInitial = [
175
210
  dynamicSteps.customizeHardware,
176
211
  dynamicSteps.readyComplete,
177
212
  ],
213
+
214
+ // Sphere
215
+ // 8
216
+ [
217
+ dynamicSteps.selectNameFolder,
218
+ dynamicSteps.selectComputeResource,
219
+ dynamicSteps.selectStorage,
220
+ dynamicSteps.selectOptions,
221
+ dynamicSteps.readyComplete,
222
+ ],
223
+ // 9 Customize the operating system
224
+ [
225
+ dynamicSteps.selectNameFolder,
226
+ dynamicSteps.selectComputeResource,
227
+ dynamicSteps.selectStorage,
228
+ dynamicSteps.selectOptions,
229
+ dynamicSteps.selectGuestOSMachineType,
230
+ dynamicSteps.readyComplete,
231
+ ],
232
+ // 10 Customize this virtual machine's hardware
233
+ [
234
+ dynamicSteps.selectNameFolder,
235
+ dynamicSteps.selectComputeResource,
236
+ dynamicSteps.selectStorage,
237
+ dynamicSteps.selectOptions,
238
+ dynamicSteps.customizeHardware,
239
+ dynamicSteps.readyComplete,
240
+ ],
241
+ // 11 Customize the operating system and this virtual machine's hardware
242
+ [
243
+ dynamicSteps.selectNameFolder,
244
+ dynamicSteps.selectComputeResource,
245
+ dynamicSteps.selectStorage,
246
+ dynamicSteps.selectOptions,
247
+ dynamicSteps.selectGuestOSMachineType,
248
+ dynamicSteps.customizeHardware,
249
+ dynamicSteps.readyComplete,
250
+ ],
251
+ // 12 Width Scheduled Tasks
252
+ [
253
+ dynamicSteps.scheduledTasks,
254
+ dynamicSteps.selectNameFolder,
255
+ dynamicSteps.selectComputeResource,
256
+ dynamicSteps.selectStorage,
257
+ dynamicSteps.selectOptions,
258
+ dynamicSteps.readyComplete,
259
+ ],
260
+ // 13 Customize the operating system
261
+ [
262
+ dynamicSteps.scheduledTasks,
263
+ dynamicSteps.selectNameFolder,
264
+ dynamicSteps.selectComputeResource,
265
+ dynamicSteps.selectStorage,
266
+ dynamicSteps.selectOptions,
267
+ dynamicSteps.selectGuestOSMachineType,
268
+ dynamicSteps.readyComplete,
269
+ ],
270
+ // 14 Customize this virtual machine's hardware
271
+ [
272
+ dynamicSteps.scheduledTasks,
273
+ dynamicSteps.selectNameFolder,
274
+ dynamicSteps.selectComputeResource,
275
+ dynamicSteps.selectStorage,
276
+ dynamicSteps.selectOptions,
277
+ dynamicSteps.customizeHardware,
278
+ dynamicSteps.readyComplete,
279
+ ],
280
+ // 15 Customize the operating system and this virtual machine's hardware
281
+ [
282
+ dynamicSteps.scheduledTasks,
283
+ dynamicSteps.selectNameFolder,
284
+ dynamicSteps.selectComputeResource,
285
+ dynamicSteps.selectStorage,
286
+ dynamicSteps.selectOptions,
287
+ dynamicSteps.selectGuestOSMachineType,
288
+ dynamicSteps.customizeHardware,
289
+ dynamicSteps.readyComplete,
290
+ ],
178
291
  ]
@@ -28,6 +28,7 @@ export interface UI_I_VmForm {
28
28
  computeResource: UI_I_TreeNode | null
29
29
  locationPath: string
30
30
  dataCenter: UI_I_TreeNode | null
31
+ options?: string[]
31
32
  }
32
33
  export interface UI_I_VmFormCash {
33
34
  dataCenterId: string | number | null
@@ -1,51 +1,52 @@
1
- import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
2
- import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
3
-
4
- export const mapCapabilities = (
5
- capabilitiesFromApi: UI_I_Capabilities
6
- ): void => {
7
- const { $binary } = useNuxtApp()
8
-
9
- // Machine Types
10
- capabilities.machineTypes = Object.keys(
11
- capabilitiesFromApi.machine_types
12
- ).map((key) => {
13
- return {
14
- text: capabilitiesFromApi.machine_types[key],
15
- value: key,
16
- }
17
- })
18
- // CPU Models
19
- capabilities.cpuModels = Object.keys(capabilitiesFromApi.cpu_models).map(
20
- (key) => {
21
- return {
22
- text: capabilitiesFromApi.cpu_models[key],
23
- value: key,
24
- }
25
- }
26
- )
27
-
28
- Object.keys(capabilitiesFromApi.bus_types).forEach(key => {
29
- capabilities.bus[key] = Object.keys(capabilitiesFromApi.bus_types[key]).map(
30
- (key2) => {
31
- return {
32
- text: capabilitiesFromApi.bus_types[key][key2],
33
- value: key2,
34
- }
35
- }
36
- )
37
- })
38
- Object.keys(capabilitiesFromApi.cdrom_bus_type).forEach(key => {
39
- capabilities.cdromBus[key] = Object.keys(capabilitiesFromApi.cdrom_bus_type[key]).map(
40
- (key2) => {
41
- return {
42
- text: capabilitiesFromApi.cdrom_bus_type[key][key2],
43
- value: key2,
44
- }
45
- }
46
- )
47
- })
48
-
49
- capabilities.maxCpus = capabilitiesFromApi.max_vcpus
50
- capabilities.maxMemory = $binary.kbToMb(capabilitiesFromApi.max_mem_kib)
51
- }
1
+ import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
2
+ import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
3
+
4
+ export const mapCapabilities = (
5
+ capabilitiesFromApi: UI_I_Capabilities
6
+ ): void => {
7
+ if (!capabilitiesFromApi) return
8
+ const { $binary } = useNuxtApp()
9
+
10
+ // Machine Types
11
+ capabilities.machineTypes = Object.keys(
12
+ capabilitiesFromApi.machine_types
13
+ ).map((key) => {
14
+ return {
15
+ text: capabilitiesFromApi.machine_types[key],
16
+ value: key,
17
+ }
18
+ })
19
+ // CPU Models
20
+ capabilities.cpuModels = Object.keys(capabilitiesFromApi.cpu_models).map(
21
+ (key) => {
22
+ return {
23
+ text: capabilitiesFromApi.cpu_models[key],
24
+ value: key,
25
+ }
26
+ }
27
+ )
28
+
29
+ Object.keys(capabilitiesFromApi.bus_types).forEach((key) => {
30
+ capabilities.bus[key] = Object.keys(capabilitiesFromApi.bus_types[key]).map(
31
+ (key2) => {
32
+ return {
33
+ text: capabilitiesFromApi.bus_types[key][key2],
34
+ value: key2,
35
+ }
36
+ }
37
+ )
38
+ })
39
+ Object.keys(capabilitiesFromApi.cdrom_bus_type).forEach((key) => {
40
+ capabilities.cdromBus[key] = Object.keys(
41
+ capabilitiesFromApi.cdrom_bus_type[key]
42
+ ).map((key2) => {
43
+ return {
44
+ text: capabilitiesFromApi.cdrom_bus_type[key][key2],
45
+ value: key2,
46
+ }
47
+ })
48
+ })
49
+
50
+ capabilities.maxCpus = capabilitiesFromApi.max_vcpus
51
+ capabilities.maxMemory = $binary.kbToMb(capabilitiesFromApi.max_mem_kib)
52
+ }
@@ -10,6 +10,7 @@
10
10
 
11
11
  <div class="tree-view-wrap">
12
12
  <common-vm-actions-common-select-template-tree-view
13
+ :templates-tree="props.templatesTree"
13
14
  @select-node="onSelectNode"
14
15
  />
15
16
  </div>
@@ -22,6 +23,7 @@ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models
22
23
 
23
24
  const props = defineProps<{
24
25
  templateSubmit: null | Function
26
+ templatesTree: UI_I_TreeNode[]
25
27
  }>()
26
28
  const emits = defineEmits<{
27
29
  (event: 'submit', value: UI_I_TreeNode | null): void
@@ -42,7 +44,8 @@ watch(
42
44
  )
43
45
 
44
46
  const submit = async (cb: Function): Promise<void> => {
45
- if (!selectedNode.value || selectedNode.value.type !== 'vm') { // TODO change vm to vmTemplate
47
+ if (!selectedNode.value || selectedNode.value.type !== 'vm') {
48
+ // TODO change vm to vmTemplate
46
49
  errors.value = [localization.value.vmWizard.selectValidTemplate]
47
50
  cb(false)
48
51
  return
@@ -19,6 +19,9 @@
19
19
  <script setup lang="ts">
20
20
  import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
21
21
 
22
+ const props = defineProps<{
23
+ templatesTree: UI_I_TreeNode[]
24
+ }>()
22
25
  const emits = defineEmits<{
23
26
  (event: 'select-node', value: UI_I_TreeNode): void
24
27
  }>()
@@ -26,11 +29,8 @@ const emits = defineEmits<{
26
29
  const { $store, $recursion }: any = useNuxtApp()
27
30
 
28
31
  const nodes = ref<UI_I_TreeNode[]>([])
29
- const nodesFromStore = computed<UI_I_TreeNode[]>(
30
- () => $store.getters['inventory/getTreeByName']('vm') || []
31
- )
32
32
  watch(
33
- nodesFromStore,
33
+ () => props.templatesTree,
34
34
  (newValue) => {
35
35
  nodes.value = useDeepCopy(newValue)
36
36
  },
@@ -9,6 +9,7 @@ export interface API_UI_I_Response<T> {
9
9
  response: {
10
10
  _data: T
11
11
  status: number
12
+ ok: boolean
12
13
  }
13
14
  }
14
15
  export interface API_UI_I_Error {
@@ -250,4 +250,6 @@ export interface API_UI_I_VmReadyToComplete {
250
250
  video_card: API_UI_I_VmReadyToCompleteVideoCard
251
251
  passthrough_pci_devices: API_UI_I_VmReadyToCompletePciDevice[]
252
252
  }
253
+ compute_resource?: string
254
+ location?: string
253
255
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.39",
4
+ "version": "1.5.41",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -35,7 +35,7 @@
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
37
  "bfg-nuxt-3-graph": "1.0.22",
38
- "bfg-uikit": "1.0.396",
38
+ "bfg-uikit": "1.0.397",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }