Commit ae8ab925 authored by Wolfgang Bumiller's avatar Wolfgang Bumiller Committed by Dietmar Maurer

www/network: node networking: ipv6 support

IPv6 address shown in cidr notation in the IP address
column, the subnet column only includes the ipv4 subnet
mask, the gateway includes both.
parent 3bd4a056
......@@ -233,6 +233,48 @@ Ext.define('PVE.node.NetworkEdit', {
fieldLabel: gettext('Gateway'),
vtype: 'IPAddress',
name: 'gateway'
},
{
xtype: 'pvetextfield',
deleteEmpty: !me.create,
fieldLabel: gettext('IPv6 address'),
vtype: 'IP6Address',
name: 'address6'
},
{
xtype: 'numberfield',
deleteEmpty: !me.create,
fieldLabel: gettext('Prefix length'),
name: 'netmask6',
value: '',
minValue: 0,
maxValue: 128,
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: 'pvetextfield',
deleteEmpty: !me.create,
fieldLabel: gettext('Gateway'),
vtype: 'IP6Address',
name: 'gateway6'
}
]);
}
......
......@@ -266,7 +266,17 @@ Ext.define('PVE.node.NetworkView', {
{
header: gettext('IP address'),
sortable: true,
dataIndex: 'address'
dataIndex: 'address',
renderer: function(value, metaData, rec) {
if (rec.data.address && rec.data.address6) {
return rec.data.address + "<br>"
+ rec.data.address6 + '/' + rec.data.netmask6;
} else if (rec.data.address6) {
return rec.data.address6 + '/' + rec.data.netmask6;
} else {
return rec.data.address;
}
}
},
{
header: gettext('Subnet mask'),
......@@ -276,7 +286,16 @@ Ext.define('PVE.node.NetworkView', {
{
header: gettext('Gateway'),
sortable: true,
dataIndex: 'gateway'
dataIndex: 'gateway',
renderer: function(value, metaData, rec) {
if (rec.data.gateway && rec.data.gateway6) {
return rec.data.gateway + "<br>" + rec.data.gateway6;
} else if (rec.data.gateway6) {
return rec.data.gateway6;
} else {
return rec.data.gateway;
}
}
}
],
listeners: {
......@@ -312,8 +331,9 @@ Ext.define('PVE.node.NetworkView', {
extend: 'Ext.data.Model',
fields: [
'iface', 'type', 'active', 'autostart',
'bridge_ports', 'slaves', 'address',
'netmask', 'gateway'
'bridge_ports', 'slaves',
'address', 'netmask', 'gateway',
'address6', 'netmask6', 'gateway6',
],
idProperty: 'iface'
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment