From 1eea6c0ce8d5357204fb6248c0444e5495e1c191 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 27 Oct 2022 11:13:49 +0200 Subject: [PATCH] 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 --- modules/luci-base/ucode/runtime.uc | 1 + modules/luci-base/ucode/template/footer.ut | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/modules/luci-base/ucode/runtime.uc b/modules/luci-base/ucode/runtime.uc index a8b6812e74..d02d8dd667 100644 --- a/modules/luci-base/ucode/runtime.uc +++ b/modules/luci-base/ucode/runtime.uc @@ -137,6 +137,7 @@ export default function(env) { if (status !== true) { media = null; + self.env.media_error = status; for (let k, v in uci.get_all('luci', 'themes')) { if (substr(k, 0, 1) != '.') { 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 @@ {% endif %} +{% if (media_error): %} + +{% endif %} + {% include(`themes/${theme}/footer`) %} -- 2.30.2