tazpanel rev 49

Update all page with latest functions such as debug, bunch of fixes and adding support for deamons
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 09 00:22:23 2011 +0200 (2011-04-09)
parents 7dfcc2b58b33
children bdb2dbfdba44
files Makefile README TODO doc/tazpanel.html hardware.cgi index.cgi lib/libtazpanel live.cgi network.cgi pkgs.cgi settings.cgi styles/default/footer.html styles/default/header.html styles/default/style.css tazpanel tazpanel.conf
line diff
     1.1 --- a/Makefile	Fri Apr 08 20:22:25 2011 +0200
     1.2 +++ b/Makefile	Sat Apr 09 00:22:23 2011 +0200
     1.3 @@ -3,7 +3,7 @@
     1.4  PREFIX?=/usr
     1.5  SYSCONFDIR?=/etc/slitaz
     1.6  DESTDIR?=
     1.7 -LINGUAS?=fr
     1.8 +LINGUAS?=
     1.9  PANEL?=/var/www/tazpanel
    1.10  
    1.11  VERSION:=$(shell grep ^VERSION tazpanel | cut -d '=' -f 2)
     2.1 --- a/README	Fri Apr 08 20:22:25 2011 +0200
     2.2 +++ b/README	Sat Apr 09 00:22:23 2011 +0200
     2.3 @@ -78,3 +78,6 @@
     2.4  Or use tazpanel cmdline:
     2.5  
     2.6  # ./tazpanel start
     2.7 +
     2.8 +
     2.9 +================================================================================
     3.1 --- a/TODO	Fri Apr 08 20:22:25 2011 +0200
     3.2 +++ b/TODO	Sat Apr 09 00:22:23 2011 +0200
     3.3 @@ -1,3 +1,5 @@
     3.4 +TODO for TazPanel
     3.5 +================================================================================
     3.6  
     3.7  
     3.8  	* Add full support for undigest to pkgs.cgi
     3.9 @@ -11,3 +13,4 @@
    3.10  	* Improve boot.cgi to handle theming GRUB, fbsplash and Slim and
    3.11  	  improve rcS.conf.
    3.12  	* Handle start-stop-restart daemons and check status in system.cgi
    3.13 +
     4.1 --- a/doc/tazpanel.html	Fri Apr 08 20:22:25 2011 +0200
     4.2 +++ b/doc/tazpanel.html	Sat Apr 09 00:22:23 2011 +0200
     4.3 @@ -10,4 +10,220 @@
     4.4  <p>
     4.5  	Get support on the Slitaz <a href="http://forum.slitaz.org/">forum</a>
     4.6  </p>
     4.7 -gn
     4.8 \ No newline at end of file
     4.9 +gni:492
    4.10 +msgid "Latest log entries"
    4.11 +msgstr ""
    4.12 +
    4.13 +#: live.cgi:50
    4.14 +msgid "TODO"
    4.15 +msgstr ""
    4.16 +
    4.17 +#: live.cgi:58
    4.18 +msgid "SliTaz Live Systems"
    4.19 +msgstr ""
    4.20 +
    4.21 +#: live.cgi:59
    4.22 +msgid "Create and manage Live CD or USB SliTaz systems"
    4.23 +msgstr ""
    4.24 +
    4.25 +#: live.cgi:62
    4.26 +msgid "Write a Live CD"
    4.27 +msgstr ""
    4.28 +
    4.29 +#: live.cgi:64
    4.30 +msgid ""
    4.31 +"The command writeiso will generate an ISO image of the\n"
    4.32 +"\tcurrent filesystem as is, including all files in the /home directory.\n"
    4.33 +"\tIt is an easy way to remaster a SliTaz Live system, you just have\n"
    4.34 +"\tto: boot, modify, writeiso."
    4.35 +msgstr ""
    4.36 +
    4.37 +#: live.cgi:70
    4.38 +msgid "Compression type:"
    4.39 +msgstr ""
    4.40 +
    4.41 +#: live.cgi:76
    4.42 +msgid "write ISO"
    4.43 +msgstr ""
    4.44 +
    4.45 +#: live.cgi:79
    4.46 +msgid "Live USB"
    4.47 +msgstr ""
    4.48 +
    4.49 +#: live.cgi:81
    4.50 +msgid ""
    4.51 +"Generate SliTaz LiveUSB media and boot in RAM! Insert a\n"
    4.52 +"\tLiveCD into the cdrom drive, select the correct device and press\n"
    4.53 +"\tGenerate."
    4.54 +msgstr ""
    4.55 +
    4.56 +#: live.cgi:86
    4.57 +msgid "USB Media to use:"
    4.58 +msgstr ""
    4.59 +
    4.60 +#: live.cgi:95
    4.61 +msgid "Not found"
    4.62 +msgstr ""
    4.63 +
    4.64 +#: live.cgi:99
    4.65 +msgid "generate"
    4.66 +msgstr ""
    4.67 +
    4.68 +#: network.cgi:41
    4.69 +msgid "Ethernet connection"
    4.70 +msgstr ""
    4.71 +
    4.72 +#: network.cgi:51
    4.73 +msgid "Wireless connection"
    4.74 +msgstr ""
    4.75 +
    4.76 +#: network.cgi:61
    4.77 +msgid "Networking"
    4.78 +msgstr ""
    4.79 +
    4.80 +#: network.cgi:63
    4.81 +msgid "Manage network connection and services"
    4.82 +msgstr ""
    4.83 +
    4.84 +#: network.cgi:67
    4.85 +msgid "Connection:"
    4.86 +msgstr ""
    4.87 +
    4.88 +#: network.cgi:68
    4.89 +msgid "Start"
    4.90 +msgstr ""
    4.91 +
    4.92 +#: network.cgi:69
    4.93 +msgid "Stop"
    4.94 +msgstr ""
    4.95 +
    4.96 +#: network.cgi:75
    4.97 +msgid "Output of ifconfig"
    4.98 +msgstr ""
    4.99 +
   4.100 +#: lib/libtazpanel:39
   4.101 +msgid "Interface"
   4.102 +msgstr ""
   4.103 +
   4.104 +#: lib/libtazpanel:41
   4.105 +msgid "Status"
   4.106 +msgstr ""
   4.107 +
   4.108 +#: lib/libtazpanel:42
   4.109 +msgid "IP Address"
   4.110 +msgstr ""
   4.111 +
   4.112 +msgid "Summary"
   4.113 +msgstr ""
   4.114 +
   4.115 +#: index.cgi:186
   4.116 +msgid "Uptime:"
   4.117 +msgstr ""
   4.118 +
   4.119 +#: index.cgi:189
   4.120 +msgid "Memory in Mb"
   4.121 +msgstr ""
   4.122 +
   4.123 +#: index.cgi:196
   4.124 +msgid "Network status"
   4.125 +msgstr ""
   4.126 +
   4.127 +#: index.cgi:199
   4.128 +msgid "Filesystem usage statistics"
   4.129 +msgstr ""
   4.130 +
   4.131 +#: index.cgi:204
   4.132 +msgid "System language"
   4.133 +msgstr ""
   4.134 +
   4.135 +#: index.cgi:215
   4.136 +#, sh-format
   4.137 +msgid ""
   4.138 +"You must logout and login again your current\n"
   4.139 +"\t\t\t\tsession to use $new_locale language."
   4.140 +msgstr ""
   4.141 +
   4.142 +#: index.cgi:218
   4.143 +#, sh-format
   4.144 +msgid "Current system locales: "
   4.145 +msgstr ""
   4.146 +
   4.147 +#: index.cgi:224
   4.148 +msgid "Avalaible locales:"
   4.149 +msgstr ""
   4.150 +
   4.151 +#: index.cgi:229
   4.152 +msgid "Generated and use"
   4.153 +msgstr ""
   4.154 +
   4.155 +#: pkgs.cgi:64
   4.156 +msgid "Last recharge        : "
   4.157 +msgstr ""
   4.158 +
   4.159 +#: pkgs.cgi:74
   4.160 +msgid "Installed packages   : "
   4.161 +msgstr ""
   4.162 +
   4.163 +#: pkgs.cgi:76
   4.164 +msgid "Mirrored packages    : "
   4.165 +msgstr ""
   4.166 +
   4.167 +#: pkgs.cgi:78
   4.168 +msgid "Upgradeable packages : "
   4.169 +msgstr ""
   4.170 +
   4.171 +#: pkgs.cgi:80
   4.172 +msgid "Installed files      : "
   4.173 +msgstr ""
   4.174 +
   4.175 +#: pkgs.cgi:82
   4.176 +msgid "Blocked packages     : "
   4.177 +msgstr ""
   4.178 +
   4.179 +#: pkgs.cgi:108
   4.180 +msgid "Search"
   4.181 +msgstr ""
   4.182 +
   4.183 +#: pkgs.cgi:119
   4.184 +msgid "Version"
   4.185 +msgstr ""
   4.186 +
   4.187 +#: pkgs.cgi:120
   4.188 +msgid "Description"
   4.189 +msgstr ""
   4.190 +
   4.191 +#: pkgs.cgi:121
   4.192 +msgid "Web"
   4.193 +msgstr ""
   4.194 +
   4.195 +#: pkgs.cgi:152 pkgs.cgi:167 pkgs.cgi:185 pkgs.cgi:204
   4.196 +msgid "Selection:"
   4.197 +msgstr ""
   4.198 +
   4.199 +#: pkgs.cgi:156 pkgs.cgi:172 pkgs.cgi:191 pkgs.cgi:210
   4.200 +msgid "List:"
   4.201 +msgstr ""
   4.202 +
   4.203 +#: pkgs.cgi:176 pkgs.cgi:195 pkgs.cgi:213 pkgs.cgi:230 pkgs.cgi:312
   4.204 +#: pkgs.cgi:369 pkgs.cgi:400 pkgs.cgi:484
   4.205 +msgid "My packages"
   4.206 +msgstr ""
   4.207 +
   4.208 +#: pkgs.cgi:188 pkgs.cgi:207
   4.209 +msgid "Toogle all"
   4.210 +msgstr ""
   4.211 +
   4.212 +#: pkgs.cgi:265
   4.213 +msgid "Category:"
   4.214 +msgstr ""
   4.215 +
   4.216 +#: pkgs.cgi:284
   4.217 +msgid "Search packages"
   4.218 +msgstr ""
   4.219 +
   4.220 +#: pkgs.cgi:300
   4.221 +msgid "Recharge"
   4.222 +msgstr ""
   4.223 +
   4.224 +#: pkgs.cgi:305
   4.225 +msgidplea
   4.226 \ No newline at end of file
     5.1 --- a/hardware.cgi	Fri Apr 08 20:22:25 2011 +0200
     5.2 +++ b/hardware.cgi	Sat Apr 09 00:22:23 2011 +0200
     5.3 @@ -32,6 +32,7 @@
     5.4  		# Default to summary with mounted filesystem, loaded modules
     5.5  		#
     5.6  		xhtml_header
     5.7 +		debug_info
     5.8  		cat << EOT
     5.9  <div id="wrapper">
    5.10  	<h2>`gettext "Drivers &amp; Devices"`</h2>
    5.11 @@ -46,8 +47,7 @@
    5.12  			df -h | grep ^/dev
    5.13  		echo '</pre>'
    5.14  		echo '<h3>Loaded kernel modules</h3>'
    5.15 -		# We may want modinfi output
    5.16 -		
    5.17 +		# Request may be modinfo output
    5.18  		case "$QUERY_STRING" in
    5.19  			modinfo=*)
    5.20  				mod=${QUERY_STRING#modinfo=}
     6.1 --- a/index.cgi	Fri Apr 08 20:22:25 2011 +0200
     6.2 +++ b/index.cgi	Sat Apr 09 00:22:23 2011 +0200
     6.3 @@ -21,41 +21,27 @@
     6.4  export TEXTDOMAIN
     6.5  
     6.6  #
     6.7 +# Things to do before displaying the page
     6.8 +#
     6.9 +
    6.10 +case "$QUERY_STRING" in
    6.11 +	panel-pass=*)
    6.12 +		new=${QUERY_STRING#*=}
    6.13 +		sed -i s@/:root:.*@/:root:$new@ $HTTPD_CONF ;;
    6.14 +	*) continue ;;
    6.15 +esac
    6.16 +
    6.17 +#
    6.18  # Commands
    6.19  #
    6.20  
    6.21  case "$QUERY_STRING" in
    6.22 -	boot)
    6.23 -		#
    6.24 -		# Everything until user login
    6.25 -		#
    6.26 -		. /etc/rcS.conf
    6.27 -		TITLE="- Boot"
    6.28 -		xhtml_header
    6.29 -		cat << EOT
    6.30 -<div id="wrapper">
    6.31 -	<h2>`gettext "Boot &amp; startup"`</h2>
    6.32 -	<p>
    6.33 -		`gettext "Everything that appends before user login."` 
    6.34 -	</p>
    6.35 -</div>
    6.36 -
    6.37 -<h3>`gettext "Kernel cmdline"`</h3>
    6.38 -<pre>
    6.39 -`cat /proc/cmdline`
    6.40 -</pre>
    6.41 -
    6.42 -<h3>`gettext "Local startup commands"`</h3>
    6.43 -<pre>
    6.44 -`cat /etc/init.d/local.sh`
    6.45 -</pre>
    6.46 -EOT
    6.47 -		;;
    6.48  	*)
    6.49  		#
    6.50  		# Default xHTML content
    6.51  		#
    6.52  		xhtml_header
    6.53 +		debug_info
    6.54  		case "$QUERY_STRING" in
    6.55  			gen-locale=*)
    6.56  				new_locale=${QUERY_STRING#gen-locale=} ;;
    6.57 @@ -88,6 +74,15 @@
    6.58  <pre>
    6.59  `df -h | grep ^/dev`
    6.60  </pre>
    6.61 +
    6.62 +<h3>`gettext "Panel settings"`</h3>
    6.63 +<form method="get" action="$SCRIPT_NAME">
    6.64 +	<div>
    6.65 +		<input type="submit" value="`gettext "Change Panel password"`" />
    6.66 +		<input type="password" name="panel-pass"/>
    6.67 +	</div>
    6.68 +</form>
    6.69 +
    6.70  EOT
    6.71  		;;
    6.72  esac
     7.1 --- a/lib/libtazpanel	Fri Apr 08 20:22:25 2011 +0200
     7.2 +++ b/lib/libtazpanel	Sat Apr 09 00:22:23 2011 +0200
     7.3 @@ -20,6 +20,13 @@
     7.4  		exit 1
     7.5  }
     7.6  
     7.7 +# DEBUG mode
     7.8 +debug_info() {
     7.9 +	if [ $DEBUG == "1" ]; then
    7.10 +		echo "<div class='debug'>$REQUEST_METHOD ${QUERY_STRING}</div>"
    7.11 +	fi
    7.12 +}
    7.13 +
    7.14  # Network interface status
    7.15  interface_status() {
    7.16  	if 	ifconfig | grep -A 1 $i | grep -q inet; then
     8.1 --- a/live.cgi	Fri Apr 08 20:22:25 2011 +0200
     8.2 +++ b/live.cgi	Sat Apr 09 00:22:23 2011 +0200
     8.3 @@ -2,6 +2,8 @@
     8.4  #
     8.5  # CGI interface for SliTaz Live systems using Tazlito and TazUSB.
     8.6  #
     8.7 +# Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
     8.8 +#
     8.9  echo "Content-Type: text/html"
    8.10  echo ""
    8.11  
    8.12 @@ -25,12 +27,12 @@
    8.13  case "$QUERY_STRING" in
    8.14  	write-iso=*)
    8.15  		comp=${QUERY_STRING#write-iso=}
    8.16 -		xterm $XTERM_OPTS \
    8.17 +		$TERMINAL $TERM_OPTS \
    8.18  			-T "write-iso" \
    8.19  			-e "tazlito writeiso $comp" & ;;
    8.20  	gen-liveusb=*)
    8.21  		dev=`httpd -d ${QUERY_STRING#gen-liveusb=}`
    8.22 -		xterm $XTERM_OPTS \
    8.23 +		$TERMINAL $TERM_OPTS \
    8.24  			-T "Tazusb gen-liveusb" \
    8.25  			-e "tazusb gen-liveusb $dev; \
    8.26  				gettext \"ENTER to quit\"; read i" & ;;
    8.27 @@ -46,6 +48,7 @@
    8.28  	create)
    8.29  		#
    8.30  		# Create a flavor file and ISO in option with all settings
    8.31 +		# Step by step interface and store files in cache.
    8.32  		#
    8.33  		gettext "TODO" ;;
    8.34  	*)
     9.1 --- a/network.cgi	Fri Apr 08 20:22:25 2011 +0200
     9.2 +++ b/network.cgi	Sat Apr 09 00:22:23 2011 +0200
     9.3 @@ -39,6 +39,7 @@
     9.4  	eth)
     9.5  		# Wired connections settings
     9.6  		xhtml_header
     9.7 +		debug_info
     9.8  		cat << EOT
     9.9  <h2>`gettext "Ethernet connection`</h2>
    9.10  <pre>
    9.11 @@ -49,6 +50,7 @@
    9.12  	wifi)
    9.13  		# Wireless connections settings
    9.14  		xhtml_header
    9.15 +		debug_info
    9.16  		cat << EOT
    9.17  <h2>`gettext "Wireless connection`</h2>
    9.18  <pre>
    9.19 @@ -59,6 +61,7 @@
    9.20  	*)
    9.21  		# Main Network page starting with a summary
    9.22  		xhtml_header
    9.23 +		debug_info
    9.24  		cat << EOT
    9.25  <h2>`gettext "Networking`</h2>
    9.26  <p>
    10.1 --- a/pkgs.cgi	Fri Apr 08 20:22:25 2011 +0200
    10.2 +++ b/pkgs.cgi	Sat Apr 09 00:22:23 2011 +0200
    10.3 @@ -21,14 +21,10 @@
    10.4  TEXTDOMAIN='tazpanel'
    10.5  export TEXTDOMAIN
    10.6  
    10.7 -# xHTML 5 header
    10.8 +# xHTML 5 header with special side bar fo categories.
    10.9  TITLE="- Packages"
   10.10  xhtml_header | sed 's/id="content"/id="content-sidebar"/'
   10.11 -
   10.12 -# DEBUG mode
   10.13 -if [ $DEBUG == "1" ]; then
   10.14 -	echo "<p class='debug'>$REQUEST_METHOD ${QUERY_STRING}</p>"
   10.15 -fi
   10.16 +debug_info
   10.17  
   10.18  # We need packages information for list and search
   10.19  parse_packages_desc() {
   10.20 @@ -73,7 +69,7 @@
   10.21  	ls $INSTALLED | wc -l
   10.22  	gettext "Mirrored packages    : "
   10.23  	cat $LOCALSTATE/packages.list | wc -l
   10.24 -	gettext "up packages : "
   10.25 +	gettext "Upgradeable packages : "
   10.26  	cat $LOCALSTATE/packages.up | wc -l
   10.27  	#gettext "Installed files      : "
   10.28  	#cat $INSTALLED/*/files.list | wc -l
    11.1 --- a/settings.cgi	Fri Apr 08 20:22:25 2011 +0200
    11.2 +++ b/settings.cgi	Sat Apr 09 00:22:23 2011 +0200
    11.3 @@ -2,8 +2,9 @@
    11.4  #
    11.5  # System settings CGI interface: user, locale, keyboard, date. Since we
    11.6  # dont have multiple page here there is only one case used to get commands
    11.7 -# values and the full content is following directly. 
    11.8 +# values and the full content is following directly.
    11.9  #
   11.10 +# Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
   11.11  #
   11.12  echo "Content-Type: text/html"
   11.13  echo ""
   11.14 @@ -78,6 +79,7 @@
   11.15  # Default xHTML content
   11.16  #
   11.17  xhtml_header
   11.18 +debug_info
   11.19  cat << EOT
   11.20  <div id="wrapper">
   11.21  	<h2>`gettext "System settings"`</h2>
    12.1 --- a/styles/default/footer.html	Fri Apr 08 20:22:25 2011 +0200
    12.2 +++ b/styles/default/footer.html	Sat Apr 09 00:22:23 2011 +0200
    12.3 @@ -3,7 +3,7 @@
    12.4  </div>
    12.5  
    12.6  <div id="footer">
    12.7 -	<a href="http://www.slitaz.org/">SliTaz</a>
    12.8 +	<a href="http://www.slitaz.org/">SliTaz Panel</a>
    12.9  </div>
   12.10  
   12.11  </body>
    13.1 --- a/styles/default/header.html	Fri Apr 08 20:22:25 2011 +0200
    13.2 +++ b/styles/default/header.html	Sat Apr 09 00:22:23 2011 +0200
    13.3 @@ -25,7 +25,7 @@
    13.4  		<a href="/network.cgi">Network</a>
    13.5  		<a href="/settings.cgi">Settings</a>
    13.6  		<a href="/live.cgi">Live</a>
    13.7 -		<a href="/index.cgi?boot">Boot</a>
    13.8 +		<a href="/boot.cgi">Boot</a>
    13.9  		<a href="/hardware.cgi">Hardware</a>
   13.10  	</div>
   13.11  </div>
    14.1 --- a/styles/default/style.css	Fri Apr 08 20:22:25 2011 +0200
    14.2 +++ b/styles/default/style.css	Sat Apr 09 00:22:23 2011 +0200
    14.3 @@ -130,7 +130,7 @@
    14.4  	padding: 4px;
    14.5  	height: 17px;
    14.6  	margin: 0;
    14.7 -	width: 190px;
    14.8 +	width: 200px;
    14.9  	border-top-left-radius: 4px;
   14.10  	border-bottom-left-radius: 4px;
   14.11  }
   14.12 @@ -206,7 +206,7 @@
   14.13  	border: 1px solid #999;
   14.14  }
   14.15  
   14.16 -input[type=text] { height: 18px; }
   14.17 +input[type=text], input[type=password] { height: 18px; }
   14.18  
   14.19  div.scroll { height: 200px; overflow: auto;
   14.20  	border: 1px solid #ddd; }
    15.1 --- a/tazpanel	Fri Apr 08 20:22:25 2011 +0200
    15.2 +++ b/tazpanel	Sat Apr 09 00:22:23 2011 +0200
    15.3 @@ -2,7 +2,8 @@
    15.4  #
    15.5  # Tiny Tazpanel cmdline interface
    15.6  #
    15.7 -
    15.8 +# Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
    15.9 +#
   15.10  VERSION=1.0
   15.11  
   15.12  # Get the configuration file and functions
    16.1 --- a/tazpanel.conf	Fri Apr 08 20:22:25 2011 +0200
    16.2 +++ b/tazpanel.conf	Sat Apr 09 00:22:23 2011 +0200
    16.3 @@ -1,5 +1,7 @@
    16.4  # tazpanel.conf: SliTaz Web Control Panel configuration
    16.5  #
    16.6 +# Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
    16.7 +#
    16.8  
    16.9  # Panel location and theme
   16.10  PANEL="/var/www/tazpanel"
   16.11 @@ -11,10 +13,11 @@
   16.12  FOOTER="/styles/$STYLE/footer.html"
   16.13  
   16.14  # Display some debug message
   16.15 -DEBUG="0"
   16.16 +DEBUG="1"
   16.17  
   16.18 -# Xterm options
   16.19 -XTERM_OPTS="-geometry 80x16-0+24 -bg black -fg white"
   16.20 +# Terminal settings
   16.21 +TERMINAL="xterm"
   16.22 +TERM_OPTS="-geometry 80x16-0+24 -bg black -fg white"
   16.23  
   16.24  # Generic page loading message
   16.25  LOADING_MSG="Loading..."