From e6c9b3746b6d23af331050002103b05fd5862405 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Fri, 19 Jan 2018 10:42:35 +0100 Subject: [17.01] luci-app-travelmate: release 1.0.2 * bump travelmate version in stable tree as well Signed-off-by: Dirk Brenken --- .../luasrc/view/travelmate/config_css.htm | 13 +++ .../luasrc/view/travelmate/logread.htm | 20 +++++ .../luasrc/view/travelmate/runtime.htm | 10 +++ .../luasrc/view/travelmate/stations.htm | 80 ++++++++++++++++++ .../luasrc/view/travelmate/wifi_scan.htm | 96 ++++++++++++++++++++++ 5 files changed, 219 insertions(+) create mode 100644 applications/luci-app-travelmate/luasrc/view/travelmate/config_css.htm create mode 100644 applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm create mode 100644 applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm create mode 100644 applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm create mode 100644 applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm (limited to 'applications/luci-app-travelmate/luasrc/view/travelmate') diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/config_css.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/config_css.htm new file mode 100644 index 000000000..2233a15e3 --- /dev/null +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/config_css.htm @@ -0,0 +1,13 @@ + diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm new file mode 100644 index 000000000..6cbeaffde --- /dev/null +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm @@ -0,0 +1,20 @@ +<%# +Copyright 2017-2018 Dirk Brenken (dev@brenken.org) +This is free software, licensed under the Apache License, Version 2.0 +-%> + +<%+header%> + +
+
+
<%:This form shows the syslog output, pre-filtered for travelmate related messages only.%>
+ +
+
+ + + +<%+footer%> diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm new file mode 100644 index 000000000..e7827b5c3 --- /dev/null +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm @@ -0,0 +1,10 @@ +<%# +Copyright 2017-2018 Dirk Brenken (dev@brenken.org) +This is free software, licensed under the Apache License, Version 2.0 +-%> + +<%+cbi/valueheader%> + + + +<%+cbi/valuefooter%> diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm new file mode 100644 index 000000000..ae1ea797a --- /dev/null +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm @@ -0,0 +1,80 @@ +<%# +Copyright 2017-2018 Dirk Brenken (dev@brenken.org) +This is free software, licensed under the Apache License, Version 2.0 +-%> + +<%- + local write = io.write + local uci = require("luci.model.uci").cursor() + local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan" +-%> + +<%+header%> + +
+

<%:Wireless Stations%>

+
+ <%=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)%> +
+ +
+ + + + + + + + +<% + uci:foreach("wireless", "wifi-iface", function(s) + local iface = s.network or "" + if iface == trmiface then + local section = s['.name'] or "" + local device = s.device or "-" + local ssid = s.ssid or "-" + local bssid = s.bssid or "-" + local encryption = s.encryption or "-" + local disabled = s.disabled or "" + local style = "text-align:left;color:#000000" + if disabled == "0" then + style = "text-align:left;color:#0069d6;font-weight:bold" + end +%> + + + + + + + + +<% + end + end) +%> +
<%:Device%><%:SSID%><%:BSSID%><%:Encryption%><%:Actions%>
<%=device%><%=ssid%><%=bssid%><%=encryption%> + + + + + +
+
+
+<% + uci:foreach("wireless", "wifi-device", function(s) + local device = s[".name"] +%> +
+ + + +
+<% + end) +%> +
+
+ +<%+footer%> diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm new file mode 100644 index 000000000..a8f63a17e --- /dev/null +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm @@ -0,0 +1,96 @@ +<%# +Copyright 2017 Dirk Brenken (dev@brenken.org) +This is free software, licensed under the Apache License, Version 2.0 +-%> + +<%- + local sys = require("luci.sys") + local utl = require("luci.util") + local dev = luci.http.formvalue("device") + local iw = luci.sys.wifi.getiwinfo(dev) + local wpa_label = {translate("WPA"), translate("WPA2"), translate("WPA/WPA2")} + + if not iw then + luci.http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations")) + end + + function format_wifi_encryption(info) + if info.wep == true then + return translate("WEP") + elseif info.wpa > 0 then + return "%s (%s/%s)" %{wpa_label[info.wpa], table.concat(info.auth_suites), table.concat(info.group_ciphers)} + elseif info.enabled then + return translate("Unknown") + else + return translate("Open") + end + end + + function percent_wifi_signal(info) + local qc = info.quality or 0 + local qm = info.quality_max or 0 + if info.bssid and qc > 0 and qm > 0 then + return math.floor((100 / qm) * qc) + else + return 0 + end + end +-%> + +<%+header%> + +
+

<%:Wireless Scan%>

+
+ + + + + + + + <% for i, net in ipairs(iw.scanlist or { }) do %> + + + + + + + + <% end %> +
<%:Uplink SSID%><%:Uplink BSSID%><%:Encryption%><%:Signal strength%>
+ <%=net.ssid and utl.pcdata(net.ssid) or "%s" % translate("hidden")%> + + <%=net.bssid and utl.pcdata(net.bssid)%> + + <%=format_wifi_encryption(net.encryption)%> + + <%=percent_wifi_signal(net)%> % + +
+ + + + + + <% if net.encryption.wpa then %> + + <% for _, v in ipairs(net.encryption.auth_suites) do %><% end %> + <% end %> + +
+
+
+
+
+ + + +
+
+ +
+
+
+ +<%+footer%> -- cgit v1.2.3