From 8a1fe2ad6d05c4b9c6943198ac475ab29e22a0a7 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Fri, 5 Oct 2018 10:21:34 +0200 Subject: luci-app-travelmate: sync with update 1.2.4 * with the config option 'trm_radio' you can now restrict travelmate to a single radio (e.g. 'radio1') or change the overall scanning order (e.g. 'radio1 radio2 radio0') * LuCI: show QR codes now inline on the overview page (collapsed by default) Signed-off-by: Dirk Brenken --- .../luasrc/view/travelmate/ap_qr.htm | 66 ------------------ .../luasrc/view/travelmate/runtime.htm | 80 ++++++++++++++++++++++ 2 files changed, 80 insertions(+), 66 deletions(-) delete mode 100644 applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm (limited to 'applications/luci-app-travelmate/luasrc/view/travelmate') diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm deleted file mode 100644 index 3f01a81e35..0000000000 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm +++ /dev/null @@ -1,66 +0,0 @@ -<%# -Copyright 2018 Dirk Brenken (dev@brenken.org) -This is free software, licensed under the Apache License, Version 2.0 --%> - -<%+header%> - -
-
- <%=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.")%> -
- <%- 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 = "" - - qrcode = luci.sys.exec("/usr/bin/qrencode --inline --8bit --type=SVG --output=- 'WIFI:S:\"'" .. e_ssid .. "'\";T:'" .. enc .. "';P:\"'" .. e_key .. "'\";H:'" .. hidden .. "';'") - -%> -
-

AP on <%=device%> with SSID "<%=ssid%>"

-

<%=qrcode%>

-
- <%- - end - end - end) - -%> -
-
-
- -
-
- -<%+footer%> diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm index 272612600c..1a53b577d1 100644 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm @@ -75,6 +75,15 @@ This is free software, licensed under the Apache License, Version 2.0 } } + function toggle_qrcode() { + var view = document.getElementById("qrcode"); + if (view.style.display === "none") { + view.style.display = "block"; + } else { + view.style.display = "none"; + } + } + XHR.get('<%=luci.dispatcher.build_url("admin", "services", "travelmate", "status")%>', null, function(x, json_info) { @@ -142,3 +151,74 @@ This is free software, licensed under the Apache License, Version 2.0 +
+ +
+ +
+
+
+ +
-- cgit v1.2.3