footer.ut 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {#
  2. Copyright 2022 Jo-Philipp Wich <jo@mein.io>
  3. Licensed to the public under the Apache License 2.0.
  4. -#}
  5. {% const rollback = dispatcher.rollback_pending() %}
  6. {% if (rollback || trigger_apply || trigger_revert): %}
  7. <script>
  8. document.addEventListener("luci-loaded", function() {
  9. {% if (trigger_apply): %}
  10. L.ui.changes.apply(true);
  11. {% elif (trigger_revert): %}
  12. L.ui.changes.revert();
  13. {% else %}
  14. L.ui.changes.confirm(true, Date.now() + {{rollback.remaining * 1000}}, {{sprintf('%J', rollback.token)}});
  15. {% endif %}
  16. });
  17. </script>
  18. {% endif %}
  19. {% if (media_error): %}
  20. <script>
  21. L.require('ui').then(function(ui) {
  22. ui.showIndicator('media_error', _('Theme fallback'), function(ev) {
  23. ui.showModal(_('Error loading theme'), [
  24. E('p', [
  25. _('A fallback is used since the configured theme failed to load with the error below.')
  26. ]),
  27. E('hr'),
  28. E('div', { 'style': 'white-space:pre-line' }, {{ sprintf('%J', trim(media_error)) }}),
  29. E('div', { 'class': 'right' }, [
  30. E('button', { 'class': 'btn cbi-button', 'click': ui.hideModal }, _('Dismiss'))
  31. ])
  32. ]);
  33. });
  34. });
  35. </script>
  36. {% endif %}
  37. {% include(`themes/${theme}/footer`) %}
  38. <!-- Lua compatibility mode active: {{ lua_active ? 'yes' : 'no' }} -->