[pve-devel] [PATCH v12 pve-manager 4/4] sdn: controllers: bgp: use node as controllerid

Alexandre Derumier aderumier at odiso.com
Wed Apr 21 23:53:39 CEST 2021


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 www/manager6/sdn/controllers/BgpEdit.js | 31 ++++++++++++++-----------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/www/manager6/sdn/controllers/BgpEdit.js b/www/manager6/sdn/controllers/BgpEdit.js
index 062fb2b4..8c6de400 100644
--- a/www/manager6/sdn/controllers/BgpEdit.js
+++ b/www/manager6/sdn/controllers/BgpEdit.js
@@ -3,16 +3,29 @@ Ext.define('PVE.sdn.controllers.BgpInputPanel', {
 
     onlineHelp: 'pvesdn_controller_plugin_evpn',
 
+    onGetValues: function(values) {
+        var me = this;
+
+        if (me.isCreate) {
+            values.type = me.type;
+	    values.controller = 'bgp' + values.node;
+        } else {
+            delete values.controller;
+        }
+
+        return values;
+    },
+
     initComponent : function() {
 	var me = this;
 
 	me.items = [
 	    {
-		xtype: me.isCreate ? 'textfield' : 'displayfield',
-		name: 'controller',
-		maxLength: 8,
-		value: me.controllerid || '',
-		fieldLabel: 'ID',
+		xtype: 'pveNodeSelector',
+		name: 'node',
+		fieldLabel: gettext('Node'),
+		multiSelect: false,
+		autoSelect: false,
 		allowBlank: false
 	    },
 	    {
@@ -37,14 +50,6 @@ Ext.define('PVE.sdn.controllers.BgpInputPanel', {
 		checked: false,
 		fieldLabel: 'EBGP'
 	    },
-	    {
-		xtype: 'pveNodeSelector',
-		name: 'node',
-		fieldLabel: gettext('Node'),
-		multiSelect: false,
-		autoSelect: false,
-		allowBlank: false
-	    },
 
 	];
 
-- 
2.20.1





More information about the pve-devel mailing list