From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dietmar@proxmox.com>
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 C2E7D74E4C
 for <pbs-devel@lists.proxmox.com>; Fri,  4 Jun 2021 09:53:08 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id B95DF1A18B
 for <pbs-devel@lists.proxmox.com>; Fri,  4 Jun 2021 09:52:38 +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 4F3671A17A
 for <pbs-devel@lists.proxmox.com>; Fri,  4 Jun 2021 09:52:34 +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 1C7D546718
 for <pbs-devel@lists.proxmox.com>; Fri,  4 Jun 2021 09:52:34 +0200 (CEST)
To: Proxmox Backup Server development discussion
 <pbs-devel@lists.proxmox.com>, Dominik Csapak <d.csapak@proxmox.com>
References: <20210602112704.893-1-d.csapak@proxmox.com>
 <20210602112704.893-5-d.csapak@proxmox.com>
From: Dietmar Maurer <dietmar@proxmox.com>
Message-ID: <0fc40de7-808c-1c43-79af-638545c4f2be@proxmox.com>
Date: Fri, 4 Jun 2021 09:52:33 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.10.0
MIME-Version: 1.0
In-Reply-To: <20210602112704.893-5-d.csapak@proxmox.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.200 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] applied: [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
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Fri, 04 Jun 2021 07:53:08 -0000

applied

On 6/2/21 1:27 PM, Dominik Csapak wrote:
> 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>
> ---
>   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: {