[pve-devel] [PATCH v10 pve-manager 15/19] sdn: evpn improvments

Alexandre Derumier aderumier at odiso.com
Tue Jan 5 10:07:05 CET 2021


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 www/manager6/Makefile                    |  1 +
 www/manager6/Utils.js                    |  5 ++
 www/manager6/sdn/ControllerView.js       |  9 ++++
 www/manager6/sdn/controllers/BgpEdit.js  | 62 ++++++++++++++++++++++++
 www/manager6/sdn/controllers/EvpnEdit.js | 16 +-----
 www/manager6/sdn/zones/Base.js           |  5 ++
 www/manager6/sdn/zones/EvpnEdit.js       |  7 +++
 7 files changed, 91 insertions(+), 14 deletions(-)
 create mode 100644 www/manager6/sdn/controllers/BgpEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 5b702d4b..60850b3e 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -236,6 +236,7 @@ JSSRC= 							\
         sdn/OptionsPanel.js				\
 	sdn/controllers/Base.js				\
 	sdn/controllers/EvpnEdit.js			\
+	sdn/controllers/BgpEdit.js			\
         sdn/IpamView.js                                 \
         sdn/ipams/Base.js                               \
         sdn/ipams/NetboxEdit.js                         \
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 98cb8ca1..89706c32 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -828,6 +828,11 @@ Ext.define('PVE.Utils', { utilities: {
 	    ipanel: 'EvpnInputPanel',
 	    faIcon: 'crosshairs'
 	},
+	bgp: {
+	    name: 'bgp',
+	    ipanel: 'BgpInputPanel',
+	    faIcon: 'crosshairs'
+	},
     },
 
     sdnipamSchema: {
diff --git a/www/manager6/sdn/ControllerView.js b/www/manager6/sdn/ControllerView.js
index e4730be0..9e400f7f 100644
--- a/www/manager6/sdn/ControllerView.js
+++ b/www/manager6/sdn/ControllerView.js
@@ -133,6 +133,15 @@ Ext.define('PVE.sdn.ControllerView', {
                         return PVE.Utils.render_sdn_pending(rec, value, 'type', 1);
                     }
 		},
+		{
+		    header: gettext('Node'),
+		    flex: 1,
+		    sortable: true,
+		    dataIndex: 'node',
+                    renderer: function(value, metaData, rec) {
+                        return PVE.Utils.render_sdn_pending(rec, value, 'node', 1);
+                    }
+		},
                 {
                     header: gettext('Pending'),
                     flex: 3,
diff --git a/www/manager6/sdn/controllers/BgpEdit.js b/www/manager6/sdn/controllers/BgpEdit.js
new file mode 100644
index 00000000..2af7a7bd
--- /dev/null
+++ b/www/manager6/sdn/controllers/BgpEdit.js
@@ -0,0 +1,62 @@
+Ext.define('PVE.sdn.controllers.BgpInputPanel', {
+    extend: 'PVE.panel.SDNControllerBase',
+
+    onlineHelp: 'pvesdn_controller_plugin_evpn',
+
+    initComponent : function() {
+	var me = this;
+
+	me.items = [
+	    {
+		xtype: me.isCreate ? 'textfield' : 'displayfield',
+		name: 'controller',
+		maxLength: 8,
+		value: me.controllerid || '',
+		fieldLabel: 'ID',
+		allowBlank: false
+	    },
+	    {
+		xtype: 'proxmoxintegerfield',
+		name: 'asn',
+		minValue: 1,
+		maxValue: 4294967295,
+		value: 65000,
+		fieldLabel: 'ASN #',
+		allowBlank: false
+	    },
+	    {
+		xtype: 'textfield',
+		name: 'peers',
+		fieldLabel: gettext('Peers'),
+		allowBlank: false
+	    },
+	    {
+		xtype: 'proxmoxcheckbox',
+		name: 'ebgp',
+		uncheckedValue: 0,
+		checked: false,
+		fieldLabel: 'EBGP'
+	    },
+	    {
+		xtype: 'pveNodeSelector',
+		name: 'node',
+		fieldLabel: gettext('Node'),
+		multiSelect: false,
+		autoSelect: false,
+		allowBlank: false
+	    },
+
+	];
+
+	me.advancedItems = [
+
+	    {
+		xtype: 'textfield',
+		name: 'loopback',
+		fieldLabel: gettext('Loopback Interface'),
+	    },
+	];
+
+	me.callParent();
+    }
+});
diff --git a/www/manager6/sdn/controllers/EvpnEdit.js b/www/manager6/sdn/controllers/EvpnEdit.js
index 125a8fc7..5aa924f0 100644
--- a/www/manager6/sdn/controllers/EvpnEdit.js
+++ b/www/manager6/sdn/controllers/EvpnEdit.js
@@ -29,20 +29,8 @@ Ext.define('PVE.sdn.controllers.EvpnInputPanel', {
 		name: 'peers',
 		fieldLabel: gettext('Peers'),
 		allowBlank: false
-	    },
-	    {
-		xtype: 'textfield',
-		name: 'gateway-external-peers',
-		fieldLabel: gettext('External Gateway Peers'),
-		allowBlank: true
-	    },
-	    {
-		xtype: 'pveNodeSelector',
-		name: 'gateway-nodes',
-		fieldLabel: gettext('Gateway Nodes'),
-		multiSelect: true,
-		autoSelect: false
-	    },
+	    }
+
 	];
 
 	me.callParent();
diff --git a/www/manager6/sdn/zones/Base.js b/www/manager6/sdn/zones/Base.js
index 6e2f5c1c..9eb31fd4 100644
--- a/www/manager6/sdn/zones/Base.js
+++ b/www/manager6/sdn/zones/Base.js
@@ -94,6 +94,11 @@ Ext.define('PVE.sdn.zones.BaseEdit', {
 		    if (values.nodes) {
 			values.nodes = values.nodes.split(',');
 		    }
+
+		    if (values.exitnodes) {
+			values.exitnodes = values.exitnodes.split(',');
+		    }
+
 		    values.enable = values.disable ? 0 : 1;
 
 		    ipanel.setValues(values);
diff --git a/www/manager6/sdn/zones/EvpnEdit.js b/www/manager6/sdn/zones/EvpnEdit.js
index f5a9560e..1a078a81 100644
--- a/www/manager6/sdn/zones/EvpnEdit.js
+++ b/www/manager6/sdn/zones/EvpnEdit.js
@@ -35,6 +35,13 @@ Ext.define('PVE.sdn.zones.EvpnInputPanel', {
 	    fieldLabel: 'VRF-VXLAN Tag',
 	    allowBlank: false
 	  },
+	  {
+	    xtype: 'pveNodeSelector',
+	    name: 'exitnodes',
+	    fieldLabel: gettext('Exit Nodes'),
+	    multiSelect: true,
+	    autoSelect: false
+	  },
 	  {
 	    xtype: 'pveSDNControllerSelector',
 	    fieldLabel: gettext('Controller'),
-- 
2.20.1





More information about the pve-devel mailing list