summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-app-adblock/po/it/adblock.po2
-rw-r--r--applications/luci-app-adblock/po/ja/adblock.po2
-rw-r--r--applications/luci-app-adblock/po/pt-br/adblock.po2
-rw-r--r--applications/luci-app-adblock/po/ru/adblock.po2
-rw-r--r--applications/luci-app-adblock/po/sv/adblock.po2
-rw-r--r--applications/luci-app-adblock/po/templates/adblock.pot2
-rw-r--r--applications/luci-app-adblock/po/zh-cn/adblock.po2
-rw-r--r--applications/luci-app-adblock/po/zh-tw/adblock.po2
-rwxr-xr-xapplications/luci-app-attendedsysupgrade/root/etc/uci-defaults/40_luci-attendedsysupgrade1
-rw-r--r--applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js14
-rw-r--r--applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm7
-rw-r--r--applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm5
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua2
-rw-r--r--applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm49
-rw-r--r--applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm93
-rw-r--r--applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua2
-rw-r--r--applications/luci-app-olsr/luasrc/controller/olsr.lua42
-rw-r--r--applications/luci-app-splash/luasrc/controller/splash/splash.lua66
-rw-r--r--applications/luci-app-splash/luasrc/view/admin_status/splash.htm65
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua100
-rw-r--r--applications/luci-app-travelmate/Makefile4
-rw-r--r--applications/luci-app-travelmate/luasrc/controller/travelmate.lua4
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua21
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua2
-rw-r--r--applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm62
-rw-r--r--applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm1
-rw-r--r--applications/luci-app-travelmate/po/ja/travelmate.po67
-rw-r--r--applications/luci-app-travelmate/po/pt-br/travelmate.po49
-rw-r--r--applications/luci-app-travelmate/po/ru/travelmate.po87
-rw-r--r--applications/luci-app-travelmate/po/templates/travelmate.pot49
-rw-r--r--applications/luci-app-wifischedule/luasrc/model/cbi/wifischedule/wifi_schedule.lua7
-rw-r--r--applications/luci-app-wol/luasrc/model/cbi/wol.lua8
32 files changed, 438 insertions, 385 deletions
diff --git a/applications/luci-app-adblock/po/it/adblock.po b/applications/luci-app-adblock/po/it/adblock.po
index bdaa2f29a..88adcc892 100644
--- a/applications/luci-app-adblock/po/it/adblock.po
+++ b/applications/luci-app-adblock/po/it/adblock.po
@@ -275,7 +275,7 @@ msgid ""
msgstr ""
msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads & list processing in parallel "
"(default '4').<br />"
msgstr ""
diff --git a/applications/luci-app-adblock/po/ja/adblock.po b/applications/luci-app-adblock/po/ja/adblock.po
index d3a0a5c82..60c5a9a54 100644
--- a/applications/luci-app-adblock/po/ja/adblock.po
+++ b/applications/luci-app-adblock/po/ja/adblock.po
@@ -301,7 +301,7 @@ msgstr ""
"処理エラーまたはドメイン カウントが0以下の場合、メールを送信します。<br />"
msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
"(default '4').<br />"
msgstr ""
"ダウンロードの制御とリストの処理を同時並行的に行うダウンロード キューのサイズ"
diff --git a/applications/luci-app-adblock/po/pt-br/adblock.po b/applications/luci-app-adblock/po/pt-br/adblock.po
index f264ed677..7eb6e3ebc 100644
--- a/applications/luci-app-adblock/po/pt-br/adblock.po
+++ b/applications/luci-app-adblock/po/pt-br/adblock.po
@@ -267,7 +267,7 @@ msgid ""
msgstr ""
msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
"(default '4').<br />"
msgstr ""
diff --git a/applications/luci-app-adblock/po/ru/adblock.po b/applications/luci-app-adblock/po/ru/adblock.po
index 0898213a4..6e80e80b3 100644
--- a/applications/luci-app-adblock/po/ru/adblock.po
+++ b/applications/luci-app-adblock/po/ru/adblock.po
@@ -303,7 +303,7 @@ msgstr ""
"&le; 0.<br />"
msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
"(default '4').<br />"
msgstr ""
"Значение очереди загрузки для выполнения параллельных загрузок (по умолчанию "
diff --git a/applications/luci-app-adblock/po/sv/adblock.po b/applications/luci-app-adblock/po/sv/adblock.po
index 5a86d2c92..d875a69f9 100644
--- a/applications/luci-app-adblock/po/sv/adblock.po
+++ b/applications/luci-app-adblock/po/sv/adblock.po
@@ -256,7 +256,7 @@ msgid ""
msgstr ""
msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
"(default '4').<br />"
msgstr ""
diff --git a/applications/luci-app-adblock/po/templates/adblock.pot b/applications/luci-app-adblock/po/templates/adblock.pot
index 285bb1dca..5a93f8f07 100644
--- a/applications/luci-app-adblock/po/templates/adblock.pot
+++ b/applications/luci-app-adblock/po/templates/adblock.pot
@@ -248,7 +248,7 @@ msgid ""
msgstr ""
msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
"(default '4').<br />"
msgstr ""
diff --git a/applications/luci-app-adblock/po/zh-cn/adblock.po b/applications/luci-app-adblock/po/zh-cn/adblock.po
index 3b8a35b04..1d7dc2b19 100644
--- a/applications/luci-app-adblock/po/zh-cn/adblock.po
+++ b/applications/luci-app-adblock/po/zh-cn/adblock.po
@@ -266,7 +266,7 @@ msgid ""
msgstr ""
msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
"(default '4').<br />"
msgstr ""
diff --git a/applications/luci-app-adblock/po/zh-tw/adblock.po b/applications/luci-app-adblock/po/zh-tw/adblock.po
index 0d1536ba8..da00842d5 100644
--- a/applications/luci-app-adblock/po/zh-tw/adblock.po
+++ b/applications/luci-app-adblock/po/zh-tw/adblock.po
@@ -266,7 +266,7 @@ msgid ""
msgstr ""
msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
"(default '4').<br />"
msgstr ""
diff --git a/applications/luci-app-attendedsysupgrade/root/etc/uci-defaults/40_luci-attendedsysupgrade b/applications/luci-app-attendedsysupgrade/root/etc/uci-defaults/40_luci-attendedsysupgrade
index 832744f7d..1b890c0cb 100755
--- a/applications/luci-app-attendedsysupgrade/root/etc/uci-defaults/40_luci-attendedsysupgrade
+++ b/applications/luci-app-attendedsysupgrade/root/etc/uci-defaults/40_luci-attendedsysupgrade
@@ -2,5 +2,6 @@
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache/
/etc/init.d/uhttpd restart
+/etc/init.d/rpcd reload
return 0
diff --git a/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js b/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js
index c2fe81d58..604074ad3 100644
--- a/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js
+++ b/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js
@@ -128,7 +128,7 @@ function ubus_call(command, argument, params, variable) {
}
}
} else {
- error_box("<b>Ubus call faild:</b></br>Request: " + request_json + "</br>Response: " + JSON.stringify(response))
+ error_box("<b>Ubus call faild:</b><br />Request: " + request_json + "<br />Response: " + JSON.stringify(response))
}
ubus_closed++;
}
@@ -180,7 +180,7 @@ function upgrade_check_callback(request_text) {
if(request_json.upgrades != undefined) {
info_output += "<h3>Package upgrades available</h3>"
for (upgrade in request_json.upgrades) {
- info_output += "<b>" + upgrade + "</b>: " + request_json.upgrades[upgrade][1] + " to " + request_json.upgrades[upgrade][0] + "</br>"
+ info_output += "<b>" + upgrade + "</b>: " + request_json.upgrades[upgrade][1] + " to " + request_json.upgrades[upgrade][0] + "<br />"
}
}
data.packages = request_json.packages
@@ -231,9 +231,9 @@ function upgrade_request_callback(request) {
var filename_split = data.sysupgrade_url.split("/")
data.filename = filename_split[filename_split.length - 1]
- info_output = "Firmware created</br><b>" + data.filename + "</b>"
+ info_output = 'Firmware created: <a href="' + data.sysupgrade_url + '"><b>' + data.filename + '</b></a>'
if(data.advanced_mode == 1) {
- info_output += '</br><a target="_blank" href="' + data.sysupgrade_url + '.log">Build log</a>'
+ info_output += '<br /><a target="_blank" href="' + data.sysupgrade_url + '.log">Build log</a>'
}
info_box(info_output);
@@ -373,12 +373,12 @@ function server_request(request_dict, path, callback) {
error_box("No firmware created due to image size. Try again with less packages selected.")
} else if (request.status === 422) {
- error_box("Unknown package in request")
-
+ var package_missing = response.getResponseHeader("X-Unknown-Package");
+ error_box("Unknown package in request: <b>" + package_missing + "</b>")
} else if (request.status === 500) {
request_json = JSON.parse(request_text)
- error_box_content = "<b>Internal server error</b></br>"
+ error_box_content = "<b>Internal server error</b><br />"
error_box_content += request_json.error
if(request_json.log != undefined) {
data.log_url = request_json.log
diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm
index 58121c420..b06fac3de 100644
--- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm
+++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm
@@ -2,6 +2,7 @@
local fw = require "luci.model.firewall".init()
local wz = fw:get_zone("wan")
local lz = fw:get_zone("lan")
+ local zones = fw:get_zones()
%>
<div class="cbi-section-create cbi-tblsection-create">
@@ -38,7 +39,7 @@
</tr>
</table>
<% end %>
- <% if wz and lz then %>
+ <% if #zones > 1 then %>
<table class="cbi-section-table" style="margin-left:5px">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell left" colspan="6"><br /><%:New forward rule%>:</th>
@@ -56,14 +57,14 @@
<td class="cbi-section-table-cell" style="width:110px">
<select class="cbi-input-text" id="_newfwd.src" name="_newfwd.src">
<% local k, v; for k, v in ipairs(fw:get_zones()) do -%>
- <option<%=ifattr(v:name() == "lan", "selected", "selected")%> value="<%=v:name()%>"><%=v:name()%></option>
+ <option<%=ifattr(v:name() == "wan", "selected", "selected")%> value="<%=v:name()%>"><%=v:name()%></option>
<%- end %>
</select>
</td>
<td class="cbi-section-table-cell" style="width:110px">
<select class="cbi-input-text" id="_newfwd.dest" name="_newfwd.dest">
<% local k, v; for k, v in ipairs(fw:get_zones()) do -%>
- <option<%=ifattr(v:name() == "wan", "selected", "selected")%> value="<%=v:name()%>"><%=v:name()%></option>
+ <option<%=ifattr(v:name() == "lan", "selected", "selected")%> value="<%=v:name()%>"><%=v:name()%></option>
<%- end %>
</select>
</td>
diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm
index ce275111d..0a5913fc0 100644
--- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm
+++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm
@@ -1,8 +1,7 @@
<%
local fw = require "luci.model.firewall".init()
local nw = require "luci.model.network".init()
- local wz = fw:get_zone("wan")
- local lz = fw:get_zone("lan")
+ local zones = fw:get_zones()
local keys, vals, a, k, v = {}, {}
for k, v in ipairs(nw:get_interfaces()) do
@@ -14,7 +13,7 @@
%>
<div class="cbi-section-create cbi-tblsection-create">
- <% if wz and lz then %>
+ <% if #zones > 1 then %>
<br />
<table class="cbi-section-table" style="width:700px; margin-left:5px">
<tr class="cbi-section-table-titles">
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua
index 920dc6afb..4b1a070d1 100644
--- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua
+++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua
@@ -93,7 +93,7 @@ function configCheck()
local trackingNumber = uci:get("mwan3", iface, "track_ip")
overview[iface]["tracking"] = 0
- if #trackingNumber > 0 then
+ if trackingNumber and #trackingNumber > 0 then
overview[iface]["tracking"] = #trackingNumber
overview[iface]["reliability"] = false
local reliabilityNumber = tonumber(uci:get("mwan3", iface, "reliability"))
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm
index 6dc3d1274..86b5ac696 100644
--- a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm
+++ b/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm
@@ -15,30 +15,27 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_
for ( var iface in status.interfaces)
{
var state = '';
- var css = '';
switch (status.interfaces[iface].status)
{
case 'online':
state = '<%:Online (tracking active)%>';
- css = 'wanon';
break;
case 'notMonitored':
state = '<%:Online (tracking off)%>';
- css = 'wanon';
break;
case 'offline':
state = '<%:Offline%>';
- css = 'wanoff';
break;
default:
state = '<%:Disabled%>';
- css = 'wanoff';
break;
}
statusview += String.format(
- '<span class="%s"><strong>%s</strong><br />%s</span>',
- css,
- iface,
+ '<div><strong>Interface: </strong>%s</div>',
+ iface
+ );
+ statusview += String.format(
+ '<div><strong>Status: </strong>%s</div></br></br>',
state
);
}
@@ -53,36 +50,8 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_
//]]></script>
<fieldset id="interface_field" class="cbi-section">
- <legend><%:MWAN Interface Live Status%></legend>
- <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
+ <legend><%:MWAN Interfaces%></legend>
+ <div id="mwan_status_text">
+ <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%>
+ </div>
</fieldset>
-
-<style type="text/css">
- .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
- max-width: 1044px;
- }
- #mwan_status_text {
- display: table;
- font-size: 14px;
- margin: auto;
- max-width: 1044px;
- min-width: 246px;
- width: 100%;
- }
- .wanon {
- background-color: rgb(144, 240, 144);
- }
- .wanoff {
- background-color: rgb(240, 144, 144);
- }
- .wanon, .wanoff {
- border-radius: 60px;
- box-shadow: 0px 2px 5px -3px;
- float: left;
- margin: 8px 3px 0px 3px;
- min-height: 30px;
- min-width: 235px;
- padding: 5px 10px 8px 10px;
- text-align: center;
- }
-</style>
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm
index 21e59a801..cb476967f 100644
--- a/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm
+++ b/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm
@@ -14,98 +14,7 @@
</ul>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
- XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
- function(x, status)
- {
- var legend = document.getElementById('diag-rc-legend');
- var statusDiv = document.getElementById('diag-rc-output');
- legend.style.display = 'none';
- if (status.interfaces)
- {
- var statusview = '';
- for ( var iface in status.interfaces)
- {
- var state = '';
- var css = '';
- switch (status.interfaces[iface].status)
- {
- case 'online':
- state = '<%:Online (tracking active)%>';
- css = 'wanon';
- break;
- case 'notMonitored':
- state = '<%:Online (tracking off)%>';
- css = 'wanon';
- break;
- case 'offline':
- state = '<%:Offline%>';
- css = 'wanoff';
- break;
- default:
- state = '<%:Disabled%>';
- css = 'wanoff';
- break;
- }
- statusview += String.format(
- '<span class="%s"><strong>%s</strong><br />%s</span>',
- css,
- iface,
- state
- );
- }
- statusDiv.innerHTML = statusview;
- }
- else
- {
- statusDiv.innerHTML = '<strong><%:No MWAN interfaces found%></strong>';
- }
- }
- );
-//]]></script>
-<div class="cbi-map">
- <h2 name="content"><%:MWAN Status - Interface%></h2>
- <%if not require("luci.sys").init.enabled("mwan3") then%>
- <div><strong><%:INFO: MWAN not running%></strong></div>
- <%end%>
- <fieldset class="cbi-section">
- <legend id="diag-rc-legend"><%:Collecting data...%></legend>
- <span id="diag-rc-output">
- <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" />
- </span>
- </fieldset>
-</div>
-
-<style type="text/css">
- #mwan_status_text {
- display: table;
- font-size: 14px;
- margin: auto;
- max-width: 1044px;
- min-width: 246px;
- width: 100%;
- }
- .wanon {
- background-color: rgb(144, 240, 144);
- }
- .wanoff {
- background-color: rgb(240, 144, 144);
- }
- .wanon, .wanoff {
- border-radius: 60px;
- box-shadow: 0px 2px 5px -3px;
- float: left;
- margin: 8px 3px 0px 3px;
- min-height: 30px;
- min-width: 235px;
- padding: 5px 10px 8px 10px;
- text-align: center;
- }
- #mwan_statuslog_text {
- padding: 20px;
- text-align: left;
- }
-</style>
+<%+mwan/overview_status_interface%>
<%+footer%>
diff --git a/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua b/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua
index 74edaf489..396dedd4a 100644
--- a/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua
+++ b/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua
@@ -86,7 +86,7 @@ pip.default = "1"
local compr = s:taboption("general", Flag, "compression", translate("Enable compression"),
translate("Enable compression"))
-compr.default = "1"
+compr.default = "0"
local udp = s:taboption("general", Flag, "udp", translate("Enable UDP"),
translate("Enable UDP channel support; this must be enabled unless you know what you are doing"))
diff --git a/applications/luci-app-olsr/luasrc/controller/olsr.lua b/applications/luci-app-olsr/luasrc/controller/olsr.lua
index 0564bd4ea..229f3d61b 100644
--- a/applications/luci-app-olsr/luasrc/controller/olsr.lua
+++ b/applications/luci-app-olsr/luasrc/controller/olsr.lua
@@ -101,41 +101,19 @@ end
local function local_mac_lookup(ipaddr)
- local _, ifa, dev
-
- ipaddr = tostring(ipaddr)
-
- if not ifaddr_table then
- ifaddr_table = nixio.getifaddrs()
- end
-
- -- ipaddr -> ifname
- for _, ifa in ipairs(ifaddr_table) do
- if ifa.addr == ipaddr then
- dev = ifa.name
- break
- end
- end
-
- -- ifname -> macaddr
- for _, ifa in ipairs(ifaddr_table) do
- if ifa.name == dev and ifa.family == "packet" then
- return ifa.addr
- end
+ local _, rt
+ for _, rt in ipairs(luci.ip.routes({ type = 1, src = ipaddr })) do
+ local link = rt.dev and luci.ip.link(rt.dev)
+ local mac = link and luci.ip.checkmac(link.mac)
+ if mac then return mac end
end
end
local function remote_mac_lookup(ipaddr)
local _, n
-
- if not neigh_table then
- neigh_table = luci.ip.neighbors()
- end
-
- for _, n in ipairs(neigh_table) do
- if n.mac and n.dest and n.dest:equal(ipaddr) then
- return n.mac
- end
+ for _, n in ipairs(luci.ip.neighbors({ dest = ipaddr })) do
+ local mac = luci.ip.checkmac(n.mac)
+ if mac then return mac end
end
end
@@ -201,9 +179,9 @@ function action_neigh(json)
for _, val in ipairs(assoclist) do
if val.network == interface and val.list then
+ local assocmac, assot
for assocmac, assot in pairs(val.list) do
- assocmac = string.lower(assocmac or "")
- if rmac == assocmac then
+ if rmac == luci.ip.checkmac(assocmac) then
signal = tonumber(assot.signal)
noise = tonumber(assot.noise)
snr = (noise*-1) - (signal*-1)
diff --git a/applications/luci-app-splash/luasrc/controller/splash/splash.lua b/applications/luci-app-splash/luasrc/controller/splash/splash.lua
index 13b8edce6..b4fdbd53a 100644
--- a/applications/luci-app-splash/luasrc/controller/splash/splash.lua
+++ b/applications/luci-app-splash/luasrc/controller/splash/splash.lua
@@ -2,6 +2,7 @@ module("luci.controller.splash.splash", package.seeall)
local uci = luci.model.uci.cursor()
local util = require "luci.util"
+local ipc = require "luci.ip"
function index()
entry({"admin", "services", "splash"}, cbi("splash/splash"), _("Client-Splash"), 90)
@@ -24,30 +25,35 @@ function index()
end
function ip_to_mac(ip)
- local ipc = require "luci.ip"
local i, n
-
- for i, n in ipairs(ipc.neighbors()) do
- if n.mac and n.dest and n.dest:equal(ip) then
- return n.mac
- end
+ for i, n in ipairs(ipc.neighbors({ dest = ip })) do
+ local mac = ipc.checkmac(n.mac)
+ if mac then return mac end
end
end
function action_dispatch()
local uci = luci.model.uci.cursor_state()
- local mac = ip_to_mac(luci.http.getenv("REMOTE_ADDR")) or ""
+ local mac = ip_to_mac(luci.http.getenv("REMOTE_ADDR"))
local access = false
- uci:foreach("luci_splash", "lease", function(s)
- if s.mac and s.mac:lower() == mac then access = true end
- end)
+ if mac then
+ uci:foreach("luci_splash", "lease", function(s)
+ if ipc.checkmac(s.mac) == mac then
+ access = true
+ return false
+ end
+ end)
- uci:foreach("luci_splash", "whitelist", function(s)
- if s.mac and s.mac:lower() == mac then access = true end
- end)
+ uci:foreach("luci_splash", "whitelist", function(s)
+ if ipc.checkmac(s.mac) == mac then
+ access = true
+ return false
+ end
+ end)
+ end
- if #mac > 0 and access then
+ if access then
luci.http.redirect(luci.dispatcher.build_url())
else
luci.http.redirect(luci.dispatcher.build_url("splash", "splash"))
@@ -56,33 +62,39 @@ end
function blacklist()
leased_macs = { }
- uci:foreach("luci_splash", "blacklist",
- function(s) leased_macs[s.mac:lower()] = true
+ uci:foreach("luci_splash", "blacklist", function(s)
+ local m = ipc.checkmac(s.mac)
+ if m then leased_macs[m] = true end
end)
return leased_macs
end
function action_activate()
local ipc = require "luci.ip"
- local mac = ip_to_mac(luci.http.getenv("REMOTE_ADDR") or "127.0.0.1") or ""
+ local mac = ip_to_mac(luci.http.getenv("REMOTE_ADDR") or "127.0.0.1")
local uci_state = require "luci.model.uci".cursor_state()
local blacklisted = false
if mac and luci.http.formvalue("accept") then
- uci:foreach("luci_splash", "blacklist",
- function(s) if s.mac and s.mac:lower() == mac then blacklisted = true end
+ uci:foreach("luci_splash", "blacklist", function(s)
+ if ipc.checkmac(s.mac) == mac then
+ blacklisted = true
+ return false
+ end
end)
+
if blacklisted then
luci.http.redirect(luci.dispatcher.build_url("splash" ,"blocked"))
else
+ local id = tostring(mac):gsub(':', ''):lower()
local redirect_url = uci:get("luci_splash", "general", "redirect_url")
if not redirect_url then
- redirect_url = uci_state:get("luci_splash_locations", mac:gsub(':', ''):lower(), "location")
+ redirect_url = uci_state:get("luci_splash_locations", id, "location")
end
if not redirect_url then
redirect_url = luci.model.uci.cursor():get("freifunk", "community", "homepage") or 'http://www.freifunk.net'
end
- remove_redirect(mac:gsub(':', ''):lower())
- os.execute("luci-splash lease "..mac.." >/dev/null 2>&1")
+ remove_redirect(id)
+ os.execute("luci-splash lease "..tostring(mac).." >/dev/null 2>&1")
luci.http.redirect(redirect_url)
end
else
@@ -101,6 +113,7 @@ function action_status_admin()
remove = { }
}
+ local key, _
for key, _ in pairs(macs) do
local policy = luci.http.formvalue("policy.%s" % key)
local mac = luci.http.protocol.urldecode(key)
@@ -141,17 +154,17 @@ function action_status_public()
luci.template.render("admin_status/splash", { is_admin = false })
end
-function remove_redirect(mac)
- local mac = mac:lower()
- mac = mac:gsub(":", "")
+function remove_redirect(id)
local uci = require "luci.model.uci".cursor_state()
local redirects = uci:get_all("luci_splash_locations")
--uci:load("luci_splash_locations")
uci:revert("luci_splash_locations")
+
-- For all redirects
+ local k, v
for k, v in pairs(redirects) do
if v[".type"] == "redirect" then
- if v[".name"] ~= mac then
+ if v[".name"] ~= id then
-- Rewrite state
uci:section("luci_splash_locations", "redirect", v[".name"], {
location = v.location
@@ -159,5 +172,6 @@ function remove_redirect(mac)
end
end
end
+
uci:save("luci_splash_redirects")
end
diff --git a/applications/luci-app-splash/luasrc/view/admin_status/splash.htm b/applications/luci-app-splash/luasrc/view/admin_status/splash.htm
index 3415c205d..37f67776a 100644
--- a/applications/luci-app-splash/luasrc/view/admin_status/splash.htm
+++ b/applications/luci-app-splash/luasrc/view/admin_status/splash.htm
@@ -6,6 +6,8 @@
<%-
local utl = require "luci.util"
+local sys = require "luci.sys"
+local ipc = require "luci.ip"
local ipt = require "luci.sys.iptparser".IptParser()
local uci = require "luci.model.uci".cursor_state()
local wat = require "luci.tools.webadmin"
@@ -14,21 +16,15 @@ local fs = require "nixio.fs"
local clients = { }
local leasetime = tonumber(uci:get("luci_splash", "general", "leasetime") or 1) * 60 * 60
-local leasefile = "/tmp/dhcp.leases"
-
-uci:foreach("dhcp", "dnsmasq",
- function(s)
- if s.leasefile then leasefile = s.leasefile end
- end)
-
uci:foreach("luci_splash_leases", "lease",
function(s)
- if s.start and s.mac then
- clients[s.mac:lower()] = {
+ local m = ipc.checkmac(s.mac)
+ if m and s.start then
+ clients[m] = {
start = tonumber(s.start),
limit = ( tonumber(s.start) + leasetime ),
- mac = s.mac:upper(),
+ mac = m,
ipaddr = s.ipaddr,
policy = "normal",
packets = 0,
@@ -39,11 +35,12 @@ uci:foreach("luci_splash_leases", "lease",
for _, r in ipairs(ipt:find({table="nat", chain="luci_splash_leases"})) do
if r.options and #r.options >= 2 and r.options[1] == "MAC" then
- if not clients[r.options[2]:lower()] then
- clients[r.options[2]:lower()] = {
+ local m = ipc.checkmac(r.options[2])
+ if m and not clients[m] then
+ clients[m] = {
start = 0,
limit = 0,
- mac = r.options[2]:upper(),
+ mac = m,
policy = ( r.target == "RETURN" ) and "whitelist" or "blacklist",
packets = 0,
bytes = 0
@@ -60,7 +57,7 @@ for mac, client in pairs(clients) do
if client.ipaddr then
local rin = ipt:find({table="mangle", chain="luci_splash_mark_in", destination=client.ipaddr})
- local rout = ipt:find({table="mangle", chain="luci_splash_mark_out", options={"MAC", client.mac:upper()}})
+ local rout = ipt:find({table="mangle", chain="luci_splash_mark_out", options={"MAC", client.mac}})
if rin and #rin > 0 then
client.bytes_in = rin[1].bytes
@@ -76,39 +73,27 @@ end
uci:foreach("luci_splash", "whitelist",
function(s)
- if s.mac and clients[s.mac:lower()] then
- clients[s.mac:lower()].policy="whitelist"
+ local m = ipc.checkmac(s.mac)
+ if m and clients[m] then
+ clients[m].policy="whitelist"
end
end)
uci:foreach("luci_splash", "blacklist",
function(s)
- if s.mac and clients[s.mac:lower()] then
- clients[s.mac:lower()].policy=(s.kicked and "kicked" or "blacklist")
+ local m = ipc.checkmac(s.mac)
+ if m and clients[m] then
+ clients[m].policy=(s.kicked and "kicked" or "blacklist")
end
end)
-if fs.access(leasefile) then
- for l in io.lines(leasefile) do
- local time, mac, ip, name = l:match("^(%d+) (%S+) (%S+) (%S+)")
- if time and mac and ip then
- local c = clients[mac:lower()]
- if c then
- c.ip = ip
- c.hostname = ( name ~= "*" ) and name or nil
- end
- end
+sys.net.host_hints(function(mac, v4, v6, name)
+ local c = mac and clients[mac]
+ if c then
+ c.ip = c.ip or v4
+ c.hostname = c.hostname or name
end
-end
-
-for i, n in ipairs(ipc.neighbors({ family = 4 })) do
- if n.mac and n.dest then
- local c = clients[n.mac]
- if c and not c.ip then
- c.ip = n.dest:string()
- end
- end
-end
+end)
local function showmac(mac)
if not is_admin then
@@ -176,7 +161,7 @@ end
splash.hostname, splash.ip, splash.mac, splash.timeleft, splash.trafficin, splash.trafficout);
<% if is_admin then %>
- s += String.format('<select name="policy.%s" style="width:200px">', splash.mac.toLowerCase());
+ s += String.format('<select name="policy.%s" style="width:200px">', splash.mac);
if (splash.policy == 'whitelist') {
s += '<option value="whitelist" selected="selected"><%:whitelisted%></option>'
} else {
@@ -196,7 +181,7 @@ end
s += String.format(
'</select>' +
'<input type="submit" class="cbi-button cbi-button-save" name="save.%s" value="<%:Save%>" />',
- splash.mac.toLowerCase());
+ splash.mac);
<% else %>
s += String.format('%s', splash.policy);
<% end %>
diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua
index 2a8aceec0..9f7a51a86 100644
--- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua
+++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua
@@ -3,25 +3,80 @@
module("luci.statistics.rrdtool.definitions.apcups",package.seeall)
-function rrdargs( graph, plugin, plugin_instance, dtype )
+function rrdargs( graph, plugin, plugin_instance )
+
+ local lu = require("luci.util")
+ local rv = { }
+
+ -- Types and instances supported by APC UPS
+ -- e.g. ups_types -> { 'timeleft', 'charge', 'percent', 'voltage' }
+ -- e.g. ups_inst['voltage'] -> { 'input', 'battery' }
+
+ local ups_types = graph.tree:data_types( plugin, plugin_instance )
+
+ local ups_inst = {}
+ for _, t in ipairs(ups_types) do
+ ups_inst[t] = graph.tree:data_instances( plugin, plugin_instance, t )
+ end
+
+
+ -- Check if hash table or array is empty or nil-filled
+
+ local function empty( t )
+ for _, v in pairs(t) do
+ if type(v) then return false end
+ end
+ return true
+ end
+
+
+ -- Append graph definition but only types/instances which are
+ -- supported and available to the plugin and UPS.
+
+ local function add_supported( t, defs )
+ local def_inst = defs['data']['instances']
+
+ if type(def_inst) == "table" then
+ for k, v in pairs( def_inst ) do
+ if lu.contains( ups_types, k) then
+ for j = #v, 1, -1 do
+ if not lu.contains( ups_inst[k], v[j] ) then
+ table.remove( v, j )
+ end
+ end
+ if #v == 0 then
+ def_inst[k] = nil -- can't assign v: immutable
+ end
+ else
+ def_inst[k] = nil -- can't assign v: immutable
+ end
+ end
+ if empty(def_inst) then return end
+ end
+ table.insert( t, defs )
+ end
+
+
+ -- Graph definitions for APC UPS measurements MUST use only 'instances':
+ -- e.g. instances = { voltage = { "input", "output" } }
local voltagesdc = {
title = "%H: Voltages on APC UPS - Battery",
vlabel = "Volts DC",
- alt_autoscale = true,
+ alt_autoscale = true,
number_format = "%5.1lfV",
data = {
instances = {
voltage = { "battery" }
},
-
- options = {
+ options = {
voltage = { title = "Battery voltage", noarea=true }
}
}
}
-
- local voltages = {
+ add_supported( rv, voltagesdc )
+
+ local voltagesac = {
title = "%H: Voltages on APC UPS - AC",
vlabel = "Volts AC",
alt_autoscale = true,
@@ -30,13 +85,13 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
instances = {
voltage = { "input", "output" }
},
-
options = {
voltage_output = { color = "00e000", title = "Output voltage", noarea=true, overlay=true },
voltage_input = { color = "ffb000", title = "Input voltage", noarea=true, overlay=true }
}
}
}
+ add_supported( rv, voltagesac )
local percentload = {
title = "%H: Load on APC UPS ",
@@ -45,17 +100,15 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
y_max = "100",
number_format = "%5.1lf%%",
data = {
- sources = {
- percent_load = { "value" }
- },
instances = {
- percent = "load"
+ percent = { "load" }
},
options = {
percent_load = { color = "00ff00", title = "Load level" }
}
}
}
+ add_supported( rv, percentload )
local charge_percent = {
title = "%H: Battery charge on APC UPS ",
@@ -64,54 +117,59 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
y_max = "100",
number_format = "%5.1lf%%",
data = {
- types = { "charge" },
+ instances = {
+ charge = { "" }
+ },
options = {
charge = { color = "00ff0b", title = "Charge level" }
}
}
}
+ add_supported( rv, charge_percent )
local temperature = {
title = "%H: Battery temperature on APC UPS ",
vlabel = "\176C",
number_format = "%5.1lf\176C",
data = {
- types = { "temperature" },
+ instances = {
+ temperature = { "" }
+ },
options = {
temperature = { color = "ffb000", title = "Battery temperature" } }
}
}
+ add_supported( rv, temperature )
local timeleft = {
title = "%H: Time left on APC UPS ",
vlabel = "Minutes",
number_format = "%.1lfm",
data = {
- sources = {
- timeleft = { "value" }
+ instances = {
+ timeleft = { "" }
},
options = {
timeleft = { color = "0000ff", title = "Time left" }
}
}
}
+ add_supported( rv, timeleft )
local frequency = {
title = "%H: Incoming line frequency on APC UPS ",
vlabel = "Hz",
number_format = "%5.0lfhz",
data = {
- sources = {
- frequency_input = { "value" }
- },
instances = {
- frequency = "frequency"
+ frequency = { "input" }
},
options = {
- frequency_frequency = { color = "000fff", title = "Line frequency" }
+ frequency_input = { color = "000fff", title = "Line frequency" }
}
}
}
+ add_supported( rv, frequency )
- return { voltages, voltagesdc, percentload, charge_percent, temperature, timeleft, frequency }
+ return rv
end
diff --git a/applications/luci-app-travelmate/Makefile b/applications/luci-app-travelmate/Makefile
index 6170f9d4c..2bd25bc17 100644
--- a/applications/luci-app-travelmate/Makefile
+++ b/applications/luci-app-travelmate/Makefile
@@ -1,11 +1,11 @@
-# Copyright 2017 Dirk Brenken (dev@brenken.org)
+# Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the Apache License, Version 2.0
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Travelmate
-LUCI_DEPENDS:=+travelmate +luci-lib-jsonc
+LUCI_DEPENDS:=+travelmate +luci-lib-jsonc +qrencode
LUCI_PKGARCH:=all
include ../../luci.mk
diff --git a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
index 0f7583497..14b8d77ff 100644
--- a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
+++ b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
@@ -3,7 +3,6 @@
module("luci.controller.travelmate", package.seeall)
-local fs = require("nixio.fs")
local util = require("luci.util")
local i18n = require("luci.i18n")
local templ = require("luci.template")
@@ -15,7 +14,8 @@ function index()
entry({"admin", "services", "travelmate"}, firstchild(), _("Travelmate"), 40).dependent = false
entry({"admin", "services", "travelmate", "tab_from_cbi"}, cbi("travelmate/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true
entry({"admin", "services", "travelmate", "stations"}, template("travelmate/stations"), _("Wireless Stations"), 20).leaf = true
- entry({"admin", "services", "travelmate", "logfile"}, call("logread"), _("View Logfile"), 30).leaf = true
+ entry({"admin", "services", "travelmate", "apqr"}, template("travelmate/ap_qr"), _("AP QR-Codes"), 30).leaf = true
+ entry({"admin", "services", "travelmate", "logfile"}, call("logread"), _("View Logfile"), 40).leaf = true
entry({"admin", "services", "travelmate", "advanced"}, firstchild(), _("Advanced"), 100)
entry({"admin", "services", "travelmate", "advanced", "configuration"}, cbi("travelmate/configuration_tab"), _("Edit Travelmate Configuration"), 110).leaf = true
entry({"admin", "services", "travelmate", "advanced", "cfg_wireless"}, cbi("travelmate/cfg_wireless_tab"), _("Edit Wireless Configuration"), 120).leaf = true
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 4fec920f7..860ce2295 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
@@ -8,9 +8,9 @@ local util = require("luci.util")
local nw = require("luci.model.network").init()
local fw = require("luci.model.firewall").init()
local dump = util.ubus("network.interface", "dump", {})
-local trmiface = uci.get("travelmate", "global", "trm_iface") or "trm_wwan"
-local trminput = uci.get("travelmate", "global", "trm_rtfile") or "/tmp/trm_runtime.json"
-local uplink = uci.get("network", trmiface) or ""
+local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan"
+local trminput = uci:get("travelmate", "global", "trm_rtfile") or "/tmp/trm_runtime.json"
+local uplink = uci:get("network", trmiface) or ""
local parse = json.parse(fs.readfile(trminput) or "")
m = Map("travelmate", translate("Travelmate"),
@@ -181,28 +181,27 @@ e2.datatype = "and(uciname,rangelength(6,6))"
e2.rmempty = true
e3 = e:option(Value, "trm_maxretry", translate("Connection Limit"),
- translate("Retry limit to connect to an uplink. ")
- .. translate("To disable this feature set it to '0' which means unlimited retries."))
+ translate("Retry limit to connect to an uplink."))
e3.default = 3
-e3.datatype = "range(0,30)"
+e3.datatype = "range(1,10)"
e3.rmempty = false
e4 = e:option(Value, "trm_minquality", translate("Signal Quality Threshold"),
translate("Minimum signal quality threshold as percent for conditional uplink (dis-) connections."))
-e4.default = 30
-e4.datatype = "range(0,100)"
+e4.default = 35
+e4.datatype = "range(20,80)"
e4.rmempty = false
e5 = e:option(Value, "trm_maxwait", translate("Interface Timeout"),
- translate("How long should travelmate wait for a successful wlan interface reload."))
+ translate("How long should travelmate wait for a successful wlan uplink connection."))
e5.default = 30
-e5.datatype = "range(5,60)"
+e5.datatype = "range(20,40)"
e5.rmempty = false
e6 = e:option(Value, "trm_timeout", translate("Overall Timeout"),
translate("Timeout in seconds between retries in 'automatic' mode."))
e6.default = 60
-e6.datatype = "range(60,300)"
+e6.datatype = "range(30,300)"
e6.rmempty = false
return m
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
index 93e8a05cf..50edd17bb 100644
--- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
+++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
@@ -4,7 +4,7 @@
local fs = require("nixio.fs")
local uci = require("luci.model.uci").cursor()
local http = require("luci.http")
-local trmiface = uci.get("travelmate", "global", "trm_iface") or "trm_wwan"
+local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan"
local encr_psk = {"psk", "psk2", "psk-mixed"}
local encr_wpa = {"wpa", "wpa2", "wpa-mixed"}
diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm
new file mode 100644
index 000000000..13342a3e6
--- /dev/null
+++ b/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm
@@ -0,0 +1,62 @@
+<%#
+Copyright 2018 Dirk Brenken (dev@brenken.org)
+This is free software, licensed under the Apache License, Version 2.0
+-%>
+
+<%+header%>
+
+<div class="cbi-map">
+ <div class="cbi-map-descr">
+ <%=translate("Here you'll find the QR codes from all of your configured Access Points. It allows you to connect your Android or iOS devices to your router's WiFi using the QR code shown below.")%>
+ </div>
+<%-
+ local write = io.write
+ local uci = require("luci.model.uci").cursor()
+
+ uci:foreach("wireless", "wifi-iface", function(s)
+ local device = s.device or ""
+ local mode = s.mode or ""
+ local ssid = s.ssid or ""
+ local enc = s.encryption or ""
+ local key = s.key or ""
+ local hidden = s.hidden or "false"
+ local disabled = s.disabled or ""
+ local wep_slots = {s.key1 or "", s.key2 or "", s.key3 or "", s.key4 or ""}
+
+ if device and mode == "ap" and disabled ~= "1" then
+ if string.match(enc, '^psk') then
+ enc = "WPA"
+ elseif string.match(enc, '^wep') then
+ enc = "WEP"
+ if tonumber(key) then
+ key = wep_slots[tonumber(key)]
+ end
+ elseif enc == "none" then
+ enc = "nopass"
+ key = "nokey"
+ else
+ enc = ""
+ end
+ if hidden == "1" then
+ hidden = "true"
+ end
+ if ssid and enc and key then
+ local e_ssid = string.gsub(ssid,"[\"\\';:, ]",[[\\\%1]])
+ local e_key = string.gsub(key,"[\"\\';:, ]",[[\\\%1]])
+ local qrcode = ""
+ if nixio.fs.access("/usr/bin/qrencode") then
+ qrcode = luci.sys.exec("/usr/bin/qrencode --inline --8bit --type=SVG --output=- 'WIFI:S:\"'" .. e_ssid .. "'\";T:'" .. enc .. "';P:\"'" .. e_key .. "'\";H:'" .. hidden .. "';'")
+ end
+-%>
+ <fieldset class="cbi-section">
+ <legend>AP on <%=device%> with SSID "<%=ssid%>"</legend>
+ <h3 name="content"><%=qrcode%></h3>
+ </fieldset>
+<%-
+ end
+ end
+ end)
+%>
+</div>
+
+<%+footer%>
diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm
index a26733995..1dacb6e24 100644
--- a/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm
+++ b/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm
@@ -12,7 +12,6 @@ This is free software, licensed under the Apache License, Version 2.0
<%+header%>
<div class="cbi-map">
-<h2 name="content"><%:Wireless Stations%></h2>
<div class="cbi-map-descr">
<%=translatef("Provides an overview of all configured uplinks for the travelmate interface (%s). You can edit, delete or re-order existing uplinks or scan for a new one. The currently used uplink is emphasized in blue.", trmiface)%>
</div>
diff --git a/applications/luci-app-travelmate/po/ja/travelmate.po b/applications/luci-app-travelmate/po/ja/travelmate.po
index 56e3badab..30f34ef30 100644
--- a/applications/luci-app-travelmate/po/ja/travelmate.po
+++ b/applications/luci-app-travelmate/po/ja/travelmate.po
@@ -7,11 +7,14 @@ msgstr ""
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.0.5\n"
+"X-Generator: Poedit 2.0.6\n"
"Last-Translator: INAGAKI Hiroshi <musashino.open@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ja\n"
+msgid "AP QR-Codes"
+msgstr "AP QR-コード"
+
msgid "Actions"
msgstr "操作"
@@ -43,6 +46,16 @@ msgstr "BSSID"
msgid "Back to overview"
msgstr "概要へ戻る"
+msgid "Captive Portal Detection"
+msgstr "キャプティブポータル検知"
+
+msgid ""
+"Check the internet availability, log captive portal redirections and keep "
+"the uplink connection 'alive'."
+msgstr ""
+"インターネットの利用可否を確認し、キャプティブポータル リダイレクトを記録して"
+"アップリンク接続を 'alive' として保持します。"
+
msgid "Cipher"
msgstr "暗号化方式"
@@ -135,13 +148,18 @@ msgid "Force a manual uplink rescan / reconnect in 'trigger' mode."
msgstr ""
"'trigger' モード時に、手動でアップリンクの再スキャンと再接続を行います。"
-msgid "How long should travelmate wait for a successful wlan interface reload."
+msgid ""
+"Here you'll find the QR codes from all of your configured Access Points. It "
+"allows you to connect your Android or iOS devices to your router's WiFi "
+"using the QR code shown below."
msgstr ""
-"無線LAN インターフェースのリロードが成功するまでの、Travelmate の待機時間で"
-"す。"
+"ここには、構成済みの全アクセスポイントの QR コードを表示しています。以下の "
+"QR コードを使用して、 Android または iOS デバイスをルータの WiFi に接続するこ"
+"とができます。"
-msgid "How many times should travelmate try to connect to an Uplink."
-msgstr "Travelmate がアップリンクへの接続を試行する回数です。"
+msgid ""
+"How long should travelmate wait for a successful wlan uplink connection."
+msgstr "Travelmate が無線アップリンクへの接続成功を待つ時間です。"
msgid "Identity"
msgstr "ID"
@@ -171,6 +189,13 @@ msgstr "最終実行日時"
msgid "Manual Rescan"
msgstr "手動再スキャン"
+msgid ""
+"Minimum signal quality threshold as percent for conditional uplink (dis-) "
+"connections."
+msgstr ""
+"条件付きアップリンク接続(または切断)のための、シグナル品質閾値の下限(%)で"
+"す。"
+
msgid "Move down"
msgstr "下へ"
@@ -233,6 +258,9 @@ msgstr "再スキャン"
msgid "Restrict travelmate to a dedicated radio, e.g. 'radio0'."
msgstr "Travelmate が指定された無線に接続するよう制御します。(例: 'radio0')"
+msgid "Retry limit to connect to an uplink."
+msgstr "アップリンクへの接続を試行する回数です。"
+
msgid "Runtime Information"
msgstr "実行情報"
@@ -248,6 +276,9 @@ msgstr "保存"
msgid "Scan"
msgstr "スキャン:"
+msgid "Signal Quality Threshold"
+msgstr "シグナル品質閾値"
+
msgid "Signal strength"
msgstr "信号強度"
@@ -298,24 +329,20 @@ msgstr ""
msgid "Timeout in seconds between retries in 'automatic' mode."
msgstr "'automatic' モード時に接続を確認または再試行する間隔(秒)です。"
-msgid "To disable this feature set it to '0' which means unlimited retries."
-msgstr ""
-"この機能を無効にして接続の再試行を無制限にする場合、 '0' を設定します。"
-
msgid "Travelmate"
msgstr "Travelmate"
msgid "Travelmate Logfile"
msgstr "Travelmate ログファイル"
-msgid "Travelmate Status"
-msgstr "Travelmate ステータス"
+msgid "Travelmate Status (Quality)"
+msgstr "Travelmate ステータス(品質)"
msgid "Travelmate Version"
msgstr "Travelmate バージョン"
-msgid "Trigger delay"
-msgstr "トリガー遅延"
+msgid "Trigger Delay"
+msgstr "トリガ遅延"
msgid "Unknown"
msgstr "不明"
@@ -365,20 +392,8 @@ msgstr ""
"ファイアウォールの wan ゾーンに追加します。このステップは、一度だけ実行される"
"必要があります。"
-msgid "connected"
-msgstr "接続済"
-
-msgid "error"
-msgstr "エラー"
-
msgid "hidden"
msgstr "(不明)"
msgid "n/a"
msgstr "利用不可"
-
-msgid "not connected"
-msgstr "未接続"
-
-msgid "running"
-msgstr "実行中"
diff --git a/applications/luci-app-travelmate/po/pt-br/travelmate.po b/applications/luci-app-travelmate/po/pt-br/travelmate.po
index cf17b024e..7cb6ac061 100644
--- a/applications/luci-app-travelmate/po/pt-br/travelmate.po
+++ b/applications/luci-app-travelmate/po/pt-br/travelmate.po
@@ -12,6 +12,9 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: pt_BR\n"
+msgid "AP QR-Codes"
+msgstr ""
+
msgid "Actions"
msgstr ""
@@ -43,6 +46,14 @@ msgstr ""
msgid "Back to overview"
msgstr ""
+msgid "Captive Portal Detection"
+msgstr ""
+
+msgid ""
+"Check the internet availability, log captive portal redirections and keep "
+"the uplink connection 'alive'."
+msgstr ""
+
msgid "Cipher"
msgstr ""
@@ -129,10 +140,14 @@ msgstr ""
msgid "Force a manual uplink rescan / reconnect in 'trigger' mode."
msgstr ""
-msgid "How long should travelmate wait for a successful wlan interface reload."
+msgid ""
+"Here you'll find the QR codes from all of your configured Access Points. It "
+"allows you to connect your Android or iOS devices to your router's WiFi "
+"using the QR code shown below."
msgstr ""
-msgid "How many times should travelmate try to connect to an Uplink."
+msgid ""
+"How long should travelmate wait for a successful wlan uplink connection."
msgstr ""
msgid "Identity"
@@ -161,6 +176,11 @@ msgstr ""
msgid "Manual Rescan"
msgstr ""
+msgid ""
+"Minimum signal quality threshold as percent for conditional uplink (dis-) "
+"connections."
+msgstr ""
+
msgid "Move down"
msgstr ""
@@ -219,6 +239,9 @@ msgstr ""
msgid "Restrict travelmate to a dedicated radio, e.g. 'radio0'."
msgstr ""
+msgid "Retry limit to connect to an uplink."
+msgstr ""
+
msgid "Runtime Information"
msgstr ""
@@ -234,6 +257,9 @@ msgstr ""
msgid "Scan"
msgstr ""
+msgid "Signal Quality Threshold"
+msgstr ""
+
msgid "Signal strength"
msgstr ""
@@ -274,22 +300,19 @@ msgstr ""
msgid "Timeout in seconds between retries in 'automatic' mode."
msgstr ""
-msgid "To disable this feature set it to '0' which means unlimited retries."
-msgstr ""
-
msgid "Travelmate"
msgstr "Travelmate"
msgid "Travelmate Logfile"
msgstr ""
-msgid "Travelmate Status"
+msgid "Travelmate Status (Quality)"
msgstr ""
msgid "Travelmate Version"
msgstr ""
-msgid "Trigger delay"
+msgid "Trigger Delay"
msgstr ""
msgid "Unknown"
@@ -338,24 +361,12 @@ msgid ""
"add it to the wan zone of the firewall. This step has only to be done once."
msgstr ""
-msgid "connected"
-msgstr ""
-
-msgid "error"
-msgstr ""
-
msgid "hidden"
msgstr ""
msgid "n/a"
msgstr ""
-msgid "not connected"
-msgstr ""
-
-msgid "running"
-msgstr ""
-
#~ msgid ""
#~ "Brief advice: Create a wwan interface, configure it to use dhcp and add "
#~ "it to the wan zone in firewall. Create the wifi interfaces to be used "
diff --git a/applications/luci-app-travelmate/po/ru/travelmate.po b/applications/luci-app-travelmate/po/ru/travelmate.po
index fe0e47647..0b04e2783 100644
--- a/applications/luci-app-travelmate/po/ru/travelmate.po
+++ b/applications/luci-app-travelmate/po/ru/travelmate.po
@@ -15,6 +15,9 @@ msgstr ""
"Project-Info: Это технический перевод, не дословный. Главное-удобный русский "
"интерфейс, все проверялось в графическом режиме, совместим с другими apps\n"
+msgid "AP QR-Codes"
+msgstr ""
+
msgid "Actions"
msgstr "Действия"
@@ -46,6 +49,14 @@ msgstr "BSSID"
msgid "Back to overview"
msgstr "Назад в меню"
+msgid "Captive Portal Detection"
+msgstr ""
+
+msgid ""
+"Check the internet availability, log captive portal redirections and keep "
+"the uplink connection 'alive'."
+msgstr ""
+
msgid "Cipher"
msgstr "Алгоритм шифрования"
@@ -138,13 +149,15 @@ msgstr ""
"Принудительно выполнить повторное сканирование/повторное подключение внешних "
"сетей в режиме 'ручной'."
-msgid "How long should travelmate wait for a successful wlan interface reload."
+msgid ""
+"Here you'll find the QR codes from all of your configured Access Points. It "
+"allows you to connect your Android or iOS devices to your router's WiFi "
+"using the QR code shown below."
msgstr ""
-"Временная задержка необходима TravelMate для полной перезагрузки wlan "
-"интерфейса."
-msgid "How many times should travelmate try to connect to an Uplink."
-msgstr "Сколько раз TravelMate должен пытаться подключиться к сети. "
+msgid ""
+"How long should travelmate wait for a successful wlan uplink connection."
+msgstr ""
msgid "Identity"
msgstr "Идентификация EAP"
@@ -174,6 +187,11 @@ msgstr "Дата последнего запуска"
msgid "Manual Rescan"
msgstr "Поиск сети вручную"
+msgid ""
+"Minimum signal quality threshold as percent for conditional uplink (dis-) "
+"connections."
+msgstr ""
+
msgid "Move down"
msgstr "Переместить вниз"
@@ -238,6 +256,9 @@ msgstr "Пересканировать"
msgid "Restrict travelmate to a dedicated radio, e.g. 'radio0'."
msgstr "Выделить TravelMate-у конкретное Wi-Fi устройство, например 'radio0'."
+msgid "Retry limit to connect to an uplink."
+msgstr ""
+
msgid "Runtime Information"
msgstr "Информация о состоянии"
@@ -253,6 +274,9 @@ msgstr "Сохранить"
msgid "Scan"
msgstr "Поиск"
+msgid "Signal Quality Threshold"
+msgstr ""
+
msgid "Signal strength"
msgstr "Мощность сигнала"
@@ -305,25 +329,20 @@ msgstr ""
"Время ожидания в секундах между повторными попытками соединения в режиме "
"'автоматически'."
-msgid "To disable this feature set it to '0' which means unlimited retries."
-msgstr ""
-"<br />Чтобы отключить эту функцию, установите значение '0', что означает "
-"неограниченное количество попыток."
-
msgid "Travelmate"
msgstr "TravelMate"
msgid "Travelmate Logfile"
msgstr "Системный журнал TravelMate"
-msgid "Travelmate Status"
-msgstr "Состояние Travelmate"
+msgid "Travelmate Status (Quality)"
+msgstr ""
msgid "Travelmate Version"
msgstr "Версия TravelMate"
-msgid "Trigger delay"
-msgstr "Задержка запуска"
+msgid "Trigger Delay"
+msgstr ""
msgid "Unknown"
msgstr "Неизвестно"
@@ -371,20 +390,40 @@ msgid ""
"add it to the wan zone of the firewall. This step has only to be done once."
msgstr "добавить в wan зону межсетевого экрана. Можно сделать только один раз."
-msgid "connected"
-msgstr "подключен"
-
-msgid "error"
-msgstr "ошибка"
-
msgid "hidden"
msgstr "скрытый"
msgid "n/a"
msgstr "нет данных"
-msgid "not connected"
-msgstr "не подключено"
+#~ msgid ""
+#~ "How long should travelmate wait for a successful wlan interface reload."
+#~ msgstr ""
+#~ "Временная задержка необходима TravelMate для полной перезагрузки wlan "
+#~ "интерфейса."
+
+#~ msgid "How many times should travelmate try to connect to an Uplink."
+#~ msgstr "Сколько раз TravelMate должен пытаться подключиться к сети. "
+
+#~ msgid "To disable this feature set it to '0' which means unlimited retries."
+#~ msgstr ""
+#~ "<br />Чтобы отключить эту функцию, установите значение '0', что означает "
+#~ "неограниченное количество попыток."
+
+#~ msgid "Travelmate Status"
+#~ msgstr "Состояние Travelmate"
+
+#~ msgid "Trigger delay"
+#~ msgstr "Задержка запуска"
+
+#~ msgid "connected"
+#~ msgstr "подключен"
+
+#~ msgid "error"
+#~ msgstr "ошибка"
+
+#~ msgid "not connected"
+#~ msgstr "не подключено"
-msgid "running"
-msgstr "работает"
+#~ msgid "running"
+#~ msgstr "работает"
diff --git a/applications/luci-app-travelmate/po/templates/travelmate.pot b/applications/luci-app-travelmate/po/templates/travelmate.pot
index aeefa491d..e27c61a9d 100644
--- a/applications/luci-app-travelmate/po/templates/travelmate.pot
+++ b/applications/luci-app-travelmate/po/templates/travelmate.pot
@@ -1,6 +1,9 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
+msgid "AP QR-Codes"
+msgstr ""
+
msgid "Actions"
msgstr ""
@@ -32,6 +35,14 @@ msgstr ""
msgid "Back to overview"
msgstr ""
+msgid "Captive Portal Detection"
+msgstr ""
+
+msgid ""
+"Check the internet availability, log captive portal redirections and keep "
+"the uplink connection 'alive'."
+msgstr ""
+
msgid "Cipher"
msgstr ""
@@ -118,10 +129,14 @@ msgstr ""
msgid "Force a manual uplink rescan / reconnect in 'trigger' mode."
msgstr ""
-msgid "How long should travelmate wait for a successful wlan interface reload."
+msgid ""
+"Here you'll find the QR codes from all of your configured Access Points. It "
+"allows you to connect your Android or iOS devices to your router's WiFi "
+"using the QR code shown below."
msgstr ""
-msgid "How many times should travelmate try to connect to an Uplink."
+msgid ""
+"How long should travelmate wait for a successful wlan uplink connection."
msgstr ""
msgid "Identity"
@@ -150,6 +165,11 @@ msgstr ""
msgid "Manual Rescan"
msgstr ""
+msgid ""
+"Minimum signal quality threshold as percent for conditional uplink (dis-) "
+"connections."
+msgstr ""
+
msgid "Move down"
msgstr ""
@@ -208,6 +228,9 @@ msgstr ""
msgid "Restrict travelmate to a dedicated radio, e.g. 'radio0'."
msgstr ""
+msgid "Retry limit to connect to an uplink."
+msgstr ""
+
msgid "Runtime Information"
msgstr ""
@@ -223,6 +246,9 @@ msgstr ""
msgid "Scan"
msgstr ""
+msgid "Signal Quality Threshold"
+msgstr ""
+
msgid "Signal strength"
msgstr ""
@@ -263,22 +289,19 @@ msgstr ""
msgid "Timeout in seconds between retries in 'automatic' mode."
msgstr ""
-msgid "To disable this feature set it to '0' which means unlimited retries."
-msgstr ""
-
msgid "Travelmate"
msgstr ""
msgid "Travelmate Logfile"
msgstr ""
-msgid "Travelmate Status"
+msgid "Travelmate Status (Quality)"
msgstr ""
msgid "Travelmate Version"
msgstr ""
-msgid "Trigger delay"
+msgid "Trigger Delay"
msgstr ""
msgid "Unknown"
@@ -327,20 +350,8 @@ msgid ""
"add it to the wan zone of the firewall. This step has only to be done once."
msgstr ""
-msgid "connected"
-msgstr ""
-
-msgid "error"
-msgstr ""
-
msgid "hidden"
msgstr ""
msgid "n/a"
msgstr ""
-
-msgid "not connected"
-msgstr ""
-
-msgid "running"
-msgstr ""
diff --git a/applications/luci-app-wifischedule/luasrc/model/cbi/wifischedule/wifi_schedule.lua b/applications/luci-app-wifischedule/luasrc/model/cbi/wifischedule/wifi_schedule.lua
index 1d301219a..07730225b 100644
--- a/applications/luci-app-wifischedule/luasrc/model/cbi/wifischedule/wifi_schedule.lua
+++ b/applications/luci-app-wifischedule/luasrc/model/cbi/wifischedule/wifi_schedule.lua
@@ -12,8 +12,9 @@
--
-- Author: Nils Koenig <openwrt@newk.it>
-local fs = require "nixio.fs"
+local fs = require "nixio.fs"
local sys = require "luci.sys"
+local uci = require("luci.model.uci").cursor()
function time_validator(self, value, desc)
if value ~= nil then
@@ -110,7 +111,7 @@ modules.wrap = "off"
modules.rows = 10
function modules.cfgvalue(self, section)
- mod = uci.get("wifi_schedule", section, "modules")
+ mod = uci:get("wifi_schedule", section, "modules")
if mod == nil then
mod = ""
end
@@ -121,7 +122,7 @@ function modules.write(self, section, value)
if value then
value_list = value:gsub("\r\n", " ")
ListValue.write(self, section, value_list)
- uci.set("wifi_schedule", section, "modules", value_list)
+ uci:set("wifi_schedule", section, "modules", value_list)
end
end
-- END Modules
diff --git a/applications/luci-app-wol/luasrc/model/cbi/wol.lua b/applications/luci-app-wol/luasrc/model/cbi/wol.lua
index ec6a1be2a..d40dde017 100644
--- a/applications/luci-app-wol/luasrc/model/cbi/wol.lua
+++ b/applications/luci-app-wol/luasrc/model/cbi/wol.lua
@@ -2,6 +2,7 @@
-- Licensed to the public under the Apache License 2.0.
local sys = require "luci.sys"
+local ipc = require "luci.ip"
local fs = require "nixio.fs"
m = SimpleForm("wol", translate("Wake on LAN"),
@@ -58,7 +59,8 @@ end
function host.write(self, s, val)
local host = luci.http.formvalue("cbid.wol.1.mac")
- if host and #host > 0 and host:match("^[a-fA-F0-9:]+$") then
+ local mac = ipc.checkmac(host)
+ if mac then
local cmd
local util = luci.http.formvalue("cbid.wol.1.binary") or (
has_ewk and "/usr/bin/etherwake" or "/usr/bin/wol"
@@ -69,10 +71,10 @@ function host.write(self, s, val)
local broadcast = luci.http.formvalue("cbid.wol.1.broadcast")
cmd = "%s -D%s %s %q" %{
util, (iface ~= "" and " -i %q" % iface or ""),
- (broadcast == "1" and " -b" or ""), host
+ (broadcast == "1" and " -b" or ""), mac
}
else
- cmd = "%s -v %q" %{ util, host }
+ cmd = "%s -v %q" %{ util, mac }
end
local msg = "<p><strong>%s</strong><br /><br /><code>%s<br /><br />" %{