raduigo.htm 632 B

12345678910111213141516171819202122232425
  1. <%
  2. local uci = require "luci.model.uci".cursor()
  3. local http_port = uci:get("radicale2", "server", "host")
  4. local usessl = uci:get_bool("radicale2", "server", "ssl")
  5. if type(http_port) == "table" then
  6. http_port = http_port[1]
  7. end
  8. if http_port then
  9. http_port = http_port:match("(%d+)$")
  10. end
  11. if not http_port then
  12. http_port = "5232"
  13. end
  14. %>
  15. <script>
  16. <%
  17. if usessl then
  18. %>
  19. var protocol = 'https'
  20. <% else %>
  21. var protocol = 'http'
  22. <% end %>
  23. document.write('<a href="' + protocol + '://' + window.location.hostname + ':' + <%=http_port%> + '/"><%=luci.i18n.translate("Go to Radicale 2.x Web UI")%></a>');
  24. </script>