From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2F7831FF183 for ; Wed, 30 Jul 2025 09:57:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AA3B035B86; Wed, 30 Jul 2025 09:58:42 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Wed, 30 Jul 2025 09:57:50 +0200 Message-ID: <20250730075750.36014-9-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250730075750.36014-1-c.ebner@proxmox.com> References: <20250730075750.36014-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753862277952 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.045 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 8/8] ui: switch datastore destroy label text on backend type 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: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Load also the backend configuration via the rstore, but do not show it in the grid. By passing the backend type along to the datastore destroy window, the destroy all data checkbox label is set based on the given type. Signed-off-by: Christian Ebner Reviewed-by: Lukas Wagner Tested-by: Lukas Wagner --- changes since version 1: - added this patch previously send as followup - adapted code to use extjs native accessor methods www/datastore/OptionView.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/www/datastore/OptionView.js b/www/datastore/OptionView.js index 913bdfc74..2f9aa9ebe 100644 --- a/www/datastore/OptionView.js +++ b/www/datastore/OptionView.js @@ -18,6 +18,10 @@ Ext.define('PBS.window.SafeDatastoreDestroy', { ? gettext('All backup snapshots and their data will be permanently destroyed!') : gettext('Configuration change only, no data will be deleted.'), destroyNoteCls: (get) => (get('destroyData') ? 'pmx-hint' : ''), + destroyCheckboxLabel: (get) => + get('backendType') === 's3' + ? gettext('Remove data from S3 bucket and local cache (dangerous!)') + : gettext('Destroy all data (dangerous!)'), }, }, @@ -46,10 +50,10 @@ Ext.define('PBS.window.SafeDatastoreDestroy', { { xtype: 'proxmoxcheckbox', name: 'destroy-data', - boxLabel: gettext('Destroy all data (dangerous!)'), defaultValue: false, bind: { value: '{destroyData}', + boxLabel: '{destroyCheckboxLabel}', }, }, { @@ -70,6 +74,12 @@ Ext.define('PBS.window.SafeDatastoreDestroy', { }, }, ], + + initComponent: function () { + let me = this; + me.getViewModel().set('backendType', me.backendType); + me.callParent(); + }, }); Ext.define('PBS.Datastore.Options', { @@ -118,7 +128,15 @@ Ext.define('PBS.Datastore.Options', { removeDatastore: function () { let me = this; + let backendType = 'filesystem'; + let backend = me.getView().getStore().getById('backend'); + + if (backend) { + let backendConfig = PBS.Utils.parsePropertyString(backend.get('value'), 'type'); + backendType = backendConfig.type; + } Ext.create('PBS.window.SafeDatastoreDestroy', { + backendType: backendType, datastore: me.getView().datastore, }); }, @@ -164,6 +182,10 @@ Ext.define('PBS.Datastore.Options', { }, rows: { + backend: { + required: false, + visible: false, + }, 'notification-mode': { required: true, defaultValue: 'notification-system', -- 2.47.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel