tazpanel rev 451
boot.cgi: add system logs
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Apr 10 12:13:52 2015 +0200 (2015-04-10) |
parents | 0b0d7c431046 |
children | 2c1f491aca05 |
files | boot.cgi po/fr.po styles/default/header.html |
line diff
1.1 --- a/boot.cgi Fri Apr 10 01:33:50 2015 +0300 1.2 +++ b/boot.cgi Fri Apr 10 12:13:52 2015 +0200 1.3 @@ -34,6 +34,33 @@ 1.4 # 1.5 1.6 case " $(GET) " in 1.7 + *\ syslog\ *) 1.8 + logtype="$(GET syslog)" 1.9 + [ "$logtype" == "syslog" ] && logtype=messages 1.10 + xhtml_header 1.11 + cat <<EOT 1.12 +<h2>$(_ 'System logs')</h2> 1.13 + 1.14 +<ul id="tabs"> 1.15 +EOT 1.16 + for i in $(sed '/var\/log/!d;s|.*/log/||' /etc/syslog.conf); do 1.17 + unset act 1.18 + [ "$i" == "$logtype" ] && act=' class="active"' 1.19 + cat <<EOT 1.20 + <li$act><a href="?syslog=$i" title="$(sed "/$i$/!d;s/[\t ].*//" /etc/syslog.conf)">$i</a></li> 1.21 +EOT 1.22 + done 1.23 + cat <<EOT 1.24 +</ul> 1.25 + 1.26 +<section> 1.27 + <div> 1.28 + <pre>$(syntax_highlighter kernel < /var/log/$logtype | \ 1.29 + loghead /var/log/$logtype)</pre> 1.30 + </div> 1.31 +</section> 1.32 +EOT 1.33 + ;; 1.34 *\ log\ *) 1.35 unset actboot actslim actxlog actkernel colors 1.36 case "$(GET log)" in 1.37 @@ -344,6 +371,7 @@ 1.38 1.39 <form> 1.40 <button name="log" data-icon="logs" >$(_ 'Boot logs')</button> 1.41 + <button name="syslog" data-icon="logs" >$(_ 'System logs')</button> 1.42 <button name="daemons" data-icon="daemons" data-root>$(_ 'Manage daemons')</button> 1.43 EOT 1.44 [ -w /boot/grub/menu.lst ] && cat <<EOT
2.1 --- a/po/fr.po Fri Apr 10 01:33:50 2015 +0300 2.2 +++ b/po/fr.po Fri Apr 10 12:13:52 2015 +0200 2.3 @@ -325,6 +325,9 @@ 2.4 msgid "Boot log files" 2.5 msgstr "Journaux de démarrage" 2.6 2.7 +msgid "System logs" 2.8 +msgstr "Journaux système" 2.9 + 2.10 #: boot.cgi:59 styles/default/header.html:53 2.11 msgid "Kernel messages" 2.12 msgstr "Messages du noyau"
3.1 --- a/styles/default/header.html Fri Apr 10 01:33:50 2015 +0300 3.2 +++ b/styles/default/header.html Fri Apr 10 12:13:52 2015 +0200 3.3 @@ -57,6 +57,7 @@ 3.4 <li><a data-icon="" href="boot.cgi?log=slim">$(_ 'X session')</a></li> 3.5 </menu> 3.6 </li> 3.7 + <li><a data-icon="logs" href="boot.cgi?syslog">$(_ 'System logs')</a> 3.8 <li><a data-icon="daemons" href="boot.cgi?daemons" data-root>$(_ 'Manage daemons')</a></li> 3.9 $(for i in menu.d/boot/* ; do [ -f $i ] && sh $i menu $i ; done) 3.10 </menu>