diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-mod-status/ucode/template/admin_status/index.ut (renamed from modules/luci-mod-status/luasrc/view/admin_status/index.htm) | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/modules/luci-mod-status/luasrc/view/admin_status/index.htm b/modules/luci-mod-status/ucode/template/admin_status/index.ut index 7d7a42c2e3..4d018a3efd 100644 --- a/modules/luci-mod-status/luasrc/view/admin_status/index.htm +++ b/modules/luci-mod-status/ucode/template/admin_status/index.ut @@ -1,15 +1,15 @@ -<%# +{# Copyright 2008 Steven Barth <steven@midlink.org> - Copyright 2008-2018 Jo-Philipp Wich <jo@mein.io> + Copyright 2008-2022 Jo-Philipp Wich <jo@mein.io> Licensed to the public under the Apache License 2.0. --%> +-#} -<%+header%> +{% include('header') %} -<h2 name="content"><%:Status%></h2> +<h2 name="content">{{ _('Status') }}</h2> <div id="view"> - <div class="spinning"><%:Loading view…%></div> + <div class="spinning">{{ _('Loading view…') }}</div> </div> <script type="text/javascript">//<![CDATA[ @@ -49,24 +49,15 @@ function renderBadge(icon, title) { //]]></script> <div class="includes" style="display:none"> -<%- - local util = require "luci.util" - local fs = require "nixio.fs" +{% + let lua_available = true; - local incdir = util.libpath() .. "/view/admin_status/index/" - if fs.access(incdir) then - local _, inc - local includes = {} - for inc in fs.dir(incdir) do - if inc:match("%.htm$") then - includes[#includes + 1] = inc:gsub("%.htm$", "") - end - end - for _, inc in luci.util.vspairs(includes) do - include("admin_status/index/" .. inc) - end - end --%> + try { require('lua'); } + catch(err) { lua_available = false; } + + if (lua_available) + include('admin_status/luaindex'); +%} </div> <script type="text/javascript"> @@ -75,4 +66,4 @@ function renderBadge(icon, title) { }); </script> -<%+footer%> +{% include('footer') %} |