diff --git a/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm b/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm deleted file mode 100644 index 1d95bae886b..00000000000 --- a/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm +++ /dev/null @@ -1,95 +0,0 @@ -<%# - Copyright 2008 Steven Barth - Copyright 2008-2010 Jo-Philipp Wich - Licensed to the public under the Apache License 2.0. --%> - -<% - local sys = require "luci.sys" - local util = require "luci.util" - local http = require "luci.http" - local disp = require "luci.dispatcher" - local ver = require "luci.version" - - local sysinfo = util.ubus("system", "info") or { } - local loadinfo = sysinfo.load or { 0, 0, 0 } - local boardinfo = util.ubus("system", "board") or { } - - local node = disp.context.dispatched - - http.prepare_content("application/xhtml+xml") --%> - - - - - - - - - -<% if node and node.css then %> -<% end -%> -<% if css then %> -<% end -%> - - - -<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI - -"> - - - - - -
- - -
- - - - - <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> -
-

<%:No password set!%>

-

<%:There is no password set on this router. Please configure a root password to protect the web interface.%>

- <% if disp.lookup("admin/system/admin") then %> - - <% end %> -
- <%- end -%> - - <%- if boardinfo.rootfs_type == "initramfs" then -%> -
-

<%:System running in recovery (initramfs) mode.%>

-

<%:No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade%>

- <% if disp.lookup("admin/system/flash") then %> - - <% end %> -
- <%- end -%> diff --git a/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/footer.htm b/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/footer.ut similarity index 73% rename from themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/footer.htm rename to themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/footer.ut index 356b6dac101..1b6bfff5bba 100644 --- a/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/footer.htm +++ b/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/footer.ut @@ -1,16 +1,15 @@ -<%# +{# Copyright 2008 Steven Barth Copyright 2008 Jo-Philipp Wich Licensed to the public under the Apache License 2.0. --%> +-#}

- <% local ver = require "luci.version" -%> - Powered by <%= ver.luciname %> (<%= ver.luciversion %>) + Powered by {{ version.luciname }} ({{ version.luciversion }})

diff --git a/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut b/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut new file mode 100644 index 00000000000..f6c20be188b --- /dev/null +++ b/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut @@ -0,0 +1,88 @@ +{# + Copyright 2008 Steven Barth + Copyright 2008-2010 Jo-Philipp Wich + Licensed to the public under the Apache License 2.0. +-#} + +{% + import { getuid, getspnam } from 'luci.core'; + + const boardinfo = ubus.call('system', 'board'); + const loadinfo = ubus.call("system", "info")?.load; + + http.prepare_content("application/xhtml+xml"); +-%} + + + + + + + + + +{% if (node?.css): %} + +{% endif %} +{% if (css): %} + +{% endif %} + + + +{{ striptags(`${boardinfo.hostname ?? '?'}${node ? ` - ${_(node.title)}` : ''}`) }} - LuCI + + + + + + + +
+ + +
+ + + + + {% if (getuid() == 0 && getspnam('root')?.pwdp === '' && join('-', ctx.request_path) != 'admin-system-admin'): %} +
+

{{ _('No password set!') }}

+

{{ _('There is no password set on this router. Please configure a root password to protect the web interface.') }}

+ {% if (dispatcher.lookup("admin/system/admin")): %} + + {% endif %} +
+ {% endif %} + + {% if (boardinfo.rootfs_type == "initramfs"): %} +
+

{{ _('System running in recovery (initramfs) mode.') }}

+

{{ _('No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade') }}

+ {% if (dispatcher.lookup("admin/system/flash")): %} + + {% endif %} +
+ {% endif %}