'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'));
},
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'))
])
])
]);
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],
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++) {