and send the scoped value to the firewall when choosing new values.
This happens for both IPSets and aliases.
Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
ref_type: undefined, // undefined = any [undefined, 'ipset' or 'alias']
ref_type: undefined, // undefined = any [undefined, 'ipset' or 'alias']
+ valueField: 'scopedref',
displayField: 'ref',
notFoundIsValid: true,
displayField: 'ref',
notFoundIsValid: true,
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
- fields: ['type', 'name', 'ref', 'comment'],
+ fields: [
+ 'type',
+ 'name',
+ 'ref',
+ 'comment',
+ 'scope',
+ {
+ name: 'scopedref',
+ calculate: function(v) {
+ if (v.type === 'alias') {
+ return `${v.scope}/${v.name}`;
+ } else {
+ return `+${v.scope}/${v.name}`;
+ }
+ },
+ },
+ ],
idProperty: 'ref',
proxy: {
type: 'proxmox',
idProperty: 'ref',
proxy: {
type: 'proxmox',
hideable: false,
width: 140,
},
hideable: false,
width: 140,
},
+ {
+ header: gettext('Scope'),
+ dataIndex: 'scope',
+ hideable: false,
+ width: 140,
+ renderer: function(value) {
+ return value === 'dc' ? gettext("Datacenter") : gettext("Guest");
+ },
+ },
{
header: gettext('Comment'),
dataIndex: 'comment',
renderer: Ext.String.htmlEncode,
{
header: gettext('Comment'),
dataIndex: 'comment',
renderer: Ext.String.htmlEncode,
flex: 1,
},
);
Ext.apply(me, {
store: store,
flex: 1,
},
);
Ext.apply(me, {
store: store,
- listConfig: { columns: columns },
+ listConfig: {
+ columns: columns,
+ width: 500,
+ },
});
me.on('change', disable_query_for_ips);
});
me.on('change', disable_query_for_ips);