public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] ui: datastore/Content: reload in activate listener
@ 2021-10-01  9:56 Dominik Csapak
  2021-10-01  9:56 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: datastore/Content: add empty text for no snapshots Dominik Csapak
  2021-10-04  8:29 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] ui: datastore/Content: reload in activate listener Dietmar Maurer
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2021-10-01  9:56 UTC (permalink / raw)
  To: pbs-devel

when we trigger the first load before the panel was fully created,
there was no load mask for it (but the snapshots would "pop in" on load)

move the first reload into the 'activate' listener. this will be called
the every time a user opens the content tab of a datastore, so guard
it by a 'firstLoad' bool.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/datastore/Content.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index 57693785..ddc923fd 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -73,7 +73,6 @@ Ext.define('PBS.DataStoreContent', {
 		'backup-time',
 	    ]);
 	    Proxmox.Utils.monStoreErrors(view, this.store);
-	    this.reload(); // initial load
 	},
 
 	reload: function() {
@@ -625,6 +624,17 @@ Ext.define('PBS.DataStoreContent', {
 	},
     },
 
+    listeners: {
+	activate: function() {
+	    let me = this;
+	    // only load on first activate to not load every tab switch
+	    if (!me.firstLoad) {
+		me.getController().reload();
+		me.firstLoad = true;
+	    }
+	},
+    },
+
     viewConfig: {
 	getRowClass: function(record, index) {
 	    let verify = record.get('verification');
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] [PATCH proxmox-backup 2/2] ui: datastore/Content: add empty text for no snapshots
  2021-10-01  9:56 [pbs-devel] [PATCH proxmox-backup 1/2] ui: datastore/Content: reload in activate listener Dominik Csapak
@ 2021-10-01  9:56 ` Dominik Csapak
  2021-10-04  8:29 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] ui: datastore/Content: reload in activate listener Dietmar Maurer
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2021-10-01  9:56 UTC (permalink / raw)
  To: pbs-devel

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/datastore/Content.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index ddc923fd..87a9079d 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -261,6 +261,10 @@ Ext.define('PBS.DataStoreContent', {
 		children: children,
 	    });
 
+	    if (!children.length) {
+		view.setEmptyText(gettext('No Snapshots found'));
+	    }
+
 	    this.updateGroupNotes(view);
 
 	    if (selected !== undefined) {
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup 1/2] ui: datastore/Content: reload in activate listener
  2021-10-01  9:56 [pbs-devel] [PATCH proxmox-backup 1/2] ui: datastore/Content: reload in activate listener Dominik Csapak
  2021-10-01  9:56 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: datastore/Content: add empty text for no snapshots Dominik Csapak
@ 2021-10-04  8:29 ` Dietmar Maurer
  1 sibling, 0 replies; 3+ messages in thread
From: Dietmar Maurer @ 2021-10-04  8:29 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

applied both patches

On 10/1/21 11:56 AM, Dominik Csapak wrote:
> when we trigger the first load before the panel was fully created,
> there was no load mask for it (but the snapshots would "pop in" on load)
>
> move the first reload into the 'activate' listener. this will be called
> the every time a user opens the content tab of a datastore, so guard
> it by a 'firstLoad' bool.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>   www/datastore/Content.js | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/www/datastore/Content.js b/www/datastore/Content.js
> index 57693785..ddc923fd 100644
> --- a/www/datastore/Content.js
> +++ b/www/datastore/Content.js
> @@ -73,7 +73,6 @@ Ext.define('PBS.DataStoreContent', {
>   		'backup-time',
>   	    ]);
>   	    Proxmox.Utils.monStoreErrors(view, this.store);
> -	    this.reload(); // initial load
>   	},
>   
>   	reload: function() {
> @@ -625,6 +624,17 @@ Ext.define('PBS.DataStoreContent', {
>   	},
>       },
>   
> +    listeners: {
> +	activate: function() {
> +	    let me = this;
> +	    // only load on first activate to not load every tab switch
> +	    if (!me.firstLoad) {
> +		me.getController().reload();
> +		me.firstLoad = true;
> +	    }
> +	},
> +    },
> +
>       viewConfig: {
>   	getRowClass: function(record, index) {
>   	    let verify = record.get('verification');




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-04  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01  9:56 [pbs-devel] [PATCH proxmox-backup 1/2] ui: datastore/Content: reload in activate listener Dominik Csapak
2021-10-01  9:56 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: datastore/Content: add empty text for no snapshots Dominik Csapak
2021-10-04  8:29 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] ui: datastore/Content: reload in activate listener Dietmar Maurer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal