cbb6c189b8132697497d3bdcee44611c6d8e0571
[project/luci.git] / applications / luci-app-travelmate / luasrc / view / travelmate / stations.htm
1 <%#
2 Copyright 2017 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"><%:Encryption%></th>
26       <th class="cbi-section-table-cell" style="text-align:center" colspan="2"><%:Actions%></th>
27     </tr>
28 <%
29   uci:foreach("wireless", "wifi-iface", function(s)
30     local iface = s.network or ""
31     if iface == trmiface then
32       local section = s['.name'] or ""
33       local device = s.device or ""
34       local ssid = s.ssid or ""
35       local encryption = s.encryption or ""
36       local disabled = s.disabled or ""
37       local style = "color:#000000"
38       if disabled == "0" then
39         style = "color:#0069d6;font-weight:bold"
40       end
41 %>
42     <tr class="cbi-section-table-row cbi-rowstyle-1" style="<%=style%>">
43       <td style="text-align:left"><%=device%></td>
44       <td style="text-align:left"><%=ssid%></td>
45       <td style="text-align:left"><%=encryption%></td>
46       <td class="cbi-value-field" style="width:70px;text-align:right">
47         <input class="cbi-button cbi-button-up" type="button" value="" onclick="location.href='<%=url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>;dir=up'" alt="<%:Move up%>" title="<%:Move up%>"/>
48         <input class="cbi-button cbi-button-down" type="button" value="" onclick="location.href='<%=url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>;dir=down'" alt="<%:Move down%>" title="<%:Move down%>"/>
49       </td>
50       <td class="cbi-value-field" style="width:150px;text-align:right">
51         <input type="button" class="cbi-button cbi-button-edit" onclick="location.href='<%=url('admin/services/travelmate/wifiedit')%>?cfg=<%=section%>'" title="<%:Edit this Uplink%>" value="<%:Edit%>"/>
52         <input type="button" class="cbi-button cbi-button-remove" onclick="location.href='<%=url('admin/services/travelmate/wifidelete')%>?cfg=<%=section%>'" title="<%:Delete this Uplink%>" value="<%:Delete%>"/>
53       </td>
54     </tr>
55 <%
56     end
57   end)
58 %>
59   </table>
60 </fieldset>
61 <div class="cbi-page-actions right">
62 <%
63   uci:foreach("wireless", "wifi-device", function(s)
64     local device = s[".name"]
65 %>
66   <form class="inline" action="<%=url('admin/services/travelmate/wifiscan')%>" method="post">
67     <input type="hidden" name="device" value="<%=device%>"/>
68     <input type="hidden" name="token" value="<%=token%>"/>
69     <input type="submit" class="cbi-button cbi-button-find" title="<%:Find and join network on %><%=device%>" value="<%:Scan %><%=device%>"/>
70   </form>
71 <%
72   end)
73 %>
74 </div>
75 </div>
76
77 <%+footer%>