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',
showProgress: false,
additionalItems: [],
config: {
item: {
id: undefined,
@ -96,56 +98,6 @@ Ext.define('Proxmox.window.SafeDestroy', {
},
},
items: [
{
xtype: 'component',
cls: [Ext.baseCSSPrefix + 'message-box-icon',
Ext.baseCSSPrefix + 'message-box-warning',
Ext.baseCSSPrefix + 'dlg-icon'],
},
{
xtype: 'container',
flex: 1,
layout: {
type: 'vbox',
align: 'stretch',
},
items: [
{
xtype: 'component',
reference: 'messageCmp',
},
{
itemId: 'confirmField',
reference: 'confirmField',
xtype: 'textfield',
name: 'confirm',
labelWidth: 300,
hideTrigger: true,
allowBlank: false,
},
{
xtype: 'container',
reference: 'noteContainer',
flex: 1,
hidden: true,
layout: {
type: 'vbox',
align: 'middle',
},
height: 25,
items: [
{
xtype: 'component',
reference: 'noteCmp',
width: '300px',
style: 'font-size: smaller; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;',
},
],
},
],
},
],
buttons: [
{
reference: 'removeButton',
@ -157,6 +109,58 @@ Ext.define('Proxmox.window.SafeDestroy', {
initComponent: function() {
let me = this;
me.items = [
{
xtype: 'component',
cls: [Ext.baseCSSPrefix + 'message-box-icon',
Ext.baseCSSPrefix + 'message-box-warning',
Ext.baseCSSPrefix + 'dlg-icon'],
},
{
xtype: 'container',
flex: 1,
layout: {
type: 'vbox',
align: 'stretch',
},
items: [
{
xtype: 'component',
reference: 'messageCmp',
},
{
itemId: 'confirmField',
reference: 'confirmField',
xtype: 'textfield',
name: 'confirm',
labelWidth: 300,
hideTrigger: true,
allowBlank: false,
},
].concat(me.additionalItems).concat([
{
xtype: 'container',
reference: 'noteContainer',
flex: 1,
hidden: true,
layout: {
type: 'vbox',
align: 'middle',
},
height: 25,
items: [
{
xtype: 'component',
reference: 'noteCmp',
width: '300px',
style: 'font-size: smaller; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;',
},
],
},
]),
},
];
me.callParent();
const item = me.getItem();