# HG changeset patch # User Christophe Lincoln # Date 1303399272 -7200 # Node ID 6e757e629f776e845a5ba4052554f9e1c82b5dbc # Parent fa2ea2d2ece4fef9b83c02edbc98947962f54fdf Add report creation (to help debbuging) diff -r fa2ea2d2ece4 -r 6e757e629f77 index.cgi --- a/index.cgi Wed Apr 20 20:17:46 2011 +0100 +++ b/index.cgi Thu Apr 21 17:21:12 2011 +0200 @@ -56,10 +56,15 @@ # # Handle files # - TITLE="- File" - xhtml_header file="$(GET file)" - echo "

$file

" + case $file in + *.html) + cat $file && exit 0 ;; + *) + TITLE="- File" + xhtml_header + echo "

$file

" ;; + esac if [ "$(GET action)" == "edit" ]; then cat < @@ -112,6 +117,83 @@ echo '
'
 		httpinfo
 		echo '
' ;; + *\ report\ *) + TITLE="- $(gettext "System report")" + output=/var/cache/slitaz/sys-report.html + xhtml_header + echo "

$(gettext "Reporting to:") $output

" + echo '
'
+		gettext "Creating report header...  "
+		cat > $output << EOT
+
+
+
+	SliTaz system report
+	
+
+
+EOT
+		ok_status
+		gettext "Creating system summary... "
+		cat >> $output << EOT
+

SliTaz system report

+Date: $(date) +
+uptime   :$(uptime)
+cmdline  : $(cat /proc/cmdline)
+version  : $(cat /etc/slitaz-release)
+packages : $(ls /var/lib/tazpkg/installed | wc -l) installed
+kernel   : $(uname -r)
+
+EOT + ok_status + gettext "Getting hardware info... " + cat >> $output << EOT +

free

+
+$(free)
+
+ +

lspci -k

+
+$(lspci -k)
+
+ +

lsusb

+
+$(lsusb)
+
+ +

lsmod

+
+$(lsmod)
+
+ +EOT + ok_status + gettext "Getting networking info... " + cat >> $output << EOT +

ifconfig -a

+
+$(ifconfig -a)
+
+EOT + ok_status + gettext "Creating report footer... " + cat cat >> $output << EOT + + +EOT + ok_status + echo '
' + echo "

+ $(gettext "View report")" + gettext "This report can be attached with a bug report on: " + echo 'bugs.slitaz.org

' ;; *) # # Default xHTML content @@ -125,19 +207,20 @@

$(gettext "SliTaz administration and configuration Panel")

$(gettext "Summary")

-

- $(gettext "Uptime:") $(uptime) -

-

- $(gettext "Memory in Mb") - $(free -m | grep Mem: | awk \ - '{print "| Total:", $2, "| Used:", $3, "| Free:", $4}') -

+
+$(gettext "Uptime       :")$(uptime)
+$(gettext "Memory in Mb :") $(free -m | grep Mem: | awk \
+	'{print "Total:", $2, "Used:", $3, "Free:", $4}')
+$(gettext "Linux kernel :") $(uname -r)
+
diff -r fa2ea2d2ece4 -r 6e757e629f77 lib/libtazpanel --- a/lib/libtazpanel Wed Apr 20 20:17:46 2011 +0100 +++ b/lib/libtazpanel Thu Apr 21 17:21:12 2011 +0200 @@ -57,6 +57,10 @@ sed s"#[^']*#$date : \0#" >> $LOG_FILE } +ok_status() { + echo "[ OK ]" +} + # Network interface status interface_status() { if ifconfig | grep -A 1 $i | grep -q inet; then diff -r fa2ea2d2ece4 -r 6e757e629f77 styles/default/images/monitor.png Binary file styles/default/images/monitor.png has changed