From 98bb3b90167ee41a7801fab48a33b9375eb02e7e Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 5 Jun 2020 10:11:51 +0200 Subject: [PATCH] ui: replace DataStoreStatus with DataStoreConfig We will show an overall status of the DataStores in the Dashboard, so there is no need for a seperate DataStores Status. This means we can move the Config to where the Status was, and remove the duplicated entry in the NavigationTree, reducing confusion for users We can still seperate the permissions by simply showing a permission denied error, or simply leaving the list empty Signed-off-by: Dominik Csapak --- www/DataStoreConfig.js | 10 ++++++++++ www/DataStoreStatus.js | 20 -------------------- www/Makefile | 1 - www/NavigationTree.js | 28 ++++++++++------------------ 4 files changed, 20 insertions(+), 39 deletions(-) delete mode 100644 www/DataStoreStatus.js diff --git a/www/DataStoreConfig.js b/www/DataStoreConfig.js index 40c9392c..8aa3076c 100644 --- a/www/DataStoreConfig.js +++ b/www/DataStoreConfig.js @@ -1,3 +1,13 @@ +Ext.define('pbs-datastore-list', { + extend: 'Ext.data.Model', + fields: [ 'name', 'comment' ], + proxy: { + type: 'proxmox', + url: "/api2/json/admin/datastore" + }, + idProperty: 'store' +}); + Ext.define('pbs-data-store-config', { extend: 'Ext.data.Model', fields: [ 'name', 'path', 'comment' ], diff --git a/www/DataStoreStatus.js b/www/DataStoreStatus.js deleted file mode 100644 index 947bd9df..00000000 --- a/www/DataStoreStatus.js +++ /dev/null @@ -1,20 +0,0 @@ -Ext.define('pbs-datastore-list', { - extend: 'Ext.data.Model', - fields: [ 'name', 'comment' ], - proxy: { - type: 'proxmox', - url: "/api2/json/admin/datastore" - }, - idProperty: 'store' -}); - -Ext.define('PBS.DataStoreStatus', { - extend: 'Ext.panel.Panel', - alias: 'widget.pbsDataStoreStatus', - - title: gettext('Data Store Status'), - - scrollable: true, - - html: "fixme: Add Datastore status", -}); diff --git a/www/Makefile b/www/Makefile index 51de6fb2..8aa6f74c 100644 --- a/www/Makefile +++ b/www/Makefile @@ -23,7 +23,6 @@ JSSRC= \ Subscription.js \ DataStorePrune.js \ DataStoreConfig.js \ - DataStoreStatus.js \ DataStoreStatistic.js \ DataStoreContent.js \ DataStorePanel.js \ diff --git a/www/NavigationTree.js b/www/NavigationTree.js index 57b46dae..68831d3c 100644 --- a/www/NavigationTree.js +++ b/www/NavigationTree.js @@ -42,12 +42,6 @@ Ext.define('PBS.store.NavigationStore', { path: 'pbsSyncJobView', leaf: true, }, - { - text: gettext('Data Store'), - iconCls: 'fa fa-archive', - path: 'pbsDataStoreConfig', - leaf: true - }, { text: gettext('Subscription'), iconCls: 'fa fa-support', @@ -61,7 +55,14 @@ Ext.define('PBS.store.NavigationStore', { iconCls: 'fa fa-wrench', path: 'pbsServerAdministration', leaf: true - } + }, + { + text: gettext('Data Store'), + iconCls: 'fa fa-archive', + path: 'pbsDataStoreConfig', + expanded: true, + leaf: false + }, ] } }); @@ -87,20 +88,11 @@ Ext.define('PBS.view.main.NavigationTree', { }, onLoad: function(store, records, success) { + if (!success) return; var view = this.getView(); let root = view.getStore().getRoot(); - if (!root.findChild('path', 'pbsDataStoreStatus', false)) { - root.appendChild({ - text: gettext('Data Store'), - expanded: true, - iconCls: 'fa fa-archive', - path: 'pbsDataStoreStatus', - leaf: false - }); - } - // FIXME: newly added always get appended to the end.. records.sort((a, b) => { if (a.id > b.id) return 1; @@ -108,7 +100,7 @@ Ext.define('PBS.view.main.NavigationTree', { return 0; }); - var list = root.findChild('path', 'pbsDataStoreStatus', false); + var list = root.findChild('path', 'pbsDataStoreConfig', false); var length = records.length; var lookup_hash = {}; for (var i = 0; i < length; i++) { -- 2.39.5