public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 manager 4/4] lxc: Add `Disconnect` option for network interfaces
Date: Wed, 15 Feb 2023 15:02:45 +0100	[thread overview]
Message-ID: <20230215140245.496507-5-c.heiss@proxmox.com> (raw)
In-Reply-To: <20230215140245.496507-1-c.heiss@proxmox.com>

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Changes v1 -> v2:
 * Rename option to kebap-case

 www/manager6/Parser.js      |  3 +++
 www/manager6/lxc/Network.js | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js
index 9f7b2c84..120a4168 100644
--- a/www/manager6/Parser.js
+++ b/www/manager6/Parser.js
@@ -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])
diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
index 85033bd8..46bf062c 100644
--- a/www/manager6/lxc/Network.js
+++ b/www/manager6/lxc/Network.js
@@ -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',
 	],
     });
 });
--
2.39.1





      parent reply	other threads:[~2023-02-15 14:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 14:02 [pve-devel] [PATCH v2 container/manager 0/4] fix #3413: Add `Disconnect` option for LXC networks Christoph Heiss
2023-02-15 14:02 ` [pve-devel] [PATCH v2 container 1/4] lxc: Fix some trailing whitespace Christoph Heiss
2023-02-17 14:22   ` Wolfgang Bumiller
2023-02-20 11:13     ` Christoph Heiss
2023-02-15 14:02 ` [pve-devel] [PATCH v2 container 2/4] lxc: Avoid open-coding normal vs SDN-specific tap_plug() Christoph Heiss
2023-02-17 14:34   ` Wolfgang Bumiller
2023-02-20 11:17     ` Christoph Heiss
2023-02-15 14:02 ` [pve-devel] [PATCH v2 container 3/4] lxc: Add `link-down` config to allow setting interfaces as disconnected Christoph Heiss
2023-02-17 14:51   ` Wolfgang Bumiller
2023-02-17 16:38     ` Thomas Lamprecht
2023-02-20 11:51       ` Christoph Heiss
2023-02-20 12:33         ` Wolfgang Bumiller
2023-02-20 12:37           ` Thomas Lamprecht
2023-02-15 14:02 ` Christoph Heiss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230215140245.496507-5-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal