* [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu()
@ 2024-07-17 12:49 Christoph Heiss
2024-07-17 12:49 ` [pve-devel] [PATCH manager 2/2] www: utils: fix inconsistency in host cpu usage display in search view Christoph Heiss
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christoph Heiss @ 2024-07-17 12:49 UTC (permalink / raw)
To: pve-devel
Comparing with Proxmox.Utils.render_cpu() seems just a slight oversight
in the condition. Fix it by aligning it with how it is done in
Proxmox.Utils.render_cpu() for consistency.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
www/manager6/Utils.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index f5608944d..ddef11bb1 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1073,7 +1073,7 @@ Ext.define('PVE.Utils', {
}
var maxcpu = node.data.maxcpu || 1;
- if (!Ext.isNumeric(maxcpu) && (maxcpu >= 1)) {
+ if (!Ext.isNumeric(maxcpu) || maxcpu < 1) {
return '';
}
--
2.45.1
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH manager 2/2] www: utils: fix inconsistency in host cpu usage display in search view
2024-07-17 12:49 [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu() Christoph Heiss
@ 2024-07-17 12:49 ` Christoph Heiss
2024-07-17 12:51 ` [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu() Christoph Heiss
2024-07-22 16:36 ` [pve-devel] applied-series: " Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Heiss @ 2024-07-17 12:49 UTC (permalink / raw)
To: pve-devel
Between the number of CPUs and the actual label, a space was missing -
resulting in an inconsistency vs. the "CPU usage" column.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
www/manager6/Utils.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index ddef11bb1..6a0ecc98f 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1078,8 +1078,9 @@ Ext.define('PVE.Utils', {
}
var per = (record.data.cpu/maxcpu) * record.data.maxcpu * 100;
+ const cpu_label = maxcpu > 1 ? 'CPUs' : 'CPU';
- return per.toFixed(1) + '% of ' + maxcpu.toString() + (maxcpu > 1 ? 'CPUs' : 'CPU');
+ return `${per.toFixed(1)}% of ${maxcpu} ${cpu_label}`;
},
render_bandwidth: function(value) {
--
2.45.1
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu()
2024-07-17 12:49 [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu() Christoph Heiss
2024-07-17 12:49 ` [pve-devel] [PATCH manager 2/2] www: utils: fix inconsistency in host cpu usage display in search view Christoph Heiss
@ 2024-07-17 12:51 ` Christoph Heiss
2024-07-22 16:36 ` [pve-devel] applied-series: " Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Heiss @ 2024-07-17 12:51 UTC (permalink / raw)
Cc: Proxmox VE development discussion
Should be marked [v2] obviously, with v1 here [0].
Sorry for the noise, noticed it only after hitting send.
[0] https://lists.proxmox.com/pipermail/pve-devel/2024-July/064681.html
On Wed, Jul 17, 2024 at 02:49:50PM GMT, Christoph Heiss wrote:
> Comparing with Proxmox.Utils.render_cpu() seems just a slight oversight
> in the condition. Fix it by aligning it with how it is done in
> Proxmox.Utils.render_cpu() for consistency.
>
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> www/manager6/Utils.js | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
> index f5608944d..ddef11bb1 100644
> --- a/www/manager6/Utils.js
> +++ b/www/manager6/Utils.js
> @@ -1073,7 +1073,7 @@ Ext.define('PVE.Utils', {
> }
> var maxcpu = node.data.maxcpu || 1;
>
> - if (!Ext.isNumeric(maxcpu) && (maxcpu >= 1)) {
> + if (!Ext.isNumeric(maxcpu) || maxcpu < 1) {
> return '';
> }
>
> --
> 2.45.1
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] applied-series: [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu()
2024-07-17 12:49 [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu() Christoph Heiss
2024-07-17 12:49 ` [pve-devel] [PATCH manager 2/2] www: utils: fix inconsistency in host cpu usage display in search view Christoph Heiss
2024-07-17 12:51 ` [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu() Christoph Heiss
@ 2024-07-22 16:36 ` Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2024-07-22 16:36 UTC (permalink / raw)
To: Proxmox VE development discussion, Christoph Heiss
Am 17/07/2024 um 14:49 schrieb Christoph Heiss:
> Comparing with Proxmox.Utils.render_cpu() seems just a slight oversight
> in the condition. Fix it by aligning it with how it is done in
> Proxmox.Utils.render_cpu() for consistency.
>
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> www/manager6/Utils.js | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
applied both patches, thanks!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-22 16:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17 12:49 [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu() Christoph Heiss
2024-07-17 12:49 ` [pve-devel] [PATCH manager 2/2] www: utils: fix inconsistency in host cpu usage display in search view Christoph Heiss
2024-07-17 12:51 ` [pve-devel] [PATCH manager 1/2] www: utils: fix `maxcpu` validity check in render_hostcpu() Christoph Heiss
2024-07-22 16:36 ` [pve-devel] applied-series: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox