From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit v2 1/1] network: optionally show alternative interface names
Date: Tue, 15 Jul 2025 11:07:48 +0200 [thread overview]
Message-ID: <20250715090749.1608768-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250715090749.1608768-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>
---
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('<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-15 9:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 9:07 [pve-devel] [PATCH manager/widget-toolkit v2 0/2] show altenative interface names in the web ui Dominik Csapak
2025-07-15 9:07 ` Dominik Csapak [this message]
2025-07-15 19:56 ` [pve-devel] [PATCH widget-toolkit v2 1/1] network: optionally show alternative interface names Thomas Lamprecht
2025-07-16 22:47 ` Thomas Lamprecht
2025-07-15 9:07 ` [pve-devel] [PATCH pve-manager v2 1/1] api/ui: show/return " Dominik Csapak
2025-07-15 9:21 ` Stefan Hanreich
2025-07-15 9:30 ` Dominik Csapak
2025-07-15 9:41 ` Stefan Hanreich
2025-07-15 10:33 ` Dominik Csapak
2025-07-15 11:06 ` Stefan Hanreich
2025-07-15 12:36 ` Thomas Lamprecht
2025-07-15 13:08 ` Stefan Hanreich
2025-07-15 13:15 ` Thomas Lamprecht
2025-07-15 13:47 ` Stefan Hanreich
2025-07-17 16:00 ` [pbs-devel] applied: " Thomas Lamprecht
2025-07-17 16:00 ` [pve-devel] applied: " Thomas Lamprecht
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=20250715090749.1608768-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.