ui: DataStoreList: add remove button
so that a user can remove a datastore from the gui, though no data is deleted, this has to be done elsewhere (for now) Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
2de4dc3a81
commit
34ee1f1c76
@ -21,6 +21,28 @@ Ext.define('PBS.Datastore.Options', {
|
||||
edit: function() {
|
||||
this.getView().run_editor();
|
||||
},
|
||||
|
||||
removeDatastore: function() {
|
||||
let me = this;
|
||||
let datastore = me.getView().datastore;
|
||||
Ext.create('Proxmox.window.SafeDestroy', {
|
||||
url: `/config/datastore/${datastore}`,
|
||||
item: {
|
||||
id: datastore,
|
||||
},
|
||||
note: gettext('Configuration change only, no data will be deleted.'),
|
||||
autoShow: true,
|
||||
taskName: 'delete-datastore',
|
||||
listeners: {
|
||||
destroy: () => {
|
||||
let navtree = Ext.ComponentQuery.query('navigationtree')[0];
|
||||
navtree.rstore.load();
|
||||
let mainview = me.getView().up('mainview');
|
||||
mainview.getController().redirectTo('pbsDataStores');
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
tbar: [
|
||||
@ -30,6 +52,14 @@ Ext.define('PBS.Datastore.Options', {
|
||||
disabled: true,
|
||||
handler: 'edit',
|
||||
},
|
||||
'->',
|
||||
{
|
||||
xtype: 'proxmoxButton',
|
||||
selModel: null,
|
||||
iconCls: 'fa fa-trash-o',
|
||||
text: gettext('Remove Datastore'),
|
||||
handler: 'removeDatastore',
|
||||
},
|
||||
],
|
||||
|
||||
listeners: {
|
||||
|
Reference in New Issue
Block a user