ui: make DataStore configuration editable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-06-05 10:11:53 +02:00 committed by Dietmar Maurer
parent 98ad58fbd2
commit e53a4c4577

View File

@ -38,6 +38,23 @@ Ext.define('PBS.DataStoreConfig', {
}).show(); }).show();
}, },
editDataStore: function() {
let me = this;
let view = me.getView();
let selection = view.getSelection();
if (selection.length < 1) return;
let name = encodeURIComponent(selection[0].data.name);
Ext.create('PBS.DataStoreEdit', {
name: name,
listeners: {
destroy: function() {
me.reload();
},
},
}).show();
},
garbageCollect: function() { garbageCollect: function() {
let me = this; let me = this;
let view = me.getView(); let view = me.getView();
@ -87,7 +104,13 @@ Ext.define('PBS.DataStoreConfig', {
text: gettext('Create'), text: gettext('Create'),
handler: 'createDataStore', handler: 'createDataStore',
}, },
// edit/remove button {
xtype: 'proxmoxButton',
text: gettext('Edit'),
disabled: true,
handler: 'editDataStore',
},
// remove_btn
'-', '-',
{ {
xtype: 'proxmoxButton', xtype: 'proxmoxButton',
@ -121,5 +144,6 @@ Ext.define('PBS.DataStoreConfig', {
listeners: { listeners: {
activate: 'reload', activate: 'reload',
itemdblclick: 'editDataStore',
}, },
}); });