'use strict';
+'require baseclass';
'require fs';
'require uci';
'require form';
-return L.Class.extend({
+return baseclass.extend({
title: _('Iptables Plugin Configuration'),
description: _('The iptables plugin will monitor selected firewall rules and collect information about processed bytes and packets per rule.'),
var o, ss;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
- o.default = '0';
for (var family = 4; family <= 6; family += 2) {
var suffix = (family == 4 ? '' : '6');
table = m[1];
count = {};
}
- else if ((m = lines[i].match(/^-A (.+?) (-.+)$/)) != null) {
+ else if ((m = lines[i].match(/^-A (.+?) ([!-].+)$/)) != null) {
count[m[1]] = (count[m[1]] || 0) + 1;
iptables[table] = iptables[table] || {};
o = ss.option(form.Value, 'table', _('Table'));
o.default = 'filter';
o.optional = true;
- o.rmempty = true;
o.transformChoices = function() { return this.super('transformChoices', []) || {} };
o.validate = function(section_id, table) {
var chain_opt = this.section.children.filter(function(o) { return o.option == 'chain' })[0],
o = ss.option(form.Value, 'chain', _('Chain'));
o.optional = true;
- o.rmempty = true;
o.transformChoices = function() { return this.super('transformChoices', []) || {} };
o.validate = function(section_id, chain) {
var table_opt = this.section.children.filter(function(o) { return o.option == 'table' })[0],
o = ss.option(form.Value, 'rule', _('Comment / Rule Number'));
o.optional = true;
- o.rmempty = true;
o.transformChoices = function() { return this.super('transformChoices', []) || {} };
o.load = function(section_id) {
var table = uci.get('luci_statistics', section_id, 'table'),