treewide: import utility classes explicitly
[project/luci.git] / applications / luci-app-statistics / htdocs / luci-static / resources / view / statistics / plugins / iptables.js
index a1b67c1b1775d3a9739e81131a7e1d3153ead886..6dcaf26de640f8f23a799dec098189f1fbba5cc1 100644 (file)
@@ -1,9 +1,10 @@
 '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.'),
 
@@ -11,7 +12,6 @@ return L.Class.extend({
                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');
@@ -33,7 +33,7 @@ return L.Class.extend({
                                                        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] || {};
@@ -85,7 +85,6 @@ return L.Class.extend({
                        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],
@@ -99,7 +98,6 @@ return L.Class.extend({
 
                        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],
@@ -138,7 +136,6 @@ return L.Class.extend({
 
                        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'),