1
0

stations.htm 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. local write = io.write
  7. local uci = require("luci.model.uci").cursor()
  8. local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan"
  9. -%>
  10. <%+header%>
  11. <div class="cbi-map">
  12. <h2 name="content"><%:Wireless Stations%></h2>
  13. <div class="cbi-map-descr">
  14. <%=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)%>
  15. </div>
  16. <fieldset class="cbi-section">
  17. <table class="cbi-section-table" style="empty-cells:hide">
  18. <tr class="cbi-section-table-titles">
  19. <th class="cbi-section-table-cell" style="text-align:left"><%:Device%></th>
  20. <th class="cbi-section-table-cell" style="text-align:left"><%:SSID%></th>
  21. <th class="cbi-section-table-cell" style="text-align:left"><%:Encryption%></th>
  22. <th class="cbi-section-table-cell" style="text-align:center" colspan="2"><%:Actions%></th>
  23. </tr>
  24. <%
  25. uci:foreach("wireless", "wifi-iface", function(s)
  26. local iface = s.network or ""
  27. if iface == trmiface then
  28. local section = s['.name'] or ""
  29. local device = s.device or ""
  30. local ssid = s.ssid or ""
  31. local encryption = s.encryption or ""
  32. local disabled = s.disabled or ""
  33. local style = "color:#000000"
  34. if disabled == "0" then
  35. style = "color:#0069d6;font-weight:bold"
  36. end
  37. %>
  38. <tr class="cbi-section-table-row cbi-rowstyle-1" style="<%=style%>">
  39. <td style="text-align:left"><%=device%></td>
  40. <td style="text-align:left"><%=ssid%></td>
  41. <td style="text-align:left"><%=encryption%></td>
  42. <td class="cbi-value-field" style="width:70px;text-align:right">
  43. <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%>"/>
  44. <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%>"/>
  45. </td>
  46. <td class="cbi-value-field" style="width:150px;text-align:right">
  47. <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%>"/>
  48. <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%>"/>
  49. </td>
  50. </tr>
  51. <%
  52. end
  53. end)
  54. %>
  55. </table>
  56. </fieldset>
  57. <div class="cbi-page-actions right">
  58. <%
  59. uci:foreach("wireless", "wifi-device", function(s)
  60. local device = s[".name"]
  61. %>
  62. <form class="inline" action="<%=luci.dispatcher.build_url('admin/services/travelmate/wifiscan')%>" method="post">
  63. <input type="hidden" name="device" value="<%=device%>"/>
  64. <input type="hidden" name="token" value="<%=token%>"/>
  65. <input type="submit" class="cbi-button cbi-button-find" title="<%:Find and join network on %><%=device%>" value="<%:Scan %><%=device%>"/>
  66. </form>
  67. <%
  68. end)
  69. %>
  70. </div>
  71. </div>
  72. <%+footer%>