X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=themes%2Fluci-theme-freifunk-generic%2Fluasrc%2Fview%2Fthemes%2Ffreifunk-generic%2Fheader.htm;h=81856552858e3108c442222a127bca1a69451dcd;hp=e8b1c062d1101fae0a2f9768b62ec9f03999ad79;hb=731ed77c0bbee7004a6b5645d9a8592a76748a1c;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92 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 e8b1c062d..818565528 100644 --- 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 @@ -1,23 +1,20 @@ <%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008-2011 Jo-Philipp Wich - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 + Copyright 2008 Steven Barth + Copyright 2008-2011 Jo-Philipp Wich + Licensed to the public under the Apache License 2.0. -%> <% - local fs = require "luci.fs" + local fs = require "nixio.fs" local sys = require "luci.sys" + local util = require "luci.util" local http = require "luci.http" local disp = require "luci.dispatcher" + local version = require "luci.version" - 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] @@ -48,20 +45,20 @@ You may obtain a copy of the License at local banner = false local show_comm = true - local lo = fs.glob("/www/luci-static/resources/custom_logo.*") - if lo[1] then - logo = string.gsub(lo[1], "/www", "") + local file + for file in fs.glob("/www/luci-static/resources/custom_logo.*") do + logo = string.gsub(file, "/www", "") + break end - local lon = fs.glob("/www/luci-static/resources/custom_logo_only.*") - if lon[1] then - logo = string.gsub(lon[1], "/www", "") + for file in fs.glob("/www/luci-static/resources/custom_logo_only.*") do + logo = string.gsub(file, "/www", "") show_comm = false + break end - local hea = fs.glob("/www/luci-static/resources/custom_header.*") - if hea[1] then - logo = string.gsub(hea[1], "/www", "") + for file in fs.glob("/www/luci-static/resources/custom_header.*") do + logo = string.gsub(file, "/www", "") show_comm = false banner = true end @@ -87,7 +84,7 @@ You may obtain a copy of the License at -<%=striptags( hostname .. ( (node and node.title) and ' - ' .. translate(tostring(node.title)) or '')) %> - LuCI +<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(tostring(node.title)) or '')) %> - LuCI @@ -108,8 +105,8 @@ You may obtain a copy of the License at <%- end -%>
- <%=luci.version.distversion%>
- <%:Load%>: <%="%.2f" % load1%> <%="%.2f" % load5%> <%="%.2f" % load15%>
- <%:Hostname%>: <%=hostname%>
+ <%=version.distversion%>
+ <%:Load%>: <%="%.2f" % (loadinfo[1] / 65535.0)%> <%="%.2f" % (loadinfo[2] / 65535.0)%> <%="%.2f" % (loadinfo[3] / 65535.0)%>
+ <%:Hostname%>: <%=boardinfo.hostname or "?"%>