themes: eliminate uses of luci.sys.loadavg()
[project/luci.git] / themes / luci-theme-freifunk-bno / luasrc / view / themes / freifunk-bno / header.htm
index 5099d18..790dbb0 100644 (file)
@@ -14,13 +14,15 @@ $Id$
 -%>
 <%
 require("luci.sys")
-local load1, load5, load15 = luci.sys.loadavg()
+require("luci.util")
+
+local boardinfo = luci.util.ubus("system", "board")
+
 local request  = require("luci.dispatcher").context.path
 local category = request[1]
 local tree     = luci.dispatcher.node()
 local cattree  = category and luci.dispatcher.node(category)
 local node     = luci.dispatcher.context.dispatched
-local hostname = luci.sys.hostname()
 
 local c = tree
 for i,r in ipairs(request) do
@@ -48,7 +50,7 @@ require("luci.http").prepare_content("text/html")
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
        <meta http-equiv="content-script-type" content="text/javascript" />
        <script type="text/javascript" src="<%=resource%>/xhr.js"></script>
-       <title><%=striptags( hostname .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
+       <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
 
        <!--[if lt IE 7]>
                <script type="text/javascript">