tazpanel rev 152

hardware.cgi: add free with colors and also add colors to top
author Christophe Lincoln <pankso@slitaz.org>
date Mon Apr 18 03:44:20 2011 +0200 (2011-04-18)
parents e4381f2e73f6
children ed55f0e369b3
files hardware.cgi index.cgi styles/default/style.css
line diff
     1.1 --- a/hardware.cgi	Mon Apr 18 02:44:54 2011 +0200
     1.2 +++ b/hardware.cgi	Mon Apr 18 03:44:20 2011 +0200
     1.3 @@ -105,17 +105,25 @@
     1.4  	<a class="button" href="$SCRIPT_NAME?modules">
     1.5  		<img src="$IMAGES/tux.png" />Kernel modules</a>
     1.6  </div>
     1.7 +
     1.8 +<h3>$(gettext "Filesystem usage statistics")</h3>
     1.9 +<pre>
    1.10  EOT
    1.11 -		echo '<h3>Filesystem usage statistics</h3>'
    1.12 -		echo '<pre>'
    1.13 -			fdisk -l | fgrep Disk
    1.14 +		fdisk -l | fgrep Disk
    1.15  		echo '</pre>'
    1.16  		echo '<pre>'
    1.17  			df -h | grep ^/dev
    1.18 -		echo '</pre>'		
    1.19 +		echo '</pre>'
    1.20 +		echo "<h3>$(gettext "System memory")</h3>"
    1.21 +		echo '<pre>'
    1.22 +		free -m | sed \
    1.23 +			-e s"#total.*\([^']\)#<span class='top'>\0</span>#"g \
    1.24 +			-e s"#^[A-Z-].*:\([^']\)#<span class='sh-comment'>\0</span>#"g
    1.25 +		echo '</pre>'
    1.26  		echo '<h3>lspci</h3>'
    1.27  		echo '<pre>'
    1.28 -			lspci -k
    1.29 +			lspci -k | \
    1.30 +				sed s"#^[0-9].*\([^']\)#<span class='diff-at'>\0</span>#"g
    1.31  		echo '</pre>'
    1.32  		echo '<h3>lsusb</h3>'
    1.33  		echo '<pre>'
     2.1 --- a/index.cgi	Mon Apr 18 02:44:54 2011 +0200
     2.2 +++ b/index.cgi	Mon Apr 18 03:44:20 2011 +0200
     2.3 @@ -101,7 +101,9 @@
     2.4  		TITLE="- $(gettext "Process activity")"
     2.5  		xhtml_header
     2.6  		echo '<pre>'
     2.7 -		top -n1 -b
     2.8 +		top -n1 -b | sed \
     2.9 +			-e s"#^[A-Z].*:\([^']\)#<span class='sh-comment'>\0</span>#"g \
    2.10 +			-e s"#PID.*\([^']\)#<span class='top'>\0</span>#"g
    2.11  		echo '</pre>' ;;
    2.12  	*\ debug\ *)
    2.13  		TITLE="- Debug"
     3.1 --- a/styles/default/style.css	Mon Apr 18 02:44:54 2011 +0200
     3.2 +++ b/styles/default/style.css	Mon Apr 18 03:44:20 2011 +0200
     3.3 @@ -199,7 +199,7 @@
     3.4  span.diff-rm { color: red; }
     3.5  span.diff-add { color: green; }
     3.6  span.diff-at { color: blue; }
     3.7 -
     3.8 +span.top { color: #00c800; font-weight: bold; font-size: 95%; }
     3.9  /* Misc */
    3.10  
    3.11  pre, .pre-main {