From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit 1/1] network: optionally show alternative interface names
Date: Mon, 14 Jul 2025 12:42:34 +0200 [thread overview]
Message-ID: <20250714104235.2107690-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250714104235.2107690-1-d.csapak@proxmox.com>
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 <d.csapak@proxmox.com>
---
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('<br>');
+ }
+ } 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<MAC>'
+ renderer: (value) => {
+ if (!value) {
+ return '';
+ }
+ if (Ext.isArray(value)) {
+ return value.map(Ext.htmlEncode).join('<br>');
+ }
+ 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
next prev parent reply other threads:[~2025-07-14 10:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 10:42 [pve-devel] [PATCH manager/widget-toolkit 0/2] show altenative interface names in the web ui Dominik Csapak
2025-07-14 10:42 ` Dominik Csapak [this message]
2025-07-14 10:42 ` [pve-devel] [PATCH pve-manager 1/1] api/ui: show/return alternative interface names Dominik Csapak
2025-07-14 13:49 ` [pve-devel] [PATCH manager/widget-toolkit 0/2] show altenative interface names in the web ui Christoph Heiss
2025-07-14 13:53 ` Dominik Csapak
2025-07-14 14:31 ` Thomas Lamprecht
2025-07-15 7:41 ` Dominik Csapak
2025-07-15 8:17 ` Thomas Lamprecht
2025-07-15 8:36 ` Dominik Csapak
2025-07-15 8:54 ` Thomas Lamprecht
2025-07-15 9:00 ` Dominik Csapak
2025-07-15 9:01 ` Thomas Lamprecht
2025-07-15 9:08 ` [pve-devel] superseded: " Dominik Csapak
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=20250714104235.2107690-2-d.csapak@proxmox.com \
--to=d.csapak@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