From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id CD48E748DD for ; Wed, 2 Jun 2021 13:27:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C3433A66D for ; Wed, 2 Jun 2021 13:27:07 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id E9706A645 for ; Wed, 2 Jun 2021 13:27:05 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id BF004466EB for ; Wed, 2 Jun 2021 13:27:05 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Wed, 2 Jun 2021 13:27:04 +0200 Message-Id: <20210602112704.893-5-d.csapak@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210602112704.893-1-d.csapak@proxmox.com> References: <20210602112704.893-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.046 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup v2 4/4] ui: DataStoreList: add remove button X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 11:27:37 -0000 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 --- www/Utils.js | 1 + www/datastore/OptionView.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/www/Utils.js b/www/Utils.js index f614d77e..6b378355 100644 --- a/www/Utils.js +++ b/www/Utils.js @@ -380,6 +380,7 @@ Ext.define('PBS.Utils', { backup: (type, id) => PBS.Utils.render_datastore_worker_id(id, gettext('Backup')), 'barcode-label-media': [gettext('Drive'), gettext('Barcode-Label Media')], 'catalog-media': [gettext('Drive'), gettext('Catalog Media')], + 'delete-datastore': [gettext('Datastore'), gettext('Remove Datastore')], dircreate: [gettext('Directory Storage'), gettext('Create')], dirremove: [gettext('Directory'), gettext('Remove')], 'eject-media': [gettext('Drive'), gettext('Eject Media')], diff --git a/www/datastore/OptionView.js b/www/datastore/OptionView.js index 723730fd..98152dce 100644 --- a/www/datastore/OptionView.js +++ b/www/datastore/OptionView.js @@ -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: { -- 2.20.1