public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] applied: [PATCH gui 1/4] dashboard: reduce noise in current kernel version
@ 2024-02-26 16:28 Thomas Lamprecht
  2024-02-26 16:28 ` [pmg-devel] applied: [PATCH gui 2/4] dashboard: show boot-mode information Thomas Lamprecht
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2024-02-26 16:28 UTC (permalink / raw)
  To: pmg-devel

use the new 'current-kernel' object returned by the node status API to
render a more usable (less noise) version information.

Keep fallback for old one to better work with upgrades (major and
minor) to this version in a cluster, where the web UI one uses might
be the new one, but a node one looks at still have the old API daemon.

Mirrors commit be04f8ee ("ui: node summary: reduce noise in current
kernel version") and commit 4fb7e9e4 ("fix #5121: ui: node status:
avoid invalid array access for certain foreign kernels") from
pve-manager.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 js/dashboard/NodeInfo.js | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/js/dashboard/NodeInfo.js b/js/dashboard/NodeInfo.js
index 99eb4d3..1c3cfa3 100644
--- a/js/dashboard/NodeInfo.js
+++ b/js/dashboard/NodeInfo.js
@@ -84,11 +84,20 @@ Ext.define('PMG.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: '',
 	},
 	{
-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pmg-devel] applied: [PATCH gui 2/4] dashboard: show boot-mode information
  2024-02-26 16:28 [pmg-devel] applied: [PATCH gui 1/4] dashboard: reduce noise in current kernel version Thomas Lamprecht
@ 2024-02-26 16:28 ` Thomas Lamprecht
  2024-02-26 16:28 ` [pmg-devel] applied [PATCH gui 3/4] dashboard: increase height of node-info and top-receiver panel to 300 Thomas Lamprecht
  2024-02-26 16:28 ` [pmg-devel] applied: [PATCH gui 4/4] dashboard: show ten of the current top receiver Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2024-02-26 16:28 UTC (permalink / raw)
  To: pmg-devel

Add a extra row for showing the current boot mode, for that we need to
grow the height of the status panel and graphs to have enough space
again.

Mirrors commit 1f1d8bf3 ("ui: node summary: add boot-mode
information") from pve-manager.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 js/dashboard/NodeInfo.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/js/dashboard/NodeInfo.js b/js/dashboard/NodeInfo.js
index 1c3cfa3..e144e42 100644
--- a/js/dashboard/NodeInfo.js
+++ b/js/dashboard/NodeInfo.js
@@ -100,6 +100,21 @@ Ext.define('PMG.NodeInfoPanel', {
 	    },
 	    value: '',
 	},
+	{
+	    colspan: 2,
+	    title: gettext('Boot Mode'),
+	    printBar: false,
+	    textField: 'boot-info',
+	    renderer: boot => {
+		if (boot.mode === 'legacy-bios') {
+		    return 'Legacy BIOS';
+		} else if (boot.mode === 'efi') {
+		    return `EFI${boot.secureboot ? ' (Secure Boot)' : ''}`;
+		}
+		return Proxmox.Utils.unknownText;
+	    },
+	    value: '',
+	},
 	{
 	    xtype: 'pmxNodeInfoRepoStatus',
 	    itemId: 'repositoryStatus',
-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pmg-devel] applied [PATCH gui 3/4] dashboard: increase height of node-info and top-receiver panel to 300
  2024-02-26 16:28 [pmg-devel] applied: [PATCH gui 1/4] dashboard: reduce noise in current kernel version Thomas Lamprecht
  2024-02-26 16:28 ` [pmg-devel] applied: [PATCH gui 2/4] dashboard: show boot-mode information Thomas Lamprecht
@ 2024-02-26 16:28 ` Thomas Lamprecht
  2024-02-26 16:28 ` [pmg-devel] applied: [PATCH gui 4/4] dashboard: show ten of the current top receiver Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2024-02-26 16:28 UTC (permalink / raw)
  To: pmg-devel

Now that the node info one got another row we can use a bit more space
to avoid that it feels to crammed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 js/Dashboard.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/js/Dashboard.js b/js/Dashboard.js
index a08e2c9..d03510e 100644
--- a/js/Dashboard.js
+++ b/js/Dashboard.js
@@ -418,12 +418,12 @@ Ext.define('PMG.Dashboard', {
 	{
 	    xtype: 'pmgNodeInfoPanel',
 	    reference: 'nodeInfo',
-	    height: 275,
+	    height: 300,
 	    bodyPadding: '15 5 15 5',
 	    iconCls: 'fa fa-tasks',
 	},
 	{
-	    height: 275,
+	    height: 300,
 	    iconCls: 'fa fa-list',
 	    title: gettext('Top Receivers'),
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pmg-devel] applied: [PATCH gui 4/4] dashboard: show ten of the current top receiver
  2024-02-26 16:28 [pmg-devel] applied: [PATCH gui 1/4] dashboard: reduce noise in current kernel version Thomas Lamprecht
  2024-02-26 16:28 ` [pmg-devel] applied: [PATCH gui 2/4] dashboard: show boot-mode information Thomas Lamprecht
  2024-02-26 16:28 ` [pmg-devel] applied [PATCH gui 3/4] dashboard: increase height of node-info and top-receiver panel to 300 Thomas Lamprecht
@ 2024-02-26 16:28 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2024-02-26 16:28 UTC (permalink / raw)
  To: pmg-devel

not only five, as with the higher panels we already got enough space,
as one row needs roughly 24 px, lower top/bottom padding a bit to get
~242 of space, fitting ten entries nicely.

The performance aspect should not matter much, getting five or ten
entries from a DB like PostgreSQL is really not costing much,
especially as with the count query in use the hard work has already
been done anyway.

Makes the top-receiver panel look a bit more coherent compared to the
node info one beside it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 js/Dashboard.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/js/Dashboard.js b/js/Dashboard.js
index d03510e..9c51734 100644
--- a/js/Dashboard.js
+++ b/js/Dashboard.js
@@ -283,6 +283,7 @@ Ext.define('PMG.Dashboard', {
 		    url: '/api2/json/statistics/recentreceivers',
 		    extraParams: {
 			hours: '{hours}',
+			limit: 10, // make this also configurable?
 		    },
 		},
 		fields: [
@@ -427,7 +428,7 @@ Ext.define('PMG.Dashboard', {
 	    iconCls: 'fa fa-list',
 	    title: gettext('Top Receivers'),
 
-	    bodyPadding: '20 20 20 20',
+	    bodyPadding: '10 10 10 10',
 	    layout: {
 		type: 'vbox',
 		pack: 'center',
-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-26 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-26 16:28 [pmg-devel] applied: [PATCH gui 1/4] dashboard: reduce noise in current kernel version Thomas Lamprecht
2024-02-26 16:28 ` [pmg-devel] applied: [PATCH gui 2/4] dashboard: show boot-mode information Thomas Lamprecht
2024-02-26 16:28 ` [pmg-devel] applied [PATCH gui 3/4] dashboard: increase height of node-info and top-receiver panel to 300 Thomas Lamprecht
2024-02-26 16:28 ` [pmg-devel] applied: [PATCH gui 4/4] dashboard: show ten of the current top receiver Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal