public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash
@ 2020-11-13 14:02 Dominik Csapak
  2020-11-13 14:02 ` [pbs-devel] [PATCH proxmox-backup 2/3] ui: DataStoreList: show message when there are no datastores Dominik Csapak
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dominik Csapak @ 2020-11-13 14:02 UTC (permalink / raw)
  To: pbs-devel

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

diff --git a/www/datastore/DataStoreList.js b/www/datastore/DataStoreList.js
index 284a6340..607f49c5 100644
--- a/www/datastore/DataStoreList.js
+++ b/www/datastore/DataStoreList.js
@@ -84,6 +84,7 @@ Ext.define('PBS.datastore.DataStoreList', {
 	for (const [store, panel] of Object.entries(me.datastores)) {
 	    if (!found[store]) {
 		me.remove(panel);
+		delete me.datastores[store];
 	    }
 	}
     },
-- 
2.20.1





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

* [pbs-devel] [PATCH proxmox-backup 2/3] ui: DataStoreList: show message when there are no datastores
  2020-11-13 14:02 [pbs-devel] [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Dominik Csapak
@ 2020-11-13 14:02 ` Dominik Csapak
  2020-11-13 14:02 ` [pbs-devel] [PATCH proxmox-backup 3/3] ui: improve comment behaviour for datastore Summary Dominik Csapak
  2020-11-16 16:00 ` [pbs-devel] applied-series: [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Dominik Csapak @ 2020-11-13 14:02 UTC (permalink / raw)
  To: pbs-devel

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

diff --git a/www/datastore/DataStoreList.js b/www/datastore/DataStoreList.js
index 607f49c5..135a630a 100644
--- a/www/datastore/DataStoreList.js
+++ b/www/datastore/DataStoreList.js
@@ -87,11 +87,15 @@ Ext.define('PBS.datastore.DataStoreList', {
 		delete me.datastores[store];
 	    }
 	}
+
+	let hasDatastores = Object.keys(me.datastores).length > 0;
+
+	me.getComponent('emptybox').setHidden(hasDatastores);
     },
 
     addSorted: function(data) {
 	let me = this;
-	let i = 0;
+	let i = 1;
 	let datastores = Object
 	    .keys(me.datastores)
 	    .sort((a, b) => a.localeCompare(b));
@@ -116,7 +120,13 @@ Ext.define('PBS.datastore.DataStoreList', {
 
     initComponent: function() {
 	let me = this;
-	me.items = [];
+	me.items = [
+	    {
+		itemId: 'emptybox',
+		xtype: 'box',
+		html: gettext('No Datastores configured'),
+	    },
+	];
 	me.datastores = {};
 	// todo make configurable?
 	me.since = (Date.now()/1000 - 30 * 24*3600).toFixed(0);
-- 
2.20.1





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

* [pbs-devel] [PATCH proxmox-backup 3/3] ui: improve comment behaviour for datastore Summary
  2020-11-13 14:02 [pbs-devel] [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Dominik Csapak
  2020-11-13 14:02 ` [pbs-devel] [PATCH proxmox-backup 2/3] ui: DataStoreList: show message when there are no datastores Dominik Csapak
@ 2020-11-13 14:02 ` Dominik Csapak
  2020-11-16 16:00 ` [pbs-devel] applied-series: [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Dominik Csapak @ 2020-11-13 14:02 UTC (permalink / raw)
  To: pbs-devel

when we could not load the config (e.g. missing permissions)
show the comment from the global datastore-list

also show a messagebox for a load error instead of setting
the text of the comment box

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/datastore/Notes.js   | 2 +-
 www/datastore/Summary.js | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/www/datastore/Notes.js b/www/datastore/Notes.js
index 21462805..2928b7ec 100644
--- a/www/datastore/Notes.js
+++ b/www/datastore/Notes.js
@@ -56,7 +56,7 @@ Ext.define('PBS.DataStoreNotes', {
 	    url: me.url,
 	    waitMsgTarget: me,
 	    failure: function(response, opts) {
-		me.update(gettext('Error') + " " + response.htmlStatus);
+		Ext.Msg.alert(gettext('Error'), response.htmlStatus);
 		me.setCollapsed(false);
 	    },
 	    success: function(response, opts) {
diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
index 41fd7c85..c263846a 100644
--- a/www/datastore/Summary.js
+++ b/www/datastore/Summary.js
@@ -264,6 +264,13 @@ Ext.define('PBS.DataStoreSummary', {
 		me.down('pbsDataStoreInfo').setTitle(`${me.datastore} (${path})`);
 		me.down('pbsDataStoreNotes').setNotes(response.result.data.comment);
 	    },
+	    failure: function(response) {
+		// fallback if e.g. we have no permissions to the config
+		let rec = Ext.getStore('pbs-datastore-list').findRecord('store', me.datastore);
+		if (rec) {
+		    me.down('pbsDataStoreNotes').setNotes(rec.data.comment || "");
+		}
+	    },
 	});
 
 	me.query('proxmoxRRDChart').forEach((chart) => {
-- 
2.20.1





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

* [pbs-devel] applied-series: [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash
  2020-11-13 14:02 [pbs-devel] [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Dominik Csapak
  2020-11-13 14:02 ` [pbs-devel] [PATCH proxmox-backup 2/3] ui: DataStoreList: show message when there are no datastores Dominik Csapak
  2020-11-13 14:02 ` [pbs-devel] [PATCH proxmox-backup 3/3] ui: improve comment behaviour for datastore Summary Dominik Csapak
@ 2020-11-16 16:00 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2020-11-16 16:00 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

On 13.11.20 15:02, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/datastore/DataStoreList.js | 1 +
>  1 file changed, 1 insertion(+)
> 
>

applied series, thanks!

I hide the "no datastores configured" initially, else it shows in the
background of the load mask - which seemed slightly confusing to me
(and the user has already visual feedback that it is loading)




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

end of thread, other threads:[~2020-11-16 16:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 14:02 [pbs-devel] [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Dominik Csapak
2020-11-13 14:02 ` [pbs-devel] [PATCH proxmox-backup 2/3] ui: DataStoreList: show message when there are no datastores Dominik Csapak
2020-11-13 14:02 ` [pbs-devel] [PATCH proxmox-backup 3/3] ui: improve comment behaviour for datastore Summary Dominik Csapak
2020-11-16 16:00 ` [pbs-devel] applied-series: [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Thomas Lamprecht

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