ui: dashboard: nicely display kernel version

Extract and display the build version and kernel
release nicely.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Gabriel Goller 2023-11-29 14:29:01 +01:00 committed by Wolfgang Bumiller
parent de99031e49
commit 487922752b

View File

@ -140,11 +140,20 @@ Ext.define('PBS.NodeInfoPanel', {
value: '',
},
{
itemId: 'kversion',
colspan: 2,
title: gettext('Kernel Version'),
printBar: false,
textField: 'kversion',
// TODO: remove with next major and only use newish current-kernel textfield
multiField: true,
//textField: 'current-kernel',
renderer: ({ data }) => {
if (!data['current-kernel']) {
return data.kversion;
}
let kernel = data['current-kernel'];
let buildDate = kernel.version.match(/\((.+)\)\s*$/)[1] ?? 'unknown';
return `${kernel.sysname} ${kernel.release} (${buildDate})`;
},
value: '',
},
{