adminindex.htm 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <%+header%>
  2. <%
  3. local uci = require "luci.model.uci".cursor()
  4. local contact = uci:get_all("freifunk", "contact")
  5. local contacturl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "contact")
  6. local hostname = uci:get_first ("system", "system", "hostname")
  7. local latitude = uci:get_first ("system", "system", "latitude")
  8. local longitude = uci:get_first ("system", "system", "longitude")
  9. local location = uci:get_first ("system", "system", "location")
  10. local basicsurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics")
  11. local nickname, name, mail
  12. if not contact then
  13. nickname, name, mail = ""
  14. else
  15. nickname = contact.nickname
  16. name = contact.name
  17. mail = contact.mail
  18. end
  19. %>
  20. <h2><%:Freifunk Overview%></h2>
  21. <%:These pages will assist you in setting up your router for Freifunk or similar wireless community networks.%>
  22. <p />
  23. <% if not (hostname and latitude and longitude and location) then%>
  24. <div class="error">
  25. <%:Basic settings are incomplete. Please go to%> <a href='<%=basicsurl%>'><%:Basic settings%></a> <%:and fill out all required fields.%>
  26. </div>
  27. <%end%>
  28. <p />
  29. <% if not (nickname and name and mail) then%>
  30. <div class="error">
  31. <%:Contact information is incomplete. Please go to%> <a href='<%=contacturl%>'><%:Contact%></a> <%:and fill out all required fields.%>
  32. <p />
  33. </div>
  34. <%end%>
  35. <% uci:foreach("wireless", "wifi-device", function(section)
  36. local device = section[".name"]
  37. local url = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "network", "wireless")
  38. if section.diversity ~= "0" and section.disabled ~= "1" and section.type ~= "mac80211" then
  39. print('<div class="error">' .. translate("Diversity is enabled for device") .. ' <b>' .. section[".name"] .. '</b>. '
  40. .. translate("Go to") .. ' <a href="' .. url .. '">' .. translate("wireless settings") .. '</a> ' ..
  41. translate("to disable it.") .. '</div><p />')
  42. end
  43. end) %>
  44. <%+footer%>