bfg-common 1.3.110 → 1.3.112
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.
- package/components/atoms/dropdown/tree/Tree.vue +1 -0
- package/components/atoms/dropdown/tree/lib/models/interfaces.ts +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +3 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +3 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces.ts +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +170 -157
- package/components/common/vm/actions/common/lib/models/interfaces.ts +1 -1
- package/components/common/vm/actions/lib/utils.ts +1 -1
- package/lib/models/store/vm/interfaces.ts +1 -1
- package/package.json +1 -1
package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue
CHANGED
|
@@ -104,6 +104,8 @@
|
|
|
104
104
|
:error-validation-fields="props.errorValidationFields"
|
|
105
105
|
:passthrough-devices="props.passthroughDevices"
|
|
106
106
|
:type="pciDevicesType[key]"
|
|
107
|
+
:is-edit="props.isEdit"
|
|
108
|
+
:state="props.state"
|
|
107
109
|
@remove="onRemovePciDevice(pciDevicesIndex[key])"
|
|
108
110
|
@send-data="
|
|
109
111
|
onSendDataPciDevicesMethod($event, pciDevicesIndex[key])
|
|
@@ -222,7 +224,7 @@ const localization = computed<UI_I_Localization>(() => useLocal())
|
|
|
222
224
|
const { $binary } = useNuxtApp()
|
|
223
225
|
|
|
224
226
|
const dropdownItems = computed<UI_I_DropdownTreeItem[]>(() =>
|
|
225
|
-
dropdownItemsFunc(localization.value)
|
|
227
|
+
dropdownItemsFunc(localization.value, props.state)
|
|
226
228
|
)
|
|
227
229
|
|
|
228
230
|
const hardDisksIndex = ref<number[]>([0])
|
|
@@ -2,7 +2,8 @@ import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
|
2
2
|
import { UI_I_DropdownTreeItem } from '~/components/atoms/dropdown/tree/lib/models/interfaces'
|
|
3
3
|
|
|
4
4
|
export const dropdownItemsFunc = (
|
|
5
|
-
localization: UI_I_Localization
|
|
5
|
+
localization: UI_I_Localization,
|
|
6
|
+
state: string | number | undefined
|
|
6
7
|
): UI_I_DropdownTreeItem[] => {
|
|
7
8
|
const { $text } = useNuxtApp()
|
|
8
9
|
|
|
@@ -33,7 +34,7 @@ export const dropdownItemsFunc = (
|
|
|
33
34
|
{
|
|
34
35
|
text: 'Other Devices',
|
|
35
36
|
children: [
|
|
36
|
-
{ text: 'PCI Device', value: 10 },
|
|
37
|
+
{ text: 'PCI Device', value: 10, disabled: state === 2 },
|
|
37
38
|
// { text: 'Watchdog Timer', value: 11 },
|
|
38
39
|
// { text: 'Precision Clock', value: 12 },
|
|
39
40
|
// { text: 'Serial Port', value: 13 },
|
|
@@ -1,157 +1,170 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="hardware-pci-device">
|
|
3
|
-
<atoms-stack-block
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} from '~/lib/models/
|
|
54
|
-
import {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} from '~/
|
|
58
|
-
import {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="hardware-pci-device">
|
|
3
|
+
<atoms-stack-block
|
|
4
|
+
:has-children="true"
|
|
5
|
+
:removable="isRemovable"
|
|
6
|
+
@remove="removePciDevice"
|
|
7
|
+
>
|
|
8
|
+
<template #stackBlockKey>
|
|
9
|
+
<div class="flex-align-center">
|
|
10
|
+
<span>{{ label }}</span>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
<template #stackBlockContent>
|
|
14
|
+
<span class="main-label">
|
|
15
|
+
{{ selectedLabel }}
|
|
16
|
+
</span>
|
|
17
|
+
</template>
|
|
18
|
+
<template #stackChildren>
|
|
19
|
+
<template v-if="props.type === 'new'">
|
|
20
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device-type-selection
|
|
21
|
+
v-model="selectedType"
|
|
22
|
+
:options="pciDeviceTypeOptions"
|
|
23
|
+
:pci-device-index="props.index"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device-direct-path-io
|
|
27
|
+
v-show="selectedType.value === 'direct_path_io'"
|
|
28
|
+
v-model="directPathIo"
|
|
29
|
+
:pci-device-index="props.index"
|
|
30
|
+
:passthrough-devices="props.passthroughDevices"
|
|
31
|
+
/>
|
|
32
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device-dynamic-direct-path-io
|
|
33
|
+
v-show="selectedType.value === 'dynamic_direct_path_io'"
|
|
34
|
+
v-model="dynamicDirectPathIo"
|
|
35
|
+
:pci-device-index="props.index"
|
|
36
|
+
:passthrough-devices="props.passthroughDevices"
|
|
37
|
+
/>
|
|
38
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device-nvidia-grid
|
|
39
|
+
v-show="selectedType.value === 'nvidia_grid'"
|
|
40
|
+
v-model="nvidiaGridProfile"
|
|
41
|
+
:pci-device-index="props.index"
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device-note />
|
|
46
|
+
</template>
|
|
47
|
+
</atoms-stack-block>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
53
|
+
import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
54
|
+
import {
|
|
55
|
+
UI_I_ConfigureAllPciDevicesItem,
|
|
56
|
+
UI_I_ConfigurePciDevicesTable,
|
|
57
|
+
} from '~/lib/models/store/host/interfaces'
|
|
58
|
+
import {
|
|
59
|
+
UI_I_PciDevice,
|
|
60
|
+
UI_I_SendDataNewPciDevice,
|
|
61
|
+
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
62
|
+
import { UI_T_PciDeviceType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
|
|
63
|
+
import { pciDeviceTypeOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/lib/config/options'
|
|
64
|
+
|
|
65
|
+
const props = defineProps<{
|
|
66
|
+
index: number
|
|
67
|
+
pciDevice: UI_I_PciDevice
|
|
68
|
+
passthroughDevices: UI_I_ConfigurePciDevicesTable
|
|
69
|
+
type: UI_T_PciDeviceType
|
|
70
|
+
isEdit: boolean
|
|
71
|
+
state?: string | number
|
|
72
|
+
// errorValidationFields: UI_I_ErrorValidationField<string>[]
|
|
73
|
+
}>()
|
|
74
|
+
const emits = defineEmits<{
|
|
75
|
+
(event: 'send-data', value: UI_I_SendDataNewPciDevice): void
|
|
76
|
+
(event: 'remove'): void
|
|
77
|
+
}>()
|
|
78
|
+
|
|
79
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
80
|
+
|
|
81
|
+
const isRunning = computed<boolean>(() => {
|
|
82
|
+
return props.state === 2
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const isRemovable = computed<boolean>(() => {
|
|
86
|
+
return !props.isEdit || !isRunning.value
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const label = computed<string>(() => {
|
|
90
|
+
if (props.type === 'edit')
|
|
91
|
+
return `${localization.value.newPciDevice} ${props.index + 1}`
|
|
92
|
+
|
|
93
|
+
return `${localization.value.pciDevice} *`
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const selectedLabel = computed<string>(() => {
|
|
97
|
+
switch (selectedType.value.value) {
|
|
98
|
+
case 'direct_path_io':
|
|
99
|
+
return `${directPathIo.value.address}|${directPathIo.value.device_name}`
|
|
100
|
+
case 'dynamic_direct_path_io':
|
|
101
|
+
return dynamicDirectPathIo.value
|
|
102
|
+
default:
|
|
103
|
+
return nvidiaGridProfile.value
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
const pciDeviceTypeOptions = ref<UI_I_OptionItem[]>(pciDeviceTypeOptionsConfig)
|
|
108
|
+
const selectedType = ref<UI_I_OptionItem>(pciDeviceTypeOptionsConfig[0])
|
|
109
|
+
|
|
110
|
+
const directPathIo = ref<UI_I_ConfigureAllPciDevicesItem>(
|
|
111
|
+
props.passthroughDevices[0]
|
|
112
|
+
)
|
|
113
|
+
const dynamicDirectPathIo = ref<string>('')
|
|
114
|
+
const nvidiaGridProfile = ref<string>('')
|
|
115
|
+
|
|
116
|
+
watch(
|
|
117
|
+
props.pciDevice,
|
|
118
|
+
(newValue) => {
|
|
119
|
+
const passthroughDevice = props.passthroughDevices.find(
|
|
120
|
+
(item) => item.address === newValue.address
|
|
121
|
+
)
|
|
122
|
+
passthroughDevice && (directPathIo.value = passthroughDevice) // Todo change
|
|
123
|
+
},
|
|
124
|
+
{ immediate: true }
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
const sendData = computed<UI_I_SendDataNewPciDevice>(() => {
|
|
128
|
+
switch (selectedType.value.value) {
|
|
129
|
+
case 'direct_path_io':
|
|
130
|
+
return {
|
|
131
|
+
address: directPathIo.value.address,
|
|
132
|
+
vendor_name: directPathIo.value.vendor_name,
|
|
133
|
+
class_name: directPathIo.value.class_name,
|
|
134
|
+
device_name: directPathIo.value.device_name,
|
|
135
|
+
}
|
|
136
|
+
case 'dynamic_direct_path_io':
|
|
137
|
+
return {
|
|
138
|
+
address: '',
|
|
139
|
+
vendor_name: '',
|
|
140
|
+
class_name: '',
|
|
141
|
+
device_name: '',
|
|
142
|
+
}
|
|
143
|
+
default:
|
|
144
|
+
return {
|
|
145
|
+
address: '',
|
|
146
|
+
vendor_name: '',
|
|
147
|
+
class_name: '',
|
|
148
|
+
device_name: '',
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
watch(
|
|
154
|
+
sendData,
|
|
155
|
+
(newValue) => {
|
|
156
|
+
emits('send-data', newValue)
|
|
157
|
+
},
|
|
158
|
+
{ immediate: true }
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
const removePciDevice = (): void => {
|
|
162
|
+
emits('remove')
|
|
163
|
+
}
|
|
164
|
+
</script>
|
|
165
|
+
|
|
166
|
+
<style scoped lang="scss">
|
|
167
|
+
#network-connect {
|
|
168
|
+
margin-right: 4px;
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -129,7 +129,7 @@ export interface UI_I_CreateVmData {
|
|
|
129
129
|
| UI_I_CreateVmDataCdDvdDevice
|
|
130
130
|
)[]
|
|
131
131
|
network_devices: UI_I_SendDataNewNetwork[]
|
|
132
|
-
|
|
132
|
+
passthrough_pci_devices: UI_I_SendDataNewPciDevice[]
|
|
133
133
|
options: UI_I_SendDataVmoptions
|
|
134
134
|
storage: UI_I_CreateVmDataStorage
|
|
135
135
|
cpu: UI_I_CreateVmDataCpu
|
|
@@ -208,6 +208,6 @@ export interface API_UI_I_VmReadyToComplete {
|
|
|
208
208
|
storage: API_UI_I_VmReadyToCompleteStorage
|
|
209
209
|
usb_controllers: API_UI_I_VmReadyToCompleteUsbController[]
|
|
210
210
|
video_card: API_UI_I_VmReadyToCompleteVideoCard
|
|
211
|
-
|
|
211
|
+
passthrough_pci_devices: API_UI_I_VmReadyToCompletePciDevice[]
|
|
212
212
|
}
|
|
213
213
|
}
|