luci-app-travelmate fixed
[project/luci.git] / applications / luci-app-travelmate / luasrc / view / travelmate / stations.htm
1 <%#
2 Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
3 This is free software, licensed under the Apache License, Version 2.0
4 -%>
5
6 <%-
7 local write = io.write
8 local uci = require("luci.model.uci").cursor()
9 local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan"
10 -%>
11
12 <%+header%>
13
14 <div class="cbi-map">
15 <h2 name="content"><%:Wireless Stations%></h2>
16 <div class="cbi-map-descr">
17 <%=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)%>
18 </div>
19
20 <fieldset class="cbi-section">
21 <table class="cbi-section-table" style="empty-cells:hide">
22 <tr class="cbi-section-table-titles">
23 <th class="cbi-section-table-cell" style="text-align:left"><%:Device%></th>
24 <th class="cbi-section-table-cell" style="text-align:left"><%:SSID%></th>
25 <th class="cbi-section-table-cell" style="text-align:left"><%:BSSID%></th>
26 <th class="cbi-section-table-cell" style="text-align:left"><%:Encryption%></th>
27 <th class="cbi-section-table-cell" style="text-align:center" colspan="2"><%:Actions%></th>
28 </tr>
29 <%
30 uci:foreach("wireless", "wifi-iface", function(s)
31 local iface = s.network or ""
32 if iface == trmiface then
33 local section = s['.name'] or ""
34 local device = s.device or "-"
35 local ssid = s.ssid or "-"
36 local bssid = s.bssid or "-"
37 local encryption = s.encryption or "-"
38 local disabled = s.disabled or ""
39 local style = "text-align:left;color:#000000"
40 if disabled == "0" then
41 style = "text-align:left;color:#0069d6;font-weight:bold"
42 end
43 %>
44 <tr class="cbi-section-table-row cbi-rowstyle-1" style="<%=style%>">
45 <td style="<%=style%>"><%=device%></td>
46 <td style="<%=style%>"><%=ssid%></td>
47 <td style="<%=style%>"><%=bssid%></td>
48 <td style="<%=style%>"><%=encryption%></td>
49 <td class="cbi-value-field" style="width:80px">
50 <input class="cbi-button cbi-button-up" type="button" value="" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>;dir=up'" alt="<%:Move up%>" title="<%:Move up%>"/>
51 <input class="cbi-button cbi-button-down" type="button" value="" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>;dir=down'" alt="<%:Move down%>" title="<%:Move down%>"/>
52 </td>
53 <td class="cbi-value-field" style="width:150px">
54 <input type="button" class="cbi-button cbi-button-edit" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiedit')%>?cfg=<%=section%>'" title="<%:Edit this Uplink%>" value="<%:Edit%>"/>
55 <input type="button" class="cbi-button cbi-button-remove" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifidelete')%>?cfg=<%=section%>'" title="<%:Delete this Uplink%>" value="<%:Delete%>"/>
56 </td>
57 </tr>
58 <%
59 end
60 end)
61 %>
62 </table>
63 </fieldset>
64 <div class="cbi-page-actions right">
65 <%
66 uci:foreach("wireless", "wifi-device", function(s)
67 local device = s[".name"]
68 %>
69 <form class="inline" action="<%=luci.dispatcher.build_url('admin/services/travelmate/wifiscan')%>" method="post">
70 <input type="hidden" name="device" value="<%=device%>"/>
71 <input type="hidden" name="token" value="<%=token%>"/>
72 <input type="submit" class="cbi-button cbi-button-find" title="<%:Find and join network on%> <%=device%>" value="<%:Scan%> <%=device%>"/>
73 </form>
74 <%
75 end)
76 %>
77 </div>
78 </div>
79
80 <%+footer%>