mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-09 18:42:31 +00:00
ui: package versions: code cleanup, use template strings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b64dd8c8a5
commit
3ddcdadce1
@ -34,7 +34,7 @@ Ext.define('PVE.node.Summary', {
|
|||||||
|
|
||||||
Proxmox.Utils.API2Request({
|
Proxmox.Utils.API2Request({
|
||||||
waitMsgTarget: me,
|
waitMsgTarget: me,
|
||||||
url: "/nodes/" + nodename + "/apt/versions",
|
url: `/nodes/${nodename}/apt/versions`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
failure: function(response, opts) {
|
failure: function(response, opts) {
|
||||||
win.close();
|
win.close();
|
||||||
@ -42,22 +42,19 @@ Ext.define('PVE.node.Summary', {
|
|||||||
},
|
},
|
||||||
success: function(response, opts) {
|
success: function(response, opts) {
|
||||||
win.show();
|
win.show();
|
||||||
var text = '';
|
let text = '';
|
||||||
|
|
||||||
Ext.Array.each(response.result.data, function(rec) {
|
Ext.Array.each(response.result.data, function(rec) {
|
||||||
var version = "not correctly installed";
|
let version = "not correctly installed";
|
||||||
var pkg = rec.Package;
|
let pkg = rec.Package;
|
||||||
if (rec.OldVersion && rec.CurrentState === 'Installed') {
|
if (rec.OldVersion && rec.CurrentState === 'Installed') {
|
||||||
version = rec.OldVersion;
|
version = rec.OldVersion;
|
||||||
}
|
}
|
||||||
if (rec.RunningKernel) {
|
if (rec.RunningKernel) {
|
||||||
text += pkg + ': ' + version + ' (running kernel: ' +
|
text += `${pkg}: ${version} (running kernel: ${rec.RunningKernel})\n`;
|
||||||
rec.RunningKernel + ')\n';
|
|
||||||
} else if (rec.ManagerVersion) {
|
} else if (rec.ManagerVersion) {
|
||||||
text += pkg + ': ' + version + ' (running version: ' +
|
text += `${pkg}: ${version} (running version: ${rec.ManagerVersion})\n`;
|
||||||
rec.ManagerVersion + ')\n';
|
|
||||||
} else {
|
} else {
|
||||||
text += pkg + ': ' + version + '\n';
|
text += `${pkg}: ${version}\n`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user