2 Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
3 This is free software, licensed under the Apache License, Version 2.0
8 local uci = require("luci.model.uci").cursor()
9 local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan"
14 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
17 <div class="cbi-map-descr">
18 <%=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)%>
21 <div class="cbi-section">
22 <div class="table cbi-section-table">
23 <div class="tr cbi-section-table-titles">
24 <div class="th left"><%:Device%></div>
25 <div class="th left"><%:SSID%></div>
26 <div class="th left"><%:BSSID%></div>
27 <div class="th left"><%:Encryption%></div>
28 <div class="th center"> </div>
31 uci:foreach("wireless", "wifi-iface", function(s)
32 local iface = s.network or ""
33 if iface == trmiface then
34 local section = s['.name'] or ""
35 local device = s.device or "-"
36 local ssid = s.ssid or "-"
37 local bssid = s.bssid or "-"
38 local encryption = s.encryption or "-"
39 local disabled = s.disabled or ""
40 local style = "text-align:left;color:#000000"
41 if disabled == "0" then
42 style = "text-align:left;color:#0069d6;font-weight:bold"
45 <div class="tr cbi-section-table-row cbi-rowstyle-1" style="<%=style%>">
46 <div class="td" style="<%=style%>"><%=device%></div>
47 <div class="td" style="<%=style%>"><%=ssid%></div>
48 <div class="td" style="<%=style%>"><%=bssid%></div>
49 <div class="td" style="<%=style%>"><%=encryption%></div>
50 <div class="td cbi-section-actions">
51 <input class="cbi-button cbi-button-up" type="button" value="<%:Up%>" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>&dir=up'" alt="<%:Move up%>" title="<%:Move up%>"/>
52 <input class="cbi-button cbi-button-down" type="button" value="<%:Down%>" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>&dir=down'" alt="<%:Move down%>" title="<%:Move down%>"/>
53 <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%>"/>
54 <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%>"/>
63 <div class="cbi-page-actions right">
65 uci:foreach("wireless", "wifi-device", function(s)
66 local device = s[".name"]
68 <form class="inline" action="<%=luci.dispatcher.build_url('admin/services/travelmate/wifiscan')%>" method="post">
69 <input type="hidden" name="device" value="<%=device%>"/>
70 <input type="hidden" name="token" value="<%=token%>"/>
71 <input type="submit" class="cbi-button cbi-button-action important" title="<%:Find and join network on%> <%=device%>" value="<%:Scan%> <%=device%>"/>