From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] ui: switch datastore destroy label text on backend type
Date: Tue, 29 Jul 2025 18:52:49 +0200 [thread overview]
Message-ID: <20250729165249.855831-1-c.ebner@proxmox.com> (raw)
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 <c.ebner@proxmox.com>
---
Note: This is the ui followup for the datastore destroy dialog as requested in:
https://lore.proxmox.com/pbs-devel/DBOL7XELUICP.1CAPP8NTAR2KR@proxmox.com/
www/datastore/OptionView.js | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/www/datastore/OptionView.js b/www/datastore/OptionView.js
index 913bdfc74..9aafd2e9c 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,14 @@ Ext.define('PBS.Datastore.Options', {
removeDatastore: function () {
let me = this;
+ let backendType = 'filesystem';
+ let backend = me.getView().rstore.data.items.find((item) => item.id === 'backend');
+ if (backend) {
+ let backendConfig = PBS.Utils.parsePropertyString(backend.data.value, 'type');
+ backendType = backendConfig.type;
+ }
Ext.create('PBS.window.SafeDatastoreDestroy', {
+ backendType: backendType,
datastore: me.getView().datastore,
});
},
@@ -164,6 +181,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
next reply other threads:[~2025-07-29 16:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 16:52 Christian Ebner [this message]
2025-07-30 7:36 ` Lukas Wagner
2025-07-30 7:45 ` Christian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250729165249.855831-1-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.