pve-manager/www/manager6/form/SDNZoneSelector.js
Stefan Hanreich ef3c6d04d1 sdn: vnets: hide irrelevant fields depending on zone type
Not all fields in the VnetEdit dialog are necessary for every zone
type. This lead to confusion for some users. Hide fields in the
VNetEdit dialog depending on which kind of zone is selected in order
to prevent potential confusion.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Theodor Fumics <theodor.fumics@gmx.net>
Reviewed-by: Theodor Fumics <theodor.fumics@gmx.net>
2024-07-30 19:58:38 +02:00

51 lines
905 B
JavaScript

Ext.define('PVE.form.SDNZoneSelector', {
extend: 'Proxmox.form.ComboGrid',
alias: ['widget.pveSDNZoneSelector'],
allowBlank: false,
valueField: 'zone',
displayField: 'zone',
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
model: 'pve-sdn-zone',
sorters: {
property: 'zone',
direction: 'ASC',
},
});
Ext.apply(me, {
store: store,
autoSelect: false,
listConfig: {
columns: [
{
header: gettext('Zone'),
sortable: true,
dataIndex: 'zone',
flex: 1,
},
],
},
});
me.callParent();
store.load();
},
}, function() {
Ext.define('pve-sdn-zone', {
extend: 'Ext.data.Model',
fields: ['zone', 'type'],
proxy: {
type: 'proxmox',
url: "/api2/json/cluster/sdn/zones",
},
idProperty: 'zone',
});
});