remove button: allow to set custom confirmation message

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2023-12-14 10:48:43 +01:00 committed by Thomas Lamprecht
parent 2834a05d2b
commit 26e2aa7ce4

View File

@ -110,6 +110,7 @@ Ext.define('Proxmox.button.StdRemoveButton', {
config: { config: {
baseurl: undefined, baseurl: undefined,
customConfirmationMessage: undefined,
}, },
getUrl: function(rec) { getUrl: function(rec) {
@ -133,7 +134,14 @@ Ext.define('Proxmox.button.StdRemoveButton', {
let me = this; let me = this;
let name = me.getRecordName(rec); let name = me.getRecordName(rec);
return Ext.String.format(gettext('Are you sure you want to remove entry {0}'), `'${name}'`);
let text;
if (me.customConfirmationMessage) {
text = me.customConfirmationMessage;
} else {
text = gettext('Are you sure you want to remove entry {0}');
}
return Ext.String.format(text, `'${name}'`);
}, },
handler: function(btn, event, rec) { handler: function(btn, event, rec) {