feat(xo-web/VM/advanced): handle pv_in_pvh virtualization mode (#5857)

And handle unknown virtualization modes by showing the raw string
This commit is contained in:
Pierre Donias 2021-07-28 18:41:22 +02:00 committed by GitHub
parent 20a6428290
commit 175be44823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 3 deletions

View File

@ -27,3 +27,5 @@
> - major: if the change breaks compatibility
>
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- xo-web minor

View File

@ -1032,6 +1032,7 @@ const messages = {
paraVirtualizedMode: 'Paravirtualization (PV)',
hardwareVirtualizedMode: 'Hardware virtualization (HVM)',
hvmModeWithPvDriversEnabled: 'Hardware virtualization with paravirtualization drivers enabled (PVHVM)',
pvInPvhMode: 'PV inside a PVH container (PV in PVH)',
windowsUpdateTools: 'Windows Update tools',
// ----- VM stat tab -----

View File

@ -34,6 +34,7 @@ export const VIRTUALIZATION_MODE_LABEL = {
hvm: 'hardwareVirtualizedMode',
pv: 'paraVirtualizedMode',
pvhvm: 'hvmModeWithPvDriversEnabled',
pv_in_pvh: 'pvInPvhMode',
}
// ===================================================================
@ -44,8 +45,9 @@ export addSubscriptions from './add-subscriptions'
export const getVirtualizationModeLabel = vm => {
const virtualizationMode = vm.virtualizationMode === 'hvm' && vm.pvDriversDetected ? 'pvhvm' : vm.virtualizationMode
const messageId = VIRTUALIZATION_MODE_LABEL[virtualizationMode]
return VIRTUALIZATION_MODE_LABEL[virtualizationMode]
return messageId === undefined ? virtualizationMode : _(messageId)
}
// ===================================================================

View File

@ -585,7 +585,7 @@ export default class TabAdvanced extends Component {
<tr>
<th>{_('virtualizationMode')}</th>
<td>
{_(getVirtualizationModeLabel(vm))}{' '}
{getVirtualizationModeLabel(vm)}{' '}
{(vm.virtualizationMode === 'pv' || vm.virtualizationMode === 'hvm') && (
<ActionButton
btnStyle='danger'

View File

@ -180,7 +180,7 @@ export default connectStore(() => {
)}
</Col>
<Col mediumSize={3}>
<p>{_(getVirtualizationModeLabel(vm))}</p>
<p>{getVirtualizationModeLabel(vm)}</p>
{vgpu !== undefined && <p>{renderXoItem(vgpuTypes[vgpu.vgpuType])}</p>}
</Col>
<Col mediumSize={3}>