bfg-common 1.0.5 → 1.0.7
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.
|
@@ -15,9 +15,15 @@
|
|
|
15
15
|
:compute-resource="props.computeResource"
|
|
16
16
|
:compute-resource-tree="props.computeResourceTree"
|
|
17
17
|
@get-compute-resource-tree="emits('get-compute-resource-tree', $event)"
|
|
18
|
-
@show-compute-resource-tree="
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
@show-compute-resource-tree="
|
|
19
|
+
emits('show-compute-resource-tree', $event)
|
|
20
|
+
"
|
|
21
|
+
@select-compute-resource-tree="
|
|
22
|
+
emits('select-compute-resource-tree', $event)
|
|
23
|
+
"
|
|
24
|
+
@clear-compute-resource-tree="
|
|
25
|
+
emits('clear-compute-resource-tree', $event)
|
|
26
|
+
"
|
|
21
27
|
/>
|
|
22
28
|
</div>
|
|
23
29
|
|
|
@@ -55,7 +61,10 @@ const props = defineProps<{
|
|
|
55
61
|
const emits = defineEmits<{
|
|
56
62
|
(event: 'submit', value: UI_I_TreeNode): void
|
|
57
63
|
(event: 'update:model-value', value: UI_I_TreeNode | null): void
|
|
58
|
-
(
|
|
64
|
+
(
|
|
65
|
+
event: 'get-compute-resource-tree',
|
|
66
|
+
value: { id: string | number; cb: () => void }
|
|
67
|
+
): void
|
|
59
68
|
(event: 'show-compute-resource-tree', value: UI_I_TreeNode): void
|
|
60
69
|
(event: 'select-compute-resource-tree', value: UI_I_TreeNode): void
|
|
61
70
|
(event: 'clear-compute-resource-tree'): void
|
|
@@ -69,12 +78,20 @@ watch(
|
|
|
69
78
|
submit()
|
|
70
79
|
}
|
|
71
80
|
)
|
|
81
|
+
const isParentDatacenter = (node: UI_I_TreeNode | null): boolean => {
|
|
82
|
+
if (!node) return false
|
|
83
|
+
|
|
84
|
+
if (node.parent?.type === 'datacenter') return true
|
|
85
|
+
if (node.parent?.type === 'folder') return isParentDatacenter(node.parent)
|
|
86
|
+
return false
|
|
87
|
+
}
|
|
72
88
|
const submit = (): void => {
|
|
89
|
+
const isDatacenterFolder = isParentDatacenter(selectedNode.value)
|
|
73
90
|
if (
|
|
74
91
|
!selectedNode.value ||
|
|
75
92
|
!compatibilityText.value[1] ||
|
|
76
93
|
selectedNode.value.type === 'datacenter' ||
|
|
77
|
-
selectedNode.value.type === 'folder' ||
|
|
94
|
+
selectedNode.value.type === 'folder' && !isDatacenterFolder ||
|
|
78
95
|
(selectedNode.value.type === 'cluster' && !selectedNode.value.nodes.length)
|
|
79
96
|
) {
|
|
80
97
|
showValidationErrors(
|
|
@@ -112,7 +129,10 @@ const compatibilityText = computed<[boolean, string]>(() => {
|
|
|
112
129
|
localization.value.compatibilityChecksSucceeded,
|
|
113
130
|
]
|
|
114
131
|
|
|
115
|
-
if (
|
|
132
|
+
if (
|
|
133
|
+
selectedNode.value.type === 'datacenter' ||
|
|
134
|
+
selectedNode.value.type === 'folder'
|
|
135
|
+
) {
|
|
116
136
|
res = [false, localization.value.selectValidClusterOrHostDestination]
|
|
117
137
|
}
|
|
118
138
|
if (selectedNode.value.type === 'cluster') {
|
|
@@ -61,6 +61,14 @@ watch(
|
|
|
61
61
|
submit()
|
|
62
62
|
}
|
|
63
63
|
)
|
|
64
|
+
|
|
65
|
+
const isParentDatacenter = (node: UI_I_TreeNode | null): boolean => {
|
|
66
|
+
if (!node) return false
|
|
67
|
+
|
|
68
|
+
if (node.parent?.type === 'datacenter') return true
|
|
69
|
+
if (node.parent?.type === 'folder') return isParentDatacenter(node.parent)
|
|
70
|
+
return false
|
|
71
|
+
}
|
|
64
72
|
const submit = async (): Promise<void> => {
|
|
65
73
|
const name = vmName.value
|
|
66
74
|
|
|
@@ -70,7 +78,9 @@ const submit = async (): Promise<void> => {
|
|
|
70
78
|
}
|
|
71
79
|
|
|
72
80
|
if (props.project === 'sphere') {
|
|
73
|
-
|
|
81
|
+
const isDatacenterFolder = isParentDatacenter(selectedNode.value)
|
|
82
|
+
|
|
83
|
+
if (selectedNode.value?.type !== 'datacenter' && selectedNode.value?.type === 'folder' && !isDatacenterFolder) {
|
|
74
84
|
showValidationErrors([
|
|
75
85
|
localization.value.enterValidLocationVirtualMachine,
|
|
76
86
|
])
|
|
@@ -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,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_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 {
|
|
@@ -87,3 +87,121 @@ export interface UI_I_EditVmPayload {
|
|
|
87
87
|
vmId: string
|
|
88
88
|
body: UI_I_CreateVmData
|
|
89
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
|
+
}
|