lxc: Add Disconnect option for network interfaces

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
This commit is contained in:
Christoph Heiss 2023-02-22 13:49:03 +01:00 committed by Wolfgang Bumiller
parent 20201caa93
commit f8c6696eb6
2 changed files with 16 additions and 0 deletions

View File

@ -298,6 +298,8 @@ Ext.define('PVE.Parser', {
data[match_res[1]] = match_res[2]; data[match_res[1]] = match_res[2];
} else if ((match_res = p.match(/^firewall=(\d+)$/)) !== null) { } else if ((match_res = p.match(/^firewall=(\d+)$/)) !== null) {
data.firewall = PVE.Parser.parseBoolean(match_res[1]); data.firewall = PVE.Parser.parseBoolean(match_res[1]);
} else if ((match_res = p.match(/^link_down=(\d+)$/)) !== null) {
data.link_down = PVE.Parser.parseBoolean(match_res[1]);
} else if (!p.match(/^type=\S+$/)) { } else if (!p.match(/^type=\S+$/)) {
console.warn(`could not parse LXC network string ${p}`); console.warn(`could not parse LXC network string ${p}`);
} }
@ -319,6 +321,7 @@ Ext.define('PVE.Parser', {
name: 1, name: 1,
rate: 1, rate: 1,
tag: 1, tag: 1,
link_down: 1,
}; };
return Object.entries(config) return Object.entries(config)
.filter(([k, v]) => v !== undefined && v !== '' && knownKeys[k]) .filter(([k, v]) => v !== undefined && v !== '' && knownKeys[k])

View File

@ -273,6 +273,12 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
]; ];
me.advancedColumn1 = [ me.advancedColumn1 = [
{
xtype: 'proxmoxcheckbox',
fieldLabel: gettext('Disconnect'),
name: 'link_down',
value: cdata.link_down,
},
{ {
xtype: 'proxmoxintegerfield', xtype: 'proxmoxintegerfield',
fieldLabel: 'MTU', fieldLabel: 'MTU',
@ -539,6 +545,12 @@ Ext.define('PVE.lxc.NetworkView', {
width: 80, width: 80,
dataIndex: 'mtu', dataIndex: 'mtu',
}, },
{
header: gettext('Disconnected'),
width: 100,
dataIndex: 'link_down',
renderer: Proxmox.Utils.format_boolean,
},
], ],
listeners: { listeners: {
activate: me.load, activate: me.load,
@ -564,6 +576,7 @@ Ext.define('PVE.lxc.NetworkView', {
'tag', 'tag',
'firewall', 'firewall',
'mtu', 'mtu',
'link_down',
], ],
}); });
}); });