Revert "luci-mod-status: allow displaying raw iptables counter values"
[project/luci.git] / modules / luci-mod-status / htdocs / luci-static / resources / view / status / iptables.js
index 04abcba9d05794e897e8496e6add8abc1a29e669..2ce744c60e5acdadc5133437f77c064e3ab77d8d 100644 (file)
@@ -1,10 +1,12 @@
 'use strict';
+'require view';
+'require poll';
 'require fs';
 'require ui';
 
 var table_names = [ 'Filter', 'NAT', 'Mangle', 'Raw' ];
 
-return L.view.extend({
+return view.extend({
        load: function() {
                return L.resolveDefault(fs.stat('/usr/sbin/ip6tables'));
        },
@@ -56,18 +58,18 @@ return L.view.extend({
                if (!cdiv) {
                        cdiv = E('div', { 'data-chain': chain }, [
                                E('h4', { 'id': 'rule_%s-%s_%s'.format(is_ipv6 ? 'ipv6' : 'ipv4', table.toLowerCase(), chain) }, title),
-                               E('div', { 'class': 'table' }, [
-                                       E('div', { 'class': 'tr table-titles' }, [
-                                               E('div', { 'class': 'th center' }, _('Pkts.')),
-                                               E('div', { 'class': 'th center' }, _('Traffic')),
-                                               E('div', { 'class': 'th' }, _('Target')),
-                                               E('div', { 'class': 'th' }, _('Prot.')),
-                                               E('div', { 'class': 'th' }, _('In')),
-                                               E('div', { 'class': 'th' }, _('Out')),
-                                               E('div', { 'class': 'th' }, _('Source')),
-                                               E('div', { 'class': 'th' }, _('Destination')),
-                                               E('div', { 'class': 'th' }, _('Options')),
-                                               E('div', { 'class': 'th' }, _('Comment'))
+                               E('table', { 'class': 'table' }, [
+                                       E('tr', { 'class': 'tr table-titles' }, [
+                                               E('th', { 'class': 'th center' }, _('Pkts.')),
+                                               E('th', { 'class': 'th center' }, _('Traffic')),
+                                               E('th', { 'class': 'th' }, _('Target')),
+                                               E('th', { 'class': 'th' }, _('Prot.')),
+                                               E('th', { 'class': 'th' }, _('In')),
+                                               E('th', { 'class': 'th' }, _('Out')),
+                                               E('th', { 'class': 'th' }, _('Source')),
+                                               E('th', { 'class': 'th' }, _('Destination')),
+                                               E('th', { 'class': 'th' }, _('Options')),
+                                               E('th', { 'class': 'th' }, _('Comment'))
                                        ])
                                ])
                        ]);
@@ -130,7 +132,7 @@ return L.view.extend({
                        else if (m[1].match(/^num /)) {
                                continue;
                        }
-                       else if ((m2 = m[1].match(/^(\d+) +(\d+) +(\d+) +(.*?) +(\S+) +(\S*) +(\S+) +(\S+) +([a-f0-9:.]+(?:\/[a-f0-9:.]+)?) +([a-f0-9:.]+(?:\/[a-f0-9:.]+)?) +(.+)$/)) !== null) {
+                       else if ((m2 = m[1].match(/^(\d+) +(\d+) +(\d+) +(.*?) +(\S+) +(\S*) +(\S+) +(\S+) +(!?[a-f0-9:.]+(?:\/[a-f0-9:.]+)?) +(!?[a-f0-9:.]+(?:\/[a-f0-9:.]+)?) +(.+)$/)) !== null) {
                                var num = +m2[1],
                                    pkts = +m2[2],
                                    bytes = +m2[3],
@@ -215,7 +217,7 @@ return L.view.extend({
                if (has_ip6tables)
                        cmds.push('/usr/sbin/ip6tables');
 
-               L.Poll.add(L.bind(function() {
+               poll.add(L.bind(function() {
                        var tasks = [];
 
                        for (var i = 0; i < cmds.length; i++) {