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

Matthias Heiserer m.heiserer at proxmox.com
Thu Jul 28 15:28:48 CEST 2022


On 26.07.2022 15:44, Daniel Tschlatscher wrote:
> 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 v2:
> * Rebased this patch for the current master
> 
>   www/dashboard/DataStoreStatistics.js  | 8 +++++++-
>   www/datastore/DataStoreListSummary.js | 5 ++++-
>   www/datastore/Summary.js              | 6 +++---
>   3 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/www/dashboard/DataStoreStatistics.js b/www/dashboard/DataStoreStatistics.js
> index 8dbd1caf..daac461d 100644
> --- a/www/dashboard/DataStoreStatistics.js
> +++ b/www/dashboard/DataStoreStatistics.js
> @@ -118,7 +118,13 @@ Ext.define('PBS.DatastoreStatistics', {
>   	    text: gettext('Estimated Full'),
>   	    dataIndex: 'estimated-full-date',
>   	    sortable: true,
> -	    renderer: PBS.Utils.render_estimate,
> +	    renderer: (value, metaData, record, rowIndex, colIndex, store) => {
> +		if (record.get("avail") === 0) {
> +		    return gettext("Full");
> +		}
> +
> +		return PBS.Utils.render_estimate(value);
> +	    },
Here...
>   	    flex: 1,
>   	    minWidth: 130,
>   	    maxWidth: 200,
> diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js
> index 3714528e..60ad0461 100644
> --- a/www/datastore/DataStoreListSummary.js
> +++ b/www/datastore/DataStoreListSummary.js
> @@ -61,7 +61,10 @@ 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 = statusData.avail > 0
> +	    ? PBS.Utils.render_estimate(statusData['estimated-full-date'])
> +	    : gettext("Full");
> +
... and here, you do the same. I would move the check if the datastore 
is full into render_estimate and pass it value and available.
>   	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')],
>   	},
>   	{






More information about the pbs-devel mailing list