# HG changeset patch # User Christophe Lincoln # Date 1302235164 -7200 # Node ID 56d55a9dcc9c612f6bd112b9878998117640baef # Parent 5b7e9a6565c9221046cca76653e5ece8511388a1 Add hardware.cgi, tiny fix in pkgs.cgi and add a TODO list diff -r 5b7e9a6565c9 -r 56d55a9dcc9c README --- a/README Fri Apr 08 03:26:38 2011 +0200 +++ b/README Fri Apr 08 05:59:24 2011 +0200 @@ -12,7 +12,8 @@ You can clone the tazpanel repo into /var/www/tazpanel and work on this copy or clone it someweher esle and 'make install'. After, add tazpanel to your /etc/hosts, type './tazpanel start' to start the server and go to the -URL: http://tazpanel:8090 +URL: http://tazpanel:8090 Panel user and password is defined in httpd.conf +and default is root:root i18n @@ -51,16 +52,20 @@ in an other script you can eventually creat a new CGI page and update all links, but please to talk to the AUTHORS before. - * index.cgi Main Tazpanel CGI script (some stuff may be splited - into users.cgi, boot.cgi, etc if too big or slow) - * network.cgi All related stuff to networking (eth, wifi, servives) - * pkgs.cgi Tazpkg packages CGI interface - * settings.cgi System settings such as time, users accounts, locales - * live.cgi All tools related to Live systems (CD, USB, Frugal) + * index.cgi Main Tazpanel CGI script (some stuff may be splited + into users.cgi, boot.cgi, etc if too big or slow) + * network.cgi All related stuff to networking (eth, wifi, servives) + * pkgs.cgi Tazpkg packages CGI interface + * system.cgi System settings and services such as time, users + accounts, locales or daemons management + * live.cgi All tools related to Live systems (CD, USB, Frugal) + * hardware.cgi Devices drivers, firmware, printing For common function have a look to lib/libtazpanel you may founf functions yoou need already coded such as xhtml_header to get the style header.html -in you CGI script. For the loading message you can use loading_msg +in you CGI script. For the loading message you can use loading_msg. When +cat is used: `gettext "Text to translate"` + Web server ---------- @@ -73,11 +78,3 @@ Or use tazpanel cmdline: # ./tazpanel start - - -Quick notes ------------ - - Panel password is defined in httpd.conf - When cat is used: `gettext "Text to translate"` - Devel can run the web server with root in the src tree diff -r 5b7e9a6565c9 -r 56d55a9dcc9c TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TODO Fri Apr 08 05:59:24 2011 +0200 @@ -0,0 +1,13 @@ + + + * Add full support for undigest to pkgs.cgi + * Add support for geniso2usb in live.cgi + * Entry to change user password in settings.cgi + * Create a step-by-step Live system builder (ending with an + ISO or USB install) + * Radically improve hardware.cgi using tazhw capabilities, install + drivers and firmware, setup printers and manage devices (mount, + umount, format, backup with dd or ?) + * Improve boot.cgi to handle theming GRUB, fbsplash and Slim and + improve rcS.conf. + * Handle start-stop-restart daemons and check status in system.cgi diff -r 5b7e9a6565c9 -r 56d55a9dcc9c hardware.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hardware.cgi Fri Apr 08 05:59:24 2011 +0200 @@ -0,0 +1,92 @@ +#!/bin/sh +# +# Hardware part of TazPanel - Devices, drivers, printing +# +# Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3 +# +echo "Content-Type: text/html" +echo "" + +# Common functions from libtazpanel +. lib/libtazpanel +get_config + +# Include gettext helper script. +. /usr/bin/gettext.sh + +# Export package name for gettext. +TEXTDOMAIN='tazpanel' +export TEXTDOMAIN + +TITLE="- Hardware" + +# +# Commands +# + +case "$QUERY_STRING" in + print*) + echo "TODO" ;; + *) + # + # Default to summary with mounted filesystem, loaded modules + # + xhtml_header + cat << EOT +
+

`gettext "Drivers & Devices"`

+

`gettext "Manage your computer hardware`

+
+EOT + echo '
'
+			fdisk -l | fgrep Disk
+		echo '
' + echo '

Filesystem usage statistics

' + echo '
'
+			df -h | grep ^/dev
+		echo '
' + echo '

Loaded kernel modules

' + # We may want modinfi output + + case "$QUERY_STRING" in + modinfo=*) + mod=${QUERY_STRING#modinfo=} + gettext "Detailled information for module:"; echo " $mod" + echo '
'
+				modinfo $mod
+				echo '
' ;; + rmmod=*) + mod=${QUERY_STRING#rmmod=} + modprobe -r $mod ;; + esac + cat << EOT + `table_start` + + `gettext "Module"` + `gettext "Size"` + `gettext "Used"` + `gettext "by"` + +EOT + # Get the list of modules and link to modinfo + lsmod | grep ^[a-z] | while read MOD SIZE USED BY + do + cat << EOT + + $MOD + $SIZE + $USED + `echo $BY | sed s/","/" "/g` + +EOT + done + table_end + echo '

lspci

' + echo '
'
+			lspci
+		echo '
' + ;; +esac + +xhtml_footer +exit 0 diff -r 5b7e9a6565c9 -r 56d55a9dcc9c index.cgi --- a/index.cgi Fri Apr 08 03:26:38 2011 +0200 +++ b/index.cgi Fri Apr 08 05:59:24 2011 +0200 @@ -49,67 +49,8 @@
 `cat /etc/init.d/local.sh`
 
- EOT ;; - hardware|modinfo=*) - # - # Hardware drivers, devices, filesystem, screen - # - TITLE="- Hardware" - xhtml_header - cat << EOT -
-

`gettext "Drivers & Devices"`

-

`gettext "Manage your computer hardware`

-
-EOT - echo '
'
-			fdisk -l | fgrep Disk
-		echo '
' - echo '

Filesystem usage statistics

' - echo '
'
-			df -h | grep ^/dev
-		echo '
' - echo '

Loaded kernel modules

' - # We may want modinfi output - - case "$QUERY_STRING" in - modinfo=*) - mod=${QUERY_STRING#modinfo=} - gettext "Detailled information for module:"; echo " $mod" - echo '
'
-				modinfo $mod
-				echo '
' ;; - rmmod=*) - mod=${QUERY_STRING#rmmod=} - modprobe -r $mod ;; - esac - table_start - cat << EOT - - `gettext "Module"` - `gettext "Size"` - `gettext "Used"` - `gettext "by"` - -EOT - # Get the list of modules and link to modinfo - lsmod | grep ^[a-z] | while read line - do - mod=`echo "$line" | awk '{print $1}'` - echo '' - echo "$mod" - echo "$line" | awk '{print "", $2, "", - "", $3, "", "", $4, ""}' - echo '' - done - table_end - echo '

lspci

' - echo '
'
-			lspci
-		echo '
' - ;; *) # # Default xHTML content diff -r 5b7e9a6565c9 -r 56d55a9dcc9c lib/libtazpanel --- a/lib/libtazpanel Fri Apr 08 03:26:38 2011 +0200 +++ b/lib/libtazpanel Fri Apr 08 05:59:24 2011 +0200 @@ -94,7 +94,6 @@ cat << EOT -`gettext "Go up"` EOT } diff -r 5b7e9a6565c9 -r 56d55a9dcc9c pkgs.cgi --- a/pkgs.cgi Fri Apr 08 03:26:38 2011 +0200 +++ b/pkgs.cgi Fri Apr 08 05:59:24 2011 +0200 @@ -36,12 +36,12 @@ cut -f 1,2,3,5 -d "|" | while read PACKAGE VERSION SHORT_DESC WEB_SITE do echo '' - if [ -d $INSTALLED/$PACKAGE ]; then - echo -e "\n + if [ -d $INSTALLED/${PACKAGE% } ]; then + echo -e "\n $PACKAGE" else - echo -e "\n + echo -e "\n $PACKAGE" fi echo "$VERSION" @@ -162,17 +162,17 @@

`gettext "My packages"`

-
- `gettext "Selection:"` - -
-
- `gettext "List:"` - - +
+ `gettext "Selection:"` + +
+
+ `gettext "List:"` + + +
EOT - echo '
' table_start table_head for pkg in * diff -r 5b7e9a6565c9 -r 56d55a9dcc9c styles/default/header.html --- a/styles/default/header.html Fri Apr 08 03:26:38 2011 +0200 +++ b/styles/default/header.html Fri Apr 08 05:59:24 2011 +0200 @@ -16,7 +16,8 @@
- + +
diff -r 5b7e9a6565c9 -r 56d55a9dcc9c styles/default/style.css --- a/styles/default/style.css Fri Apr 08 03:26:38 2011 +0200 +++ b/styles/default/style.css Fri Apr 08 05:59:24 2011 +0200 @@ -171,6 +171,7 @@ table a { color: #000; } table a:hover { color: #666; } +td.small { min-width: 60px; } td.pkg { max-width: 160px; } td.desc { max-width: 300px; }