[pve-devel] [PATCH manager] Add mac prefix to the datacenter options

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Jul 15 10:02:29 CEST 2016


---
 www/manager6/dc/OptionView.js | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index 2149cb0..11f563c 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -99,6 +99,31 @@ Ext.define('PVE.dc.EmailFromEdit', {
     }
 });
 
+Ext.define('PVE.dc.MacPrefixEdit', {
+    extend: 'PVE.window.Edit',
+
+    initComponent : function() {
+	var me = this;
+
+	Ext.applyIf(me, {
+	    subject: gettext('MAC address prefix'),
+	    items: {
+		xtype: 'pvetextfield',
+		name: 'mac_prefix',
+		regex: /[a-f0-9]{2}(?::[a-f0-9]{2}){0,2}:?/i,
+		emptyText: 'none',
+		deleteEmpty: true,
+		value: '',
+		fieldLabel: gettext('MAC address prefix')
+	    }
+	});
+
+	me.callParent();
+
+	me.load();
+    }
+});
+
 Ext.define('PVE.dc.OptionView', {
     extend: 'PVE.grid.ObjectGrid',
     alias: ['widget.pveDcOptionView'],
@@ -146,6 +171,17 @@ Ext.define('PVE.dc.OptionView', {
 		    }
 		    return value;
 		}
+	    },
+	    mac_prefix: {
+		header: gettext('MAC address prefix'),
+		editor: 'PVE.dc.MacPrefixEdit', 
+		required: true,
+		renderer: function(value) {
+		    if (!value) {
+			return 'Do not use a prefix for MAC addresses';
+		    }
+		    return value;
+		}
 	    }
 	};
 
-- 
2.1.4





More information about the pve-devel mailing list