public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager] ui: sdn: zonedit: fix display && refactor
Date: Sat, 17 Jun 2023 14:43:05 +0200	[thread overview]
Message-ID: <20230617124305.346338-1-aderumier@odiso.com> (raw)

move ipam selector to main items as it's non optional, and it's breaking
display if present in advanced.

move common id,mtu,nodes fields from modules to base

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/sdn/zones/Base.js       | 34 ++++++++++++++++++++++++++--
 www/manager6/sdn/zones/EvpnEdit.js   | 27 ----------------------
 www/manager6/sdn/zones/QinQEdit.js   | 26 ---------------------
 www/manager6/sdn/zones/SimpleEdit.js | 30 +-----------------------
 www/manager6/sdn/zones/VlanEdit.js   | 27 ----------------------
 www/manager6/sdn/zones/VxlanEdit.js  | 26 ---------------------
 6 files changed, 33 insertions(+), 137 deletions(-)

diff --git a/www/manager6/sdn/zones/Base.js b/www/manager6/sdn/zones/Base.js
index 347889c0..655352a8 100644
--- a/www/manager6/sdn/zones/Base.js
+++ b/www/manager6/sdn/zones/Base.js
@@ -18,14 +18,44 @@ Ext.define('PVE.panel.SDNZoneBase', {
     initComponent: function() {
 	var me = this;
 
-	me.advancedItems = [
+	me.items.unshift({
+	    xtype: me.isCreate ? 'textfield' : 'displayfield',
+	    name: 'zone',
+	    maxLength: 8,
+	    value: me.zone || '',
+	    fieldLabel: 'ID',
+	    allowBlank: false,
+	});
+
+        me.items.push(
+            {
+                xtype: 'proxmoxintegerfield',
+                name: 'mtu',
+                minValue: 100,
+                maxValue: 65000,
+                fieldLabel: 'MTU',
+                skipEmptyText: true,
+                allowBlank: true,
+                emptyText: 'auto',
+            },
+            {
+                xtype: 'pveNodeSelector',
+                name: 'nodes',
+                fieldLabel: gettext('Nodes'),
+                emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
+                multiSelect: true,
+                autoSelect: false,
+            },
 	    {
 		xtype: 'pveSDNIpamSelector',
 		fieldLabel: gettext('Ipam'),
 		name: 'ipam',
-		value: 'pve',
+		value: me.ipam || 'pve',
 		allowBlank: false,
 	    },
+	);
+
+	me.advancedItems = [
 	    {
 		xtype: 'pveSDNDnsSelector',
 		fieldLabel: gettext('Dns server'),
diff --git a/www/manager6/sdn/zones/EvpnEdit.js b/www/manager6/sdn/zones/EvpnEdit.js
index f1314ad5..1d13976c 100644
--- a/www/manager6/sdn/zones/EvpnEdit.js
+++ b/www/manager6/sdn/zones/EvpnEdit.js
@@ -39,14 +39,6 @@ Ext.define('PVE.sdn.zones.EvpnInputPanel', {
 	var me = this;
 
 	me.items = [
-	    {
-		xtype: me.isCreate ? 'textfield' : 'displayfield',
-		name: 'zone',
-		maxLength: 8,
-		value: me.zone || '',
-		fieldLabel: 'ID',
-		allowBlank: false,
-	    },
 	    {
 		xtype: 'pveSDNControllerSelector',
 		fieldLabel: gettext('Controller'),
@@ -111,25 +103,6 @@ Ext.define('PVE.sdn.zones.EvpnInputPanel', {
 		fieldLabel: gettext('Route-target import'),
 		allowBlank: true,
 	    },
-	    {
-		xtype: 'proxmoxintegerfield',
-		name: 'mtu',
-		minValue: 100,
-		maxValue: 65000,
-		fieldLabel: 'MTU',
-		skipEmptyText: true,
-		allowBlank: true,
-		emptyText: 'auto',
-	    },
-	    {
-		xtype: 'pveNodeSelector',
-		name: 'nodes',
-		fieldLabel: gettext('Nodes'),
-		emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
-		multiSelect: true,
-		autoSelect: false,
-	    },
-
 	];
 
 	me.callParent();
diff --git a/www/manager6/sdn/zones/QinQEdit.js b/www/manager6/sdn/zones/QinQEdit.js
index d9e117d9..c059a7a2 100644
--- a/www/manager6/sdn/zones/QinQEdit.js
+++ b/www/manager6/sdn/zones/QinQEdit.js
@@ -19,14 +19,6 @@ Ext.define('PVE.sdn.zones.QinQInputPanel', {
 	let me = this;
 
 	me.items = [
-	    {
-		xtype: me.isCreate ? 'textfield' : 'displayfield',
-		name: 'zone',
-		maxLength: 8,
-		value: me.zone || '',
-		fieldLabel: 'ID',
-		allowBlank: false,
-	    },
 	    {
 		xtype: 'textfield',
 		name: 'bridge',
@@ -52,24 +44,6 @@ Ext.define('PVE.sdn.zones.QinQInputPanel', {
 		    ['802.1ad', '802.1ad'],
 		],
 	    },
-	    {
-		xtype: 'proxmoxintegerfield',
-		name: 'mtu',
-		minValue: 100,
-		maxValue: 65000,
-		fieldLabel: 'MTU',
-		skipEmptyText: true,
-		allowBlank: true,
-		emptyText: 'auto',
-	    },
-	    {
-		xtype: 'pveNodeSelector',
-		name: 'nodes',
-		fieldLabel: gettext('Nodes'),
-		emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
-		multiSelect: true,
-		autoSelect: false,
-	    },
 	];
 
 	me.callParent();
diff --git a/www/manager6/sdn/zones/SimpleEdit.js b/www/manager6/sdn/zones/SimpleEdit.js
index 56df7952..cb7c3403 100644
--- a/www/manager6/sdn/zones/SimpleEdit.js
+++ b/www/manager6/sdn/zones/SimpleEdit.js
@@ -18,35 +18,7 @@ Ext.define('PVE.sdn.zones.SimpleInputPanel', {
     initComponent: function() {
 	var me = this;
 
-        me.items = [
-           {
-            xtype: me.isCreate ? 'textfield' : 'displayfield',
-            name: 'zone',
-            maxLength: 10,
-            value: me.zone || '',
-            fieldLabel: 'ID',
-            allowBlank: false,
-          },
-          {
-            xtype: 'proxmoxintegerfield',
-            name: 'mtu',
-            minValue: 100,
-            maxValue: 65000,
-            fieldLabel: 'MTU',
-            skipEmptyText: true,
-            allowBlank: true,
-            emptyText: 'auto',
-          },
-          {
-            xtype: 'pveNodeSelector',
-            name: 'nodes',
-            fieldLabel: gettext('Nodes'),
-            emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
-            multiSelect: true,
-            autoSelect: false,
-          },
-
-	];
+        me.items = [];
 
 	me.callParent();
     },
diff --git a/www/manager6/sdn/zones/VlanEdit.js b/www/manager6/sdn/zones/VlanEdit.js
index 93d2bede..23530bfc 100644
--- a/www/manager6/sdn/zones/VlanEdit.js
+++ b/www/manager6/sdn/zones/VlanEdit.js
@@ -19,39 +19,12 @@ Ext.define('PVE.sdn.zones.VlanInputPanel', {
 	var me = this;
 
         me.items = [
-           {
-            xtype: me.isCreate ? 'textfield' : 'displayfield',
-            name: 'zone',
-            maxLength: 10,
-            value: me.zone || '',
-            fieldLabel: 'ID',
-            allowBlank: false,
-          },
           {
             xtype: 'textfield',
             name: 'bridge',
             fieldLabel: 'Bridge',
             allowBlank: false,
           },
-          {
-            xtype: 'proxmoxintegerfield',
-            name: 'mtu',
-            minValue: 100,
-            maxValue: 65000,
-            fieldLabel: 'MTU',
-            skipEmptyText: true,
-            allowBlank: true,
-            emptyText: 'auto',
-          },
-          {
-            xtype: 'pveNodeSelector',
-            name: 'nodes',
-            fieldLabel: gettext('Nodes'),
-            emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
-            multiSelect: true,
-            autoSelect: false,
-          },
-
 	];
 
 	me.callParent();
diff --git a/www/manager6/sdn/zones/VxlanEdit.js b/www/manager6/sdn/zones/VxlanEdit.js
index 41cc7e68..b556790d 100644
--- a/www/manager6/sdn/zones/VxlanEdit.js
+++ b/www/manager6/sdn/zones/VxlanEdit.js
@@ -21,38 +21,12 @@ Ext.define('PVE.sdn.zones.VxlanInputPanel', {
 	var me = this;
 
 	me.items = [
-	    {
-		xtype: me.isCreate ? 'textfield' : 'displayfield',
-		maxLength: 8,
-		name: 'zone',
-		value: me.zone || '',
-		fieldLabel: 'ID',
-		allowBlank: false,
-	    },
 	    {
 		xtype: 'textfield',
 		name: 'peers',
 		fieldLabel: gettext('Peer Address List'),
 		allowBlank: false,
 	    },
-	    {
-		xtype: 'proxmoxintegerfield',
-		name: 'mtu',
-		minValue: 100,
-		maxValue: 65000,
-		fieldLabel: 'MTU',
-		skipEmptyText: true,
-		allowBlank: true,
-		emptyText: 'auto',
-	    },
-	    {
-		xtype: 'pveNodeSelector',
-		name: 'nodes',
-		fieldLabel: gettext('Nodes'),
-		emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
-		multiSelect: true,
-		autoSelect: false,
-	    },
 	];
 
 	me.callParent();
-- 
2.39.2




             reply	other threads:[~2023-06-17 12:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17 12:43 Alexandre Derumier [this message]
2023-07-19 11:20 ` [pve-devel] applied: " Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230617124305.346338-1-aderumier@odiso.com \
    --to=aderumier@odiso.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal