From bac04441f11f29b53d6c24ed9a32244cd95dce25 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 13 May 2008 17:32:11 +0000 Subject: [PATCH] * modules/admin-core: Reintroduced ffluci.controller.admin.status * modules/admin-core: Added Syslog status page --- core/src/sys.lua | 5 +++++ modules/admin-core/src/controller/admin/status.lua | 6 ++++++ modules/admin-core/src/model/menu/00admin.lua | 3 +++ modules/admin-core/src/view/admin_status/index.htm | 7 +++++++ modules/admin-core/src/view/admin_status/syslog.htm | 5 +++++ modules/admin-core/src/view/admin_uci/changes.htm | 2 +- 6 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 modules/admin-core/src/controller/admin/status.lua create mode 100644 modules/admin-core/src/view/admin_status/index.htm create mode 100644 modules/admin-core/src/view/admin_status/syslog.htm diff --git a/core/src/sys.lua b/core/src/sys.lua index 376654893..debd8e94c 100644 --- a/core/src/sys.lua +++ b/core/src/sys.lua @@ -122,6 +122,11 @@ function sysinfo() return s, m, r end +-- Reads the syslog +function syslog() + return exec("logread") +end + group = {} group.getgroup = posix.getgroup diff --git a/modules/admin-core/src/controller/admin/status.lua b/modules/admin-core/src/controller/admin/status.lua new file mode 100644 index 000000000..fa9fe65bd --- /dev/null +++ b/modules/admin-core/src/controller/admin/status.lua @@ -0,0 +1,6 @@ +module("ffluci.controller.admin.status", package.seeall) + +function action_syslog() + local syslog = ffluci.sys.syslog() + ffluci.template.render("admin_status/syslog", {syslog=syslog}) +end \ No newline at end of file diff --git a/modules/admin-core/src/model/menu/00admin.lua b/modules/admin-core/src/model/menu/00admin.lua index c48db19bd..b21e5e338 100644 --- a/modules/admin-core/src/model/menu/00admin.lua +++ b/modules/admin-core/src/model/menu/00admin.lua @@ -1,6 +1,9 @@ add("admin", "index", "Übersicht", 10) act("luci", "Oberfläche") +add("admin", "status", "Status", 20) +act("syslog", "Systemprotokoll") + add("admin", "system", "System", 30) act("packages", "Paketverwaltung") act("passwd", "Passwort ändern") diff --git a/modules/admin-core/src/view/admin_status/index.htm b/modules/admin-core/src/view/admin_status/index.htm new file mode 100644 index 000000000..984093693 --- /dev/null +++ b/modules/admin-core/src/view/admin_status/index.htm @@ -0,0 +1,7 @@ +<%+header%> +

<%:status Status%>

+

<%:status1 Hier finden sich Informationen über den aktuellen Status des Systems, beispielsweise +Prozessortakt, Speicherauslastung und Netzwerkschnittstellen.%>

+

<%:status2 Zusätzlich können hier Protokolldaten, des Kernels und diverser Systemdienste eingesehen werden, +um deren Zustand zu kontrollieren.%>

+<%+footer%> \ No newline at end of file diff --git a/modules/admin-core/src/view/admin_status/syslog.htm b/modules/admin-core/src/view/admin_status/syslog.htm new file mode 100644 index 000000000..905161be2 --- /dev/null +++ b/modules/admin-core/src/view/admin_status/syslog.htm @@ -0,0 +1,5 @@ +<%+header%> +

<%:status Status%>

+

<%:syslog Systemprotokoll%>

+<%=syslog%> +<%+footer%> \ No newline at end of file diff --git a/modules/admin-core/src/view/admin_uci/changes.htm b/modules/admin-core/src/view/admin_uci/changes.htm index 3bbcd0e5f..52efb4589 100644 --- a/modules/admin-core/src/view/admin_uci/changes.htm +++ b/modules/admin-core/src/view/admin_uci/changes.htm @@ -1,7 +1,7 @@ <%+header%>

<%:config Konfiguration%>

<%:changes Änderungen%>

-<%=(ffluci.model.uci.changes() or "-")%> +<%=ffluci.model.uci.changes()%>
-- 2.25.1