[pve-devel] [PATCH pve-manager 3/3] sdn: add simple zone plugin

Alexandre Derumier aderumier at odiso.com
Wed Jul 1 09:11:10 CEST 2020


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 www/manager6/Makefile                |  1 +
 www/manager6/Utils.js                |  5 +++
 www/manager6/sdn/zones/SimpleEdit.js | 53 ++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)
 create mode 100644 www/manager6/sdn/zones/SimpleEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index ff452184..46254c04 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -203,6 +203,7 @@ JSSRC= 				                 	\
 	sdn/zones/VxlanEdit.js				\
 	sdn/zones/QinQEdit.js				\
 	sdn/zones/EvpnEdit.js				\
+	sdn/zones/SimpleEdit.js				\
 	sdn/ControllerView.js				\
 	sdn/controllers/Base.js				\
 	sdn/controllers/EvpnEdit.js			\
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 1dae292e..c5a76dcd 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -669,6 +669,11 @@ Ext.define('PVE.Utils', { utilities: {
 	     name: 'zone',
 	     hideAdd: true
 	},
+	simple: {
+	    name: 'Simple',
+	    ipanel: 'SimpleInputPanel',
+	    faIcon: 'th'
+	},
 	vlan: {
 	    name: 'VLAN',
 	    ipanel: 'VlanInputPanel',
diff --git a/www/manager6/sdn/zones/SimpleEdit.js b/www/manager6/sdn/zones/SimpleEdit.js
new file mode 100644
index 00000000..683d6766
--- /dev/null
+++ b/www/manager6/sdn/zones/SimpleEdit.js
@@ -0,0 +1,53 @@
+Ext.define('PVE.sdn.zones.SimpleInputPanel', {
+    extend: 'PVE.panel.SDNZoneBase',
+
+    onlineHelp: 'pvesdn_zone_plugin_simple',
+
+    onGetValues: function(values) {
+        var me = this;
+
+        if (me.isCreate) {
+            values.type = me.type;
+        } else {
+            delete values.zone;
+        }
+
+        return values;
+    },
+
+    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.callParent();
+    }
+});
-- 
2.20.1




More information about the pve-devel mailing list