[pbs-devel] [PATCH proxmox-backup 2/3] ui: DataStoreList: show message when there are no datastores

Dominik Csapak d.csapak at proxmox.com
Fri Nov 13 15:02:35 CET 2020


Signed-off-by: Dominik Csapak <d.csapak at 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






More information about the pbs-devel mailing list