[pmg-devel] [PATCH widget-toolkit 2/2] change network input from address/netmask to cidr and change labels

Dominik Csapak d.csapak at proxmox.com
Tue Apr 16 11:05:40 CEST 2019


this makes the ui easier and is consistent with the rest of our ui
(container and cloud init)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 node/NetworkEdit.js | 68 +++++++----------------------------------------------
 1 file changed, 8 insertions(+), 60 deletions(-)

diff --git a/node/NetworkEdit.js b/node/NetworkEdit.js
index 1478e11..c3ef63c 100644
--- a/node/NetworkEdit.js
+++ b/node/NetworkEdit.js
@@ -210,80 +210,28 @@ Ext.define('Proxmox.node.NetworkEdit', {
 		{
 		    xtype: 'proxmoxtextfield',
 		    deleteEmpty: !me.isCreate,
-		    fieldLabel: gettext('IP address'),
-		    vtype: 'IPAddress',
-		    name: 'address'
-		},
-		{
-		    xtype: 'proxmoxtextfield',
-		    deleteEmpty: !me.isCreate,
-		    fieldLabel: gettext('Subnet mask'),
-		    vtype: 'IPAddress',
-		    name: 'netmask',
-		    validator: function(value) {
-			/*jslint confusion: true */
-			if (!me.items) {
-			    return true;
-			}
-			var address = me.down('field[name=address]').getValue();
-			if (value !== '') {
-			    if (address === '') {
-				return "Subnet mask requires option 'IP address'";
-			    }
-			} else {
-			    if (address !== '') {
-				return "Option 'IP address' requires a subnet mask";
-			    }
-			}
-
-			return true;
-		    }
+		    fieldLabel: 'IPv4/CIDR',
+		    vtype: 'IPCIDRAddress',
+		    name: 'cidr'
 		},
 		{
 		    xtype: 'proxmoxtextfield',
 		    deleteEmpty: !me.isCreate,
-		    fieldLabel: gettext('Gateway'),
+		    fieldLabel: gettext('Gateway') + ' (IPv4)',
 		    vtype: 'IPAddress',
 		    name: 'gateway'
 		},
 		{
 		    xtype: 'proxmoxtextfield',
 		    deleteEmpty: !me.isCreate,
-		    fieldLabel: gettext('IPv6 address'),
-		    vtype: 'IP6Address',
-		    name: 'address6'
-		},
-		{
-		    xtype: 'proxmoxtextfield',
-		    deleteEmpty: !me.isCreate,
-		    fieldLabel: gettext('Prefix length'),
-		    vtype: 'IP6PrefixLength',
-		    name: 'netmask6',
-		    value: '',
-		    allowBlank: true,
-		    validator: function(value) {
-			/*jslint confusion: true */
-			if (!me.items) {
-			    return true;
-			}
-			var address = me.down('field[name=address6]').getValue();
-			if (value !== '') {
-			    if (address === '') {
-				return "IPv6 prefix length requires option 'IPv6 address'";
-			    }
-			} else {
-			    if (address !== '') {
-				return "Option 'IPv6 address' requires an IPv6 prefix length";
-			    }
-			}
-
-			return true;
-		    }
+		    fieldLabel: 'IPv6/CIDR',
+		    vtype: 'IP6CIDRAddress',
+		    name: 'cidr6'
 		},
 		{
 		    xtype: 'proxmoxtextfield',
 		    deleteEmpty: !me.isCreate,
-		    fieldLabel: gettext('Gateway'),
+		    fieldLabel: gettext('Gateway') + ' (IPv6)',
 		    vtype: 'IP6Address',
 		    name: 'gateway6'
 		}
-- 
2.11.0




More information about the pmg-devel mailing list