config-mode.htm 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <%-
  2. local gluon_luci = require 'gluon.luci'
  3. local sysconfig = require 'gluon.sysconfig'
  4. local i18n = require 'luci.i18n'
  5. local template = require 'luci.template'
  6. -%>
  7. <h2><%:Welcome!%></h2>
  8. <p>
  9. <%= template.render_string(i18n.translate('gluon-config-mode:welcome'), {
  10. hostname = hostname,
  11. sysconfig = sysconfig,
  12. escape = gluon_luci.escape,
  13. urlescape = gluon_luci.urlescape,
  14. }) %>
  15. </p>
  16. <% if not self.embedded then %>
  17. <form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>">
  18. <div>
  19. <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
  20. <input type="hidden" name="cbi.submit" value="1" />
  21. </div>
  22. <% end %>
  23. <div class="cbi-map" id="cbi-<%=self.config%>">
  24. <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
  25. <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
  26. <% self:render_children() %>
  27. <br />
  28. </div>
  29. <%- if self.message then %>
  30. <div><%=self.message%></div>
  31. <%- end %>
  32. <%- if self.errmessage then %>
  33. <div class="error"><%=self.errmessage%></div>
  34. <%- end %>
  35. <% if not self.embedded then %>
  36. <div class="cbi-page-actions">
  37. <%-
  38. if type(self.hidden) == "table" then
  39. for k, v in pairs(self.hidden) do
  40. -%>
  41. <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
  42. <%-
  43. end
  44. end
  45. %>
  46. <input class="cbi-button cbi-button-save" type="submit" value="<%:Save & restart%>" />
  47. <script type="text/javascript">cbi_d_update();</script>
  48. </div>
  49. </form>
  50. <% end %>