bfg-common 1.0.7 → 1.0.9
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.
|
@@ -327,8 +327,8 @@ const onChangeNameAndNext = (name: string, node: UI_I_TreeNode): void => {
|
|
|
327
327
|
'id',
|
|
328
328
|
'parent'
|
|
329
329
|
)
|
|
330
|
-
vmForm.value.dataCenter = node
|
|
331
|
-
vmFormCash.value.dataCenterId =
|
|
330
|
+
vmForm.value.dataCenter = $recursion.findParentByValue(node, 'datacenter', 'type', 'parent')
|
|
331
|
+
vmFormCash.value.dataCenterId = vmForm.value.dataCenter?.id || null
|
|
332
332
|
onNext(true)
|
|
333
333
|
}
|
|
334
334
|
// Для сферы
|
|
@@ -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_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_UI_I_VmEditCpu {
|
|
|
19
19
|
shares: number
|
|
20
20
|
vcpus: number
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface API_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_I_VmEditOptions {
|
|
29
29
|
boot_options: {
|
|
30
30
|
boot_delay_ms: number
|
|
31
31
|
boot_menu: boolean
|
|
@@ -71,9 +71,9 @@ 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_I_VmEditOptions
|
|
75
|
+
cpu: API_UI_I_VmEditCpu
|
|
76
|
+
memory: API_UI_I_VmEditMemory
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export interface UI_I_CreateVmPayload {
|
package/package.json
CHANGED
package/plugins/recursion.ts
CHANGED
|
@@ -204,6 +204,21 @@ export default defineNuxtPlugin(() => {
|
|
|
204
204
|
return (parentPath ? `${parentPath}/` : '') + node[valueProp]
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
self.findParentByValue = (
|
|
208
|
+
node: any,
|
|
209
|
+
value: any,
|
|
210
|
+
valueProp: string,
|
|
211
|
+
parentProp: string
|
|
212
|
+
): any | null => {
|
|
213
|
+
if (!node) return null
|
|
214
|
+
|
|
215
|
+
if (node[valueProp] === value) return node
|
|
216
|
+
const parent = node[parentProp]
|
|
217
|
+
if (parent) return self.findParentByValue(parent, value, valueProp, parentProp)
|
|
218
|
+
|
|
219
|
+
return null
|
|
220
|
+
}
|
|
221
|
+
|
|
207
222
|
return self
|
|
208
223
|
}.call({})
|
|
209
224
|
|