add advanced checkbox to the wizard

so we can show/hide the advanced options of the inputpanels

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-04-05 16:03:46 +02:00 committed by Dietmar Maurer
parent 00d9d6b0d2
commit 8bb1541c24

View File

@ -117,6 +117,9 @@ Ext.define('PVE.window.Wizard', {
me.title = Proxmox.Utils.dialog_title(me.subject, true, false);
}
var sp = Ext.state.Manager.getProvider();
var advchecked = sp.get('proxmox-advanced-cb');
Ext.apply(me, {
items: [
{
@ -153,6 +156,22 @@ Ext.define('PVE.window.Wizard', {
itemId: 'help'
},
'->',
{
xtype: 'proxmoxcheckbox',
boxLabelAlign: 'before',
boxLabel: gettext('Advanced'),
value: advchecked,
listeners: {
change: function(cb, val) {
var tp = me.down('#wizcontent');
tp.query('inputpanel').forEach(function(ip) {
ip.setAdvancedVisible(val);
});
sp.set('proxmox-advanced-cb', val);
}
}
},
{
text: gettext('Back'),
disabled: true,
@ -210,6 +229,10 @@ Ext.define('PVE.window.Wizard', {
});
me.callParent();
Ext.Array.each(me.query('inputpanel'), function(panel) {
panel.setAdvancedVisible(advchecked);
});
Ext.Array.each(me.query('field'), function(field) {
var validcheck = function() {
var tp = me.down('#wizcontent');