devices = 'Devices'
disable = 'disable'
distance = 'Distance'
+dmesg = 'Kernel Log'
dnsserver = '<abbr title="Domain Name System">DNS</abbr>-Server'
edit = 'Edit'
enable = 'enable'
<i18n:msg xml:id="devices">Devices</i18n:msg>
<i18n:msg xml:id="disable">disable</i18n:msg>
<i18n:msg xml:id="distance">Distance</i18n:msg>
+<i18n:msg xml:id="dmesg">Kernel Log</i18n:msg>
<i18n:msg xml:id="dnsserver"><abbr title="Domain Name System">DNS</abbr>-Server</i18n:msg>
<i18n:msg xml:id="edit">Edit</i18n:msg>
<i18n:msg xml:id="enable">enable</i18n:msg>
devices = 'Equipements'
disable = 'désactiver'
distance = 'Distance'
+dmesg = 'Journal du noyau'
dnsserver = 'Serveur DNS'
edit = 'Editer'
enable = 'activer'
<i18n:msg xml:id="devices">Equipements</i18n:msg>
<i18n:msg xml:id="disable">désactiver</i18n:msg>
<i18n:msg xml:id="distance">Distance</i18n:msg>
+<i18n:msg xml:id="dmesg">Journal du noyau</i18n:msg>
<i18n:msg xml:id="dnsserver">Serveur DNS</i18n:msg>
<i18n:msg xml:id="edit">Editer</i18n:msg>
<i18n:msg xml:id="enable">activer</i18n:msg>
devices = 'Geräte'
disable = 'deaktivieren'
distance = 'Distanz'
+dmesg = 'Kernelprotokoll'
dnsserver = 'DNS-Server'
edit = 'Bearbeiten'
enable = 'aktivieren'
<i18n:msg xml:id="devices">Geräte</i18n:msg>
<i18n:msg xml:id="disable">deaktivieren</i18n:msg>
<i18n:msg xml:id="distance">Distanz</i18n:msg>
+<i18n:msg xml:id="dmesg">Kernelprotokoll</i18n:msg>
<i18n:msg xml:id="dnsserver">DNS-Server</i18n:msg>
<i18n:msg xml:id="edit">Bearbeiten</i18n:msg>
devices = 'Dispositivos'
disable = 'desativar'
distance = 'Distância'
+dmesg = 'Log do Kernel'
dnsserver = 'Servidor-<abbr title="Sistema de Nomes de Domínios">DNS</abbr>'
edit = 'Editar'
enable = 'ativar'
<i18n:msg xml:id="delete">Apagar</i18n:msg>
<i18n:msg xml:id="descr">Descrição</i18n:msg>
<i18n:msg xml:id="design">Tema</i18n:msg>
-<i18n:msg xml:id="destination">Destino</i18n:msg>
+<i18n:msg xml:id="destination">Destino</i18n:msg>
<i18n:msg xml:id="device">Dispositivo</i18n:msg>
<i18n:msg xml:id="devices">Dispositivos</i18n:msg>
<i18n:msg xml:id="disable">desativar</i18n:msg>
<i18n:msg xml:id="distance">Distância</i18n:msg>
+<i18n:msg xml:id="dmesg">Log do Kernel</i18n:msg>
<i18n:msg xml:id="dnsserver">Servidor-<abbr title="Sistema de Nomes de Domínios">DNS</abbr></i18n:msg>
<i18n:msg xml:id="edit">Editar</i18n:msg>
<i18n:msg xml:id="enable">ativar</i18n:msg>
<i18n:msg xml:id="services">Serviços</i18n:msg>
<i18n:msg xml:id="settings">Configurações</i18n:msg>
<i18n:msg xml:id="size">Tamanho</i18n:msg>
-<i18n:msg xml:id="source">Origem</i18n:msg>
+<i18n:msg xml:id="source">Origem</i18n:msg>
<i18n:msg xml:id="start">Início</i18n:msg>
<i18n:msg xml:id="static">estático</i18n:msg>
<i18n:msg xml:id="status">Status</i18n:msg>
devices = 'Устройства'
disable = 'выключено'
distance = 'Расстояние'
+dmesg = 'Kernel log'
dnsserver = '<abbr title="Служба Доменных Имён">DNS</abbr>-Сервер'
edit = 'Редактировать'
enable = 'включено'
<i18n:msg xml:id="devices">Устройства</i18n:msg>
<i18n:msg xml:id="disable">выключено</i18n:msg>
<i18n:msg xml:id="distance">Расстояние</i18n:msg>
+<i18n:msg xml:id="dmesg">Kernel log</i18n:msg>
<i18n:msg xml:id="dnsserver"><abbr title="Служба Доменных Имён">DNS</abbr>-Сервер</i18n:msg>
<i18n:msg xml:id="edit">Редактировать</i18n:msg>
<i18n:msg xml:id="enable">включено</i18n:msg>
return (str:gsub("^%s*(.-)%s*$", "%1"))
end
+--- Count the occurences of given substring in given string.
+-- @param str String to search in
+-- @param pattern String containing pattern to find
+-- @return Number of found occurences
+function cmatch(str, pat)
+ local count = 0
+ for _ in str:gmatch(pat) do count = count + 1 end
+ return count
+end
+
--- Parse certain units from the given string and return the canonical integer
-- value or 0 if the unit is unknown. Upper- or lower case is irrelevant.
-- Recognized units are:
return val
end
+-- also register functions above in the central string class for convenience
+string.escape = escape
+string.pcdata = pcdata
+string.striptags = striptags
+string.split = split
+string.trim = trim
+string.cmatch = cmatch
+string.parse_units = parse_units
+
+
--- Appends numerically indexed tables or single objects to a given table.
-- @param src Target table
-- @param ... Objects to insert
return luci.util.exec("logread")
end
+--- Retrieves the output of the "dmesg" command.
+-- @return String containing the current log buffer
+function dmesg()
+ return luci.util.exec("dmesg")
+end
+
--- Generates a random id with specified length.
-- @param bytes Number of bytes for the unique id
-- @return String containing hex encoded id
local i18n = luci.i18n.translate
entry({"admin", "status"}, template("admin_status/index"), i18n("status", "Status"), 20).index = true
- entry({"admin", "status", "syslog"}, call("action_syslog"), i18n("syslog", "Systemprotokoll"))
+ entry({"admin", "status", "syslog"}, call("action_syslog"), i18n("syslog", "Systemprotokoll"), 1)
+ entry({"admin", "status", "dmesg"}, call("action_dmesg"), i18n("dmesg", "Kernelprotokoll"), 2)
end
function action_syslog()
local syslog = luci.sys.syslog()
luci.template.render("admin_status/syslog", {syslog=syslog})
-end
\ No newline at end of file
+end
+
+function action_dmesg()
+ local dmesg = luci.sys.dmesg()
+ luci.template.render("admin_status/dmesg", {dmesg=dmesg})
+end
--- /dev/null
+<%#
+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: syslog.htm 3622 2008-10-23 16:05:55Z jow $
+
+-%>
+<%+header%>
+<h2><a id="content" name="content"><%:dmesg%></a></h2>
+<div id="content_syslog">
+<textarea readonly="readonly" wrap="off" rows="<%=dmesg:cmatch("\n")+2%>" id="syslog"><%=dmesg:pcdata()%></textarea>
+</div>
+<%+footer%>
-%>
<%+header%>
-<h2><a id="content" name="content"><%:status%></a></h2>
-<h3><%:syslog%></h3>
+<h2><a id="content" name="content"><%:syslog%></a></h2>
<div id="content_syslog">
-<textarea readonly="readonly" wrap="off" id="syslog"><%=luci.util.pcdata(syslog)%></textarea>
+<textarea readonly="readonly" wrap="off" rows="<%=syslog:cmatch("\n")+2%>" id="syslog"><%=syslog:pcdata()%></textarea>
</div>
<%+footer%>
margin-bottom: 1em;
}
+textarea#syslog {
+ width: 98%;
+ min-height: 500px;
+ border: 3px solid #cccccc;
+ padding: 5px;
+ font-family: monospace;
+}
+
.cbi-section {
margin-bottom: 0.5em;
padding: 0.5em 1em;
margin-bottom: 1em;
}
+textarea#syslog {
+ width: 98%;
+ min-height: 500px;
+ border: 3px solid #cccccc;
+ padding: 5px;
+ font-family: monospace;
+}
+
.cbi-section {
margin-bottom: 0.5em;
padding: 0.5em 1em;
textarea#syslog {
width: 98%;
- height: 450px;
+ min-height: 500px;
border: 3px solid #cccccc;
padding: 5px;
font-family: monospace;
- overflow: auto;
}
#maincontent {