the stacked graphs had more information, namely how much memory was
available and how much was used without the ZFS ARC. So put this
information into the tooltip where the users most likely want to see it.

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
not sure if this is wanted/needed, since we did not have that
information before either. (But I think it's nice to have)

 www/manager6/node/Summary.js | 60 +++++++++++++++++++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)

diff --git a/www/manager6/node/Summary.js b/www/manager6/node/Summary.js
index c7a33c51..e51e8ba0 100644
--- a/www/manager6/node/Summary.js
+++ b/www/manager6/node/Summary.js
@@ -177,7 +177,65 @@ Ext.define('PVE.node.Summary', {
                         {
                             xtype: 'proxmoxRRDChart',
                             title: gettext('Memory usage'),
-                            fields: ['memtotal', 'memused', 'arcsize'],
+                            fields: [
+                                {
+                                    yField: 'memtotal',
+                                    title: gettext('Total'),
+                                    tooltip: {
+                                        trackMouse: true,
+                                        renderer: function (toolTip, record, 
item) {
+                                            let value = record.get('memtotal');
+
+                                            if (value === null) {
+                                                toolTip.setHtml(gettext('No 
Data'));
+                                            } else {
+                                                let total = 
Proxmox.Utils.format_size(value);
+                                                let time = new 
Date(record.get('time'));
+
+                                                let avail = 
record.get('memavailable');
+                                                let availText = '';
+                                                if (Ext.isNumeric(avail)) {
+                                                    let v = 
Proxmox.Utils.format_size(avail);
+                                                    availText = ` 
(${gettext('Available')}: ${v})`;
+                                                }
+
+                                                toolTip.setHtml(
+                                                    `${gettext('Total')}: 
${total}${availText}<br>${time}`,
+                                                );
+                                            }
+                                        },
+                                    },
+                                },
+                                {
+                                    yField: 'memused',
+                                    title: gettext('Used'),
+                                    tooltip: {
+                                        trackMouse: true,
+                                        renderer: function (toolTip, record, 
item) {
+                                            let value = record.get('memused');
+
+                                            if (value === null) {
+                                                toolTip.setHtml(gettext('No 
Data'));
+                                            } else {
+                                                let total = 
Proxmox.Utils.format_size(value);
+                                                let time = new 
Date(record.get('time'));
+
+                                                let arc = 
record.get('arcsize');
+                                                let arcText = '';
+                                                if (Ext.isNumeric(arc)) {
+                                                    let v = 
Proxmox.Utils.format_size(value - arc);
+                                                    arcText = ` 
(${gettext('Without ZFS ARC')}: ${v})`;
+                                                }
+
+                                                toolTip.setHtml(
+                                                    `${gettext('Used')}: 
${total}${arcText}<br>${time}`,
+                                                );
+                                            }
+                                        },
+                                    },
+                                },
+                                'arcsize',
+                            ],
                             fieldTitles: [gettext('Total'), gettext('Used'), 
gettext('ZFS ARC')],
                             colors: ['#94ae0a', '#115fa6', '#7c7474'],
                             unit: 'bytes',
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to