[pbs-devel] [PATCH proxmox-backup] ui: warn of missing gc-schedule, prune/verify jobs

Gabriel Goller g.goller at proxmox.com
Mon Dec 4 16:42:16 CET 2023


Comments inline.

On 11/30/23 15:01, Christian Ebner wrote:
> Warn about a missing garbage collection schedule, prune job or verify
> jobs configuration in summary panel of a datastore.
>
> Show the number of prune/verify job configurations, if there are jobs
> configured.
>
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
>   www/datastore/Summary.js | 80 ++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 80 insertions(+)
>
> diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
> index a932b4e0..6a63ca14 100644
> --- a/www/datastore/Summary.js
> +++ b/www/datastore/Summary.js
> @@ -49,12 +49,19 @@ Ext.define('PBS.DataStoreInfo', {
>   	    usage: {},
>   	    stillbad: 0,
>   	    mountpoint: "",
> +	    gcScheduldeMsg: gettext('unknown'),
Small typo here... This should say `gcScheduleMsg`.
> +	    pruneJobMsg: gettext('unknown'),
> +	    verifyJobMsg: gettext('unknown'),
>   	},
>       },
>   
>       controller: {
>   	xclass: 'Ext.app.ViewController',
>   
> +	fmtWarning: function(msg) {
> +	    return `<i class="fa fa-fw fa-lg fa-exclamation-circle warning"></i> ${msg}`;
> +	},
> +
>   	onLoad: function(store, data, success) {
>   	    let me = this;
>   	    if (!success) {
> @@ -101,6 +108,51 @@ Ext.define('PBS.DataStoreInfo', {
>   	    vm.set('ctcount', countstext(counts.ct));
>   	    vm.set('vmcount', countstext(counts.vm));
>   	    vm.set('hostcount', countstext(counts.host));
> +
> +	    Proxmox.Utils.API2Request({
> +		url: `/config/datastore/${me.view.datastore}`,
> +		success: function(response) {
> +		    if (response.result.data['gc-schedule']) {
> +			vm.set('gcScheduleMsg', gettext('configured'));
How about we put a green checkmark here (and on the other lines below)? 
Otherwise this wall of text looks kinda bleak :(
We could add the `fa fa-check-circle` icon with the `good` (color: 
green) class?


There are also a few linting issues:

3 issues marked with (*) could be auto-fixed using '--fix'.
[./datastore/Summary.js]:
WARN: line 123 col 4: comma-dangle - Missing trailing comma. (*)
WARN: line 138 col 4: comma-dangle - Missing trailing comma. (*)
WARN: line 153 col 4: comma-dangle - Missing trailing comma. (*)





More information about the pbs-devel mailing list