mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-08-08 05:59:19 +00:00
change network input from address/netmask to cidr and change labels
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@proxmox.com>
This commit is contained in:
parent
d0c2b8781a
commit
8e2d096c7f
@ -210,80 +210,28 @@ Ext.define('Proxmox.node.NetworkEdit', {
|
|||||||
{
|
{
|
||||||
xtype: 'proxmoxtextfield',
|
xtype: 'proxmoxtextfield',
|
||||||
deleteEmpty: !me.isCreate,
|
deleteEmpty: !me.isCreate,
|
||||||
fieldLabel: gettext('IP address'),
|
fieldLabel: 'IPv4/CIDR',
|
||||||
vtype: 'IPAddress',
|
vtype: 'IPCIDRAddress',
|
||||||
name: 'address'
|
name: 'cidr'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'proxmoxtextfield',
|
xtype: 'proxmoxtextfield',
|
||||||
deleteEmpty: !me.isCreate,
|
deleteEmpty: !me.isCreate,
|
||||||
fieldLabel: gettext('Subnet mask'),
|
fieldLabel: gettext('Gateway') + ' (IPv4)',
|
||||||
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;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
xtype: 'proxmoxtextfield',
|
|
||||||
deleteEmpty: !me.isCreate,
|
|
||||||
fieldLabel: gettext('Gateway'),
|
|
||||||
vtype: 'IPAddress',
|
vtype: 'IPAddress',
|
||||||
name: 'gateway'
|
name: 'gateway'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'proxmoxtextfield',
|
xtype: 'proxmoxtextfield',
|
||||||
deleteEmpty: !me.isCreate,
|
deleteEmpty: !me.isCreate,
|
||||||
fieldLabel: gettext('IPv6 address'),
|
fieldLabel: 'IPv6/CIDR',
|
||||||
vtype: 'IP6Address',
|
vtype: 'IP6CIDRAddress',
|
||||||
name: 'address6'
|
name: 'cidr6'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'proxmoxtextfield',
|
xtype: 'proxmoxtextfield',
|
||||||
deleteEmpty: !me.isCreate,
|
deleteEmpty: !me.isCreate,
|
||||||
fieldLabel: gettext('Prefix length'),
|
fieldLabel: gettext('Gateway') + ' (IPv6)',
|
||||||
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;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
xtype: 'proxmoxtextfield',
|
|
||||||
deleteEmpty: !me.isCreate,
|
|
||||||
fieldLabel: gettext('Gateway'),
|
|
||||||
vtype: 'IP6Address',
|
vtype: 'IP6Address',
|
||||||
name: 'gateway6'
|
name: 'gateway6'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user