config-mode.htm 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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="token" value="<%=token%>" />
  21. <input type="hidden" name="cbi.submit" value="1" />
  22. </div>
  23. <% end %>
  24. <div class="cbi-map" id="cbi-<%=self.config%>">
  25. <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
  26. <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
  27. <% self:render_children() %>
  28. <br />
  29. </div>
  30. <%- if self.message then %>
  31. <div><%=self.message%></div>
  32. <%- end %>
  33. <%- if self.errmessage then %>
  34. <div class="error"><%=self.errmessage%></div>
  35. <%- end %>
  36. <% if not self.embedded then %>
  37. <div class="cbi-page-actions">
  38. <%-
  39. if type(self.hidden) == "table" then
  40. for k, v in pairs(self.hidden) do
  41. -%>
  42. <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
  43. <%-
  44. end
  45. end
  46. %>
  47. <input class="cbi-button cbi-button-save" type="submit" value="<%:Save & restart%>" />
  48. <script type="text/javascript">cbi_d_update();</script>
  49. </div>
  50. </form>
  51. <% end %>