network view: pass generic editOptions config to edit window

Avoid the need to loop through every product specific feature
enablement, rather allow one to pass a generic object including them.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2024-11-16 16:37:14 +01:00
parent 358b98bf4f
commit 0988db8ffc

View File

@ -33,8 +33,8 @@ Ext.define('Proxmox.node.NetworkView', {
showApplyBtn: false, showApplyBtn: false,
// decides if VLAN IDs field for bridges is shown, depends on the product if needed // for options passed down to the network edit window
bridge_set_vids: false, editOptions: {},
initComponent: function() { initComponent: function() {
let me = this; let me = this;
@ -103,7 +103,7 @@ Ext.define('Proxmox.node.NetworkView', {
nodename: me.nodename, nodename: me.nodename,
iface: rec.data.iface, iface: rec.data.iface,
iftype: rec.data.type, iftype: rec.data.type,
bridge_set_vids: me.bridge_set_vids, ...me.editOptions,
listeners: { listeners: {
destroy: () => reload(), destroy: () => reload(),
}, },
@ -174,7 +174,7 @@ Ext.define('Proxmox.node.NetworkView', {
nodename: me.nodename, nodename: me.nodename,
iftype: iType, iftype: iType,
iface_default: findNextFreeInterfaceId(iDefault ?? iType), iface_default: findNextFreeInterfaceId(iDefault ?? iType),
bridge_set_vids: me.bridge_set_vids, ...me.editOptions,
onlineHelp: 'sysadmin_network_configuration', onlineHelp: 'sysadmin_network_configuration',
listeners: { listeners: {
destroy: () => reload(), destroy: () => reload(),