[pve-devel] [RFC manager] fix: # 2123 Logging of user defined firewall rules

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Mar 18 10:13:19 CET 2019


On 3/15/19 2:51 PM, Christian Ebner wrote:
> This patch relies on the corresponding patch to pve-firewall, adding the user
> defined log levels for firewall rules.
> 
> By this, the user can select a per rule log level for self defined rules. These
> are independent of the global log level, which is defined in the firewall options.
> 
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
>  www/manager6/grid/FirewallRules.js | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
> index 85b30371..27795e96 100644
> --- a/www/manager6/grid/FirewallRules.js
> +++ b/www/manager6/grid/FirewallRules.js
> @@ -59,7 +59,7 @@ Ext.define('PVE.FirewallRulePanel', {
>  	// hack: editable ComboGrid returns nothing when empty, so we need to set ''
>  	// Also, disabled text fields return nothing, so we need to set ''
>  
> -	Ext.Array.each(['source', 'dest', 'macro', 'proto', 'sport', 'dport'], function(key) {
> +	Ext.Array.each(['source', 'dest', 'macro', 'proto', 'sport', 'dport', 'log'], function(key) {
>  	    if (values[key] === undefined) {
>  		values[key] = '';
>  	    }
> @@ -205,9 +205,18 @@ Ext.define('PVE.FirewallRulePanel', {
>  		name: 'dport',
>  		value: '',
>  		fieldLabel: gettext('Dest. port')
> +	    },
> +	    {
> +		xtype: 'proxmoxKVComboBox',
> +		name: 'log',
> +		value: 'nolog',
> +		fieldLabel: gettext('Log level'),
> +		comboItems: [['nolog', 'nolog'], ['info', 'info'], ['err', 'err'],
> +		    ['warning', 'warning'], ['crit', 'crit'], ['alert', 'alert'],
> +		    ['emerg', 'emerg'], ['debug', 'debug']]

we have the exact same array already defined in PVE.FirewallOptions, maybe we want to
share them? Or make a a mini-component definition in one of the two files we're using
it?

>  	    }
>  	];
> -	
> +
>  	me.columnB = [
>  	    {
>  		xtype: 'textfield',
> @@ -736,6 +745,14 @@ Ext.define('PVE.FirewallRules', {
>  		width: 100
>  	    },
>  	    {
> +		header: gettext('Log level'),
> +		dataIndex: 'log',
> +		renderer: function(value, metaData, record) {
> +		    return render_errors('log', value, metaData, record);
> +		},
> +		width: 100
> +	    },
> +	    {
>  		header: gettext('Comment'),
>  		dataIndex: 'comment',
>  		flex: 1,
> 





More information about the pve-devel mailing list