0
0
mirror of https://github.com/openwrt/luci.git synced 2025-07-04 19:03:12 +00:00
Files
luci/modules/luci-base/ucode/template/header.ut
Oleg S f6f82b52eb luci-base: package update based cache-busting string
Problem:
After updating the JS-part of any package, the user is forced to clear
the browser cache.

Fix:
Each time a package is removed or installed, the contents of the
"/lib/apk/db/installed" file are changed.
This fix add the modification time of the "/lib/apk/db/installed" file
to the version of the main LuCI package (for each js-file).

Signed-off-by: Oleg S <remittor@gmail.com>
2025-04-14 15:16:54 +02:00

32 lines
1.0 KiB
Plaintext

{#
Copyright 2022 Jo-Philipp Wich <jo@mein.io>
Licensed to the public under the Apache License 2.0.
-#}
{%
include(`themes/${theme}/header`);
-%}
<script src="{{ resource }}/luci.js?v={# PKG_VERSION #}-{{ pkgs_update_time }}"></script>
<script>
L = new LuCI({{ replace(`${ {
media : media,
resource : resource,
scriptname : http.getenv("SCRIPT_NAME"),
pathinfo : http.getenv("PATH_INFO"),
documentroot : http.getenv("DOCUMENT_ROOT"),
requestpath : ctx.request_path,
dispatchpath : ctx.path,
pollinterval : +config.main.pollinterval || 5,
ubuspath : config.main.ubuspath || '/ubus/',
sessionid : ctx.authsession,
token : ctx.authtoken,
nodespec : dispatched,
apply_rollback : max(+config.apply.rollback || 90, 90),
apply_holdoff : max(+config.apply.holdoff || 4, 1),
apply_timeout : max(+config.apply.timeout || 5, 1),
apply_display : max(+config.apply.display || 1.5, 1),
rollback_token : rollback_token
} }`, '/', '\\/') }});
</script>