[pve-devel] [PATCH manager 01/11] add advanced checkbox to the wizard

Dominik Csapak d.csapak at proxmox.com
Thu Apr 5 16:03:46 CEST 2018


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

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/window/Wizard.js | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/www/manager6/window/Wizard.js b/www/manager6/window/Wizard.js
index 6b8e3c38..87e4bf0a 100644
--- a/www/manager6/window/Wizard.js
+++ b/www/manager6/window/Wizard.js
@@ -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: [
 		{
@@ -154,6 +157,22 @@ Ext.define('PVE.window.Wizard', {
 		},
 		'->',
 		{
+		    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,
 		    itemId: 'back',
@@ -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');
-- 
2.11.0





More information about the pve-devel mailing list