vm.set('maintenance', '');
}
- let usage = statusData.used/statusData.total;
+ let total = statusData.avail + statusData.used;
+ let usage = statusData.used / total;
let usagetext = Ext.String.format(gettext('{0} of {1}'),
Proxmox.Utils.format_size(statusData.used, true),
- Proxmox.Utils.format_size(statusData.total, true),
+ Proxmox.Utils.format_size(total, true),
);
let usagePanel = me.lookup('usage');
fields: [
'used',
'total',
+ {
+ name: 'unpriv-total', // Can't resuse 'total' here as that creates a stack overflow
+ calculate: function(data) {
+ let used = data.used;
+ let avail = data.available;
+
+ if (avail && used) {
+ return avail + used;
+ }
+
+ return data.total;
+ },
+ },
+ 'available',
'read_ios',
'read_bytes',
'write_ios',
let vm = me.getViewModel();
let counts = store.getById('counts').data.value;
- let total = store.getById('total').data.value;
let used = store.getById('used').data.value;
+ let total = store.getById('avail').data.value + used;
let usage = Proxmox.Utils.render_size_usage(used, total, true);
vm.set('usagetext', usage);
{
xtype: 'proxmoxRRDChart',
title: gettext('Storage usage (bytes)'),
- fields: ['total', 'used'],
+ fields: ['unpriv-total', 'used'],
fieldTitles: [gettext('Total'), gettext('Storage usage')],
},
{