From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 00C001FF16B for ; Tue, 15 Jul 2025 11:06:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E702A36B4C; Tue, 15 Jul 2025 11:07:52 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Tue, 15 Jul 2025 11:07:48 +0200 Message-Id: <20250715090749.1608768-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250715090749.1608768-1-d.csapak@proxmox.com> References: <20250715090749.1608768-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.020 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH widget-toolkit v2 1/1] network: optionally show alternative interface names X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" add a new (hidden by default) column for the interface names, and show them when editing an existing interface with such alternative names. Signed-off-by: Dominik Csapak --- no changes from v1 src/node/NetworkEdit.js | 19 +++++++++++++++++++ src/node/NetworkView.js | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/node/NetworkEdit.js b/src/node/NetworkEdit.js index b8e23f9..cd9dc7c 100644 --- a/src/node/NetworkEdit.js +++ b/src/node/NetworkEdit.js @@ -5,6 +5,9 @@ Ext.define('Proxmox.node.NetworkEdit', { // Enable to show the VLAN ID field enableBridgeVlanIds: false, + // Show alternative names below normal name + showAltNames: false, + initComponent: function () { let me = this; @@ -363,6 +366,14 @@ Ext.define('Proxmox.node.NetworkEdit', { }, ); + if (me.showAltNames && !me.isCreate) { + column1.push({ + xtype: 'displayfield', + name: 'altnames', + fieldLabel: gettext("Alternative Names"), + }); + } + if (me.iftype === 'OVSBond') { column1.push( { @@ -449,6 +460,14 @@ Ext.define('Proxmox.node.NetworkEdit', { }); return; } + + if (data.altnames) { + if (Ext.isArray(data.altnames)) { + data.altnames = data.altnames.join('
'); + } + } else { + me.down('field[name=altnames]').setVisible(false); + } me.setValues(data); me.isValid(); // trigger validation }, diff --git a/src/node/NetworkView.js b/src/node/NetworkView.js index cf8e6b7..0c62388 100644 --- a/src/node/NetworkView.js +++ b/src/node/NetworkView.js @@ -4,6 +4,7 @@ Ext.define('proxmox-networks', { 'active', 'address', 'address6', + 'altnames', 'autostart', 'bridge_ports', 'cidr', @@ -33,6 +34,9 @@ Ext.define('Proxmox.node.NetworkView', { showApplyBtn: false, + // if true, the altnames column will be shown by default + showAltNames: false, + // for options passed down to the network edit window editOptions: {}, @@ -103,6 +107,7 @@ Ext.define('Proxmox.node.NetworkView', { nodename: me.nodename, iface: rec.data.iface, iftype: rec.data.type, + showAltNames: me.showAltNames, ...me.editOptions, listeners: { destroy: () => reload(), @@ -278,6 +283,21 @@ Ext.define('Proxmox.node.NetworkView', { sortable: true, dataIndex: 'iface', }, + { + header: gettext("Alternative Names"), + dataIndex: 'altnames', + hidden: !me.showAltNames, + width: 140, // enough space for 'enx' + renderer: (value) => { + if (!value) { + return ''; + } + if (Ext.isArray(value)) { + return value.map(Ext.htmlEncode).join('
'); + } + return Ext.htmlEncode(value); + }, + }, { header: gettext('Type'), sortable: true, -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel