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 <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-06-05 10:11:51 +02:00 committed by Dietmar Maurer
parent eb80aac288
commit 98bb3b9016
4 changed files with 20 additions and 39 deletions

View File

@ -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' ],

View File

@ -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",
});

View File

@ -23,7 +23,6 @@ JSSRC= \
Subscription.js \
DataStorePrune.js \
DataStoreConfig.js \
DataStoreStatus.js \
DataStoreStatistic.js \
DataStoreContent.js \
DataStorePanel.js \

View File

@ -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++) {