mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-14 14:39:58 +00:00
ui: datastore: factor out safe datastore destroy
will extend it for data-destroy flag in a next commit Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
857f346c22
commit
4fbec4c02a
@ -1,3 +1,26 @@
|
|||||||
|
Ext.define('PBS.window.SafeDatastoreDestroy', {
|
||||||
|
extend: 'Proxmox.window.SafeDestroy',
|
||||||
|
xtype: 'pbsDatastoreSafeDestroy',
|
||||||
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
|
cbind: {
|
||||||
|
url: `/config/datastore/{datastore}`,
|
||||||
|
item: get => ({ id: get('datastore') }),
|
||||||
|
},
|
||||||
|
|
||||||
|
autoShow: true,
|
||||||
|
taskName: 'delete-datastore',
|
||||||
|
note: gettext('Configuration change only, no data will be deleted.'),
|
||||||
|
|
||||||
|
apiCallDone: function(success) {
|
||||||
|
if (success) {
|
||||||
|
let navtree = Ext.ComponentQuery.query('navigationtree')[0];
|
||||||
|
navtree.rstore.load();
|
||||||
|
let mainview = Ext.ComponentQuery.query('mainview')[0];
|
||||||
|
mainview.getController().redirectTo('pbsDataStores');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
Ext.define('PBS.Datastore.Options', {
|
Ext.define('PBS.Datastore.Options', {
|
||||||
extend: 'Proxmox.grid.ObjectGrid',
|
extend: 'Proxmox.grid.ObjectGrid',
|
||||||
@ -45,21 +68,8 @@ Ext.define('PBS.Datastore.Options', {
|
|||||||
|
|
||||||
removeDatastore: function() {
|
removeDatastore: function() {
|
||||||
let me = this;
|
let me = this;
|
||||||
let datastore = me.getView().datastore;
|
Ext.create('PBS.window.SafeDatastoreDestroy', {
|
||||||
Ext.create('Proxmox.window.SafeDestroy', {
|
datastore: me.getView().datastore,
|
||||||
url: `/config/datastore/${datastore}`,
|
|
||||||
item: {
|
|
||||||
id: datastore,
|
|
||||||
},
|
|
||||||
note: gettext('Configuration change only, no data will be deleted.'),
|
|
||||||
autoShow: true,
|
|
||||||
taskName: 'delete-datastore',
|
|
||||||
apiCallDone: (success) => {
|
|
||||||
let navtree = Ext.ComponentQuery.query('navigationtree')[0];
|
|
||||||
navtree.rstore.load();
|
|
||||||
let mainview = me.getView().up('mainview');
|
|
||||||
mainview.getController().redirectTo('pbsDataStores');
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user