mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 13:36:37 +00:00

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>
51 lines
905 B
JavaScript
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',
|
|
});
|
|
});
|