summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js319
-rw-r--r--applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js290
-rw-r--r--applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js401
-rw-r--r--applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js249
-rw-r--r--applications/luci-app-firewall/luasrc/controller/firewall.lua9
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua162
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua133
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua365
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua273
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua229
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua104
-rw-r--r--applications/luci-app-firewall/po/de/firewall.po50
-rw-r--r--applications/luci-app-mwan3/po/de/mwan3.po26
-rw-r--r--applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js4
-rw-r--r--applications/luci-app-opkg/po/ca/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/cs/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/de/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/el/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/en/opkg.po4
-rw-r--r--applications/luci-app-opkg/po/es/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/fr/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/he/opkg.po4
-rw-r--r--applications/luci-app-opkg/po/hu/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/it/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/ja/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/ko/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/ms/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/no/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/pl/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/pt-br/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/pt/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/ro/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/ru/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/sk/opkg.po4
-rw-r--r--applications/luci-app-opkg/po/sv/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/templates/opkg.pot4
-rw-r--r--applications/luci-app-opkg/po/tr/opkg.po4
-rw-r--r--applications/luci-app-opkg/po/uk/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/vi/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/zh-cn/opkg.po8
-rw-r--r--applications/luci-app-opkg/po/zh-tw/opkg.po8
-rw-r--r--applications/luci-app-simple-adblock/Makefile2
-rw-r--r--applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua133
-rw-r--r--applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock2
-rw-r--r--applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua54
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua8
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/apcups.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/conntrack.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/contextswitch.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/cpu.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/cpufreq.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/csv.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/curl.lua4
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/df.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/disk.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/dns.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/email.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/entropy.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/exec.lua4
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/interface.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/iptables.lua4
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/irq.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/iwinfo.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/load.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/memory.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/netlink.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/network.lua4
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/nut.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/olsrd.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/openvpn.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/ping.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/processes.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/rrdtool.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/sensors.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/splash_leases.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/tcpconns.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/thermal.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/unixsock.lua9
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/plugins/uptime.lua9
-rwxr-xr-xapplications/luci-app-statistics/root/usr/bin/stat-genconfig194
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua6
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua6
-rw-r--r--applications/luci-app-travelmate/po/es/travelmate.po8
-rw-r--r--applications/luci-app-travelmate/po/ja/travelmate.po18
-rw-r--r--applications/luci-app-travelmate/po/pt-br/travelmate.po8
-rw-r--r--applications/luci-app-travelmate/po/ru/travelmate.po8
-rw-r--r--applications/luci-app-travelmate/po/templates/travelmate.pot8
-rw-r--r--applications/luci-app-travelmate/po/zh-cn/travelmate.po8
-rw-r--r--applications/luci-app-travelmate/po/zh-tw/travelmate.po8
89 files changed, 1887 insertions, 1671 deletions
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js
new file mode 100644
index 000000000..909540eaf
--- /dev/null
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js
@@ -0,0 +1,319 @@
+'use strict';
+'require ui';
+'require uci';
+'require form';
+'require network';
+'require firewall';
+'require tools.prng as random';
+
+var protocols = [
+ 'ip', 0, 'IP',
+ 'hopopt', 0, 'HOPOPT',
+ 'icmp', 1, 'ICMP',
+ 'igmp', 2, 'IGMP',
+ 'ggp', 3 , 'GGP',
+ 'ipencap', 4, 'IP-ENCAP',
+ 'st', 5, 'ST',
+ 'tcp', 6, 'TCP',
+ 'egp', 8, 'EGP',
+ 'igp', 9, 'IGP',
+ 'pup', 12, 'PUP',
+ 'udp', 17, 'UDP',
+ 'hmp', 20, 'HMP',
+ 'xns-idp', 22, 'XNS-IDP',
+ 'rdp', 27, 'RDP',
+ 'iso-tp4', 29, 'ISO-TP4',
+ 'dccp', 33, 'DCCP',
+ 'xtp', 36, 'XTP',
+ 'ddp', 37, 'DDP',
+ 'idpr-cmtp', 38, 'IDPR-CMTP',
+ 'ipv6', 41, 'IPv6',
+ 'ipv6-route', 43, 'IPv6-Route',
+ 'ipv6-frag', 44, 'IPv6-Frag',
+ 'idrp', 45, 'IDRP',
+ 'rsvp', 46, 'RSVP',
+ 'gre', 47, 'GRE',
+ 'esp', 50, 'IPSEC-ESP',
+ 'ah', 51, 'IPSEC-AH',
+ 'skip', 57, 'SKIP',
+ 'ipv6-icmp', 58, 'IPv6-ICMP',
+ 'ipv6-nonxt', 59, 'IPv6-NoNxt',
+ 'ipv6-opts', 60, 'IPv6-Opts',
+ 'rspf', 73, 'RSPF', 'CPHB',
+ 'vmtp', 81, 'VMTP',
+ 'eigrp', 88, 'EIGRP',
+ 'ospf', 89, 'OSPFIGP',
+ 'ax.25', 93, 'AX.25',
+ 'ipip', 94, 'IPIP',
+ 'etherip', 97, 'ETHERIP',
+ 'encap', 98, 'ENCAP',
+ 'pim', 103, 'PIM',
+ 'ipcomp', 108, 'IPCOMP',
+ 'vrrp', 112, 'VRRP',
+ 'l2tp', 115, 'L2TP',
+ 'isis', 124, 'ISIS',
+ 'sctp', 132, 'SCTP',
+ 'fc', 133, 'FC',
+ 'mobility-header', 135, 'Mobility-Header',
+ 'udplite', 136, 'UDPLite',
+ 'mpls-in-ip', 137, 'MPLS-in-IP',
+ 'manet', 138, 'MANET',
+ 'hip', 139, 'HIP',
+ 'shim6', 140, 'Shim6',
+ 'wesp', 141, 'WESP',
+ 'rohc', 142, 'ROHC',
+];
+
+function toArray(x) {
+ if (x == null)
+ return [];
+ else if (Array.isArray(x))
+ return x.map(String);
+ else if (typeof(x) == 'object')
+ return [ x ];
+
+ var s = String(x).trim();
+
+ if (s == '')
+ return [];
+
+ return s.split(/\s+/);
+}
+
+function lookupProto(x) {
+ if (x == null || x == '')
+ return null;
+
+ var s = String(x).toLowerCase();
+
+ for (var i = 0; i < protocols.length; i += 3)
+ if (s == protocols[i] || s == protocols[i+1])
+ return [ protocols[i+1], protocols[i+2] ];
+
+ return [ -1, x ];
+}
+
+
+return L.Class.extend({
+ fmt_neg: function(x) {
+ var rv = E([]),
+ v = (typeof(x) == 'string') ? x.replace(/^ *! */, '') : '';
+
+ L.dom.append(rv, (v != '' && v != x) ? [ _('not') + ' ', v ] : [ '', x ]);
+ return rv;
+ },
+
+ fmt_mac: function(x) {
+ var rv = E([]), l = toArray(x);
+
+ if (l.length == 0)
+ return null;
+
+ L.dom.append(rv, [ _('MAC') + ' ' ]);
+
+ for (var i = 0; i < l.length; i++) {
+ var n = this.fmt_neg(l[i]);
+ L.dom.append(rv, (i > 0) ? [ ', ', n ] : n);
+ }
+
+ if (rv.childNodes.length > 2)
+ rv.firstChild.data = _('MACs') + ' ';
+
+ return rv;
+ },
+
+ fmt_port: function(x, d) {
+ var rv = E([]), l = toArray(x);
+
+ if (l.length == 0) {
+ if (d) {
+ L.dom.append(rv, E('var', {}, d));
+ return rv;
+ }
+
+ return null;
+ }
+
+ L.dom.append(rv, [ _('port') + ' ' ]);
+
+ for (var i = 0; i < l.length; i++) {
+ var n = this.fmt_neg(l[i]),
+ m = n.lastChild.data.match(/^(\d+)\D+(\d+)$/);
+
+ if (i > 0)
+ L.dom.append(rv, [ ', ' ]);
+
+ if (m) {
+ rv.firstChild.data = _('ports') + ' ';
+ L.dom.append(rv, E('var', [ n.firstChild, m[1], '-', m[2] ]));
+ }
+ else {
+ L.dom.append(rv, E('var', {}, n));
+ }
+ }
+
+ if (rv.childNodes.length > 2)
+ rv.firstChild.data = _('ports') + ' ';
+
+ return rv;
+ },
+
+ fmt_ip: function(x, d) {
+ var rv = E([]), l = toArray(x);
+
+ if (l.length == 0) {
+ if (d) {
+ L.dom.append(rv, E('var', {}, d));
+ return rv;
+ }
+
+ return null;
+ }
+
+ L.dom.append(rv, [ _('IP') + ' ' ]);
+
+ for (var i = 0; i < l.length; i++) {
+ var n = this.fmt_neg(l[i]),
+ m = n.lastChild.data.match(/^(\S+)\/(\d+\.\S+)$/);
+
+ if (i > 0)
+ L.dom.append(rv, [ ', ' ]);
+
+ if (m)
+ rv.firstChild.data = _('IP range') + ' ';
+ else if (n.lastChild.data.match(/^[a-zA-Z0-9_]+$/))
+ rv.firstChild.data = _('Network') + ' ';
+
+ L.dom.append(rv, E('var', {}, n));
+ }
+
+ if (rv.childNodes.length > 2)
+ rv.firstChild.data = _('IPs') + ' ';
+
+ return rv;
+ },
+
+ fmt_zone: function(x, d) {
+ if (x == '*')
+ return E('var', _('any zone'));
+ else if (x != null && x != '')
+ return E('var', {}, [ x ]);
+ else if (d != null && d != '')
+ return E('var', {}, d);
+ else
+ return null;
+ },
+
+ fmt_icmp_type: function(x) {
+ var rv = E([]), l = toArray(x);
+
+ if (l.length == 0)
+ return null;
+
+ L.dom.append(rv, [ _('type') + ' ' ]);
+
+ for (var i = 0; i < l.length; i++) {
+ var n = this.fmt_neg(l[i]);
+
+ if (i > 0)
+ L.dom.append(rv, [ ', ' ]);
+
+ L.dom.append(rv, E('var', {}, n));
+ }
+
+ if (rv.childNodes.length > 2)
+ rv.firstChild.data = _('types') + ' ';
+
+ return rv;
+ },
+
+ fmt_proto: function(x, icmp_types) {
+ var rv = E([]), l = toArray(x);
+
+ if (l.length == 0)
+ return null;
+
+ var t = this.fmt_icmp_type(icmp_types);
+
+ for (var i = 0; i < l.length; i++) {
+ var n = this.fmt_neg(l[i]),
+ p = lookupProto(n.lastChild.data);
+
+ if (n.lastChild.data == 'all')
+ continue;
+
+ if (i > 0)
+ L.dom.append(rv, [ ', ' ]);
+
+ if (t && (p[0] == 1 || p[0] == 58))
+ L.dom.append(rv, [ _('%s%s with %s').format(n.firstChild.data, p[1], ''), t ]);
+ else
+ L.dom.append(rv, [ n.firstChild.data, p[1] ]);
+ }
+
+ return rv;
+ },
+
+ fmt_limit: function(limit, burst) {
+ if (limit == null || limit == '')
+ return null;
+
+ var m = String(limit).match(/^(\d+)\/(\w+)$/),
+ u = m[2] || 'second',
+ l = +(m[1] || limit),
+ b = +burst;
+
+ if (!isNaN(l)) {
+ if (u.match(/^s/))
+ u = _('second');
+ else if (u.match(/^m/))
+ u = _('minute');
+ else if (u.match(/^h/))
+ u = _('hour');
+ else if (u.match(/^d/))
+ u = _('day');
+
+ if (!isNaN(b) && b > 0)
+ return E('<span>' +
+ _('<var>%d</var> pkts. per <var>%s</var>, burst <var>%d</var> pkts.').format(l, u, b) +
+ '</span>');
+ else
+ return E('<span>' +
+ _('<var>%d</var> pkts. per <var>%s</var>').format(l, u) +
+ '</span>');
+ }
+ },
+
+ fmt_target: function(x, src, dest) {
+ if (src == null || src == '') {
+ if (x == 'ACCEPT')
+ return _('Accept output');
+ else if (x == 'REJECT')
+ return _('Refuse output');
+ else if (x == 'NOTRACK')
+ return _('Do not track output');
+ else /* if (x == 'DROP') */
+ return _('Discard output');
+ }
+ else if (dest != null && dest != '') {
+ if (x == 'ACCEPT')
+ return _('Accept forward');
+ else if (x == 'REJECT')
+ return _('Refuse forward');
+ else if (x == 'NOTRACK')
+ return _('Do not track forward');
+ else /* if (x == 'DROP') */
+ return _('Discard forward');
+ }
+ else {
+ if (x == 'ACCEPT')
+ return _('Accept input');
+ else if (x == 'REJECT' )
+ return _('Refuse input');
+ else if (x == 'NOTRACK')
+ return _('Do not track input');
+ else /* if (x == 'DROP') */
+ return _('Discard input');
+ }
+ }
+});
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
new file mode 100644
index 000000000..743d115e8
--- /dev/null
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
@@ -0,0 +1,290 @@
+'use strict';
+'require ui';
+'require rpc';
+'require uci';
+'require form';
+'require tools.firewall as fwtool';
+'require tools.widgets as widgets';
+
+function skeys(obj, key, mode) {
+ if (obj == null || typeof(obj) != 'object')
+ return [];
+
+ return Object.keys(obj).map(function(e) {
+ var v = (key != null) ? obj[e][key] : e;
+
+ switch (mode) {
+ case 'addr':
+ v = (v != null) ? v.replace(/(?:^|[.:])([0-9a-fA-F]{1,4})/g,
+ function(m0, m1) { return ('000' + m1.toLowerCase()).substr(-4) }) : null;
+ break;
+
+ case 'num':
+ v = (v != null) ? +v : null;
+ break;
+ }
+
+ return [ e, v ];
+ }).filter(function(e) {
+ return (e[1] != null);
+ }).sort(function(a, b) {
+ return (a[1] > b[1]);
+ }).map(function(e) {
+ return e[0];
+ });
+}
+
+function fmt(fmt /*, ...*/) {
+ var repl = [], wrap = false;
+
+ for (var i = 1; i < arguments.length; i++) {
+ if (L.dom.elem(arguments[i])) {
+ switch (arguments[i].nodeType) {
+ case 1:
+ repl.push(arguments[i].outerHTML);
+ wrap = true;
+ break;
+
+ case 3:
+ repl.push(arguments[i].data);
+ break;
+
+ case 11:
+ var span = E('span');
+ span.appendChild(arguments[i]);
+ repl.push(span.innerHTML);
+ wrap = true;
+ break;
+
+ default:
+ repl.push('');
+ }
+ }
+ else {
+ repl.push(arguments[i]);
+ }
+ }
+
+ var rv = fmt.format.apply(fmt, repl);
+ return wrap ? E('span', rv) : rv;
+}
+
+function forward_proto_txt(s) {
+ return fmt('%s-%s', _('IPv4'),
+ fwtool.fmt_proto(uci.get('firewall', s, 'proto'),
+ uci.get('firewall', s, 'icmp_type')) || 'TCP+UDP');
+}
+
+function forward_src_txt(s) {
+ var z = fwtool.fmt_zone(uci.get('firewall', s, 'src'), _('any zone')),
+ a = fwtool.fmt_ip(uci.get('firewall', s, 'src_ip'), _('any host')),
+ p = fwtool.fmt_port(uci.get('firewall', s, 'src_port')),
+ m = fwtool.fmt_mac(uci.get('firewall', s, 'src_mac'));
+
+ if (p && m)
+ return fmt(_('From %s in %s with source %s and %s'), a, z, p, m);
+ else if (p || m)
+ return fmt(_('From %s in %s with source %s'), a, z, p || m);
+ else
+ return fmt(_('From %s in %s'), a, z);
+}
+
+function forward_via_txt(s) {
+ var a = fwtool.fmt_ip(uci.get('firewall', s, 'src_dip'), _('any router IP')),
+ p = fwtool.fmt_port(uci.get('firewall', s, 'src_dport'));
+
+ if (p)
+ return fmt(_('Via %s at %s'), a, p);
+ else
+ return fmt(_('Via %s'), a);
+}
+
+return L.view.extend({
+ callHostHints: rpc.declare({
+ object: 'luci',
+ method: 'host_hints'
+ }),
+
+ load: function() {
+ return Promise.all([
+ this.callHostHints()
+ ]);
+ },
+
+ render: function(data) {
+ var hosts = data[0],
+ m, s, o;
+
+ m = new form.Map('firewall', _('Firewall - Port Forwards'),
+ _('Port forwarding allows remote computers on the Internet to connect to a specific computer or service within the private LAN.'));
+
+ s = m.section(form.GridSection, 'redirect', _('Port Forwards'));
+ s.addremove = true;
+ s.anonymous = true;
+ s.sortable = true;
+
+ s.tab('general', _('General Settings'));
+ s.tab('advanced', _('Advanced Settings'));
+
+ s.filter = function(section_id) {
+ return (uci.get('firewall', section_id, 'target') != 'SNAT');
+ };
+
+ s.sectiontitle = function(section_id) {
+ return uci.get('firewall', section_id, 'name') || _('Unnamed forward');
+ };
+
+ o = s.taboption('general', form.Value, 'name', _('Name'));
+ o.placeholder = _('Unnamed forward');
+ o.modalonly = true;
+
+ o = s.option(form.DummyValue, '_match', _('Match'));
+ o.modalonly = false;
+ o.textvalue = function(s) {
+ return E('small', [
+ forward_proto_txt(s), E('br'),
+ forward_src_txt(s), E('br'),
+ forward_via_txt(s)
+ ]);
+ };
+
+ o = s.option(form.ListValue, '_dest', _('Forward to'));
+ o.modalonly = false;
+ o.textvalue = function(s) {
+ var z = fwtool.fmt_zone(uci.get('firewall', s, 'dest'), _('any zone')),
+ a = fwtool.fmt_ip(uci.get('firewall', s, 'dest_ip'), _('any host')),
+ p = fwtool.fmt_port(uci.get('firewall', s, 'dest_port')) ||
+ fwtool.fmt_port(uci.get('firewall', s, 'src_dport'));
+
+ if (p)
+ return fmt(_('%s, %s in %s'), a, p, z);
+ else
+ return fmt(_('%s in %s'), a, z);
+ };
+
+ o = s.option(form.Flag, 'enabled', _('Enable'));
+ o.modalonly = false;
+ o.default = o.enabled;
+ o.editable = true;
+
+ o = s.taboption('general', form.Value, 'proto', _('Protocol'));
+ o.modalonly = true;
+ o.default = 'tcp udp';
+ o.value('tcp udp', 'TCP+UDP');
+ o.value('tcp', 'TCP');
+ o.value('udp', 'UDP');
+ o.value('icmp', 'ICMP');
+
+ o.cfgvalue = function(/* ... */) {
+ var v = this.super('cfgvalue', arguments);
+ return (v == 'tcpudp') ? 'tcp udp' : v;
+ };
+
+ o = s.taboption('general', widgets.ZoneSelect, 'src', _('Source zone'));
+ o.modalonly = true;
+ o.rmempty = false;
+ o.nocreate = true;
+ o.default = 'wan';
+
+ o = s.taboption('advanced', form.Value, 'src_mac', _('Source MAC address'),
+ _('Only match incoming traffic from these MACs.'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.datatype = 'neg(macaddr)';
+ o.placeholder = E('em', _('any'));
+ skeys(hosts).forEach(function(mac) {
+ o.value(mac, '%s (%s)'.format(
+ mac,
+ hosts[mac].name || hosts[mac].ipv4 || hosts[mac].ipv6 || '?'
+ ));
+ });
+
+ o = s.taboption('advanced', form.Value, 'src_ip', _('Source IP address'),
+ _('Only match incoming traffic from this IP or range.'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.datatype = 'neg(ipmask4)';
+ o.placeholder = E('em', _('any'));
+ skeys(hosts, 'ipv4', 'addr').forEach(function(mac) {
+ o.value(hosts[mac].ipv4, '%s (%s)'.format(
+ hosts[mac].ipv4,
+ hosts[mac].name || mac
+ ));
+ });
+
+ o = s.taboption('advanced', form.Value, 'src_port', _('Source port'),
+ _('Only match incoming traffic originating from the given source port or port range on the client host'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.datatype = 'neg(portrange)';
+ o.placeholder = _('any');
+ o.depends('proto', 'tcp');
+ o.depends('proto', 'udp');
+ o.depends('proto', 'tcp udp');
+ o.depends('proto', 'tcpudp');
+
+ o = s.taboption('advanced', form.Value, 'src_dip', _('External IP address'),
+ _('Only match incoming traffic directed at the given IP address.'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.datatype = 'neg(ipmask4)';
+ o.placeholder = E('em', _('any'));
+ skeys(hosts, 'ipv4', 'addr').forEach(function(mac) {
+ o.value(hosts[mac].ipv4, '%s (%s)'.format(
+ hosts[mac].ipv4,
+ hosts[mac].name || mac
+ ));
+ });
+
+ o = s.taboption('general', form.Value, 'src_dport', _('External port'),
+ _('Match incoming traffic directed at the given destination port or port range on this host'));
+ o.modalonly = true;
+ o.rmempty = false;
+ o.datatype = 'neg(portrange)';
+ o.depends('proto', 'tcp');
+ o.depends('proto', 'udp');
+ o.depends('proto', 'tcp udp');
+ o.depends('proto', 'tcpudp');
+
+ o = s.taboption('general', widgets.ZoneSelect, 'dest', _('Internal zone'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.nocreate = true;
+ o.default = 'lan';
+
+ o = s.taboption('general', form.Value, 'dest_ip', _('Internal IP address'),
+ _('Redirect matched incoming traffic to the specified internal host'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.datatype = 'ipmask4';
+ skeys(hosts, 'ipv4', 'addr').forEach(function(mac) {
+ o.value(hosts[mac].ipv4, '%s (%s)'.format(
+ hosts[mac].ipv4,
+ hosts[mac].name || mac
+ ));
+ });
+
+ o = s.taboption('general', form.Value, 'dest_port', _('Internal port'),
+ _('Redirect matched incoming traffic to the given port on the internal host'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.placeholder = _('any');
+ o.datatype = 'portrange';
+ o.depends('proto', 'tcp');
+ o.depends('proto', 'udp');
+ o.depends('proto', 'tcp udp');
+ o.depends('proto', 'tcpudp');
+
+ o = s.taboption('advanced', form.Flag, 'reflection', _('Enable NAT Loopback'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.default = o.enabled;
+
+ o = s.taboption('advanced', form.Value, 'extra', _('Extra arguments'),
+ _('Passes additional arguments to iptables. Use with care!'));
+ o.modalonly = true;
+ o.rmempty = true;
+
+ return m.render();
+ }
+});
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js
new file mode 100644
index 000000000..9fa1aa252
--- /dev/null
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js
@@ -0,0 +1,401 @@
+'use strict';
+'require ui';
+'require rpc';
+'require uci';
+'require form';
+'require tools.firewall as fwtool';
+'require tools.widgets as widgets';
+
+function skeys(obj, key, mode) {
+ if (obj == null || typeof(obj) != 'object')
+ return [];
+
+ return Object.keys(obj).map(function(e) {
+ var v = (key != null) ? obj[e][key] : e;
+
+ switch (mode) {
+ case 'addr':
+ v = (v != null) ? v.replace(/(?:^|[.:])([0-9a-fA-F]{1,4})/g,
+ function(m0, m1) { return ('000' + m1.toLowerCase()).substr(-4) }) : null;
+ break;
+
+ case 'num':
+ v = (v != null) ? +v : null;
+ break;
+ }
+
+ return [ e, v ];
+ }).filter(function(e) {
+ return (e[1] != null);
+ }).sort(function(a, b) {
+ return (a[1] > b[1]);
+ }).map(function(e) {
+ return e[0];
+ });
+}
+
+function fmt(fmt /*, ...*/) {
+ var repl = [], wrap = false;
+
+ for (var i = 1; i < arguments.length; i++) {
+ if (L.dom.elem(arguments[i])) {
+ switch (arguments[i].nodeType) {
+ case 1:
+ repl.push(arguments[i].outerHTML);
+ wrap = true;
+ break;
+
+ case 3:
+ repl.push(arguments[i].data);
+ break;
+
+ case 11:
+ var span = E('span');
+ span.appendChild(arguments[i]);
+ repl.push(span.innerHTML);
+ wrap = true;
+ break;
+
+ default:
+ repl.push('');
+ }
+ }
+ else {
+ repl.push(arguments[i]);
+ }
+ }
+
+ var rv = fmt.format.apply(fmt, repl);
+ return wrap ? E('span', rv) : rv;
+}
+
+function forward_proto_txt(s) {
+ return fmt('%s-%s', _('IPv4'),
+ fwtool.fmt_proto(uci.get('firewall', s, 'proto'),
+ uci.get('firewall', s, 'icmp_type')) || 'TCP+UDP');
+}
+
+function rule_src_txt(s) {
+ var z = fwtool.fmt_zone(uci.get('firewall', s, 'src')),
+ p = fwtool.fmt_port(uci.get('firewall', s, 'src_port')),
+ m = fwtool.fmt_mac(uci.get('firewall', s, 'src_mac'));
+
+ // Forward/Input
+ if (z) {
+ var a = fwtool.fmt_ip(uci.get('firewall', s, 'src_ip'), _('any host'));
+ if (p && m)
+ return fmt(_('From %s in %s with source %s and %s'), a, z, p, m);
+ else if (p || m)
+ return fmt(_('From %s in %s with source %s'), a, z, p || m);
+ else
+ return fmt(_('From %s in %s'), a, z);
+ }
+
+ // Output
+ else {
+ var a = fwtool.fmt_ip(uci.get('firewall', s, 'src_ip'), _('any router IP'));
+ if (p && m)
+ return fmt(_('From %s on <var>this device</var> with source %s and %s'), a, p, m);
+ else if (p || m)
+ return fmt(_('From %s on <var>this device</var> with source %s'), a, p || m);
+ else
+ return fmt(_('From %s on <var>this device</var>'), a);
+ }
+}
+
+function rule_dest_txt(s) {
+ var z = fwtool.fmt_zone(uci.get('firewall', s, 'dest')),
+ p = fwtool.fmt_port(uci.get('firewall', s, 'dest_port'));
+
+ // Forward
+ if (z) {
+ var a = fwtool.fmt_ip(uci.get('firewall', s, 'dest_ip'), _('any host'));
+ if (p)
+ return fmt(_('To %s, %s in %s'), a, p, z);
+ else
+ return fmt(_('To %s in %s'), a, z);
+ }
+
+ // Input
+ else {
+ var a = fwtool.fmt_ip(uci.get('firewall', s, 'dest_ip'), _('any router IP'));
+ if (p)
+ return fmt(_('To %s at %s on <var>this device</var>'), a, p);
+ else
+ return fmt(_('To %s on <var>this device</var>'), a);
+ }
+}
+
+function rule_target_txt(s) {
+ var t = fwtool.fmt_target(uci.get('firewall', s, 'target'), uci.get('firewall', s, 'src'), uci.get('firewall', s, 'dest')),
+ l = fwtool.fmt_limit(uci.get('firewall', s, 'limit'), uci.get('firewall', s, 'limit_burst'));
+
+ if (l)
+ return fmt(_('<var>%s</var> and limit to %s'), t, l);
+ else
+ return fmt('<var>%s</var>', t);
+}
+
+return L.view.extend({
+ callHostHints: rpc.declare({
+ object: 'luci',
+ method: 'host_hints'
+ }),
+
+ load: function() {
+ return this.callHostHints().catch(function(e) {
+ console.debug('load fail', e);
+ });
+ },
+
+ render: function(hosts) {
+ var m, s, o;
+
+ m = new form.Map('firewall', _('Firewall - Traffic Rules'),
+ _('Traffic rules define policies for packets traveling between different zones, for example to reject traffic between certain hosts or to open WAN ports on the router.'));
+
+ s = m.section(form.GridSection, 'rule', _('Traffic Rules'));
+ s.addremove = true;
+ s.anonymous = true;
+ s.sortable = true;
+
+ s.tab('general', _('General Settings'));
+ s.tab('advanced', _('Advanced Settings'));
+ s.tab('timed', _('Time Restrictions'));
+
+ s.filter = function(section_id) {
+ return (uci.get('firewall', section_id, 'target') != 'SNAT');
+ };
+
+ s.sectiontitle = function(section_id) {
+ return uci.get('firewall', section_id, 'name') || _('Unnamed rule');
+ };
+
+ o = s.taboption('general', form.Value, 'name', _('Name'));
+ o.placeholder = _('Unnamed rule');
+ o.modalonly = true;
+
+ o = s.option(form.DummyValue, '_match', _('Match'));
+ o.modalonly = false;
+ o.textvalue = function(s) {
+ return E('small', [
+ forward_proto_txt(s), E('br'),
+ rule_src_txt(s), E('br'),
+ rule_dest_txt(s)
+ ]);
+ };
+
+ o = s.option(form.ListValue, '_target', _('Action'));
+ o.modalonly = false;
+ o.textvalue = function(s) {
+ return rule_target_txt(s);
+ };
+
+ o = s.option(form.Flag, 'enabled', _('Enable'));
+ o.modalonly = false;
+ o.default = o.enabled;
+ o.editable = true;
+
+ //ft.opt_enabled(s, Button);
+ //ft.opt_name(s, Value, _('Name'));
+
+
+ o = s.taboption('advanced', form.ListValue, 'family', _('Restrict to address family'));
+ o.modalonly = true;
+ o.rmempty = true;
+ o.value('', _('IPv4 and IPv6'));
+ o.value('ipv4', _('IPv4 only'));
+ o.value('ipv6', _('IPv6 only'));
+
+ o = s.taboption('general', form.Value, 'proto', _('Protocol'));
+ o.modalonly = true;
+ o.default = 'tcp udp';
+ o.value('all', _('Any'));
+ o.value('tcp udp', 'TCP+UDP');
+ o.value('tcp', 'TCP');
+ o.value('udp', 'UDP');
+ o.value('icmp', 'ICMP');
+ o.cfgvalue = function(/* ... */) {
+ var v = this.super('cfgvalue', arguments);
+ return (v == 'tcpudp') ? 'tcp udp' : v;
+ };
+
+ o = s.taboption('advanced', form.MultiValue, 'icmp_type', _('Match ICMP type'));
+ o.modalonly = true;
+ o.multiple = true;
+ o.custom = true;
+ o.cast = 'table';
+ o.placeholder = _('any');
+ o.value('', 'any');
+ o.value('echo-reply');
+ o.value('destination-unreachable');
+ o.value('network-unreachable');
+ o.value('host-unreachable');
+ o.value('protocol-unreachable');
+ o.value('port-unreachable');
+ o.value('fragmentation-needed');
+ o.value('source-route-failed');
+ o.value('network-unknown');
+ o.value('host-unknown');
+ o.value('network-prohibited');
+ o.value('host-prohibited');
+ o.value('TOS-network-unreachable');
+ o.value('TOS-host-unreachable');
+ o.value('communication-prohibited');
+ o.value('host-precedence-violation');
+ o.value('precedence-cutoff');
+ o.value('source-quench');
+ o.value('redirect');
+ o.value('network-redirect');
+ o.value('host-redirect');
+ o.value('TOS-network-redirect');
+ o.value('TOS-host-redirect');
+ o.value('echo-request');
+ o.value('router-advertisement');
+ o.value('router-solicitation');
+ o.value('time-exceeded');
+ o.value('ttl-zero-during-transit');
+ o.value('ttl-zero-during-reassembly');
+ o.value('parameter-problem');
+ o.value('ip-header-bad');
+ o.value('required-option-missing');
+ o.value('timestamp-request');
+ o.value('timestamp-reply');
+ o.value('address-mask-request');
+ o.value('address-mask-reply');
+ o.depends('proto', 'icmp');
+
+ o = s.taboption('general', widgets.ZoneSelect, 'src', _('Source zone'));
+ o.modalonly = true;
+ o.nocreate = true;
+ o.allowany = true;
+ o.allowlocal = 'src';
+ o.default = 'wan';
+
+ o = s.taboption('advanced', form.Value, 'src_mac', _('Source MAC address'));
+ o.modalonly = true;
+ o.datatype = 'list(macaddr)';
+ o.placeholder = _('any');
+ skeys(hosts).forEach(function(mac) {
+ o.value(mac, '%s (%s)'.format(
+ mac,
+ hosts[mac].name || hosts[mac].ipv4 || hosts[mac].ipv6 || '?'
+ ));
+ });
+
+ o = s.taboption('general', form.Value, 'src_ip', _('Source address'));
+ o.modalonly = true;
+ o.datatype = 'list(neg(ipmask))';
+ o.placeholder = _('any');
+ skeys(hosts, 'ipv4', 'addr').forEach(function(mac) {
+ o.value(hosts[mac].ipv4, '%s (%s)'.format(
+ hosts[mac].ipv4,
+ hosts[mac].name || mac
+ ));
+ });
+
+ o = s.taboption('general', form.Value, 'src_port', _('Source port'));
+ o.modalonly = true;
+ o.datatype = 'list(neg(portrange))';
+ o.placeholder = _('any');
+ o.depends('proto', 'tcp');
+ o.depends('proto', 'udp');
+ o.depends('proto', 'tcp udp');
+ o.depends('proto', 'tcpudp');
+
+ o = s.taboption('general', widgets.ZoneSelect, 'dest_local', _('Output zone'));
+ o.modalonly = true;
+ o.nocreate = true;
+ o.allowany = true;
+ o.alias = 'dest';
+ o.default = 'wan';
+ o.depends('src', '');
+
+ o = s.taboption('general', widgets.ZoneSelect, 'dest_remote', _('Destination zone'));
+ o.modalonly = true;
+ o.nocreate = true;
+ o.allowany = true;
+ o.allowlocal = true;
+ o.alias = 'dest';
+ o.default = 'lan';
+ o.depends({'src': '', '!reverse': true});
+
+ o = s.taboption('general', form.Value, 'dest_ip', _('Destination address'));
+ o.modalonly = true;
+ o.datatype = 'list(neg(ipmask))';
+ o.placeholder = _('any');
+ skeys(hosts, 'ipv4', 'addr').forEach(function(mac) {
+ o.value(hosts[mac].ipv4, '%s (%s)'.format(
+ hosts[mac].ipv4,
+ hosts[mac].name || mac
+ ));
+ });
+
+ o = s.taboption('general', form.Value, 'dest_port', _('Destination port'));
+ o.modalonly = true;
+ o.datatype = 'list(neg(portrange))';
+ o.placeholder = _('any');
+ o.depends('proto', 'tcp');
+ o.depends('proto', 'udp');
+ o.depends('proto', 'tcp udp');
+ o.depends('proto', 'tcpudp');
+
+ o = s.taboption('general', form.ListValue, 'target', _('Action'));
+ o.modalonly = true;
+ o.default = 'ACCEPT';
+ o.value('DROP', _('drop'));
+ o.value('ACCEPT', _('accept'));
+ o.value('REJECT', _('reject'));
+ o.value('NOTRACK', _("don't track"));
+
+ o = s.taboption('advanced', form.Value, 'extra', _('Extra arguments'),
+ _('Passes additional arguments to iptables. Use with care!'));
+ o.modalonly = true;
+
+ o = s.taboption('timed', form.MultiValue, 'weekdays', _('Week Days'));
+ o.modalonly = true;
+ o.multiple = true;
+ o.display = 5;
+ o.placeholder = _('Any day');
+ o.value('Sun', _('Sunday'));
+ o.value('Mon', _('Monday'));
+ o.value('Tue', _('Tuesday'));
+ o.value('Wed', _('Wednesday'));
+ o.value('Thu', _('Thursday'));
+ o.value('Fri', _('Friday'));
+ o.value('Sat', _('Saturday'));
+
+ o = s.taboption('timed', form.MultiValue, 'monthdays', _('Month Days'));
+ o.modalonly = true;
+ o.multiple = true;
+ o.display_size = 15;
+ o.placeholder = _('Any day');
+ for (var i = 1; i <= 31; i++)
+ o.value(i);
+
+ o = s.taboption('timed', form.Value, 'start_time', _('Start Time (hh.mm.ss)'));
+ o.modalonly = true;
+ o.datatype = 'timehhmmss';
+
+ o = s.taboption('timed', form.Value, 'stop_time', _('Stop Time (hh.mm.ss)'));
+ o.modalonly = true;
+ o.datatype = 'timehhmmss';
+
+ o = s.taboption('timed', form.Value, 'start_date', _('Start Date (yyyy-mm-dd)'));
+ o.modalonly = true;
+ o.datatype = 'dateyyyymmdd';
+
+ o = s.taboption('timed', form.Value, 'stop_date', _('Stop Date (yyyy-mm-dd)'));
+ o.modalonly = true;
+ o.datatype = 'dateyyyymmdd';
+
+ o = s.taboption('timed', form.Flag, 'utc_time', _('Time in UTC'));
+ o.modalonly = true;
+ o.default = o.disabled;
+
+ return m.render().catch(function(e) {
+ console.debug('render fail')
+ });
+
+ }
+});
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
new file mode 100644
index 000000000..3f1061a10
--- /dev/null
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
@@ -0,0 +1,249 @@
+'use strict';
+'require rpc';
+'require uci';
+'require form';
+'require network';
+'require firewall';
+'require tools.widgets as widgets';
+
+return L.view.extend({
+ callOffloadSupport: rpc.declare({
+ object: 'luci',
+ method: 'offload_support',
+ expect: { offload_support: false }
+ }),
+
+ load: function() {
+ return this.callOffloadSupport();
+ },
+
+ render: function(hasOffloading) {
+ var m, s, o, inp, out;
+
+ m = new form.Map('firewall', _('Firewall - Zone Settings'),
+ _('The firewall creates zones over your network interfaces to control network traffic flow.'));
+
+ s = m.section(form.TypedSection, 'defaults', _('General Settings'));
+ s.anonymous = true;
+ s.addremove = false;
+
+ o = s.option(form.Flag, 'syn_flood', _('Enable SYN-flood protection'));
+ o = s.option(form.Flag, 'drop_invalid', _('Drop invalid packets'));
+
+ var p = [
+ s.option(form.ListValue, 'input', _('Input')),
+ s.option(form.ListValue, 'output', _('Output')),
+ s.option(form.ListValue, 'forward', _('Forward'))
+ ];
+
+ for (var i = 0; i < p.length; i++) {
+ p[i].value('REJECT', _('reject'));
+ p[i].value('DROP', _('drop'));
+ p[i].value('ACCEPT', _('accept'));
+ }
+
+ /* Netfilter flow offload support */
+
+ if (hasOffloading) {
+ s = m.section(form.TypedSection, 'defaults', _('Routing/NAT Offloading'),
+ _('Experimental feature. Not fully compatible with QoS/SQM.'));
+
+ s.anonymous = true;
+ s.addremove = false;
+
+ o = s.option(form.Flag, 'flow_offloading',
+ _('Software flow offloading'),
+ _('Software based offloading for routing/NAT'));
+ o.optional = true;
+
+ o = s.option(form.Flag, 'flow_offloading_hw',
+ _('Hardware flow offloading'),
+ _('Requires hardware NAT support. Implemented at least for mt7621'));
+ o.optional = true;
+ o.depends('flow_offloading', '1');
+ }
+
+
+ s = m.section(form.GridSection, 'zone', _('Zones'));
+ s.addremove = true;
+ s.anonymous = true;
+ s.sortable = true;
+
+ s.tab('general', _('General Settings'));
+ s.tab('advanced', _('Advanced Settings'));
+
+ o = s.taboption('general', form.DummyValue, '_generalinfo');
+ o.rawhtml = true;
+ o.modalonly = true;
+ o.cfgvalue = function(section_id) {
+ var name = uci.get('firewall', section_id, 'name');
+
+ return _('This section defines common properties of %q. The <em>input</em> and <em>output</em> options set the default policies for traffic entering and leaving this zone while the <em>forward</em> option describes the policy for forwarded traffic between different networks within the zone. <em>Covered networks</em> specifies which available networks are members of this zone.')
+ .replace(/%s/g, name).replace(/%q/g, '"' + name + '"');
+ };
+
+ o = s.taboption('general', form.Value, 'name', _('Name'));
+ o.placeholder = _('Unnamed zone');
+ o.modalonly = true;
+ o.datatype = 'and(uciname,maxlength(11))';
+ o.write = function(section_id, formvalue) {
+ var cfgvalue = this.cfgvalue(section_id);
+
+ if (cfgvalue != formvalue)
+ return firewall.renameZone(cfgvalue, formvalue);
+ };
+
+ o = s.option(widgets.ZoneForwards, '_info', _('Zone ⇒ Forwardings'));
+ o.editable = true;
+ o.modalonly = false;
+ o.cfgvalue = function(section_id) {
+ return uci.get('firewall', section_id, 'name');
+ };
+
+ var p = [
+ s.taboption('general', form.ListValue, 'input', _('Input')),
+ s.taboption('general', form.ListValue, 'output', _('Output')),
+ s.taboption('general', form.ListValue, 'forward', _('Forward'))
+ ];
+
+ for (var i = 0; i < p.length; i++) {
+ p[i].value('REJECT', _('reject'));
+ p[i].value('DROP', _('drop'));
+ p[i].value('ACCEPT', _('accept'));
+ p[i].editable = true;
+ }
+
+ o = s.taboption('general', form.Flag, 'masq', _('Masquerading'));
+ o.editable = true;
+
+ o = s.taboption('general', form.Flag, 'mtu_fix', _('MSS clamping'));
+ o.modalonly = true;
+
+ o = s.taboption('general', widgets.NetworkSelect, 'network', _('Covered networks'));
+ o.modalonly = true;
+ o.multiple = true;
+ o.write = function(section_id, formvalue) {
+ var name = uci.get('firewall', section_id, 'name'),
+ cfgvalue = this.cfgvalue(section_id);
+
+ if (typeof(cfgvalue) == 'string' && Array.isArray(formvalue) && (cfgvalue == formvalue.join(' ')))
+ return;
+
+ var tasks = [ firewall.getZone(name) ];
+
+ if (Array.isArray(formvalue))
+ for (var i = 0; i < formvalue.length; i++) {
+ var netname = formvalue[i];
+ tasks.push(network.getNetwork(netname).then(function(net) {
+ return net || network.addNetwork(netname, { 'proto': 'none' });
+ }));
+ }
+
+ return Promise.all(tasks).then(function(zone_networks) {
+ if (zone_networks[0])
+ for (var i = 1; i < zone_networks.length; i++)
+ zone_networks[0].addNetwork(zone_networks[i].getName());
+ });
+ };
+
+ o = s.taboption('advanced', form.DummyValue, '_advancedinfo');
+ o.rawhtml = true;
+ o.modalonly = true;
+ o.cfgvalue = function(section_id) {
+ var name = uci.get('firewall', section_id, 'name');
+
+ return _('The options below control the forwarding policies between this zone (%s) and other zones. <em>Destination zones</em> cover forwarded traffic <strong>originating from %q</strong>. <em>Source zones</em> match forwarded traffic from other zones <strong>targeted at %q</strong>. The forwarding rule is <em>unidirectional</em>, e.g. a forward from lan to wan does <em>not</em> imply a permission to forward from wan to lan as well.')
+ .format(name);
+ };
+
+ o = s.taboption('advanced', form.ListValue, 'family', _('Restrict to address family'));
+ o.value('', _('IPv4 and IPv6'));
+ o.value('ipv4', _('IPv4 only'));
+ o.value('ipv6', _('IPv6 only'));
+ o.modalonly = true;
+
+ o = s.taboption('advanced', form.DynamicList, 'masq_src', _('Restrict Masquerading to given source subnets'));
+ o.depends('family', '');
+ o.depends('family', 'ipv4');
+ o.datatype = 'list(neg(or(uciname,hostname,ipmask4)))';
+ o.placeholder = '0.0.0.0/0';
+ o.modalonly = true;
+
+ o = s.taboption('advanced', form.DynamicList, 'masq_dest', _('Restrict Masquerading to given destination subnets'));
+ o.depends('family', '');
+ o.depends('family', 'ipv4');
+ o.datatype = 'list(neg(or(uciname,hostname,ipmask4)))';
+ o.placeholder = '0.0.0.0/0';
+ o.modalonly = true;
+
+ o = s.taboption('advanced', form.Flag, 'conntrack', _('Force connection tracking'));
+ o.modalonly = true;
+
+ o = s.taboption('advanced', form.Flag, 'log', _('Enable logging on this zone'));
+ o.modalonly = true;
+
+ o = s.taboption('advanced', form.Value, 'log_limit', _('Limit log messages'));
+ o.depends('log', '1');
+ o.placeholder = '10/minute';
+ o.modalonly = true;
+
+ o = s.taboption('general', form.DummyValue, '_forwardinfo');
+ o.rawhtml = true;
+ o.modalonly = true;
+ o.cfgvalue = function(section_id) {
+ return _('The options below control the forwarding policies between this zone (%s) and other zones. <em>Destination zones</em> cover forwarded traffic <strong>originating from %q</strong>. <em>Source zones</em> match forwarded traffic from other zones <strong>targeted at %q</strong>. The forwarding rule is <em>unidirectional</em>, e.g. a forward from lan to wan does <em>not</em> imply a permission to forward from wan to lan as well.')
+ .format(uci.get('firewall', section_id, 'name'));
+ };
+
+ out = o = s.taboption('general', widgets.ZoneSelect, 'out', _('Allow forward to <em>destination zones</em>:'));
+ o.nocreate = true;
+ o.multiple = true;
+ o.modalonly = true;
+ o.filter = function(section_id, value) {
+ return (uci.get('firewall', section_id, 'name') != value);
+ };
+ o.cfgvalue = function(section_id) {
+ var out = (this.option == 'out'),
+ zone = this.lookupZone(uci.get('firewall', section_id, 'name')),
+ fwds = zone.getForwardingsBy(out ? 'src' : 'dest'),
+ value = [];
+
+ for (var i = 0; i < fwds.length; i++)
+ value.push(out ? fwds[i].getDestination() : fwds[i].getSource());
+
+ return value;
+ };
+ o.write = o.remove = function(section_id, formvalue) {
+ var out = (this.option == 'out'),
+ zone = this.lookupZone(uci.get('firewall', section_id, 'name')),
+ fwds = zone.getForwardingsBy(out ? 'src' : 'dest');
+
+ if (formvalue == null)
+ formvalue = [];
+
+ if (Array.isArray(formvalue)) {
+ for (var i = 0; i < fwds.length; i++) {
+ var cmp = out ? fwds[i].getDestination() : fwds[i].getSource();
+ if (!formvalue.filter(function(d) { return d == cmp }).length)
+ zone.deleteForwarding(fwds[i]);
+ }
+
+ for (var i = 0; i < formvalue.length; i++)
+ if (out)
+ zone.addForwardingTo(formvalue[i]);
+ else
+ zone.addForwardingFrom(formvalue[i]);
+ }
+ };
+
+ inp = o = s.taboption('general', widgets.ZoneSelect, 'in', _('Allow forward from <em>source zones</em>:'));
+ o.nocreate = true;
+ o.multiple = true;
+ o.modalonly = true;
+ o.write = o.remove = out.write;
+ o.filter = out.filter;
+ o.cfgvalue = out.cfgvalue;
+
+ return m.render();
+ }
+});
diff --git a/applications/luci-app-firewall/luasrc/controller/firewall.lua b/applications/luci-app-firewall/luasrc/controller/firewall.lua
index 4fe7770ef..58a44c601 100644
--- a/applications/luci-app-firewall/luasrc/controller/firewall.lua
+++ b/applications/luci-app-firewall/luasrc/controller/firewall.lua
@@ -6,16 +6,13 @@ function index()
_("Firewall"), 60)
entry({"admin", "network", "firewall", "zones"},
- arcombine(cbi("firewall/zones"), cbi("firewall/zone-details")),
- _("General Settings"), 10).leaf = true
+ view("firewall/zones"), _("General Settings"), 10)
entry({"admin", "network", "firewall", "forwards"},
- arcombine(cbi("firewall/forwards"), cbi("firewall/forward-details")),
- _("Port Forwards"), 20).leaf = true
+ view("firewall/forwards"), _("Port Forwards"), 20)
entry({"admin", "network", "firewall", "rules"},
- arcombine(cbi("firewall/rules"), cbi("firewall/rule-details")),
- _("Traffic Rules"), 30).leaf = true
+ view("firewall/rules"), _("Traffic Rules"), 30)
entry({"admin", "network", "firewall", "custom"},
form("firewall/custom"),
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua
deleted file mode 100644
index d51f8fb79..000000000
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua
+++ /dev/null
@@ -1,162 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-local sys = require "luci.sys"
-local dsp = require "luci.dispatcher"
-local ft = require "luci.tools.firewall"
-
-local m, s, o
-
-arg[1] = arg[1] or ""
-
-m = Map("firewall",
- translate("Firewall - Port Forwards"),
- translate("This page allows you to change advanced properties of the port \
- forwarding entry. In most cases there is no need to modify \
- those settings."))
-
-m.redirect = dsp.build_url("admin/network/firewall/forwards")
-
-if m.uci:get("firewall", arg[1]) ~= "redirect" then
- luci.http.redirect(m.redirect)
- return
-else
- local name = m:get(arg[1], "name") or m:get(arg[1], "_name")
- if not name or #name == 0 then
- name = translate("(Unnamed Entry)")
- end
- m.title = "%s - %s" %{ translate("Firewall - Port Forwards"), name }
-end
-
-s = m:section(NamedSection, arg[1], "redirect", "")
-s.anonymous = true
-s.addremove = false
-
-ft.opt_enabled(s, Button)
-ft.opt_name(s, Value, translate("Name"))
-
-
-o = s:option(Value, "proto", translate("Protocol"))
-o:value("tcp udp", "TCP+UDP")
-o:value("tcp", "TCP")
-o:value("udp", "UDP")
-o:value("icmp", "ICMP")
-
-function o.cfgvalue(...)
- local v = Value.cfgvalue(...)
- if not v or v == "tcpudp" then
- return "tcp udp"
- end
- return v
-end
-
-
-o = s:option(Value, "src", translate("Source zone"))
-o.nocreate = true
-o.default = "wan"
-o.template = "cbi/firewall_zonelist"
-o.rmempty = false
-
-
-o = s:option(DynamicList, "src_mac",
- translate("Source MAC address"),
- translate("Only match incoming traffic from these MACs."))
-o.rmempty = true
-o.datatype = "neg(macaddr)"
-o.placeholder = translate("any")
-
-luci.sys.net.mac_hints(function(mac, name)
- o:value(mac, "%s (%s)" %{ mac, name })
-end)
-
-
-o = s:option(Value, "src_ip",
- translate("Source IP address"),
- translate("Only match incoming traffic from this IP or range."))
-o.rmempty = true
-o.datatype = "neg(ipmask4)"
-o.placeholder = translate("any")
-
-luci.sys.net.ipv4_hints(function(ip, name)
- o:value(ip, "%s (%s)" %{ ip, name })
-end)
-
-
-o = s:option(Value, "src_port",
- translate("Source port"),
- translate("Only match incoming traffic originating from the given source port or port range on the client host"))
-o.rmempty = true
-o.datatype = "neg(portrange)"
-o.placeholder = translate("any")
-
-o:depends("proto", "tcp")
-o:depends("proto", "udp")
-o:depends("proto", "tcp udp")
-o:depends("proto", "tcpudp")
-
-o = s:option(Value, "src_dip",
- translate("External IP address"),
- translate("Only match incoming traffic directed at the given IP address."))
-
-luci.sys.net.ipv4_hints(function(ip, name)
- o:value(ip, "%s (%s)" %{ ip, name })
-end)
-
-
-o.rmempty = true
-o.datatype = "neg(ipmask4)"
-o.placeholder = translate("any")
-
-
-o = s:option(Value, "src_dport", translate("External port"),
- translate("Match incoming traffic directed at the given " ..
- "destination port or port range on this host"))
-o.datatype = "neg(portrange)"
-
-o:depends("proto", "tcp")
-o:depends("proto", "udp")
-o:depends("proto", "tcp udp")
-o:depends("proto", "tcpudp")
-
-o = s:option(Value, "dest", translate("Internal zone"))
-o.nocreate = true
-o.default = "lan"
-o.template = "cbi/firewall_zonelist"
-
-
-o = s:option(Value, "dest_ip", translate("Internal IP address"),
- translate("Redirect matched incoming traffic to the specified \
- internal host"))
-o.datatype = "ipmask4"
-
-luci.sys.net.ipv4_hints(function(ip, name)
- o:value(ip, "%s (%s)" %{ ip, name })
-end)
-
-
-o = s:option(Value, "dest_port",
- translate("Internal port"),
- translate("Redirect matched incoming traffic to the given port on \
- the internal host"))
-o.placeholder = translate("any")
-o.datatype = "portrange"
-
-o:depends("proto", "tcp")
-o:depends("proto", "udp")
-o:depends("proto", "tcp udp")
-o:depends("proto", "tcpudp")
-
-o = s:option(Flag, "reflection", translate("Enable NAT Loopback"))
-o.rmempty = true
-o.default = o.enabled
-o.cfgvalue = function(...)
- return Flag.cfgvalue(...) or "1"
-end
-
-
-s:option(Value, "extra",
- translate("Extra arguments"),
- translate("Passes additional arguments to iptables. Use with care!"))
-
-
-return m
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua
deleted file mode 100644
index 5d1ffe091..000000000
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua
+++ /dev/null
@@ -1,133 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2010-2012 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-local ds = require "luci.dispatcher"
-local ft = require "luci.tools.firewall"
-
-m = Map("firewall", translate("Firewall - Port Forwards"),
- translate("Port forwarding allows remote computers on the Internet to \
- connect to a specific computer or service within the \
- private LAN."))
-
---
--- Port Forwards
---
-
-s = m:section(TypedSection, "redirect", translate("Port Forwards"))
-s.template = "cbi/tblsection"
-s.addremove = true
-s.anonymous = true
-s.sortable = true
-s.extedit = ds.build_url("admin/network/firewall/forwards/%s")
-s.template_addremove = "firewall/cbi_addforward"
-
-function s.create(self, section)
- local n = m:formvalue("_newfwd.name")
- local p = m:formvalue("_newfwd.proto")
- local E = m:formvalue("_newfwd.extzone")
- local e = m:formvalue("_newfwd.extport")
- local I = m:formvalue("_newfwd.intzone")
- local a = m:formvalue("_newfwd.intaddr")
- local i = m:formvalue("_newfwd.intport")
-
- if p == "other" or (p and a) then
- created = TypedSection.create(self, section)
-
- self.map:set(created, "target", "DNAT")
- self.map:set(created, "src", E or "wan")
- self.map:set(created, "dest", I or "lan")
- self.map:set(created, "proto", (p ~= "other") and p or "all")
- self.map:set(created, "src_dport", e)
- self.map:set(created, "dest_ip", a)
- self.map:set(created, "dest_port", i)
- self.map:set(created, "name", n)
- end
-
- if p ~= "other" then
- created = nil
- end
-end
-
-function s.parse(self, ...)
- TypedSection.parse(self, ...)
- if created then
- m.uci:save("firewall")
- luci.http.redirect(ds.build_url(
- "admin/network/firewall/forwards", created
- ))
- end
-end
-
-function s.filter(self, sid)
- return (self.map:get(sid, "target") ~= "SNAT")
-end
-
-function s.sectiontitle(self, sid)
- return (self.map:get(sid, "name") or translate("Unnamed forward"))
-end
-
-
-local function forward_proto_txt(self, s)
- return "%s-%s" %{
- translate("IPv4"),
- ft.fmt_proto(self.map:get(s, "proto"),
- self.map:get(s, "icmp_type")) or "TCP+UDP"
- }
-end
-
-local function forward_src_txt(self, s)
- local z = ft.fmt_zone(self.map:get(s, "src"), translate("any zone"))
- local a = ft.fmt_ip(self.map:get(s, "src_ip"), translate("any host"))
- local p = ft.fmt_port(self.map:get(s, "src_port"))
- local m = ft.fmt_mac(self.map:get(s, "src_mac"))
-
- if p and m then
- return translatef("From %s in %s with source %s and %s", a, z, p, m)
- elseif p or m then
- return translatef("From %s in %s with source %s", a, z, p or m)
- else
- return translatef("From %s in %s", a, z)
- end
-end
-
-local function forward_via_txt(self, s)
- local a = ft.fmt_ip(self.map:get(s, "src_dip"), translate("any router IP"))
- local p = ft.fmt_port(self.map:get(s, "src_dport"))
-
- if p then
- return translatef("Via %s at %s", a, p)
- else
- return translatef("Via %s", a)
- end
-end
-
-match = s:option(DummyValue, "match", translate("Match"))
-match.rawhtml = true
-function match.cfgvalue(self, s)
- return "<small>%s<br />%s<br />%s</small>" % {
- forward_proto_txt(self, s),
- forward_src_txt(self, s),
- forward_via_txt(self, s)
- }
-end
-
-
-dest = s:option(DummyValue, "dest", translate("Forward to"))
-dest.rawhtml = true
-function dest.cfgvalue(self, s)
- local z = ft.fmt_zone(self.map:get(s, "dest"), translate("any zone"))
- local a = ft.fmt_ip(self.map:get(s, "dest_ip"), translate("any host"))
- local p = ft.fmt_port(self.map:get(s, "dest_port")) or
- ft.fmt_port(self.map:get(s, "src_dport"))
-
- if p then
- return translatef("%s, %s in %s", a, p, z)
- else
- return translatef("%s in %s", a, z)
- end
-end
-
-ft.opt_enabled(s, Flag, translate("Enable"))
-
-return m
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua
deleted file mode 100644
index def01c669..000000000
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua
+++ /dev/null
@@ -1,365 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2010-2012 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-local dsp = require "luci.dispatcher"
-local ft = require "luci.tools.firewall"
-local nw = require "luci.model.network"
-local m, s, o, v, _
-
-arg[1] = arg[1] or ""
-
-m = Map("firewall",
- translate("Firewall - Traffic Rules"),
- translate("This page allows you to change advanced properties of the \
- traffic rule entry, such as matched source and destination \
- hosts."))
-
-m.redirect = dsp.build_url("admin/network/firewall/rules")
-
-nw.init(m.uci)
-
-local rule_type = m.uci:get("firewall", arg[1])
-if rule_type == "redirect" and m:get(arg[1], "target") ~= "SNAT" then
- rule_type = nil
-end
-
-if not rule_type then
- luci.http.redirect(m.redirect)
- return
-
---
--- SNAT
---
-elseif rule_type == "redirect" then
-
- local name = m:get(arg[1], "name") or m:get(arg[1], "_name")
- if not name or #name == 0 then
- name = translate("(Unnamed SNAT)")
- else
- name = "SNAT %s" % name
- end
-
- m.title = "%s - %s" %{ translate("Firewall - Traffic Rules"), name }
-
- s = m:section(NamedSection, arg[1], "redirect", "")
- s.anonymous = true
- s.addremove = false
-
-
- ft.opt_enabled(s, Button)
- ft.opt_name(s, Value, translate("Name"))
-
-
- o = s:option(Value, "proto",
- translate("Protocol"),
- translate("You may specify multiple by selecting \"-- custom --\" and \
- then entering protocols separated by space."))
-
- o:value("all", "All protocols")
- o:value("tcp udp", "TCP+UDP")
- o:value("tcp", "TCP")
- o:value("udp", "UDP")
- o:value("icmp", "ICMP")
-
- function o.cfgvalue(...)
- local v = Value.cfgvalue(...)
- if not v or v == "tcpudp" then
- return "tcp udp"
- end
- return v
- end
-
-
- o = s:option(Value, "src", translate("Source zone"))
- o.nocreate = true
- o.default = "wan"
- o.template = "cbi/firewall_zonelist"
-
-
- o = s:option(Value, "src_ip", translate("Source IP address"))
- o.rmempty = true
- o.datatype = "neg(ipmask4)"
- o.placeholder = translate("any")
-
- luci.sys.net.ipv4_hints(function(ip, name)
- o:value(ip, "%s (%s)" %{ ip, name })
- end)
-
-
- o = s:option(Value, "src_port",
- translate("Source port"),
- translate("Match incoming traffic originating from the given source \
- port or port range on the client host."))
- o.rmempty = true
- o.datatype = "neg(portrange)"
- o.placeholder = translate("any")
-
- o:depends("proto", "tcp")
- o:depends("proto", "udp")
- o:depends("proto", "tcp udp")
- o:depends("proto", "tcpudp")
-
- o = s:option(Value, "dest", translate("Destination zone"))
- o.nocreate = true
- o.default = "lan"
- o.template = "cbi/firewall_zonelist"
-
-
- o = s:option(Value, "dest_ip", translate("Destination IP address"))
- o.datatype = "neg(ipmask4)"
-
- luci.sys.net.ipv4_hints(function(ip, name)
- o:value(ip, "%s (%s)" %{ ip, name })
- end)
-
-
- o = s:option(Value, "dest_port",
- translate("Destination port"),
- translate("Match forwarded traffic to the given destination port or \
- port range."))
-
- o.rmempty = true
- o.placeholder = translate("any")
- o.datatype = "neg(portrange)"
-
- o:depends("proto", "tcp")
- o:depends("proto", "udp")
- o:depends("proto", "tcp udp")
- o:depends("proto", "tcpudp")
-
- o = s:option(Value, "src_dip",
- translate("SNAT IP address"),
- translate("Rewrite matched traffic to the given address."))
- o.rmempty = false
- o.datatype = "ip4addr"
-
- for _, v in ipairs(nw:get_interfaces()) do
- local a
- for _, a in ipairs(v:ipaddrs()) do
- o:value(a:host():string(), '%s (%s)' %{
- a:host():string(), v:shortname()
- })
- end
- end
-
-
- o = s:option(Value, "src_dport", translate("SNAT port"),
- translate("Rewrite matched traffic to the given source port. May be \
- left empty to only rewrite the IP address."))
- o.datatype = "portrange"
- o.rmempty = true
- o.placeholder = translate('Do not rewrite')
-
- o:depends("proto", "tcp")
- o:depends("proto", "udp")
- o:depends("proto", "tcp udp")
- o:depends("proto", "tcpudp")
-
- s:option(Value, "extra",
- translate("Extra arguments"),
- translate("Passes additional arguments to iptables. Use with care!"))
-
-
---
--- Rule
---
-else
- local name = m:get(arg[1], "name") or m:get(arg[1], "_name")
- if not name or #name == 0 then
- name = translate("(Unnamed Rule)")
- end
-
- m.title = "%s - %s" %{ translate("Firewall - Traffic Rules"), name }
-
-
- s = m:section(NamedSection, arg[1], "rule", "")
- s.anonymous = true
- s.addremove = false
-
- ft.opt_enabled(s, Button)
- ft.opt_name(s, Value, translate("Name"))
-
-
- o = s:option(ListValue, "family", translate("Restrict to address family"))
- o.rmempty = true
- o:value("", translate("IPv4 and IPv6"))
- o:value("ipv4", translate("IPv4 only"))
- o:value("ipv6", translate("IPv6 only"))
-
-
- o = s:option(Value, "proto", translate("Protocol"))
- o:value("all", translate("Any"))
- o:value("tcp udp", "TCP+UDP")
- o:value("tcp", "TCP")
- o:value("udp", "UDP")
- o:value("icmp", "ICMP")
-
- function o.cfgvalue(...)
- local v = Value.cfgvalue(...)
- if not v or v == "tcpudp" then
- return "tcp udp"
- end
- return v
- end
-
-
- o = s:option(DropDown, "icmp_type", translate("Match ICMP type"))
- o.multiple = true
- o.display = 10
- o.dropdown = 10
- o.custom = true
- o.cast = "table"
-
- o:value("", "any")
- o:value("echo-reply")
- o:value("destination-unreachable")
- o:value("network-unreachable")
- o:value("host-unreachable")
- o:value("protocol-unreachable")
- o:value("port-unreachable")
- o:value("fragmentation-needed")
- o:value("source-route-failed")
- o:value("network-unknown")
- o:value("host-unknown")
- o:value("network-prohibited")
- o:value("host-prohibited")
- o:value("TOS-network-unreachable")
- o:value("TOS-host-unreachable")
- o:value("communication-prohibited")
- o:value("host-precedence-violation")
- o:value("precedence-cutoff")
- o:value("source-quench")
- o:value("redirect")
- o:value("network-redirect")
- o:value("host-redirect")
- o:value("TOS-network-redirect")
- o:value("TOS-host-redirect")
- o:value("echo-request")
- o:value("router-advertisement")
- o:value("router-solicitation")
- o:value("time-exceeded")
- o:value("ttl-zero-during-transit")
- o:value("ttl-zero-during-reassembly")
- o:value("parameter-problem")
- o:value("ip-header-bad")
- o:value("required-option-missing")
- o:value("timestamp-request")
- o:value("timestamp-reply")
- o:value("address-mask-request")
- o:value("address-mask-reply")
-
- o:depends("proto", "icmp")
-
-
- o = s:option(Value, "src", translate("Source zone"))
- o.nocreate = true
- o.allowany = true
- o.allowlocal = "src"
- o.template = "cbi/firewall_zonelist"
-
-
- o = s:option(Value, "src_mac", translate("Source MAC address"))
- o.datatype = "list(macaddr)"
- o.placeholder = translate("any")
-
- luci.sys.net.mac_hints(function(mac, name)
- o:value(mac, "%s (%s)" %{ mac, name })
- end)
-
-
- o = s:option(Value, "src_ip", translate("Source address"))
- o.datatype = "list(neg(ipmask))"
- o.placeholder = translate("any")
-
- luci.sys.net.ipv4_hints(function(ip, name)
- o:value(ip, "%s (%s)" %{ ip, name })
- end)
-
-
- o = s:option(Value, "src_port", translate("Source port"))
- o.datatype = "list(neg(portrange))"
- o.placeholder = translate("any")
-
- o:depends("proto", "tcp")
- o:depends("proto", "udp")
- o:depends("proto", "tcp udp")
- o:depends("proto", "tcpudp")
-
- o = s:option(Value, "dest_local", translate("Output zone"))
- o.nocreate = true
- o.allowany = true
- o.template = "cbi/firewall_zonelist"
- o.alias = "dest"
- o:depends("src", "")
-
- o = s:option(Value, "dest_remote", translate("Destination zone"))
- o.nocreate = true
- o.allowany = true
- o.allowlocal = true
- o.template = "cbi/firewall_zonelist"
- o.alias = "dest"
- o:depends({["src"] = "", ["!reverse"] = true})
-
-
- o = s:option(Value, "dest_ip", translate("Destination address"))
- o.datatype = "list(neg(ipmask))"
- o.placeholder = translate("any")
-
- luci.sys.net.ipv4_hints(function(ip, name)
- o:value(ip, "%s (%s)" %{ ip, name })
- end)
-
-
- o = s:option(Value, "dest_port", translate("Destination port"))
- o.datatype = "list(neg(portrange))"
- o.placeholder = translate("any")
-
- o:depends("proto", "tcp")
- o:depends("proto", "udp")
- o:depends("proto", "tcp udp")
- o:depends("proto", "tcpudp")
-
- o = s:option(ListValue, "target", translate("Action"))
- o.default = "ACCEPT"
- o:value("DROP", translate("drop"))
- o:value("ACCEPT", translate("accept"))
- o:value("REJECT", translate("reject"))
- o:value("NOTRACK", translate("don't track"))
-
-
- s:option(Value, "extra",
- translate("Extra arguments"),
- translate("Passes additional arguments to iptables. Use with care!"))
-end
-
-o = s:option(DropDown, "weekdays", translate("Week Days"))
-o.multiple = true
-o.display = 5
-o:value("Sun", translate("Sunday"))
-o:value("Mon", translate("Monday"))
-o:value("Tue", translate("Tuesday"))
-o:value("Wed", translate("Wednesday"))
-o:value("Thu", translate("Thursday"))
-o:value("Fri", translate("Friday"))
-o:value("Sat", translate("Saturday"))
-
-o = s:option(DropDown, "monthdays", translate("Month Days"))
-o.multiple = true
-o.display = 15
-for i = 1,31 do
- o:value(translate(i))
-end
-
-o = s:option(Value, "start_time", translate("Start Time (hh:mm:ss)"))
-o.datatype = "timehhmmss"
-o = s:option(Value, "stop_time", translate("Stop Time (hh:mm:ss)"))
-o.datatype = "timehhmmss"
-o = s:option(Value, "start_date", translate("Start Date (yyyy-mm-dd)"))
-o.datatype = "dateyyyymmdd"
-o = s:option(Value, "stop_date", translate("Stop Date (yyyy-mm-dd)"))
-o.datatype = "dateyyyymmdd"
-
-o = s:option(Flag, "utc_time", translate("Time in UTC"))
-o.default = o.disabled
-
-return m
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua
deleted file mode 100644
index f4b6b2a92..000000000
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua
+++ /dev/null
@@ -1,273 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2010-2012 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-local ds = require "luci.dispatcher"
-local ft = require "luci.tools.firewall"
-
-m = Map("firewall",
- translate("Firewall - Traffic Rules"),
- translate("Traffic rules define policies for packets traveling between \
- different zones, for example to reject traffic between certain hosts \
- or to open WAN ports on the router."))
-
---
--- Rules
---
-
-s = m:section(TypedSection, "rule", translate("Traffic Rules"))
-s.addremove = true
-s.anonymous = true
-s.sortable = true
-s.template = "cbi/tblsection"
-s.extedit = ds.build_url("admin/network/firewall/rules/%s")
-s.defaults.target = "ACCEPT"
-s.template_addremove = "firewall/cbi_addrule"
-
-
-function s.create(self, section)
- created = TypedSection.create(self, section)
-end
-
-function s.parse(self, ...)
- TypedSection.parse(self, ...)
-
- local i_n = m:formvalue("_newopen.name")
- local i_p = m:formvalue("_newopen.proto")
- local i_e = m:formvalue("_newopen.extport")
- local i_x = m:formvalue("_newopen.submit")
-
- local f_n = m:formvalue("_newfwd.name")
- local f_s = m:formvalue("_newfwd.src")
- local f_d = m:formvalue("_newfwd.dest")
- local f_x = m:formvalue("_newfwd.submit")
-
- if i_x then
- created = TypedSection.create(self, section)
-
- self.map:set(created, "target", "ACCEPT")
- self.map:set(created, "src", "wan")
- self.map:set(created, "proto", (i_p ~= "other") and i_p or "all")
- self.map:set(created, "dest_port", i_e)
- self.map:set(created, "name", i_n)
-
- if i_p ~= "other" and i_e and #i_e > 0 then
- created = nil
- end
-
- elseif f_x then
- created = TypedSection.create(self, section)
-
- self.map:set(created, "target", "ACCEPT")
- self.map:set(created, "src", f_s)
- self.map:set(created, "dest", f_d)
- self.map:set(created, "name", f_n)
- end
-
- if created then
- m.uci:save("firewall")
- luci.http.redirect(ds.build_url(
- "admin/network/firewall/rules", created
- ))
- end
-end
-
-function s.sectiontitle(self, sid)
- return (self.map:get(sid, "name") or translate("Unnamed rule"))
-end
-
-local function rule_proto_txt(self, s)
- local f = self.map:get(s, "family")
- local p = ft.fmt_proto(self.map:get(s, "proto"),
- self.map:get(s, "icmp_type")) or translate("traffic")
-
- if f and f:match("4") then
- return "%s-%s" %{ translate("IPv4"), p }
- elseif f and f:match("6") then
- return "%s-%s" %{ translate("IPv6"), p }
- else
- return "%s %s" %{ translate("Any"), p }
- end
-end
-
-local function rule_src_txt(self, s)
- local z = ft.fmt_zone(self.map:get(s, "src"))
- local p = ft.fmt_port(self.map:get(s, "src_port"))
- local m = ft.fmt_mac(self.map:get(s, "src_mac"))
-
- -- Forward/Input
- if z and #z > 0 then
- local a = ft.fmt_ip(self.map:get(s, "src_ip"), translate("any host"))
- if p and m then
- return translatef("From %s in %s with source %s and %s", a, z, p, m)
- elseif p or m then
- return translatef("From %s in %s with source %s", a, z, p or m)
- else
- return translatef("From %s in %s", a, z)
- end
-
- -- Output
- else
- local a = ft.fmt_ip(self.map:get(s, "src_ip"), translate("any router IP"))
- if p and m then
- return translatef("From %s on <var>this device</var> with source %s and %s", a, p, m)
- elseif p or m then
- return translatef("From %s on <var>this device</var> with source %s", a, p or m)
- else
- return translatef("From %s on <var>this device</var>", a)
- end
- end
-end
-
-local function rule_dest_txt(self, s)
- local z = ft.fmt_zone(self.map:get(s, "dest"))
- local p = ft.fmt_port(self.map:get(s, "dest_port"))
-
- -- Forward
- if z then
- local a = ft.fmt_ip(self.map:get(s, "dest_ip"), translate("any host"))
- if p then
- return translatef("To %s, %s in %s", a, p, z)
- else
- return translatef("To %s in %s", a, z)
- end
-
- -- Input
- else
- local a = ft.fmt_ip(self.map:get(s, "dest_ip"),
- translate("any router IP"))
-
- if p then
- return translatef("To %s at %s on <var>this device</var>", a, p)
- else
- return translatef("To %s on <var>this device</var>", a)
- end
- end
-end
-
-local function snat_dest_txt(self, s)
- local z = ft.fmt_zone(self.map:get(s, "dest"), translate("any zone"))
- local a = ft.fmt_ip(self.map:get(s, "dest_ip"), translate("any host"))
- local p = ft.fmt_port(self.map:get(s, "dest_port")) or
- ft.fmt_port(self.map:get(s, "src_dport"))
-
- if p then
- return translatef("To %s, %s in %s", a, p, z)
- else
- return translatef("To %s in %s", a, z)
- end
-end
-
-
-match = s:option(DummyValue, "match", translate("Match"))
-match.rawhtml = true
-function match.cfgvalue(self, s)
- return "<small>%s<br />%s<br />%s</small>" % {
- rule_proto_txt(self, s),
- rule_src_txt(self, s),
- rule_dest_txt(self, s)
- }
-end
-
-target = s:option(DummyValue, "target", translate("Action"))
-target.rawhtml = true
-function target.cfgvalue(self, s)
- local t = ft.fmt_target(self.map:get(s, "target"), self.map:get(s, "src"), self.map:get(s, "dest"))
- local l = ft.fmt_limit(self.map:get(s, "limit"),
- self.map:get(s, "limit_burst"))
-
- if l then
- return translatef("<var>%s</var> and limit to %s", t, l)
- else
- return "<var>%s</var>" % t
- end
-end
-
-ft.opt_enabled(s, Flag, translate("Enable"))
-
-
---
--- SNAT
---
-
-s = m:section(TypedSection, "redirect",
- translate("Source NAT"),
- translate("Source NAT is a specific form of masquerading which allows \
- fine grained control over the source IP used for outgoing traffic, \
- for example to map multiple WAN addresses to internal subnets."))
-s.template = "cbi/tblsection"
-s.addremove = true
-s.anonymous = true
-s.sortable = true
-s.extedit = ds.build_url("admin/network/firewall/rules/%s")
-s.template_addremove = "firewall/cbi_addsnat"
-
-function s.create(self, section)
- created = TypedSection.create(self, section)
-end
-
-function s.parse(self, ...)
- TypedSection.parse(self, ...)
-
- local n = m:formvalue("_newsnat.name")
- local s = m:formvalue("_newsnat.src")
- local d = m:formvalue("_newsnat.dest")
- local a = m:formvalue("_newsnat.dip")
- local p = m:formvalue("_newsnat.dport")
- local x = m:formvalue("_newsnat.submit")
-
- if x and a and #a > 0 then
- created = TypedSection.create(self, section)
-
- self.map:set(created, "target", "SNAT")
- self.map:set(created, "src", s)
- self.map:set(created, "dest", d)
- self.map:set(created, "proto", "all")
- self.map:set(created, "src_dip", a)
- self.map:set(created, "src_dport", p)
- self.map:set(created, "name", n)
- end
-
- if created then
- m.uci:save("firewall")
- luci.http.redirect(ds.build_url(
- "admin/network/firewall/rules", created
- ))
- end
-end
-
-function s.filter(self, sid)
- return (self.map:get(sid, "target") == "SNAT")
-end
-
-function s.sectiontitle(self, sid)
- return (self.map:get(sid, "name") or translate("Unnamed SNAT"))
-end
-
-match = s:option(DummyValue, "match", translate("Match"))
-match.rawhtml = true
-function match.cfgvalue(self, s)
- return "<small>%s<br />%s<br />%s</small>" % {
- rule_proto_txt(self, s),
- rule_src_txt(self, s),
- snat_dest_txt(self, s)
- }
-end
-
-snat = s:option(DummyValue, "via", translate("Action"))
-snat.rawhtml = true
-function snat.cfgvalue(self, s)
- local a = ft.fmt_ip(self.map:get(s, "src_dip"))
- local p = ft.fmt_port(self.map:get(s, "src_dport"))
-
- if a and p then
- return translatef("Rewrite to source %s, %s", a, p)
- else
- return translatef("Rewrite to source %s", a or p)
- end
-end
-
-ft.opt_enabled(s, Flag, translate("Enable"))
-
-
-return m
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua
deleted file mode 100644
index e168c3c60..000000000
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua
+++ /dev/null
@@ -1,229 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2010-2011 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-local nw = require "luci.model.network"
-local fw = require "luci.model.firewall"
-local ds = require "luci.dispatcher"
-local ut = require "luci.util"
-
-local m, p, i, v
-local s, name, net, family, msrc, mdest, log, lim
-local s2, out, inp
-
-
-m = Map("firewall", translate("Firewall - Zone Settings"))
-m.redirect = luci.dispatcher.build_url("admin/network/firewall/zones")
-
-fw.init(m.uci)
-nw.init(m.uci)
-
-
-local zone = fw:get_zone(arg[1])
-if not zone then
- luci.http.redirect(ds.build_url("admin/network/firewall/zones"))
- return
-else
- m.title = "%s - %s" %{
- translate("Firewall - Zone Settings"),
- translatef("Zone %q", zone:name() or "?")
- }
-end
-
-
-s = m:section(NamedSection, zone.sid, "zone",
- translatef("Zone %q", zone:name()),
- translatef("This section defines common properties of %q. \
- The <em>input</em> and <em>output</em> options set the default \
- policies for traffic entering and leaving this zone while the \
- <em>forward</em> option describes the policy for forwarded traffic \
- between different networks within the zone. \
- <em>Covered networks</em> specifies which available networks are \
- members of this zone.", zone:name()))
-
-s.anonymous = true
-s.addremove = false
-
-m.on_commit = function(map)
- local zone = fw:get_zone(arg[1])
- if zone then
- s.section = zone.sid
- s2.section = zone.sid
- end
-end
-
-
-s:tab("general", translate("General Settings"))
-s:tab("advanced", translate("Advanced Settings"))
-
-
-name = s:taboption("general", Value, "name", translate("Name"))
-name.optional = false
-name.forcewrite = true
-name.datatype = "and(uciname,maxlength(11))"
-
-function name.write(self, section, value)
- if zone:name() ~= value then
- fw:rename_zone(zone:name(), value)
- out.exclude = value
- inp.exclude = value
- end
-end
-
-p = {
- s:taboption("general", ListValue, "input", translate("Input")),
- s:taboption("general", ListValue, "output", translate("Output")),
- s:taboption("general", ListValue, "forward", translate("Forward"))
-}
-
-for i, v in ipairs(p) do
- v:value("REJECT", translate("reject"))
- v:value("DROP", translate("drop"))
- v:value("ACCEPT", translate("accept"))
-end
-
-s:taboption("general", Flag, "masq", translate("Masquerading"))
-s:taboption("general", Flag, "mtu_fix", translate("MSS clamping"))
-
-net = s:taboption("general", Value, "network", translate("Covered networks"))
-net.template = "cbi/network_netlist"
-net.widget = "checkbox"
-net.cast = "string"
-
-function net.formvalue(self, section)
- return Value.formvalue(self, section) or "-"
-end
-
-function net.cfgvalue(self, section)
- return Value.cfgvalue(self, section) or name:cfgvalue(section)
-end
-
-function net.write(self, section, value)
- zone:clear_networks()
-
- local net
- for net in ut.imatch(value) do
- local n = nw:get_network(net) or nw:add_network(net, { proto = "none" })
- if n then
- zone:add_network(n:name())
- end
- end
-end
-
-
-family = s:taboption("advanced", ListValue, "family",
- translate("Restrict to address family"))
-
-family.rmempty = true
-family:value("", translate("IPv4 and IPv6"))
-family:value("ipv4", translate("IPv4 only"))
-family:value("ipv6", translate("IPv6 only"))
-
-msrc = s:taboption("advanced", DynamicList, "masq_src",
- translate("Restrict Masquerading to given source subnets"))
-
-msrc.optional = true
-msrc.datatype = "list(neg(or(uciname,hostname,ipmask4)))"
-msrc.placeholder = "0.0.0.0/0"
-msrc:depends("family", "")
-msrc:depends("family", "ipv4")
-
-mdest = s:taboption("advanced", DynamicList, "masq_dest",
- translate("Restrict Masquerading to given destination subnets"))
-
-mdest.optional = true
-mdest.datatype = "list(neg(or(uciname,hostname,ipmask4)))"
-mdest.placeholder = "0.0.0.0/0"
-mdest:depends("family", "")
-mdest:depends("family", "ipv4")
-
-s:taboption("advanced", Flag, "conntrack",
- translate("Force connection tracking"))
-
-log = s:taboption("advanced", Flag, "log",
- translate("Enable logging on this zone"))
-
-log.rmempty = true
-log.enabled = "1"
-
-lim = s:taboption("advanced", Value, "log_limit",
- translate("Limit log messages"))
-
-lim.placeholder = "10/minute"
-lim:depends("log", "1")
-
-
-s2 = m:section(NamedSection, zone.sid, "fwd_out",
- translate("Inter-Zone Forwarding"),
- translatef("The options below control the forwarding policies between \
- this zone (%s) and other zones. <em>Destination zones</em> cover \
- forwarded traffic <strong>originating from %q</strong>. \
- <em>Source zones</em> match forwarded traffic from other zones \
- <strong>targeted at %q</strong>. The forwarding rule is \
- <em>unidirectional</em>, e.g. a forward from lan to wan does \
- <em>not</em> imply a permission to forward from wan to lan as well.",
- zone:name(), zone:name(), zone:name()
-
- ))
-
-out = s2:option(Value, "out",
- translate("Allow forward to <em>destination zones</em>:"))
-
-out.nocreate = true
-out.widget = "checkbox"
-out.exclude = zone:name()
-out.template = "cbi/firewall_zonelist"
-
-inp = s2:option(Value, "in",
- translate("Allow forward from <em>source zones</em>:"))
-
-inp.nocreate = true
-inp.widget = "checkbox"
-inp.exclude = zone:name()
-inp.template = "cbi/firewall_zonelist"
-
-function out.cfgvalue(self, section)
- local v = { }
- local f
- for _, f in ipairs(zone:get_forwardings_by("src")) do
- v[#v+1] = f:dest()
- end
- return table.concat(v, " ")
-end
-
-function inp.cfgvalue(self, section)
- local v = { }
- local f
- for _, f in ipairs(zone:get_forwardings_by("dest")) do
- v[#v+1] = f:src()
- end
- return v
-end
-
-function out.formvalue(self, section)
- return Value.formvalue(self, section) or "-"
-end
-
-function inp.formvalue(self, section)
- return Value.formvalue(self, section) or "-"
-end
-
-function out.write(self, section, value)
- zone:del_forwardings_by("src")
-
- local f
- for f in ut.imatch(value) do
- zone:add_forwarding_to(f)
- end
-end
-
-function inp.write(self, section, value)
- zone:del_forwardings_by("dest")
-
- local f
- for f in ut.imatch(value) do
- zone:add_forwarding_from(f)
- end
-end
-
-return m
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua
deleted file mode 100644
index 46402a8fc..000000000
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua
+++ /dev/null
@@ -1,104 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Licensed to the public under the Apache License 2.0.
-
-local ds = require "luci.dispatcher"
-local fw = require "luci.model.firewall"
-local fs = require "nixio.fs"
-
-local m, s, o, p, i, v
-
-m = Map("firewall",
- translate("Firewall - Zone Settings"),
- translate("The firewall creates zones over your network interfaces to control network traffic flow."))
-
-fw.init(m.uci)
-
-s = m:section(TypedSection, "defaults", translate("General Settings"))
-s.anonymous = true
-s.addremove = false
-
-s:option(Flag, "syn_flood", translate("Enable SYN-flood protection"))
-
-o = s:option(Flag, "drop_invalid", translate("Drop invalid packets"))
-
-p = {
- s:option(ListValue, "input", translate("Input")),
- s:option(ListValue, "output", translate("Output")),
- s:option(ListValue, "forward", translate("Forward"))
-}
-
-for i, v in ipairs(p) do
- v:value("REJECT", translate("reject"))
- v:value("DROP", translate("drop"))
- v:value("ACCEPT", translate("accept"))
-end
-
--- Netfilter flow offload support
-
-local offload = fs.access("/sys/module/xt_FLOWOFFLOAD/refcnt")
-
-if offload then
- s:option(DummyValue, "offload_advice",
- translate("Routing/NAT Offloading"),
- translate("Experimental feature. Not fully compatible with QoS/SQM."))
-
- o = s:option(Flag, "flow_offloading",
- translate("Software flow offloading"),
- translate("Software based offloading for routing/NAT"))
- o.optional = true
-
- o = s:option(Flag, "flow_offloading_hw",
- translate("Hardware flow offloading"),
- translate("Requires hardware NAT support. Implemented at least for mt7621"))
- o.optional = true
- o:depends( "flow_offloading", 1)
-end
-
--- Firewall zones
-
-s = m:section(TypedSection, "zone", translate("Zones"))
-s.template = "cbi/tblsection"
-s.anonymous = true
-s.addremove = true
-s.extedit = ds.build_url("admin", "network", "firewall", "zones", "%s")
-
-function s.sectiontitle(self, sid)
- local z = fw:get_zone(sid)
- return z:name()
-end
-
-function s.create(self)
- local z = fw:new_zone()
- if z then
- luci.http.redirect(
- ds.build_url("admin", "network", "firewall", "zones", z.sid)
- )
- end
-end
-
-function s.remove(self, section)
- return fw:del_zone(section)
-end
-
-o = s:option(DummyValue, "_info", translate("Zone ⇒ Forwardings"))
-o.template = "cbi/firewall_zoneforwards"
-o.cfgvalue = function(self, section)
- return self.map:get(section, "name")
-end
-
-p = {
- s:option(ListValue, "input", translate("Input")),
- s:option(ListValue, "output", translate("Output")),
- s:option(ListValue, "forward", translate("Forward"))
-}
-
-for i, v in ipairs(p) do
- v:value("REJECT", translate("reject"))
- v:value("DROP", translate("drop"))
- v:value("ACCEPT", translate("accept"))
-end
-
-s:option(Flag, "masq", translate("Masquerading"))
-s:option(Flag, "mtu_fix", translate("MSS clamping"))
-
-return m
diff --git a/applications/luci-app-firewall/po/de/firewall.po b/applications/luci-app-firewall/po/de/firewall.po
index ad0cc1f29..d9a3861e6 100644
--- a/applications/luci-app-firewall/po/de/firewall.po
+++ b/applications/luci-app-firewall/po/de/firewall.po
@@ -194,7 +194,7 @@ msgstr "Protokollierung innerhalb der Zone aktivieren"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua:43
msgid "Experimental feature. Not fully compatible with QoS/SQM."
-msgstr ""
+msgstr "Experimentelle Funktion. Nicht vollständig kompatibel mit QoS/SQM."
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua:98
msgid "External IP address"
@@ -259,7 +259,7 @@ msgstr "Weiterleiten an"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:343
msgid "Friday"
-msgstr ""
+msgstr "Freitag"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua:90
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua:106
@@ -296,7 +296,7 @@ msgstr "Allgemein"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua:51
msgid "Hardware flow offloading"
-msgstr ""
+msgstr "Hardwarebeschleunigte Flusskontrolle"
#: applications/luci-app-firewall/luasrc/tools/firewall.lua:75
msgid "IP"
@@ -411,11 +411,11 @@ msgstr "Selektiert eingehenden Verkehr nach den angegebenen Quell-Ports."
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:339
msgid "Monday"
-msgstr ""
+msgstr "Montag"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:346
msgid "Month Days"
-msgstr ""
+msgstr "Monatstage"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua:36
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:50
@@ -541,7 +541,7 @@ msgstr ""
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua:52
msgid "Requires hardware NAT support. Implemented at least for mt7621"
-msgstr ""
+msgstr "Erfordert Hardware-NAT-Unterstützung. (Zumindest für mt7621 implementiert)"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/custom.lua:29
msgid "Restart Firewall"
@@ -582,15 +582,15 @@ msgstr "Schreibe um auf Quell-%s, %s"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua:42
msgid "Routing/NAT Offloading"
-msgstr ""
+msgstr "Routing/NAT-Beschleunigung"
#: applications/luci-app-firewall/luasrc/tools/firewall.lua:245
msgid "Rule is disabled"
-msgstr ""
+msgstr "Regel ist deaktiviert"
#: applications/luci-app-firewall/luasrc/tools/firewall.lua:241
msgid "Rule is enabled"
-msgstr ""
+msgstr "Regel ist aktiviert"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:131
msgid "SNAT IP address"
@@ -602,15 +602,15 @@ msgstr "SNAT-Port"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:344
msgid "Saturday"
-msgstr ""
+msgstr "Samstag"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua:47
msgid "Software based offloading for routing/NAT"
-msgstr ""
+msgstr "Softwarebasierte Auslagerung für Routing/NAT"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua:46
msgid "Software flow offloading"
-msgstr ""
+msgstr "Beschleunigte Flusskontrolle"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua:74
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:79
@@ -656,23 +656,23 @@ msgstr "Quell-Zone"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:357
msgid "Start Date (yyyy-mm-dd)"
-msgstr ""
+msgstr "Startdatum (JJJJ-MM-TT)"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:353
msgid "Start Time (hh:mm:ss)"
-msgstr ""
+msgstr "Startzeit (hh:mm:ss)"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:359
msgid "Stop Date (yyyy-mm-dd)"
-msgstr ""
+msgstr "Enddatum (JJJJ-MM-TT)"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:355
msgid "Stop Time (hh:mm:ss)"
-msgstr ""
+msgstr "Endzeit (hh:mm:ss)"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:338
msgid "Sunday"
-msgstr ""
+msgstr "Sonntag"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua:12
msgid ""
@@ -735,11 +735,11 @@ msgstr ""
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:342
msgid "Thursday"
-msgstr ""
+msgstr "Donnerstag"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:362
msgid "Time in UTC"
-msgstr ""
+msgstr "Zeit ist UTC"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua:141
msgid "To %s at %s on <var>this device</var>"
@@ -784,19 +784,19 @@ msgstr ""
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:340
msgid "Tuesday"
-msgstr ""
+msgstr "Dienstag"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua:244
msgid "Unnamed SNAT"
-msgstr ""
+msgstr "Unbennante SNAT-Regel"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua:67
msgid "Unnamed forward"
-msgstr ""
+msgstr "Unbenannte Portweiterleitung"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rules.lua:76
msgid "Unnamed rule"
-msgstr ""
+msgstr "Unbennante Regel"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua:101
msgid "Via %s"
@@ -808,11 +808,11 @@ msgstr "Über %s an %s"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:341
msgid "Wednesday"
-msgstr ""
+msgstr "Mittwoch"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:335
msgid "Week Days"
-msgstr ""
+msgstr "Wochentage"
#: applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua:55
msgid ""
diff --git a/applications/luci-app-mwan3/po/de/mwan3.po b/applications/luci-app-mwan3/po/de/mwan3.po
index 5cb3b2641..8a6d06b17 100644
--- a/applications/luci-app-mwan3/po/de/mwan3.po
+++ b/applications/luci-app-mwan3/po/de/mwan3.po
@@ -173,10 +173,12 @@ msgstr "Aktiviert"
msgid ""
"Enables firewall rule logging (global mwan3 logging must also be enabled)"
msgstr ""
+"Aktiviert die Protokollierung von Firewall-Regeln (globale "
+"Firewall-Protokollierung muss ebenfalls aktiviert sein)."
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua:23
msgid "Enables global firewall logging"
-msgstr ""
+msgstr "Aktiviert die globale Firewall-Protokollierung"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua:16
msgid "Enter value in hex, starting with <code>0x</code>"
@@ -200,7 +202,7 @@ msgstr "Fehler-Intervall"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua:29
msgid "Firewall loglevel"
-msgstr ""
+msgstr "Firewall-Protokollierungsstufe"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua:15
msgid "Firewall mask"
@@ -325,7 +327,7 @@ msgstr ""
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua:28
msgid "Loglevel"
-msgstr ""
+msgstr "Protokollierungsstufe"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua:8
msgid "MWAN - Globals"
@@ -672,11 +674,11 @@ msgstr ""
#: applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm:69
msgid "Task"
-msgstr ""
+msgstr "Aufgabe"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua:15
msgid "There are currently %d of %d supported interfaces configured"
-msgstr ""
+msgstr "Es sind derzeit %d von %d unterstützten Schnittstellen konfiguriert"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua:245
msgid ""
@@ -732,7 +734,7 @@ msgstr ""
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua:36
msgid "Tracking hostname or IP address"
-msgstr "Tracking des Hostnamen oder der IP-Addresse"
+msgstr "Name oder IP-Adresse des Tracking Hosts"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua:40
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua:170
@@ -771,34 +773,46 @@ msgstr "Schaue in der Datei /etc/protocols für Protokollbeschreibung mach"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua:19
msgid "WARNING: %d interfaces are configured exceeding the maximum of %d!"
msgstr ""
+"WARNUNG: %d Schnittstellen sind konfiguriert. Damit wird das Maximum von %d "
+"überschritten!"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua:26
msgid "WARNING: Interface %s are not found in /etc/config/network"
msgstr ""
+"WARNUNG: Die Schnittstelle %s wurde in /etc/config/network nicht gefunden!"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua:45
msgid "WARNING: Interface %s has a duplicate metric %s configured"
msgstr ""
+"WARNUNG: Die Schnittstelle %s hat eine doppelte Metrik %s konfiguriert!"
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua:38
msgid ""
"WARNING: Interface %s has a higher reliability requirement than tracking "
"hosts (%d)"
msgstr ""
+"WARNUNG: Die Tracking-Sicherheit der Schnittstelle %s ist höher als die "
+"Anzahl der Tracking Hosts (%d)."
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua:32
msgid "WARNING: Interface %s has no default route in the main routing table"
msgstr ""
+"WARNUNG: Die Schnittstelle %s hat keine Standardroute in der "
+"Hauptroutinentabelle."
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua:30
msgid "WARNING: Policy %s has exceeding the maximum name of 15 characters"
msgstr ""
+"WARNUNG: Die Regel %s hat die maximale Namenslänge von 15 Zeichen "
+"überschritten."
#: applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua:34
msgid ""
"WARNING: Rule %s have a port configured with no or improper protocol "
"specified!"
msgstr ""
+"WARNUNG: Die Regel %s hat einen Port, der mit keinem oder einem falschen "
+"Protokoll konfiguriert ist!"
#: applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm:37
msgid "Waiting for command to complete..."
diff --git a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
index 2c0c460d1..20fbf430b 100644
--- a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
+++ b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
@@ -162,7 +162,7 @@ function display(pattern)
'class': 'btn cbi-button-negative',
'data-package': name,
'click': handleRemove
- }, _('Remove'));
+ }, _('Remove…'));
}
else {
var inst = packages.installed.pkgs[name];
@@ -737,7 +737,7 @@ function handleRemove(ev)
'data-package': name,
'class': 'btn cbi-button-negative',
'click': handleOpkg
- }, _('Remove…'))
+ }, _('Remove'))
])
])
]);
diff --git a/applications/luci-app-opkg/po/ca/opkg.po b/applications/luci-app-opkg/po/ca/opkg.po
index 8e0a701ba..b15c51684 100644
--- a/applications/luci-app-opkg/po/ca/opkg.po
+++ b/applications/luci-app-opkg/po/ca/opkg.po
@@ -193,16 +193,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Treu"
+msgid "Remove…"
+msgstr "Treu…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Treu…"
+msgid "Remove"
+msgstr "Treu"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/cs/opkg.po b/applications/luci-app-opkg/po/cs/opkg.po
index 524b9b6fb..a93ddb9f2 100644
--- a/applications/luci-app-opkg/po/cs/opkg.po
+++ b/applications/luci-app-opkg/po/cs/opkg.po
@@ -187,16 +187,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr "Opravdu se pokusíte nainstalovat <em>%h</em>?"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Odstranit"
+msgid "Remove…"
+msgstr "Odstranit…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr "Odstraňte balíček <em>%h</em>"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Odstranit…"
+msgid "Remove"
+msgstr "Odstranit"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/de/opkg.po b/applications/luci-app-opkg/po/de/opkg.po
index eb7971897..5efd9a0df 100644
--- a/applications/luci-app-opkg/po/de/opkg.po
+++ b/applications/luci-app-opkg/po/de/opkg.po
@@ -191,16 +191,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr "Soll wirklich versucht werden, <em>%h</em> zu installieren?"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Entfernen"
+msgid "Remove…"
+msgstr "Entfernen…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr "Paket <em>%h</em> entfernen"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Entfernen…"
+msgid "Remove"
+msgstr "Entfernen"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/el/opkg.po b/applications/luci-app-opkg/po/el/opkg.po
index 3fa5a2a97..647c8e43d 100644
--- a/applications/luci-app-opkg/po/el/opkg.po
+++ b/applications/luci-app-opkg/po/el/opkg.po
@@ -193,16 +193,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Αφαίρεση"
+msgid "Remove…"
+msgstr "Αφαίρεση…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Αφαίρεση…"
+msgid "Remove"
+msgstr "Αφαίρεση"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/en/opkg.po b/applications/luci-app-opkg/po/en/opkg.po
index 44d9d87f8..49422f6e1 100644
--- a/applications/luci-app-opkg/po/en/opkg.po
+++ b/applications/luci-app-opkg/po/en/opkg.po
@@ -182,7 +182,7 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
+msgid "Remove…"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
@@ -190,7 +190,7 @@ msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
+msgid "Remove"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
diff --git a/applications/luci-app-opkg/po/es/opkg.po b/applications/luci-app-opkg/po/es/opkg.po
index 5dc936a14..aa4c5c0f1 100644
--- a/applications/luci-app-opkg/po/es/opkg.po
+++ b/applications/luci-app-opkg/po/es/opkg.po
@@ -189,16 +189,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr "¿Realmente intentas instalar <em>%h</em>?"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Desinstalar"
+msgid "Remove…"
+msgstr "Desinstalar…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr "Eliminar paquete <em>%h</em>"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr ""
+msgid "Remove"
+msgstr "Desinstalar"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/fr/opkg.po b/applications/luci-app-opkg/po/fr/opkg.po
index 4c4467900..c1b014a5d 100644
--- a/applications/luci-app-opkg/po/fr/opkg.po
+++ b/applications/luci-app-opkg/po/fr/opkg.po
@@ -193,16 +193,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Désinstaller"
+msgid "Remove…"
+msgstr "Désinstaller…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Désinstaller…"
+msgid "Remove"
+msgstr "Désinstaller"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/he/opkg.po b/applications/luci-app-opkg/po/he/opkg.po
index cad99287c..96cabcf3a 100644
--- a/applications/luci-app-opkg/po/he/opkg.po
+++ b/applications/luci-app-opkg/po/he/opkg.po
@@ -189,7 +189,7 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
+msgid "Remove…"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
@@ -197,7 +197,7 @@ msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
+msgid "Remove"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
diff --git a/applications/luci-app-opkg/po/hu/opkg.po b/applications/luci-app-opkg/po/hu/opkg.po
index 8c8575bb3..038248c11 100644
--- a/applications/luci-app-opkg/po/hu/opkg.po
+++ b/applications/luci-app-opkg/po/hu/opkg.po
@@ -191,16 +191,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Eltávolítás"
+msgid "Remove…"
+msgstr "Eltávolítás…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Eltávolítás…"
+msgid "Remove"
+msgstr "Eltávolítás"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/it/opkg.po b/applications/luci-app-opkg/po/it/opkg.po
index e35d09e38..1e94abfe3 100644
--- a/applications/luci-app-opkg/po/it/opkg.po
+++ b/applications/luci-app-opkg/po/it/opkg.po
@@ -193,16 +193,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Rimuovi"
+msgid "Remove…"
+msgstr "Rimuovi…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Rimuovi…"
+msgid "Remove"
+msgstr "Rimuovi"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/ja/opkg.po b/applications/luci-app-opkg/po/ja/opkg.po
index c75792836..851a5bede 100644
--- a/applications/luci-app-opkg/po/ja/opkg.po
+++ b/applications/luci-app-opkg/po/ja/opkg.po
@@ -188,16 +188,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr "<em>%h</em> のインストールを試行してもよろしいですか?"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "削除"
+msgid "Remove…"
+msgstr "削除…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr "<em>%h</em> パッケージを削除"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "削除…"
+msgid "Remove"
+msgstr "削除"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/ko/opkg.po b/applications/luci-app-opkg/po/ko/opkg.po
index 37c30fa25..98b4884e7 100644
--- a/applications/luci-app-opkg/po/ko/opkg.po
+++ b/applications/luci-app-opkg/po/ko/opkg.po
@@ -192,16 +192,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "제거"
+msgid "Remove…"
+msgstr "제거…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "제거…"
+msgid "Remove"
+msgstr "제거"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/ms/opkg.po b/applications/luci-app-opkg/po/ms/opkg.po
index a4b05343e..123959f5c 100644
--- a/applications/luci-app-opkg/po/ms/opkg.po
+++ b/applications/luci-app-opkg/po/ms/opkg.po
@@ -193,16 +193,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Menghapuskan"
+msgid "Remove…"
+msgstr "Menghapuskan…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Menghapuskan…"
+msgid "Remove"
+msgstr "Menghapuskan"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/no/opkg.po b/applications/luci-app-opkg/po/no/opkg.po
index d941e2ae6..26ec3833e 100644
--- a/applications/luci-app-opkg/po/no/opkg.po
+++ b/applications/luci-app-opkg/po/no/opkg.po
@@ -188,16 +188,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Avinstaller"
+msgid "Remove…"
+msgstr "Avinstaller…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Avinstaller…"
+msgid "Remove"
+msgstr "Avinstaller"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/pl/opkg.po b/applications/luci-app-opkg/po/pl/opkg.po
index 7472c88b0..9e8a5e8c3 100644
--- a/applications/luci-app-opkg/po/pl/opkg.po
+++ b/applications/luci-app-opkg/po/pl/opkg.po
@@ -202,16 +202,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr "Czy na pewno chcesz zainstalować pakiet <em>%h</em>?"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Usuń"
+msgid "Remove…"
+msgstr "Usuń…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr "Usuń pakiet <em>%h</em>"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Usuń…"
+msgid "Remove"
+msgstr "Usuń"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/pt-br/opkg.po b/applications/luci-app-opkg/po/pt-br/opkg.po
index 98cbf5c9d..3bb622645 100644
--- a/applications/luci-app-opkg/po/pt-br/opkg.po
+++ b/applications/luci-app-opkg/po/pt-br/opkg.po
@@ -194,16 +194,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Remover"
+msgid "Remove…"
+msgstr "Remover…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Remover…"
+msgid "Remove"
+msgstr "Remover"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/pt/opkg.po b/applications/luci-app-opkg/po/pt/opkg.po
index 3805fbe1d..5726f02f4 100644
--- a/applications/luci-app-opkg/po/pt/opkg.po
+++ b/applications/luci-app-opkg/po/pt/opkg.po
@@ -193,16 +193,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Remover"
+msgid "Remove…"
+msgstr "Remover…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Remover…"
+msgid "Remove"
+msgstr "Remover"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/ro/opkg.po b/applications/luci-app-opkg/po/ro/opkg.po
index d81f92204..7f6066566 100644
--- a/applications/luci-app-opkg/po/ro/opkg.po
+++ b/applications/luci-app-opkg/po/ro/opkg.po
@@ -192,16 +192,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Elimina"
+msgid "Remove…"
+msgstr "Elimina…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Elimina…"
+msgid "Remove"
+msgstr "Elimina"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/ru/opkg.po b/applications/luci-app-opkg/po/ru/opkg.po
index 6d9ad1a91..7a1f81d0a 100644
--- a/applications/luci-app-opkg/po/ru/opkg.po
+++ b/applications/luci-app-opkg/po/ru/opkg.po
@@ -191,16 +191,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr "Вы действительно хотите установить <em>%h</em>?"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Удалить"
+msgid "Remove…"
+msgstr "Удалить…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr "Удалить пакет <em>%h</em>"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Удалить…"
+msgid "Remove"
+msgstr "Удалить"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/sk/opkg.po b/applications/luci-app-opkg/po/sk/opkg.po
index 7f20b0042..f39e7c54d 100644
--- a/applications/luci-app-opkg/po/sk/opkg.po
+++ b/applications/luci-app-opkg/po/sk/opkg.po
@@ -178,7 +178,7 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
+msgid "Remove…"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
@@ -186,7 +186,7 @@ msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
+msgid "Remove"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
diff --git a/applications/luci-app-opkg/po/sv/opkg.po b/applications/luci-app-opkg/po/sv/opkg.po
index 1ca223f62..488b164f7 100644
--- a/applications/luci-app-opkg/po/sv/opkg.po
+++ b/applications/luci-app-opkg/po/sv/opkg.po
@@ -191,16 +191,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Ta bort"
+msgid "Remove…"
+msgstr "Ta bort…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Ta bort…"
+msgid "Remove"
+msgstr "Ta bort"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/templates/opkg.pot b/applications/luci-app-opkg/po/templates/opkg.pot
index ccd349e1c..2631ec020 100644
--- a/applications/luci-app-opkg/po/templates/opkg.pot
+++ b/applications/luci-app-opkg/po/templates/opkg.pot
@@ -170,7 +170,7 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
+msgid "Remove…"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
@@ -178,7 +178,7 @@ msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
+msgid "Remove"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
diff --git a/applications/luci-app-opkg/po/tr/opkg.po b/applications/luci-app-opkg/po/tr/opkg.po
index efe286e30..9b6e8dabb 100644
--- a/applications/luci-app-opkg/po/tr/opkg.po
+++ b/applications/luci-app-opkg/po/tr/opkg.po
@@ -185,7 +185,7 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
+msgid "Remove…"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
@@ -193,7 +193,7 @@ msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
+msgid "Remove"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
diff --git a/applications/luci-app-opkg/po/uk/opkg.po b/applications/luci-app-opkg/po/uk/opkg.po
index 52a209d13..554ed583a 100644
--- a/applications/luci-app-opkg/po/uk/opkg.po
+++ b/applications/luci-app-opkg/po/uk/opkg.po
@@ -185,16 +185,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr "Дійсно спробувати інсталювати <em>%h</em>?"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Видалити"
+msgid "Remove…"
+msgstr "Видалити…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr "Видалити пакет <em>%h</em>"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Видалити…"
+msgid "Remove"
+msgstr "Видалити"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/vi/opkg.po b/applications/luci-app-opkg/po/vi/opkg.po
index 22afb4ec8..8a8ba0b59 100644
--- a/applications/luci-app-opkg/po/vi/opkg.po
+++ b/applications/luci-app-opkg/po/vi/opkg.po
@@ -192,16 +192,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "Loại bỏ"
+msgid "Remove…"
+msgstr "Loại bỏ…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "Loại bỏ…"
+msgid "Remove"
+msgstr "Loại bỏ"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/zh-cn/opkg.po b/applications/luci-app-opkg/po/zh-cn/opkg.po
index b268aa6e2..e027dc793 100644
--- a/applications/luci-app-opkg/po/zh-cn/opkg.po
+++ b/applications/luci-app-opkg/po/zh-cn/opkg.po
@@ -185,16 +185,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr "真的要安装 <em>%h</em> 吗?"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "移除"
+msgid "Remove…"
+msgstr "移除…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr "移除软件包 <em>%h</em>"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "移除…"
+msgid "Remove"
+msgstr "移除"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-opkg/po/zh-tw/opkg.po b/applications/luci-app-opkg/po/zh-tw/opkg.po
index 8d432af0d..7fd5d77aa 100644
--- a/applications/luci-app-opkg/po/zh-tw/opkg.po
+++ b/applications/luci-app-opkg/po/zh-tw/opkg.po
@@ -191,16 +191,16 @@ msgid "Really attempt to install <em>%h</em>?"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:165
-msgid "Remove"
-msgstr "移除"
+msgid "Remove…"
+msgstr "移除…"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:718
msgid "Remove package <em>%h</em>"
msgstr ""
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:740
-msgid "Remove…"
-msgstr "移除…"
+msgid "Remove"
+msgstr "移除"
#: applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js:568
msgid "Require approx. %.1024mB size for %d package(s) to install."
diff --git a/applications/luci-app-simple-adblock/Makefile b/applications/luci-app-simple-adblock/Makefile
index 2471078fc..7cd8514a4 100644
--- a/applications/luci-app-simple-adblock/Makefile
+++ b/applications/luci-app-simple-adblock/Makefile
@@ -10,7 +10,7 @@ LUCI_TITLE:=Simple Adblock Web UI
LUCI_DESCRIPTION:=Provides Web UI for simple-adblock service.
LUCI_DEPENDS:=+luci-mod-admin-full +simple-adblock
LUCI_PKGARCH:=all
-PKG_RELEASE:=16
+PKG_RELEASE:=27
include ../../luci.mk
diff --git a/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua b/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua
index 4dbb21c6e..155cb9547 100644
--- a/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua
+++ b/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua
@@ -1,61 +1,110 @@
-- Copyright 2016-2018 Stan Grishin <stangri@melmac.net>
-- Licensed to the public under the Apache License 2.0.
-m = Map("simple-adblock", translate("Simple AdBlock Settings"))
-
-h = m:section(NamedSection, "config", "simple-adblock", translate("Service Status"))
-
local packageName = "simple-adblock"
local uci = require "luci.model.uci".cursor()
local util = require "luci.util"
+local sys = require "luci.sys"
+local jsonc = require "luci.jsonc"
+local fs = require "nixio.fs"
+local http = require "luci.http"
+local dispatcher = require "luci.dispatcher"
local enabledFlag = uci:get(packageName, "config", "enabled")
-local status = util.ubus('service', 'list', { name = packageName })
-if status and status[packageName] and status[packageName]['instances'] and status[packageName]['instances']['status'] and status[packageName]['instances']['status']['data'] and status[packageName]['instances']['status']['data']['status'] then
- status = status[packageName]['instances']['status']['data']['status']
-else
- status = "Stopped"
+local command
+
+m = Map("simple-adblock", translate("Simple AdBlock Settings"))
+m.apply_on_parse = true
+m.on_after_apply = function(self)
+ sys.call("/etc/init.d/simple-adblock restart")
+end
+
+local tmpfs
+if fs.access("/var/run/" .. packageName .. ".json") then
+ tmpfs = jsonc.parse(util.trim(sys.exec("cat /var/run/" .. packageName .. ".json")))
+end
+
+local tmpfsVersion, tmpfsStatus, tmpfsMessage, tmpfsError, tmpfsStats = "", "Stopped"
+if tmpfs and tmpfs['data'] then
+ if tmpfs['data']['status'] and tmpfs['data']['status'] ~= "" then
+ tmpfsStatus = tmpfs['data']['status']
+ end
+ if tmpfs['data']['message'] and tmpfs['data']['message'] ~= "" then
+ tmpfsMessage = tmpfs['data']['message']
+ end
+ if tmpfs['data']['error'] and tmpfs['data']['error'] ~= "" then
+ tmpfsError = tmpfs['data']['error']
+ end
+ if tmpfs['data']['stats'] and tmpfs['data']['stats'] ~= "" then
+ tmpfsStats = tmpfs['data']['stats']
+ end
+ if tmpfs['data']['version'] and tmpfs['data']['version'] ~= "" then
+ tmpfsVersion = " (" .. packageName .. " " .. tmpfs['data']['version'] .. ")"
+ end
end
-if status:match("Reloading") then
- ds = h:option(DummyValue, "_dummy", translate("Service Status"))
- ds.template = "simple-adblock/status"
- ds.value = status
+
+h = m:section(NamedSection, "config", "simple-adblock", translate("Service Status") .. tmpfsVersion)
+
+if tmpfsStatus and tmpfsStatus:match("ing") then
+ ss = h:option(DummyValue, "_dummy", translate("Service Status"))
+ ss.template = "simple-adblock/status"
+ ss.value = tmpfsStatus .. '...'
+ if tmpfsMessage then
+ sm = h:option(DummyValue, "_dummy", translate("Task"))
+ sm.template = "simple-adblock/status"
+ sm.value = tmpfsMessage
+ end
else
en = h:option(Button, "__toggle")
- if enabledFlag ~= "1" or status:match("Stopped") then
+ if enabledFlag ~= "1" or tmpfsStatus:match("Stopped") then
en.title = translate("Service is disabled/stopped")
en.inputtitle = translate("Enable/Start")
en.inputstyle = "apply important"
- if nixio.fs.access("/var/simple-adblock.cache") then
- ds = h:option(DummyValue, "_dummy", translate("Service Status"))
- ds.template = "simple-adblock/status"
- ds.value = "Cache file containing " .. luci.util.trim(luci.sys.exec("wc -l < /var/simple-adblock.cache")) .. " domains found"
+ if fs.access("/var/run/simple-adblock.cache") then
+ sm = h:option(DummyValue, "_dummy", translate("Info"))
+ sm.template = "simple-adblock/status"
+ sm.value = "Cache file containing " .. util.trim(sys.exec("wc -l < /var/run/simple-adblock.cache")) .. " domains found."
+ elseif fs.access("/etc/$simple-adblock.gz") then
+ sm = h:option(DummyValue, "_dummy", translate("Info"))
+ sm.template = "simple-adblock/status"
+ sm.value = "Compressed cache file found."
end
else
en.title = translate("Service is enabled/started")
en.inputtitle = translate("Stop/Disable")
en.inputstyle = "reset important"
- ds = h:option(DummyValue, "_dummy", translate("Service Status"))
- ds.template = "simple-adblock/status"
- ds.value = status
- if not status:match("Success") then
+ ss = h:option(DummyValue, "_dummy", translate("Service Status"))
+ ss.template = "simple-adblock/status"
+ ss.value = tmpfsStatus
+ if tmpfsMessage then
+ ms = h:option(DummyValue, "_dummy", translate("Message"))
+ ms.template = "simple-adblock/status"
+ ms.value = tmpfsMessage
+ end
+ if tmpfsError then
+ es = h:option(DummyValue, "_dummy", translate("Collected Errors"))
+ es.template = "simple-adblock/status"
+ es.value = tmpfsError
reload = h:option(Button, "__reload")
reload.title = translate("Service started with error")
reload.inputtitle = translate("Reload")
reload.inputstyle = "apply important"
function reload.write()
- luci.sys.exec("/etc/init.d/simple-adblock reload")
- luci.http.redirect(luci.dispatcher.build_url("admin/services/" .. packageName))
+ sys.exec("/etc/init.d/simple-adblock reload")
+ http.redirect(dispatcher.build_url("admin/services/" .. packageName))
end
end
end
function en.write()
- enabledFlag = enabledFlag == "1" and "0" or "1"
+ if tmpfsStatus and tmpfsStatus:match("Stopped") then
+ enabledFlag = "1"
+ else
+ enabledFlag = enabledFlag == "1" and "0" or "1"
+ end
uci:set(packageName, "config", "enabled", enabledFlag)
uci:save(packageName)
uci:commit(packageName)
if enabledFlag == "0" then
luci.sys.init.stop(packageName)
--- luci.sys.exec("/etc/init.d/simple-adblock killcache")
else
luci.sys.init.enable(packageName)
luci.sys.init.start(packageName)
@@ -87,13 +136,13 @@ if nixio.fs.access(sysfs_path) then
leds = nixio.util.consume((nixio.fs.dir(sysfs_path)))
end
if #leds ~= 0 then
- o3 = s:taboption("basic", Value, "led", translate("LED to indicate status"), translate("Pick the LED not already used in")
+ o4 = s:taboption("basic", Value, "led", translate("LED to indicate status"), translate("Pick the LED not already used in")
.. [[ <a href="]] .. luci.dispatcher.build_url("admin/system/leds") .. [[">]]
.. translate("System LED Configuration") .. [[</a>]])
- o3.rmempty = true
- o3:value("", translate("none"))
+ o4.rmempty = false
+ o4:value("", translate("none"))
for k, v in ipairs(leds) do
- o3:value(v)
+ o4:value(v)
end
end
@@ -107,11 +156,29 @@ o7 = s:taboption("advanced", Value, "download_timeout", translate("Download time
o7.default = 10
o7.datatype = "range(1,60)"
+o5 = s:taboption("advanced", ListValue, "parallel_downloads", translate("Simultaneous processing"), translate("Launch all lists downloads and processing simultaneously, reducing service start time"))
+o5:value("0", translate("Do not use simultaneous processing"))
+o5:value("1", translate("Use simultaneous processing"))
+o5.rmempty = false
+o5.default = 1
+
+o9 = s:taboption("advanced", ListValue, "allow_non_ascii", translate("Allow Non-ASCII characters in DNSMASQ file"), translate("Only enable if your version of DNSMASQ supports the use of Non-ASCII characters, otherwise DNSMASQ will fail to start."))
+o9:value("0", translate("Do not allow Non-ASCII"))
+o9:value("1", translate("Allow Non-ASCII"))
+o9.rmempty = false
+o9.default = "0"
+
+o10 = s:taboption("advanced", ListValue, "compressed_cache", translate("Store compressed cache file on router"), translate("Attempt to create a compressed cache of final block-list on the router."))
+o10:value("0", translate("Do not store compressed cache"))
+o10:value("1", translate("Store compressed cache"))
+o10.rmempty = false
+o10.default = "0"
+
o8 = s:taboption("advanced", ListValue, "debug", translate("Enable Debugging"), translate("Enables debug output to /tmp/simple-adblock.log"))
-o8:value("", translate("Disable Debugging"))
+o8:value("0", translate("Disable Debugging"))
o8:value("1", translate("Enable Debugging"))
-o8.rmempty = true
-o8.default = 0
+o8.rmempty = false
+o8.default = "0"
s2 = m:section(NamedSection, "config", "simple-adblock", translate("Whitelist and Blocklist Management"))
diff --git a/applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock b/applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock
index 3b7137e02..97bc9fbee 100644
--- a/applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock
+++ b/applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock
@@ -1,8 +1,6 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@simple-adblock[-1]
- add ucitrack simple-adblock
- set ucitrack.@simple-adblock[-1].init=simple-adblock
commit ucitrack
EOF
diff --git a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
index eb7769b85..4c5db17d8 100644
--- a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
+++ b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
@@ -22,53 +22,25 @@ function index()
s_output = _("Output plugins"),
s_general = _("General plugins"),
s_network = _("Network plugins"),
-
- apcups = _("APC UPS"),
- conntrack = _("Conntrack"),
- contextswitch = _("Context Switches"),
- cpu = _("Processor"),
- cpufreq = _("CPU Frequency"),
- csv = _("CSV Output"),
- curl = _("cUrl"),
- df = _("Disk Space Usage"),
- disk = _("Disk Usage"),
- dns = _("DNS"),
- email = _("Email"),
- entropy = _("Entropy"),
- exec = _("Exec"),
- interface = _("Interfaces"),
- iptables = _("Firewall"),
- irq = _("Interrupts"),
- iwinfo = _("Wireless"),
- load = _("System Load"),
- memory = _("Memory"),
- netlink = _("Netlink"),
- network = _("Network"),
- nut = _("UPS"),
- olsrd = _("OLSRd"),
- openvpn = _("OpenVPN"),
- ping = _("Ping"),
- processes = _("Processes"),
- rrdtool = _("RRDTool"),
- sensors = _("Sensors"),
- splash_leases = _("Splash Leases"),
- tcpconns = _("TCP Connections"),
- thermal = _("Thermal"),
- unixsock = _("UnixSock"),
- uptime = _("Uptime")
}
-- our collectd menu
local collectd_menu = {
- output = { "csv", "network", "rrdtool", "unixsock" },
- general = { "apcups", "contextswitch", "cpu", "cpufreq", "df",
- "disk", "email", "entropy", "exec", "irq", "load", "memory",
- "nut", "processes", "sensors", "thermal", "uptime" },
- network = { "conntrack", "curl", "dns", "interface", "iptables",
- "netlink", "olsrd", "openvpn", "ping",
- "splash_leases", "tcpconns", "iwinfo" }
+ output = { },
+ general = { },
+ network = { }
}
+ local plugin_dir = "/usr/lib/lua/luci/statistics/plugins/"
+ for filename in nixio.fs.dir(plugin_dir) do
+ local plugin_fun = loadfile(plugin_dir .. filename)
+ setfenv(plugin_fun, { _ = luci.i18n.translate })
+ local plugin = plugin_fun()
+ local name = filename:gsub("%.lua", "")
+ table.insert(collectd_menu[plugin.category], name)
+ labels[name] = plugin.label
+ end
+
-- create toplevel menu nodes
local st = entry({"admin", "statistics"}, template("admin_statistics/index"), _("Statistics"), 80)
st.index = true
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua
index 3179da63b..bcee6efe0 100644
--- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua
@@ -20,6 +20,14 @@ hosts = s:option( Value, "Hosts", translate("Monitor hosts"), translate ("Add mu
hosts.default = "127.0.0.1"
hosts:depends( "enable", 1 )
+-- collectd_ping.adressfamily (AddressFamily)
+addressfamily = s:option( ListValue, "AddressFamily", translate("Address family") )
+addressfamily.default = "any"
+addressfamily:value( "any" )
+addressfamily:value( "ipv4" )
+addressfamily:value( "ipv6" )
+addressfamily:depends( "enable", 1 )
+
-- collectd_ping.ttl (TTL)
ttl = s:option( Value, "TTL", translate("TTL for ping packets") )
ttl.isinteger = true
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/apcups.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/apcups.lua
new file mode 100644
index 000000000..c54b550c3
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/apcups.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { "Host", "Port" },
+ { },
+ { }
+ },
+ label = _("APC UPS"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/conntrack.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/conntrack.lua
new file mode 100644
index 000000000..59f1a006b
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/conntrack.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("Conntrack"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/contextswitch.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/contextswitch.lua
new file mode 100644
index 000000000..90b44c2e7
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/contextswitch.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("Context Switches"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/cpu.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/cpu.lua
new file mode 100644
index 000000000..004a450ee
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/cpu.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("Processor"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/cpufreq.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/cpufreq.lua
new file mode 100644
index 000000000..29d2b8e80
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/cpufreq.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("CPU Frequency"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/csv.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/csv.lua
new file mode 100644
index 000000000..17a8621af
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/csv.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { "DataDir" },
+ { "StoreRates" },
+ { }
+ },
+ label = _("CSV Output"),
+ category = "output"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/curl.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/curl.lua
new file mode 100644
index 000000000..04217bdd6
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/curl.lua
@@ -0,0 +1,4 @@
+return {
+ label = _("cUrl"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/df.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/df.lua
new file mode 100644
index 000000000..89acbff0f
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/df.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "IgnoreSelected" },
+ { "Devices", "MountPoints", "FSTypes" }
+ },
+ label = _("Disk Space Usage"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/disk.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/disk.lua
new file mode 100644
index 000000000..3d6eeb5ab
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/disk.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "IgnoreSelected" },
+ { "Disks" }
+ },
+ label = _("Disk Usage"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/dns.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/dns.lua
new file mode 100644
index 000000000..4d10b8658
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/dns.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { "Interfaces", "IgnoreSources" }
+ },
+ label = _("DNS"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/email.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/email.lua
new file mode 100644
index 000000000..6d4c54a57
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/email.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { "SocketFile", "SocketGroup", "SocketPerms", "MaxConns" },
+ { },
+ { }
+ },
+ label = _("Email"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/entropy.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/entropy.lua
new file mode 100644
index 000000000..3b48d1644
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/entropy.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("Entropy"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/exec.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/exec.lua
new file mode 100644
index 000000000..4a972ccc8
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/exec.lua
@@ -0,0 +1,4 @@
+return {
+ label = _("Exec"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/interface.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/interface.lua
new file mode 100644
index 000000000..e22026789
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/interface.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "IgnoreSelected" },
+ { "Interfaces" }
+ },
+ label = _("Interfaces"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/iptables.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/iptables.lua
new file mode 100644
index 000000000..75006b306
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/iptables.lua
@@ -0,0 +1,4 @@
+return {
+ label = _("Firewall"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/irq.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/irq.lua
new file mode 100644
index 000000000..fa17b939a
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/irq.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "IgnoreSelected" },
+ { "Irqs" }
+ },
+ label = _("Interrupts"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/iwinfo.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/iwinfo.lua
new file mode 100644
index 000000000..658ff2aeb
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/iwinfo.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "IgnoreSelected" },
+ { "Interfaces" }
+ },
+ label = _("Wireless"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/load.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/load.lua
new file mode 100644
index 000000000..fdd6891e2
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/load.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("System Load"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/memory.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/memory.lua
new file mode 100644
index 000000000..8dee2dafc
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/memory.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("Memory"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/netlink.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/netlink.lua
new file mode 100644
index 000000000..885caf0bd
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/netlink.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "IgnoreSelected" },
+ { "Interfaces", "VerboseInterfaces", "QDiscs", "Classes", "Filters" }
+ },
+ label = _("Netlink"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/network.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/network.lua
new file mode 100644
index 000000000..5e4e62017
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/network.lua
@@ -0,0 +1,4 @@
+return {
+ label = _("Network"),
+ category = "output"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/nut.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/nut.lua
new file mode 100644
index 000000000..c490c4fd7
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/nut.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { "UPS" }
+ },
+ label = _("UPS"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/olsrd.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/olsrd.lua
new file mode 100644
index 000000000..077729788
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/olsrd.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { "Host", "Port", "CollectLinks","CollectRoutes","CollectTopology"},
+ { },
+ { }
+ },
+ label = _("OLSRd"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/openvpn.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/openvpn.lua
new file mode 100644
index 000000000..850a995bc
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/openvpn.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "CollectIndividualUsers", "CollectUserCount", "CollectCompression", "ImprovedNamingSchema" },
+ { "StatusFile" }
+ },
+ label = _("OpenVPN"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/ping.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/ping.lua
new file mode 100644
index 000000000..9ad16d802
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/ping.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { "TTL", "Interval", "AddressFamily" },
+ { },
+ { "Hosts" }
+ },
+ label = _("Ping"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/processes.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/processes.lua
new file mode 100644
index 000000000..cabf8f1e4
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/processes.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { "Processes" }
+ },
+ label = _("Processes"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/rrdtool.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/rrdtool.lua
new file mode 100644
index 000000000..de5b4c7ec
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/rrdtool.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { "DataDir", "StepSize", "HeartBeat", "RRARows", "XFF", "CacheFlush", "CacheTimeout" },
+ { "RRASingle" },
+ { "RRATimespans" }
+ },
+ label = _("RRDTool"),
+ category = "output"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/sensors.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/sensors.lua
new file mode 100644
index 000000000..713ab9aef
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/sensors.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "IgnoreSelected" },
+ { "Sensor" }
+ },
+ label = _("Sensors"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/splash_leases.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/splash_leases.lua
new file mode 100644
index 000000000..5640ea2bf
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/splash_leases.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("Splash Leases"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/tcpconns.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/tcpconns.lua
new file mode 100644
index 000000000..bb76522d3
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/tcpconns.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "ListeningPorts" },
+ { "LocalPorts", "RemotePorts" }
+ },
+ label = _("TCP Connections"),
+ category = "network"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/thermal.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/thermal.lua
new file mode 100644
index 000000000..e7e45f256
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/thermal.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { "IgnoreSelected" },
+ { "Device" }
+ },
+ label = _("Thermal"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/unixsock.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/unixsock.lua
new file mode 100644
index 000000000..71f50e1db
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/unixsock.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { "SocketFile", "SocketGroup", "SocketPerms" },
+ { },
+ { }
+ },
+ label = _("UnixSock"),
+ category = "output"
+}
diff --git a/applications/luci-app-statistics/luasrc/statistics/plugins/uptime.lua b/applications/luci-app-statistics/luasrc/statistics/plugins/uptime.lua
new file mode 100644
index 000000000..bb51a6a96
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/plugins/uptime.lua
@@ -0,0 +1,9 @@
+return {
+ legend = {
+ { },
+ { },
+ { }
+ },
+ label = _("Uptime"),
+ category = "general"
+}
diff --git a/applications/luci-app-statistics/root/usr/bin/stat-genconfig b/applications/luci-app-statistics/root/usr/bin/stat-genconfig
index 55cc6979e..df36da419 100755
--- a/applications/luci-app-statistics/root/usr/bin/stat-genconfig
+++ b/applications/luci-app-statistics/root/usr/bin/stat-genconfig
@@ -19,6 +19,7 @@ $Id$
require("luci.model.uci")
require("luci.sys.iptparser")
require("luci.util")
+require("nixio.fs")
local ipt = luci.sys.iptparser.IptParser()
local uci = luci.model.uci.cursor()
@@ -270,206 +271,31 @@ end
plugins = {
- apcups = {
- { "Host", "Port" },
- { },
- { }
- },
-
collectd = {
{ "BaseDir", "Include", "PIDFile", "PluginDir", "TypesDB", "Interval", "ReadThreads", "Hostname" },
{ },
{ }
},
-
- conntrack = {
- { },
- { },
- { }
- },
-
- cpu = {
- { },
- { },
- { }
- },
-
- cpufreq = {
- { },
- { },
- { }
- },
-
- contextswitch = {
- { },
- { },
- { }
- },
-
- csv = {
- { "DataDir" },
- { "StoreRates" },
- { }
- },
-
curl = config_curl,
-
- df = {
- { },
- { "IgnoreSelected" },
- { "Devices", "MountPoints", "FSTypes" }
- },
-
- disk = {
- { },
- { "IgnoreSelected" },
- { "Disks" }
- },
-
- dns = {
- { },
- { },
- { "Interfaces", "IgnoreSources" }
- },
-
- email = {
- { "SocketFile", "SocketGroup", "SocketPerms", "MaxConns" },
- { },
- { }
- },
-
- entropy = {
- { },
- { },
- { }
- },
-
exec = config_exec,
-
- interface = {
- { },
- { "IgnoreSelected" },
- { "Interfaces" }
- },
-
iptables = config_iptables,
-
- irq = {
- { },
- { "IgnoreSelected" },
- { "Irqs" }
- },
-
- iwinfo = {
- { },
- { "IgnoreSelected" },
- { "Interfaces" }
- },
-
- load = {
- { },
- { },
- { }
- },
-
logfile = {
{ "LogLevel", "File" },
{ "Timestamp" },
{ }
},
-
- memory = {
- { },
- { },
- { }
- },
-
- netlink = {
- { },
- { "IgnoreSelected" },
- { "Interfaces", "VerboseInterfaces", "QDiscs", "Classes", "Filters" }
- },
-
network = config_network,
+}
- nut = {
- { },
- { },
- { "UPS" }
- },
-
- olsrd = {
- { "Host", "Port", "CollectLinks","CollectRoutes","CollectTopology"},
- { },
- { }
- },
-
- openvpn = {
- { },
- { "CollectIndividualUsers", "CollectUserCount", "CollectCompression", "ImprovedNamingSchema" },
- { "StatusFile" }
- },
-
- ping = {
- { "TTL", "Interval" },
- { },
- { "Hosts" }
- },
-
- processes = {
- { },
- { },
- { "Processes" }
- },
-
- rrdtool = {
- { "DataDir", "StepSize", "HeartBeat", "RRARows", "XFF", "CacheFlush", "CacheTimeout" },
- { "RRASingle" },
- { "RRATimespans" }
- },
-
- sensors = {
- { },
- { "IgnoreSelected" },
- { "Sensor" }
- },
-
- splash_leases = {
- { },
- { },
- { }
- },
-
- tcpconns = {
- { },
- { "ListeningPorts" },
- { "LocalPorts", "RemotePorts" }
- },
-
- thermal = {
- { },
- { "IgnoreSelected" },
- { "Device" }
- },
-
- unixsock = {
- { "SocketFile", "SocketGroup", "SocketPerms" },
- { },
- { }
- },
-
- uptime = {
- { },
- { },
- { }
- },
+local plugin_dir = "/usr/lib/lua/luci/statistics/plugins/"
+for filename in nixio.fs.dir(plugin_dir) do
+ local plugin_fun = loadfile(plugin_dir .. filename)
+ setfenv(plugin_fun, { _ = luci.i18n.translate })
+ local plugin = plugin_fun()
+ local name = filename:gsub("%.lua", "")
+ plugins[name] = plugin.legend
+end
- wireless = {
- { },
- { },
- { }
- },
-}
preprocess = {
RRATimespans = function(val)
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
index 827a39b8c..429d4357d 100644
--- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
+++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
@@ -139,4 +139,10 @@ e8.default = 60
e8.datatype = "range(30,300)"
e8.rmempty = false
+e10 = e:option(Value, "trm_scanbuffer", translate("Scan Buffer Size"),
+ translate("Buffer size in bytes to prepare nearby scan results."))
+e10.default = 1024
+e10.datatype = "range(512,4096)"
+e10.optional = true
+
return m
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua
index f3ad76259..dae358ae0 100644
--- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua
+++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua
@@ -1,4 +1,4 @@
--- Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
+-- Copyright 2017-2019 Dirk Brenken (dev@brenken.org)
-- This is free software, licensed under the Apache License, Version 2.0
local fs = require("nixio.fs")
@@ -29,8 +29,8 @@ if s ~= nil then
bssid.default = s.bssid or ""
s.cipher = "auto"
- if string.match(s.encryption, '\+') and not string.match(s.encryption, '^wep') then
- s.pos = string.find(s.encryption, '\+')
+ if string.match(s.encryption, '%+') and not string.match(s.encryption, '^wep') then
+ s.pos = string.find(s.encryption, '%+')
s.cipher = string.sub(s.encryption, s.pos + 1)
s.encryption = string.sub(s.encryption, 0, s.pos - 1)
end
diff --git a/applications/luci-app-travelmate/po/es/travelmate.po b/applications/luci-app-travelmate/po/es/travelmate.po
index 44a034871..c948a78d6 100644
--- a/applications/luci-app-travelmate/po/es/travelmate.po
+++ b/applications/luci-app-travelmate/po/es/travelmate.po
@@ -70,6 +70,10 @@ msgstr "BSSID"
msgid "Back to overview"
msgstr "Volver a la visión general"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:143
+msgid "Buffer size in bytes to prepare nearby scan results."
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:58
msgid "Captive Portal Detection"
msgstr "Detección de portal cautivo"
@@ -423,6 +427,10 @@ msgstr "Guardar"
msgid "Scan"
msgstr "Escanear"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:142
+msgid "Scan Buffer Size"
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm:147
msgid "Show/Hide QR-Codes"
msgstr "Mostrar/Ocultar códigos QR"
diff --git a/applications/luci-app-travelmate/po/ja/travelmate.po b/applications/luci-app-travelmate/po/ja/travelmate.po
index 00b8e7dc0..ade155c84 100644
--- a/applications/luci-app-travelmate/po/ja/travelmate.po
+++ b/applications/luci-app-travelmate/po/ja/travelmate.po
@@ -7,7 +7,7 @@ msgstr ""
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.2\n"
+"X-Generator: Poedit 2.2.1\n"
"Last-Translator: INAGAKI Hiroshi <musashino.open@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ja\n"
@@ -55,6 +55,8 @@ msgid ""
"Automatically resets the 'Faulty Stations' list after n minutes. Default is "
"'0' which means no expiry."
msgstr ""
+"'問題のあるステーション' リストを指定された時間(分)が経過後に自動的にリセッ"
+"トします。デフォルトは期限切れとしないことを意味する '0' です。"
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua:44
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua:27
@@ -68,6 +70,10 @@ msgstr "BSSID"
msgid "Back to overview"
msgstr "概要へ戻る"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:143
+msgid "Buffer size in bytes to prepare nearby scan results."
+msgstr "スキャン結果を準備するためのバッファー サイズ (byte) です。"
+
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:58
msgid "Captive Portal Detection"
msgstr "キャプティブポータル検知"
@@ -257,7 +263,7 @@ msgstr "最終実行"
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:106
msgid "List Auto Expiry"
-msgstr ""
+msgstr "リストの自動期限切れ"
#: applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm:59
msgid "Loading"
@@ -285,7 +291,7 @@ msgstr "使用されるアップリンク インターフェースの名前で
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:63
msgid "Net Error Check"
-msgstr ""
+msgstr "ネット エラーチェック"
#: applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm:25
msgid "Open"
@@ -417,6 +423,10 @@ msgstr "保存"
msgid "Scan"
msgstr "スキャン:"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:142
+msgid "Scan Buffer Size"
+msgstr "スキャンバッファー サイズ"
+
#: applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm:147
msgid "Show/Hide QR-Codes"
msgstr "QR コードを表示/非表示"
@@ -501,7 +511,7 @@ msgstr "Travelmate バージョン"
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:64
msgid "Treat missing internet availability as an error."
-msgstr ""
+msgstr "インターネット可用性が無い場合をエラーとして扱います。"
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:112
msgid "Trigger Delay"
diff --git a/applications/luci-app-travelmate/po/pt-br/travelmate.po b/applications/luci-app-travelmate/po/pt-br/travelmate.po
index 32e9f2500..3ad498c85 100644
--- a/applications/luci-app-travelmate/po/pt-br/travelmate.po
+++ b/applications/luci-app-travelmate/po/pt-br/travelmate.po
@@ -68,6 +68,10 @@ msgstr "BSSID"
msgid "Back to overview"
msgstr "Voltar para visão geral"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:143
+msgid "Buffer size in bytes to prepare nearby scan results."
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:58
msgid "Captive Portal Detection"
msgstr "Detecção de Portal de Autenticação"
@@ -419,6 +423,10 @@ msgstr "Salvar"
msgid "Scan"
msgstr "Escanear"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:142
+msgid "Scan Buffer Size"
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm:147
msgid "Show/Hide QR-Codes"
msgstr ""
diff --git a/applications/luci-app-travelmate/po/ru/travelmate.po b/applications/luci-app-travelmate/po/ru/travelmate.po
index 127d0b005..9d694e09b 100644
--- a/applications/luci-app-travelmate/po/ru/travelmate.po
+++ b/applications/luci-app-travelmate/po/ru/travelmate.po
@@ -71,6 +71,10 @@ msgstr "BSSID"
msgid "Back to overview"
msgstr "Назад в меню"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:143
+msgid "Buffer size in bytes to prepare nearby scan results."
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:58
msgid "Captive Portal Detection"
msgstr ""
@@ -413,6 +417,10 @@ msgstr "Сохранить"
msgid "Scan"
msgstr "Поиск"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:142
+msgid "Scan Buffer Size"
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm:147
msgid "Show/Hide QR-Codes"
msgstr ""
diff --git a/applications/luci-app-travelmate/po/templates/travelmate.pot b/applications/luci-app-travelmate/po/templates/travelmate.pot
index aa9e39533..481c22fe9 100644
--- a/applications/luci-app-travelmate/po/templates/travelmate.pot
+++ b/applications/luci-app-travelmate/po/templates/travelmate.pot
@@ -57,6 +57,10 @@ msgstr ""
msgid "Back to overview"
msgstr ""
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:143
+msgid "Buffer size in bytes to prepare nearby scan results."
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:58
msgid "Captive Portal Detection"
msgstr ""
@@ -389,6 +393,10 @@ msgstr ""
msgid "Scan"
msgstr ""
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:142
+msgid "Scan Buffer Size"
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm:147
msgid "Show/Hide QR-Codes"
msgstr ""
diff --git a/applications/luci-app-travelmate/po/zh-cn/travelmate.po b/applications/luci-app-travelmate/po/zh-cn/travelmate.po
index 1ac234c49..53147d279 100644
--- a/applications/luci-app-travelmate/po/zh-cn/travelmate.po
+++ b/applications/luci-app-travelmate/po/zh-cn/travelmate.po
@@ -71,6 +71,10 @@ msgstr "BSSID"
msgid "Back to overview"
msgstr "返回概述"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:143
+msgid "Buffer size in bytes to prepare nearby scan results."
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:58
msgid "Captive Portal Detection"
msgstr "强制门户检测"
@@ -407,6 +411,10 @@ msgstr "保存"
msgid "Scan"
msgstr "扫描"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:142
+msgid "Scan Buffer Size"
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm:147
msgid "Show/Hide QR-Codes"
msgstr "显示/隐藏 QR 码"
diff --git a/applications/luci-app-travelmate/po/zh-tw/travelmate.po b/applications/luci-app-travelmate/po/zh-tw/travelmate.po
index 3b1d697e5..3c373fb15 100644
--- a/applications/luci-app-travelmate/po/zh-tw/travelmate.po
+++ b/applications/luci-app-travelmate/po/zh-tw/travelmate.po
@@ -71,6 +71,10 @@ msgstr "BSSID"
msgid "Back to overview"
msgstr "返回概述"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:143
+msgid "Buffer size in bytes to prepare nearby scan results."
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:58
msgid "Captive Portal Detection"
msgstr "強制門戶檢測"
@@ -408,6 +412,10 @@ msgstr "儲存"
msgid "Scan"
msgstr "掃描"
+#: applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua:142
+msgid "Scan Buffer Size"
+msgstr ""
+
#: applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm:147
msgid "Show/Hide QR-Codes"
msgstr "顯示/隱藏 QR 碼"