summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-16 23:17:50 +0000
committerSteven Barth <steven@midlink.org>2008-08-16 23:17:50 +0000
commit510fde01188d1a9a903c2d56b83f498a1e6666b8 (patch)
tree8b36dc4af7e96a86f21f67b5ef23a40fd7072624 /modules/admin-full/luasrc
parent32f2f12438f29ab2b0423d434f08e7bd2d1c755f (diff)
Added status information
Minor Cleanups
Diffstat (limited to 'modules/admin-full/luasrc')
-rw-r--r--modules/admin-full/luasrc/controller/admin/network.lua2
-rw-r--r--modules/admin-full/luasrc/controller/admin/system.lua4
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_system/system.lua28
-rw-r--r--modules/admin-full/luasrc/view/admin_network/index.htm22
-rw-r--r--modules/admin-full/luasrc/view/admin_system/index.htm20
5 files changed, 31 insertions, 45 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua
index a4b070c02..3952fb868 100644
--- a/modules/admin-full/luasrc/controller/admin/network.lua
+++ b/modules/admin-full/luasrc/controller/admin/network.lua
@@ -19,7 +19,7 @@ function index()
local i18n = luci.i18n.translate
local page = node("admin", "network")
- page.target = template("admin_network/index")
+ page.target = alias("admin", "network", "network")
page.title = i18n("network")
page.order = 50
diff --git a/modules/admin-full/luasrc/controller/admin/system.lua b/modules/admin-full/luasrc/controller/admin/system.lua
index 21f804a7a..fdddf6b8d 100644
--- a/modules/admin-full/luasrc/controller/admin/system.lua
+++ b/modules/admin-full/luasrc/controller/admin/system.lua
@@ -17,12 +17,12 @@ function index()
luci.i18n.loadc("admin-core")
local i18n = luci.i18n.translate
- entry({"admin", "system"}, template("admin_system/index"), i18n("system"), 30)
+ entry({"admin", "system"}, alias("admin", "system", "system"), i18n("system"), 30)
+ entry({"admin", "system", "system"}, cbi("admin_system/system"), i18n("system"), 1)
entry({"admin", "system", "packages"}, call("action_packages"), i18n("a_s_packages"), 10)
entry({"admin", "system", "packages", "ipkg"}, form("admin_system/ipkg"), i18n("a_s_p_ipkg"))
entry({"admin", "system", "passwd"}, form("admin_system/passwd"), i18n("a_s_changepw"), 20)
entry({"admin", "system", "sshkeys"}, form("admin_system/sshkeys"), i18n("a_s_sshkeys"), 30)
- entry({"admin", "system", "system"}, cbi("admin_system/system"), i18n("system"), 40)
entry({"admin", "system", "processes"}, form("admin_system/processes"), i18n("process_head"), 45)
entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), i18n("a_s_fstab"), 50)
entry({"admin", "system", "leds"}, cbi("admin_system/leds"), i18n("leds", "LEDs"), 60)
diff --git a/modules/admin-full/luasrc/model/cbi/admin_system/system.lua b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua
index 6cc5c495f..9967ce933 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_system/system.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua
@@ -12,12 +12,40 @@ You may obtain a copy of the License at
$Id$
]]--
require("luci.http.protocol.date")
+require("luci.sys")
+require("luci.tools.webadmin")
m = Map("system", translate("system"), translate("a_s_desc"))
s = m:section(TypedSection, "system", "")
s.anonymous = true
+local system, model, memtotal, memcached, membuffers, memfree = luci.sys.sysinfo()
+local uptime = luci.sys.uptime()
+
+s:option(DummyValue, "_system", translate("system")).value = system
+s:option(DummyValue, "_cpu", translate("m_i_processor")).value = model
+
+local load1, load5, load15 = luci.sys.loadavg()
+s:option(DummyValue, "_la", translate("load")).value =
+ string.format("%.2f, %.2f, %.2f", load1, load5, load15)
+
+s:option(DummyValue, "_memtotal", translate("m_i_memory")).value =
+ string.format("%.2f MB (%.0f%% %s, %.0f%% %s, %.0f%% %s)",
+ tonumber(memtotal) / 1024,
+ 100 * memcached / memtotal,
+ translate("mem_cached") or "",
+ 100 * membuffers / memtotal,
+ translate("mem_buffered") or "",
+ 100 * memfree / memtotal,
+ translate("mem_free") or "")
+
+s:option(DummyValue, "_systime", translate("m_i_systemtime")).value =
+ os.date("%c")
+
+s:option(DummyValue, "_uptime", translate("m_i_uptime")).value =
+ luci.tools.webadmin.date_format(tonumber(uptime))
+
s:option(Value, "hostname", translate("hostname"))
tz = s:option(ListValue, "timezone", translate("timezone"))
diff --git a/modules/admin-full/luasrc/view/admin_network/index.htm b/modules/admin-full/luasrc/view/admin_network/index.htm
deleted file mode 100644
index dec286436..000000000
--- a/modules/admin-full/luasrc/view/admin_network/index.htm
+++ /dev/null
@@ -1,22 +0,0 @@
-<%#
-LuCI - Lua Configuration Interface
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-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
-
-$Id$
-
--%>
-<%+header%>
-<h1><%:network%></h1>
-<p><%:a_network1%></p>
-<p><%:a_network2%></p>
-<p><%:a_network3%></p>
-<p><%:a_network4%></p>
-<p><%:a_network5%></p>
-<%+footer%> \ No newline at end of file
diff --git a/modules/admin-full/luasrc/view/admin_system/index.htm b/modules/admin-full/luasrc/view/admin_system/index.htm
deleted file mode 100644
index 3138903c4..000000000
--- a/modules/admin-full/luasrc/view/admin_system/index.htm
+++ /dev/null
@@ -1,20 +0,0 @@
-<%#
-LuCI - Lua Configuration Interface
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-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
-
-$Id$
-
--%>
-<%+header%>
-<h1><%:system%></h1>
-<p><%:a_s_i_system1%></p>
-<p><%:a_s_i_system2%></p>
-<p><%:a_s_i_system3%></p>
-<%+footer%> \ No newline at end of file