mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 18:50:36 +00:00
add some gui widgets for firewall
This commit is contained in:
parent
b14da6fb0c
commit
98282daade
16
www/manager/form/FirewallPolicySelector.js
Normal file
16
www/manager/form/FirewallPolicySelector.js
Normal file
@ -0,0 +1,16 @@
|
||||
Ext.define('PVE.form.FirewallPolicySelector', {
|
||||
extend: 'PVE.form.KVComboBox',
|
||||
alias: ['widget.pveFirewallPolicySelector'],
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
me.data = [
|
||||
['ACCEPT', 'ACCEPT'],
|
||||
['REJECT', 'REJECT'],
|
||||
[ 'DROP', 'DROP']
|
||||
];
|
||||
|
||||
me.callParent();
|
||||
}
|
||||
});
|
48
www/manager/form/IPSetSelector.js
Normal file
48
www/manager/form/IPSetSelector.js
Normal file
@ -0,0 +1,48 @@
|
||||
Ext.define('PVE.form.IPSetSelector', {
|
||||
extend: 'PVE.form.ComboGrid',
|
||||
alias: ['widget.pveIPSetSelector'],
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
var store = Ext.create('Ext.data.Store', {
|
||||
autoLoad: true,
|
||||
fields: [ { name: 'name',
|
||||
convert: function(v) { return '+' + v; }},
|
||||
'comment' ],
|
||||
idProperty: 'name',
|
||||
proxy: {
|
||||
type: 'pve',
|
||||
url: "/api2/json/cluster/firewall/ipset"
|
||||
},
|
||||
sorters: {
|
||||
property: 'name',
|
||||
order: 'DESC'
|
||||
}
|
||||
});
|
||||
|
||||
Ext.apply(me, {
|
||||
store: store,
|
||||
valueField: 'name',
|
||||
displayField: 'name',
|
||||
listConfig: {
|
||||
columns: [
|
||||
{
|
||||
header: gettext('IPSet'),
|
||||
dataIndex: 'name',
|
||||
hideable: false,
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
header: gettext('Comment'),
|
||||
dataIndex: 'comment',
|
||||
flex: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
me.callParent();
|
||||
}
|
||||
});
|
||||
|
46
www/manager/form/SecurityGroupSelector.js
Normal file
46
www/manager/form/SecurityGroupSelector.js
Normal file
@ -0,0 +1,46 @@
|
||||
Ext.define('PVE.form.SecurityGroupsSelector', {
|
||||
extend: 'PVE.form.ComboGrid',
|
||||
alias: ['widget.pveSecurityGroupsSelector'],
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
var store = Ext.create('Ext.data.Store', {
|
||||
autoLoad: true,
|
||||
fields: [ 'group', 'comment' ],
|
||||
idProperty: 'group',
|
||||
proxy: {
|
||||
type: 'pve',
|
||||
url: "/api2/json/cluster/firewall/groups"
|
||||
},
|
||||
sorters: {
|
||||
property: 'group',
|
||||
order: 'DESC'
|
||||
}
|
||||
});
|
||||
|
||||
Ext.apply(me, {
|
||||
store: store,
|
||||
valueField: 'group',
|
||||
displayField: 'group',
|
||||
listConfig: {
|
||||
columns: [
|
||||
{
|
||||
header: gettext('Security Group'),
|
||||
dataIndex: 'group',
|
||||
hideable: false,
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
header: gettext('Comment'),
|
||||
dataIndex: 'comment',
|
||||
flex: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
me.callParent();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user