header.ut 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. {#
  2. Copyright 2022 Jo-Philipp Wich <jo@mein.io>
  3. Licensed to the public under the Apache License 2.0.
  4. -#}
  5. {%
  6. include(`themes/${theme}/header`);
  7. -%}
  8. <script type="text/javascript" src="{{ resource }}/promis.min.js"></script>
  9. <script type="text/javascript" src="{{ resource }}/luci.js"></script>
  10. <script type="text/javascript">
  11. L = new LuCI({{ replace(`${ {
  12. media : media,
  13. resource : resource,
  14. scriptname : http.getenv("SCRIPT_NAME"),
  15. pathinfo : http.getenv("PATH_INFO"),
  16. documentroot : http.getenv("DOCUMENT_ROOT"),
  17. requestpath : ctx.request_path,
  18. dispatchpath : ctx.path,
  19. pollinterval : +config.main.pollinterval || 5,
  20. ubuspath : config.main.ubuspath || '/ubus/',
  21. sessionid : ctx.authsession,
  22. token : ctx.authtoken,
  23. nodespec : dispatched,
  24. apply_rollback : max(+config.apply.rollback || 90, 90),
  25. apply_holdoff : max(+config.apply.holdoff || 4, 1),
  26. apply_timeout : max(+config.apply.timeout || 5, 1),
  27. apply_display : max(+config.apply.display || 1.5, 1),
  28. rollback_token : rollback_token
  29. } }`, '/', '\\/') }});
  30. </script>