]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - node/NetworkEdit.js
change network input from address/netmask to cidr and change labels
[proxmox-widget-toolkit.git] / node / NetworkEdit.js
index 1478e113e4c427c8bb712eb17f04ae4d7e50be86..c3ef63c32ad9c1aea8a1b0182f79b1087ad30149 100644 (file)
@@ -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'
                }