[pve-devel] [PATCH manager v2 3/3] fix #1573: show bootdisk usage on container summary

Dominik Csapak d.csapak at proxmox.com
Fri Jan 26 13:36:25 CET 2018


we have the information, so show it
this does not change the output for vms, where we do not have
any information about disk usage at all

if we add the 'disk' info to vms, it will magically work there then

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* use the newly added features to dynamically show/hide the progressbar
  and use the correct renderer
 www/manager6/panel/GuestStatusView.js | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/www/manager6/panel/GuestStatusView.js b/www/manager6/panel/GuestStatusView.js
index a645d6f1..250a93a7 100644
--- a/www/manager6/panel/GuestStatusView.js
+++ b/www/manager6/panel/GuestStatusView.js
@@ -63,9 +63,18 @@ Ext.define('PVE.panel.GuestStatusView', {
 	{
 	    itemId: 'rootfs',
 	    title: gettext('Bootdisk size'),
-	    textField: 'maxdisk',
+	    valueField: 'disk',
+	    maxField: 'maxdisk',
 	    printBar: false,
-	    renderer: PVE.Utils.render_size
+	    renderer: function(used, max) {
+		var me = this;
+		me.setPrintBar(used > 0);
+		if (used === 0) {
+		    return PVE.Utils.render_size(max);
+		} else {
+		    return PVE.Utils.render_size_usage(used,max);
+		}
+	    }
 	}
     ],
 
-- 
2.11.0





More information about the pve-devel mailing list