Commit 1f325061 authored by Dietmar Maurer's avatar Dietmar Maurer

use new API for IPSetSelector

We now list all available IPSets and Aliases.
parent 2f9ca384
...@@ -200,7 +200,7 @@ Ext.define('PVE.SecurityGroups', { ...@@ -200,7 +200,7 @@ Ext.define('PVE.SecurityGroups', {
var rule_panel = Ext.createWidget('pveFirewallRules', { var rule_panel = Ext.createWidget('pveFirewallRules', {
region: 'center', region: 'center',
allow_groups: false, allow_groups: false,
ipset_base_url: '/cluster/firewall/ipset', ipset_base_url: '/cluster/firewall/refs',
tbar_prefix: '<b>' + gettext('Rules') + ':</b>', tbar_prefix: '<b>' + gettext('Rules') + ':</b>',
flex: 0.75, flex: 0.75,
border: false border: false
......
...@@ -13,29 +13,33 @@ Ext.define('PVE.form.IPSetSelector', { ...@@ -13,29 +13,33 @@ Ext.define('PVE.form.IPSetSelector', {
var store = Ext.create('Ext.data.Store', { var store = Ext.create('Ext.data.Store', {
autoLoad: true, autoLoad: true,
fields: [ { name: 'name', fields: [ 'type', 'name', 'ref', 'comment' ],
convert: function(v) { return '+' + v; }}, idProperty: 'ref',
'comment' ],
idProperty: 'name',
proxy: { proxy: {
type: 'pve', type: 'pve',
url: "/api2/json" + me.base_url url: "/api2/json" + me.base_url
}, },
sorters: { sorters: {
property: 'name', property: 'ref',
order: 'DESC' order: 'DESC'
} }
}); });
Ext.apply(me, { Ext.apply(me, {
store: store, store: store,
valueField: 'name', valueField: 'ref',
displayField: 'name', displayField: 'ref',
listConfig: { listConfig: {
columns: [ columns: [
{ {
header: gettext('IPSet'), header: gettext('Type'),
dataIndex: 'name', dataIndex: 'type',
hideable: false,
width: 60
},
{
header: gettext('Name'),
dataIndex: 'ref',
hideable: false, hideable: false,
width: 100 width: 100
}, },
......
...@@ -26,8 +26,8 @@ Ext.define('PVE.panel.Firewall', { ...@@ -26,8 +26,8 @@ Ext.define('PVE.panel.Firewall', {
title: 'Rules', title: 'Rules',
allow_iface: true, allow_iface: true,
base_url: me.base_url + '/rules', base_url: me.base_url + '/rules',
ipset_base_url: me.fwtype === 'vm' ? (me.base_url + '/ipset') : ipset_base_url: me.fwtype === 'vm' ? (me.base_url + '/refs') :
'/cluster/firewall/ipset', '/cluster/firewall/refs',
itemId: 'rules' itemId: 'rules'
} }
]; ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment