From e53a4c4577f63ceb876f54f69c2905d077d5f61c Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 5 Jun 2020 10:11:53 +0200 Subject: [PATCH] ui: make DataStore configuration editable Signed-off-by: Dominik Csapak --- www/config/DataStoreConfig.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/www/config/DataStoreConfig.js b/www/config/DataStoreConfig.js index c5f50c2b..8ff647dd 100644 --- a/www/config/DataStoreConfig.js +++ b/www/config/DataStoreConfig.js @@ -38,6 +38,23 @@ Ext.define('PBS.DataStoreConfig', { }).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() { let me = this; let view = me.getView(); @@ -87,7 +104,13 @@ Ext.define('PBS.DataStoreConfig', { text: gettext('Create'), handler: 'createDataStore', }, - // edit/remove button + { + xtype: 'proxmoxButton', + text: gettext('Edit'), + disabled: true, + handler: 'editDataStore', + }, + // remove_btn '-', { xtype: 'proxmoxButton', @@ -121,5 +144,6 @@ Ext.define('PBS.DataStoreConfig', { listeners: { activate: 'reload', + itemdblclick: 'editDataStore', }, });