summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/ucode/template
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-10-27 11:13:49 +0200
committerJo-Philipp Wich <jo@mein.io>2022-10-27 11:14:52 +0200
commit1eea6c0ce8d5357204fb6248c0444e5495e1c191 (patch)
tree2050b6d9e32ca8193baeeb150d9f96752690cf28 /modules/luci-base/ucode/template
parentbd4bf6ac9bafa8f1b80de37709eb64fb40c08c29 (diff)
luci-base: add ui indicator when fallback theme is used
Add a ui indicator displaying error details when the configured theme failed to load and the next available one is being used instead. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/ucode/template')
-rw-r--r--modules/luci-base/ucode/template/footer.ut19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/luci-base/ucode/template/footer.ut b/modules/luci-base/ucode/template/footer.ut
index 22d4f136f0..d0978594f8 100644
--- a/modules/luci-base/ucode/template/footer.ut
+++ b/modules/luci-base/ucode/template/footer.ut
@@ -18,6 +18,25 @@
</script>
{% endif %}
+{% if (media_error): %}
+ <script type="text/javascript">
+ L.require('ui').then(function(ui) {
+ ui.showIndicator('media_error', _('Theme fallback'), function(ev) {
+ ui.showModal(_('Error loading theme'), [
+ E('p', [
+ _('A fallback is used since the configured theme failed to load with the error below.')
+ ]),
+ E('hr'),
+ E('div', { 'style': 'white-space:pre-line' }, {{ sprintf('%J', trim(media_error)) }}),
+ E('div', { 'class': 'right' }, [
+ E('button', { 'class': 'btn cbi-button', 'click': ui.hideModal }, _('Dismiss'))
+ ])
+ ]);
+ });
+ });
+ </script>
+{% endif %}
+
{% include(`themes/${theme}/footer`) %}
<!-- Lua compatibility mode active: {{ lua_active ? 'yes' : 'no' }} -->