[pve-devel] [PATCH widget-toolkit v2 1/1] network: optionally show alternative interface names
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Jul 15 21:56:45 CEST 2025
Am 15.07.25 um 11:07 schrieb Dominik Csapak:
> add a new (hidden by default) column for the interface names, and show
> them when editing an existing interface with such alternative names.
>
Look OK code-wise in general, UX comments inline.
> Signed-off-by: Dominik Csapak <d.csapak at 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
> @@ -449,6 +460,14 @@ Ext.define('Proxmox.node.NetworkEdit', {
> });
> return;
> }
> +
> + if (data.altnames) {
> + if (Ext.isArray(data.altnames)) {
> + data.altnames = data.altnames.join('<br>');
hmm, with a handful of interfaces each having a handful of altnames
this would increase the height quite a bit I would think.
What do you think about joining the array with comma+space and enabling
sensible text wrapping on word boundaries in this column instead?
> + }
> + } 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
> @@ -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>');
same as above w.r.t. join separator.
> + }
> + return Ext.htmlEncode(value);
> + },
> + },
> {
> header: gettext('Type'),
> sortable: true,
More information about the pve-devel
mailing list