* [pve-devel] [PATCH pve-manager] ui: node summary: use SI units for HD usage
@ 2023-11-21 9:00 Christian Ebner
2023-11-21 9:58 ` Philipp Hufnagl
2023-11-21 10:05 ` Fiona Ebner
0 siblings, 2 replies; 5+ messages in thread
From: Christian Ebner @ 2023-11-21 9:00 UTC (permalink / raw)
To: pve-devel
SI units are used for storage size information, as typically used by
hard disk manufacturers.
Change the root filesystem usage values in the node summary to be
consistent.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
www/manager6/node/StatusView.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/www/manager6/node/StatusView.js b/www/manager6/node/StatusView.js
index d34724f7..a6975b6e 100644
--- a/www/manager6/node/StatusView.js
+++ b/www/manager6/node/StatusView.js
@@ -72,7 +72,9 @@ Ext.define('PVE.node.StatusView', {
title: '/ ' + gettext('HD space'),
valueField: 'rootfs',
maxField: 'rootfs',
- renderer: Proxmox.Utils.render_node_size_usage,
+ renderer: function(record) {
+ return Proxmox.Utils.render_size_usage(record.used, record.total, true);
+ },
},
{
iconCls: 'fa fa-fw fa-refresh',
--
2.39.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH pve-manager] ui: node summary: use SI units for HD usage
2023-11-21 9:00 [pve-devel] [PATCH pve-manager] ui: node summary: use SI units for HD usage Christian Ebner
@ 2023-11-21 9:58 ` Philipp Hufnagl
2023-11-21 10:05 ` Fiona Ebner
1 sibling, 0 replies; 5+ messages in thread
From: Philipp Hufnagl @ 2023-11-21 9:58 UTC (permalink / raw)
To: pve-devel
On 11/21/23 10:00, Christian Ebner wrote:
> SI units are used for storage size information, as typically used by
> hard disk manufacturers.
>
> Change the root filesystem usage values in the node summary to be
> consistent.
>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
> www/manager6/node/StatusView.js | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/www/manager6/node/StatusView.js b/www/manager6/node/StatusView.js
> index d34724f7..a6975b6e 100644
> --- a/www/manager6/node/StatusView.js
> +++ b/www/manager6/node/StatusView.js
> @@ -72,7 +72,9 @@ Ext.define('PVE.node.StatusView', {
> title: '/ ' + gettext('HD space'),
> valueField: 'rootfs',
> maxField: 'rootfs',
> - renderer: Proxmox.Utils.render_node_size_usage,
> + renderer: function(record) {
> + return Proxmox.Utils.render_size_usage(record.used, record.total, true);
> + },
> },
> {
> iconCls: 'fa fa-fw fa-refresh',
LGTM
Tested-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
Reviewed-by: Philipp Hufnagl <p.hufangl@proxmox.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH pve-manager] ui: node summary: use SI units for HD usage
2023-11-21 9:00 [pve-devel] [PATCH pve-manager] ui: node summary: use SI units for HD usage Christian Ebner
2023-11-21 9:58 ` Philipp Hufnagl
@ 2023-11-21 10:05 ` Fiona Ebner
2023-11-21 11:03 ` Christian Ebner
1 sibling, 1 reply; 5+ messages in thread
From: Fiona Ebner @ 2023-11-21 10:05 UTC (permalink / raw)
To: Proxmox VE development discussion, Christian Ebner
Am 21.11.23 um 10:00 schrieb Christian Ebner:
> diff --git a/www/manager6/node/StatusView.js b/www/manager6/node/StatusView.js
> index d34724f7..a6975b6e 100644
> --- a/www/manager6/node/StatusView.js
> +++ b/www/manager6/node/StatusView.js
> @@ -72,7 +72,9 @@ Ext.define('PVE.node.StatusView', {
> title: '/ ' + gettext('HD space'),
> valueField: 'rootfs',
> maxField: 'rootfs',
> - renderer: Proxmox.Utils.render_node_size_usage,
> + renderer: function(record) {
> + return Proxmox.Utils.render_size_usage(record.used, record.total, true);
> + },
Would it make more sense to change render_node_size_usage directly? Then
PMG and PBS would also get the change. Like this, it will be
inconsistent between the products, or?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH pve-manager] ui: node summary: use SI units for HD usage
2023-11-21 10:05 ` Fiona Ebner
@ 2023-11-21 11:03 ` Christian Ebner
2023-11-21 11:10 ` Christian Ebner
0 siblings, 1 reply; 5+ messages in thread
From: Christian Ebner @ 2023-11-21 11:03 UTC (permalink / raw)
To: Fiona Ebner, Proxmox VE development discussion
> On 21.11.2023 11:05 CET Fiona Ebner <f.ebner@proxmox.com> wrote:
>
>
> Am 21.11.23 um 10:00 schrieb Christian Ebner:
> > diff --git a/www/manager6/node/StatusView.js b/www/manager6/node/StatusView.js
> > index d34724f7..a6975b6e 100644
> > --- a/www/manager6/node/StatusView.js
> > +++ b/www/manager6/node/StatusView.js
> > @@ -72,7 +72,9 @@ Ext.define('PVE.node.StatusView', {
> > title: '/ ' + gettext('HD space'),
> > valueField: 'rootfs',
> > maxField: 'rootfs',
> > - renderer: Proxmox.Utils.render_node_size_usage,
> > + renderer: function(record) {
> > + return Proxmox.Utils.render_size_usage(record.used, record.total, true);
> > + },
>
> Would it make more sense to change render_node_size_usage directly? Then
> PMG and PBS would also get the change. Like this, it will be
> inconsistent between the products, or?
render_node_size_usage is used also for rendering memory size information, where we want IEC units.
Therefore, my initial approach was adding the `useSI` parameter to `render_node_size_usage` as second parameter, which however breaks all the other renderer invocations, I assume because the renderer invocation passes along multiple parameters.
This is why I opted for the invocation as is.
PBS already shows the HD usage values in SI units.
Cheers,
Chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH pve-manager] ui: node summary: use SI units for HD usage
2023-11-21 11:03 ` Christian Ebner
@ 2023-11-21 11:10 ` Christian Ebner
0 siblings, 0 replies; 5+ messages in thread
From: Christian Ebner @ 2023-11-21 11:10 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
> On 21.11.2023 12:03 CET Christian Ebner <c.ebner@proxmox.com> wrote:
>
>
> > On 21.11.2023 11:05 CET Fiona Ebner <f.ebner@proxmox.com> wrote:
> >
> >
> > Am 21.11.23 um 10:00 schrieb Christian Ebner:
> > > diff --git a/www/manager6/node/StatusView.js b/www/manager6/node/StatusView.js
> > > index d34724f7..a6975b6e 100644
> > > --- a/www/manager6/node/StatusView.js
> > > +++ b/www/manager6/node/StatusView.js
> > > @@ -72,7 +72,9 @@ Ext.define('PVE.node.StatusView', {
> > > title: '/ ' + gettext('HD space'),
> > > valueField: 'rootfs',
> > > maxField: 'rootfs',
> > > - renderer: Proxmox.Utils.render_node_size_usage,
> > > + renderer: function(record) {
> > > + return Proxmox.Utils.render_size_usage(record.used, record.total, true);
> > > + },
> >
> > Would it make more sense to change render_node_size_usage directly? Then
> > PMG and PBS would also get the change. Like this, it will be
> > inconsistent between the products, or?
>
> render_node_size_usage is used also for rendering memory size information, where we want IEC units.
>
> Therefore, my initial approach was adding the `useSI` parameter to `render_node_size_usage` as second parameter, which however breaks all the other renderer invocations, I assume because the renderer invocation passes along multiple parameters.
>
> This is why I opted for the invocation as is.
>
> PBS already shows the HD usage values in SI units.
>
> Cheers,
> Chris
Checked also how this is handled in PBS, also there the `render_size_usage` is invoked, see [0].
[0] https://git.proxmox.com/?p=proxmox-backup.git;a=blob;f=www/panel/NodeInfo.js;h=2551c9a55ba18a8cb6dbc095df94b650ed25eda2;hb=HEAD#l117
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-21 11:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 9:00 [pve-devel] [PATCH pve-manager] ui: node summary: use SI units for HD usage Christian Ebner
2023-11-21 9:58 ` Philipp Hufnagl
2023-11-21 10:05 ` Fiona Ebner
2023-11-21 11:03 ` Christian Ebner
2023-11-21 11:10 ` Christian Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox