[pbs-devel] [PATCH proxmox-backup v4 3/3] gui: change reporting of the estimated_time_full to "Full" if no space

Daniel Tschlatscher d.tschlatscher at proxmox.com
Wed Aug 24 12:26:57 CEST 2022


is left in the datastore. Before, the GUI would report "Never" for the
estimated time full, because the value provided in the backend was in
the past. To get around this, the GUI now report "Full" if the value
for available reaches 0.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher at proxmox.com>
---
Changes from v3:
* Moved the check for whether to display "Full" into render_estimate

 www/Utils.js                          | 6 +++++-
 www/datastore/DataStoreListSummary.js | 3 ++-
 www/datastore/Summary.js              | 6 +++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/www/Utils.js b/www/Utils.js
index ad451c9f..f6d353ef 100644
--- a/www/Utils.js
+++ b/www/Utils.js
@@ -285,7 +285,11 @@ Ext.define('PBS.Utils', {
 	return tokenid.match(/^(.+)!([^!]+)$/)[2];
     },
 
-    render_estimate: function(value) {
+    render_estimate: function(value, metaData, record) {
+	if (record.data.avail === 0) {
+	    return gettext("Full");
+	}
+
 	if (value === undefined) {
 	    return gettext('Not enough data');
 	}
diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js
index 3714528e..a88cacef 100644
--- a/www/datastore/DataStoreListSummary.js
+++ b/www/datastore/DataStoreListSummary.js
@@ -61,7 +61,8 @@ Ext.define('PBS.datastore.DataStoreListSummary', {
 	let usagePanel = me.lookup('usage');
 	usagePanel.updateValue(usage, usagetext);
 
-	let estimate = PBS.Utils.render_estimate(statusData['estimated-full-date']);
+	let estimate = PBS.Utils.render_estimate(statusData['estimated-full-date'], null, { data: statusData });
+
 	vm.set('full', estimate);
 	vm.set('deduplication', PBS.Utils.calculate_dedup_factor(statusData['gc-status']).toFixed(2));
 	vm.set('stillbad', statusData['gc-status']['still-bad']);
diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
index 94be9559..4025949c 100644
--- a/www/datastore/Summary.js
+++ b/www/datastore/Summary.js
@@ -2,7 +2,7 @@ Ext.define('pve-rrd-datastore', {
     extend: 'Ext.data.Model',
     fields: [
 	'used',
-	'total',
+	'unpriv_total',
 	'read_ios',
 	'read_bytes',
 	'write_ios',
@@ -66,7 +66,7 @@ Ext.define('PBS.DataStoreInfo', {
 	    let vm = me.getViewModel();
 
 	    let counts = store.getById('counts').data.value;
-	    let total = store.getById('total').data.value;
+	    let total = store.getById('unpriv-total').data.value;
 	    let used = store.getById('used').data.value;
 
 	    let usage = Proxmox.Utils.render_size_usage(used, total, true);
@@ -236,7 +236,7 @@ Ext.define('PBS.DataStoreSummary', {
 	{
 	    xtype: 'proxmoxRRDChart',
 	    title: gettext('Storage usage (bytes)'),
-	    fields: ['total', 'used'],
+	    fields: ['unpriv_total', 'used'],
 	    fieldTitles: [gettext('Total'), gettext('Storage usage')],
 	},
 	{
-- 
2.30.2






More information about the pbs-devel mailing list