projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
themes: eliminate uses of luci.sys.loadavg()
[project/luci.git]
/
themes
/
luci-theme-freifunk-generic
/
luasrc
/
view
/
themes
/
freifunk-generic
/
header.htm
diff --git
a/themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm
b/themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm
index
e8b1c06
..
3eacf0a
100644
(file)
--- a/
themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm
+++ b/
themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm
@@
-13,11
+13,13
@@
You may obtain a copy of the License at
<%
local fs = require "luci.fs"
local sys = require "luci.sys"
<%
local fs = require "luci.fs"
local sys = require "luci.sys"
+ local util = require "luci.util"
local http = require "luci.http"
local disp = require "luci.dispatcher"
local http = require "luci.http"
local disp = require "luci.dispatcher"
- local hostname = sys.hostname()
- local load1, load5, load15 = sys.loadavg()
+ local sysinfo = util.ubus("system", "info") or { }
+ local loadinfo = sysinfo.load or { 0, 0, 0 }
+ local boardinfo = util.ubus("system", "board") or { }
local request = disp.context.path
local category = request[1]
local request = disp.context.path
local category = request[1]
@@
-87,7
+89,7
@@
You may obtain a copy of the License at
<meta name="viewport" content="initial-scale=1.0" />
<script type="text/javascript" src="<%=resource%>/xhr.js"></script>
<meta name="viewport" content="initial-scale=1.0" />
<script type="text/javascript" src="<%=resource%>/xhr.js"></script>
-<title><%=striptags(
hostname
.. ( (node and node.title) and ' - ' .. translate(tostring(node.title)) or '')) %> - LuCI</title>
+<title><%=striptags(
(boardinfo.hostname or "?")
.. ( (node and node.title) and ' - ' .. translate(tostring(node.title)) or '')) %> - LuCI</title>
</head>
<body class="lang_<%=luci.i18n.context.lang%>">
</head>
<body class="lang_<%=luci.i18n.context.lang%>">
@@
-127,8
+129,8
@@
You may obtain a copy of the License at
</div>
<div class="header_right">
<%=luci.version.distversion%><br />
</div>
<div class="header_right">
<%=luci.version.distversion%><br />
- <%:Load%>: <%="%.2f" % load
1%> <%="%.2f" % load5%> <%="%.2f" % load15
%><br />
- <%:Hostname%>: <%=
hostname
%><br />
+ <%:Load%>: <%="%.2f" % load
info[1] / 65535.0%> <%="%.2f" % loadinfo[2] / 65535.0%> <%="%.2f" % loadinfo[3] / 65535.0
%><br />
+ <%:Hostname%>: <%=
boardinfo.hostname or "?"
%><br />
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
<%:Auto Refresh%>:
<span id="xhr_poll_status_on"><%:on%></span>
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
<%:Auto Refresh%>:
<span id="xhr_poll_status_on"><%:on%></span>