feat(xo-web,xo-server): expose VM Xen Tools version (#2838)
Fixes #2650
This commit is contained in:
parent
5cb6dc6d92
commit
51609d45a2
@ -232,13 +232,11 @@ const TRANSFORMS = {
|
||||
}
|
||||
|
||||
const { major, minor } = guestMetrics.PV_drivers_version
|
||||
const [hostMajor, hostMinor] = (
|
||||
obj.$resident_on || obj.$pool.$master
|
||||
).software_version.product_version.split('.')
|
||||
|
||||
return major >= hostMajor && minor >= hostMinor
|
||||
? 'up to date'
|
||||
: 'out of date'
|
||||
return {
|
||||
major,
|
||||
minor,
|
||||
}
|
||||
})()
|
||||
|
||||
let resourceSet = otherConfig['xo:resource_set']
|
||||
|
@ -894,12 +894,7 @@ const messages = {
|
||||
cpuCapLabel: 'CPU cap',
|
||||
defaultCpuCap: 'Default ({value, number})',
|
||||
pvArgsLabel: 'PV args',
|
||||
xenToolsStatus: 'Xen tools status',
|
||||
xenToolsStatusValue: {
|
||||
defaultMessage: '{status}',
|
||||
description:
|
||||
'status can be `not-installed`, `unknown`, `out-of-date` & `up-to-date`',
|
||||
},
|
||||
xenToolsStatus: 'Xen tools version',
|
||||
osName: 'OS name',
|
||||
osKernel: 'OS kernel',
|
||||
autoPowerOn: 'Auto power on',
|
||||
|
@ -219,21 +219,6 @@ export const parseSize = size => {
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
export const normalizeXenToolsStatus = status => {
|
||||
if (status === false) {
|
||||
return 'not-installed'
|
||||
}
|
||||
if (status === undefined) {
|
||||
return 'unknown'
|
||||
}
|
||||
if (status === 'up to date') {
|
||||
return 'up-to-date'
|
||||
}
|
||||
return 'out-of-date'
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
const _NotFound = () => <h1>{_('errorPageNotFound')}</h1>
|
||||
|
||||
// Decorator to declare routes on a component.
|
||||
|
@ -20,7 +20,6 @@ import {
|
||||
connectStore,
|
||||
formatSize,
|
||||
getCoresPerSocketPossibilities,
|
||||
normalizeXenToolsStatus,
|
||||
osFamily,
|
||||
} from 'utils'
|
||||
import {
|
||||
@ -561,9 +560,7 @@ export default connectStore(() => {
|
||||
<tr>
|
||||
<th>{_('xenToolsStatus')}</th>
|
||||
<td>
|
||||
{_('xenToolsStatusValue', {
|
||||
status: normalizeXenToolsStatus(vm.xenTools),
|
||||
})}
|
||||
{vm.xenTools && `${vm.xenTools.major}.${vm.xenTools.minor}`}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
Loading…
Reference in New Issue
Block a user