2 LuCI - Lua Configuration Interface
3 Copyright
2009 Jo-Philipp Wich
<xm@subsignal.org
>
5 Licensed under the Apache License, Version
2.0 (the
"License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-
2.0
17 local sys = require
"luci.sys"
18 local utl = require
"luci.util"
19 local uci = require
"luci.model.uci".cursor_state()
22 uci:foreach(
"network",
"interface", function(i)
23 if i.ifname ~=
"lo" then
24 ifaces[#ifaces+
1] = { i['.name'], i.ifname, i.ipaddr }
28 local dev = luci.http.formvalue(
"device")
29 local iw = luci.sys.wifi.getiwinfo(dev)
35 <h2><a id=
"content" name=
"content"><%:a_s_iw_join Join Network%
></a></h2>
37 <form method=
"post" action=
"<%=REQUEST_URI%>">
39 <div class=
"cbi-map-descr">
40 <%=luci.i18n.translatef(
"a_s_iw_join_desc",
"You are about to join the wireless network <em><strong>%s</strong></em>. " ..
41 "In order to complete the process, you need to provide some additional details.",
42 utl.pcdata(luci.http.formvalue(
"join") or
"(hidden)")
46 <fieldset class=
"cbi-section">
47 <input type=
"hidden" name=
"confirm" value=
"1" />
48 <input type=
"hidden" name=
"join" value=
"<%=utl.pcdata(luci.http.formvalue("join
"))%>" />
49 <input type=
"hidden" name=
"device" value=
"<%=utl.pcdata(luci.http.formvalue("device
"))%>" />
50 <input type=
"hidden" name=
"mode" value=
"<%=luci.http.formvalue("mode
")%>" />
51 <input type=
"hidden" name=
"bssid" value=
"<%=luci.http.formvalue("bssid
")%>" />
52 <input type=
"hidden" name=
"channel" value=
"<%=luci.http.formvalue("channel
")%>" />
53 <input type=
"hidden" name=
"wep" value=
"<%=luci.http.formvalue("wep
")%>" />
54 <input type=
"hidden" name=
"wpa_version" value=
"<%=luci.http.formvalue("wpa_version
")%>" />
56 <% if luci.http.formvalue(
"wep") ==
"1" then %
>
57 <label for=
"pw_key">WEP passphrase
</label><br />
58 <input class=
"cbi-input-password" type=
"password" name=
"key" id=
"pw_key" />
60 <% elseif tonumber(luci.http.formvalue(
"wpa_version") or
0)
> 0 and luci.http.formvalue(
"wpa_suites") ==
"PSK" then %
>
61 <label for=
"pw_key">WPA passphrase
</label><br />
62 <input class=
"cbi-input-password" type=
"password" name=
"key" id=
"pw_key" />
64 <% if tonumber(luci.http.formvalue(
"wpa_version") or
0) ==
3 then %
>
65 <select name=
"wpa_suite">
66 <option value=
"psk">WPA-PSK
</option>
67 <option value=
"psk2" selected=
"selected">WPA2-PSK
</option>
68 <option value=
"psk+psk2">WPA/WPA2-PSK mixed mode
</option>
71 <input type=
"hidden" name=
"wpa_suite" value=
"psk<%=tonumber(luci.http.formvalue("wpa_version
") or 0) == 2 and 2%>" />
77 <label for=
"sel_attach_intf">Attach wireless to
</label><br />
78 <select name=
"attach_intf" id=
"sel_attach_intf">
79 <% for _, i in ipairs(ifaces) do %
>
80 <option<% if i[
1] ==
"wan" then %
> selected=
"selected"<% end %
> value=
"<%=i[1]%>"><%=i[
1]%
> (<%=i[
2]%
><% if i[
3] then %
> - <%=i[
3]%
><% end %
>)
</option>
82 <option value=
"">-- no interface --
</option>
88 <% if luci.http.formvalue(
"mode") ==
"Ad-Hoc" then %
>
89 <input type=
"checkbox" name=
"fixed_bssid" value=
"1" id=
"cb_fixed_bssid" checked=
"checked" />
90 <label for=
"cb_fixed_bssid">Lock to BSSID <%=luci.http.formvalue(
"bssid")%
></label>
94 <% if iw.mbssid_support then %
>
95 <input type=
"checkbox" name=
"replace_net" value=
"1" id=
"cb_replace_net" checked=
"checked" />
96 <label for=
"cb_replace_net">Overwrite existing wireless configuration
</label>
99 <input type=
"hidden" name=
"replace_net" value=
"1" />
102 <input type=
"checkbox" name=
"autoconnect" value=
"1" id=
"cb_autoconnect" checked=
"checked" />
103 <label for=
"cb_autoconnect">Automatically connect
</label>
106 <div class=
"cbi-page-actions">
107 <input class=
"cbi-button-apply" type=
"submit" value=
"<%:a_s_iw_join_confirm Join network%>" />
108 <input class=
"cbi-button-reset" type=
"submit" name=
"cancel" value=
"<%:a_s_iw_back_scan Back to scan results%>" />