2 Copyright
2018 Dirk Brenken (dev@brenken.org)
3 This is free software, licensed under the Apache License, Version
2.0
9 <div class=
"cbi-map-descr">
10 <%=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.")%
>
12 <%- local uci = require(
"luci.model.uci").cursor()
14 uci:foreach(
"wireless",
"wifi-iface", function(s)
15 local device = s.device or
""
16 local mode = s.mode or
""
17 local ssid = s.ssid or
""
18 local enc = s.encryption or
""
19 local key = s.key or
""
20 local hidden = s.hidden or
"false"
21 local disabled = s.disabled or
""
22 local wep_slots = {s.key1 or
"", s.key2 or
"", s.key3 or
"", s.key4 or
""}
24 if device and mode ==
"ap" and disabled ~=
"1" then
25 if string.match(enc, '^psk') then
27 elseif string.match(enc, '^wep') then
30 key = wep_slots[tonumber(key)]
32 elseif enc ==
"none" then
43 if ssid and enc and key then
44 local e_ssid = string.gsub(ssid,
"[\"\\';:, ]
",[[\\\%1]])
45 local e_key = string.gsub(key,"[\
"\\';:, ]",[[\\\%
1]])
48 qrcode = luci.sys.exec(
"/usr/bin/qrencode --inline --8bit --type=SVG --output=- 'WIFI:S:\"'
" .. e_ssid .. "'\
";T:'" .. enc ..
"';P:\"'
" .. e_key .. "'\
";H:'" .. hidden ..
"';'")
50 <div class=
"cbi-section">
51 <h3>AP on <%=device%
> with SSID
"<%=ssid%>"</h3>
60 <div class=
"cbi-page-actions right">
61 <form class=
"inline" action=
"<%=luci.dispatcher.build_url('admin/services/travelmate/tab_from_cbi')%>" method=
"post">
62 <input class=
"cbi-button cbi-button-reset" type=
"submit" value=
"<%:Back to overview%>" />