safe destroy: allow specifing additional items

to be used to add more checkboxes for PVE's guest destroy use case.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2021-04-19 15:14:36 +02:00 committed by Thomas Lamprecht
parent 2b1f7bb066
commit 1488907695

View File

@ -15,6 +15,8 @@ Ext.define('Proxmox.window.SafeDestroy', {
defaultFocus: 'confirmField', defaultFocus: 'confirmField',
showProgress: false, showProgress: false,
additionalItems: [],
config: { config: {
item: { item: {
id: undefined, id: undefined,
@ -96,7 +98,18 @@ Ext.define('Proxmox.window.SafeDestroy', {
}, },
}, },
items: [ buttons: [
{
reference: 'removeButton',
text: gettext('Remove'),
disabled: true,
},
],
initComponent: function() {
let me = this;
me.items = [
{ {
xtype: 'component', xtype: 'component',
cls: [Ext.baseCSSPrefix + 'message-box-icon', cls: [Ext.baseCSSPrefix + 'message-box-icon',
@ -124,6 +137,7 @@ Ext.define('Proxmox.window.SafeDestroy', {
hideTrigger: true, hideTrigger: true,
allowBlank: false, allowBlank: false,
}, },
].concat(me.additionalItems).concat([
{ {
xtype: 'container', xtype: 'container',
reference: 'noteContainer', reference: 'noteContainer',
@ -143,19 +157,9 @@ Ext.define('Proxmox.window.SafeDestroy', {
}, },
], ],
}, },
], ]),
}, },
], ];
buttons: [
{
reference: 'removeButton',
text: gettext('Remove'),
disabled: true,
},
],
initComponent: function() {
let me = this;
me.callParent(); me.callParent();