bfg-common 1.0.4 → 1.0.6
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) &&
|
|
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) &&
|
|
516
|
+
: stepPosition.value === 5) &&
|
|
517
|
+
!force
|
|
499
518
|
) {
|
|
500
519
|
customizeHardwareSubmit.value++
|
|
501
520
|
return false
|
|
@@ -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
|
-
|
|
62
|
+
locationPath?: string, // для сферы
|
|
63
|
+
computeResourcePath?: string // для сферы
|
|
63
64
|
) => Promise<T>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
|
|
10
10
|
import { UI_I_CreateVmData } from '~/components/common/vm/actions/add/models/interfaces'
|
|
11
11
|
|
|
12
|
-
export interface
|
|
12
|
+
export interface API_UI_UI_I_VmEditCpu {
|
|
13
13
|
core_per_socket: number
|
|
14
14
|
hotplug: boolean
|
|
15
15
|
limit_mhz: number
|
|
@@ -19,13 +19,13 @@ export interface API_UI_I_VmEditCpu {
|
|
|
19
19
|
shares: number
|
|
20
20
|
vcpus: number
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface API_UI_UI_I_VmEditMemory {
|
|
23
23
|
hotplug: boolean
|
|
24
24
|
limit_mb: number
|
|
25
25
|
reservation_mb: number
|
|
26
26
|
size_mb: number
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
28
|
+
export interface API_UI_UI_I_VmEditOptions {
|
|
29
29
|
boot_options: {
|
|
30
30
|
boot_delay_ms: number
|
|
31
31
|
boot_menu: boolean
|
|
@@ -71,17 +71,137 @@ export interface UI_I_VmSettings {
|
|
|
71
71
|
maxMemory: number
|
|
72
72
|
uuid: string
|
|
73
73
|
compatibility: string
|
|
74
|
-
options:
|
|
75
|
-
cpu:
|
|
76
|
-
memory:
|
|
74
|
+
options: API_UI_UI_I_VmEditOptions
|
|
75
|
+
cpu: API_UI_UI_I_VmEditCpu
|
|
76
|
+
memory: API_UI_UI_I_VmEditMemory
|
|
77
77
|
}
|
|
78
78
|
|
|
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 {
|
|
85
87
|
vmId: string
|
|
86
88
|
body: UI_I_CreateVmData
|
|
87
89
|
}
|
|
90
|
+
|
|
91
|
+
export interface API_UI_I_VmReadyToCompleteCpu {
|
|
92
|
+
core_per_socket: number
|
|
93
|
+
hotplug: number
|
|
94
|
+
limit_mhz: number
|
|
95
|
+
max_vcpus: number
|
|
96
|
+
model: string
|
|
97
|
+
reservation_mhz: number
|
|
98
|
+
shares: number
|
|
99
|
+
vcpus: number
|
|
100
|
+
}
|
|
101
|
+
export interface API_UI_I_VmReadyToCompleteDiskDevices {
|
|
102
|
+
boot_order: number
|
|
103
|
+
bus: string
|
|
104
|
+
cache: string
|
|
105
|
+
create: boolean
|
|
106
|
+
device_type: string
|
|
107
|
+
discard: string
|
|
108
|
+
disk_mode: string
|
|
109
|
+
io: string
|
|
110
|
+
limit_iops: number
|
|
111
|
+
provision_type: string
|
|
112
|
+
read_only: boolean
|
|
113
|
+
shares: number
|
|
114
|
+
sharing: boolean
|
|
115
|
+
size: number
|
|
116
|
+
source: string
|
|
117
|
+
storage_id: string
|
|
118
|
+
target: string
|
|
119
|
+
}
|
|
120
|
+
export interface API_UI_I_VmReadyToCompleteInputDevices {
|
|
121
|
+
bus: string
|
|
122
|
+
type: string
|
|
123
|
+
}
|
|
124
|
+
export interface API_UI_I_VmReadyToCompleteMemory {
|
|
125
|
+
hotplug: boolean
|
|
126
|
+
limit_mb: number
|
|
127
|
+
reservation_mb: number
|
|
128
|
+
size_mb: number
|
|
129
|
+
}
|
|
130
|
+
export interface API_UI_I_VmReadyToCompleteNetworkDevices {
|
|
131
|
+
boot_order: number
|
|
132
|
+
mac: string
|
|
133
|
+
model: string
|
|
134
|
+
net_bridge: string
|
|
135
|
+
network: string
|
|
136
|
+
target: string
|
|
137
|
+
}
|
|
138
|
+
export interface API_UI_I_VmReadyToCompleteOptions {
|
|
139
|
+
boot_options: {
|
|
140
|
+
boot_delay_ms: number
|
|
141
|
+
boot_menu: boolean
|
|
142
|
+
firmware: string
|
|
143
|
+
}
|
|
144
|
+
guest_tools: {
|
|
145
|
+
enabled: boolean
|
|
146
|
+
synchronized_time: boolean
|
|
147
|
+
}
|
|
148
|
+
remote_console: {
|
|
149
|
+
guest_os_lock: boolean
|
|
150
|
+
keymap: string
|
|
151
|
+
limit_sessions: number
|
|
152
|
+
password: string
|
|
153
|
+
port: number
|
|
154
|
+
type: string
|
|
155
|
+
spice: {
|
|
156
|
+
clipboard: boolean
|
|
157
|
+
file_transfer: boolean
|
|
158
|
+
img_compression: string
|
|
159
|
+
jpeg_compression: string
|
|
160
|
+
playback_compression: boolean
|
|
161
|
+
streaming_mode: string
|
|
162
|
+
zlib_glz_compression: string
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
id: string
|
|
166
|
+
}
|
|
167
|
+
export interface API_UI_I_VmReadyToCompleteStorage {
|
|
168
|
+
folder: string
|
|
169
|
+
id: string
|
|
170
|
+
}
|
|
171
|
+
export interface API_UI_I_VmReadyToCompleteUsbController {
|
|
172
|
+
type: number
|
|
173
|
+
}
|
|
174
|
+
export interface API_UI_I_VmReadyToCompleteVideoCard {
|
|
175
|
+
adapter: string
|
|
176
|
+
displays: number
|
|
177
|
+
memory_mb: number
|
|
178
|
+
}
|
|
179
|
+
export interface API_UI_I_VmReadyToCompletePciDevice {
|
|
180
|
+
id: string
|
|
181
|
+
class_name: string
|
|
182
|
+
device_name: string
|
|
183
|
+
vendor_name: string
|
|
184
|
+
}
|
|
185
|
+
export interface API_UI_I_VmReadyToComplete {
|
|
186
|
+
message: string
|
|
187
|
+
vm_desc: {
|
|
188
|
+
compatibility: string
|
|
189
|
+
deployment_name: string
|
|
190
|
+
guest_os_family: string
|
|
191
|
+
guest_os_version: string
|
|
192
|
+
machine_type: string
|
|
193
|
+
name: string
|
|
194
|
+
uuid: string
|
|
195
|
+
cpu: API_UI_I_VmReadyToCompleteCpu
|
|
196
|
+
disk_devices: API_UI_I_VmReadyToCompleteDiskDevices[]
|
|
197
|
+
input_devices: API_UI_I_VmReadyToCompleteInputDevices[]
|
|
198
|
+
memory: API_UI_I_VmReadyToCompleteMemory
|
|
199
|
+
monitoring: any
|
|
200
|
+
network_devices: API_UI_I_VmReadyToCompleteNetworkDevices[]
|
|
201
|
+
options: API_UI_I_VmReadyToCompleteOptions
|
|
202
|
+
storage: API_UI_I_VmReadyToCompleteStorage
|
|
203
|
+
usb_controllers: API_UI_I_VmReadyToCompleteUsbController[]
|
|
204
|
+
video_card: API_UI_I_VmReadyToCompleteVideoCard
|
|
205
|
+
pci_pt_devices: API_UI_I_VmReadyToCompletePciDevice[]
|
|
206
|
+
}
|
|
207
|
+
}
|