]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
lxc: Add `Disconnect` option for network interfaces
authorChristoph Heiss <c.heiss@proxmox.com>
Wed, 22 Feb 2023 12:49:03 +0000 (13:49 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 16 Mar 2023 15:04:10 +0000 (16:04 +0100)
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
www/manager6/Parser.js
www/manager6/lxc/Network.js

index 9f7b2c84ddb72946e20dbd6a67a9cdc2b635064d..c3772d3bb688e39ba1eb3059e7dcfd8e25c0e762 100644 (file)
@@ -298,6 +298,8 @@ Ext.define('PVE.Parser', {
                data[match_res[1]] = match_res[2];
            } else if ((match_res = p.match(/^firewall=(\d+)$/)) !== null) {
                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+$/)) {
                console.warn(`could not parse LXC network string ${p}`);
            }
@@ -319,6 +321,7 @@ Ext.define('PVE.Parser', {
            name: 1,
            rate: 1,
            tag: 1,
+           link_down: 1,
        };
        return Object.entries(config)
            .filter(([k, v]) => v !== undefined && v !== '' && knownKeys[k])
index 85033bd86b82651812c095dec80e8a1631f90665..b2cd94109485e15d2f78d20c9c014df8fdb24b52 100644 (file)
@@ -273,6 +273,12 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
        ];
 
        me.advancedColumn1 = [
+           {
+               xtype: 'proxmoxcheckbox',
+               fieldLabel: gettext('Disconnect'),
+               name: 'link_down',
+               value: cdata.link_down,
+           },
            {
                xtype: 'proxmoxintegerfield',
                fieldLabel: 'MTU',
@@ -539,6 +545,12 @@ Ext.define('PVE.lxc.NetworkView', {
                    width: 80,
                    dataIndex: 'mtu',
                },
+               {
+                   header: gettext('Disconnected'),
+                   width: 100,
+                   dataIndex: 'link_down',
+                   renderer: Proxmox.Utils.format_boolean,
+               },
            ],
            listeners: {
                activate: me.load,
@@ -564,6 +576,7 @@ Ext.define('PVE.lxc.NetworkView', {
            'tag',
            'firewall',
            'mtu',
+           'link_down',
        ],
     });
 });