tazpanel rev 151

boot.cgi: Add grub page configuration
author Christophe Lincoln <pankso@slitaz.org>
date Mon Apr 18 02:44:54 2011 +0200 (2011-04-18)
parents 3e240532b3db
children 29a4a55db6e3
files boot.cgi data/tazpanel.conf lib/libtazpanel
line diff
     1.1 --- a/boot.cgi	Mon Apr 18 01:00:41 2011 +0200
     1.2 +++ b/boot.cgi	Mon Apr 18 02:44:54 2011 +0200
     1.3 @@ -171,33 +171,84 @@
     1.4  			echo '</td></tr>'
     1.5  		done
     1.6  		table_end ;;
     1.7 +	*\ grub\ *)
     1.8 +		if [ "$(GET splash)" ]; then
     1.9 +			default=$(GET default)
    1.10 +			timeout=$(GET timeout)
    1.11 +			splash=$(GET splash)
    1.12 +			sed -i \
    1.13 +				-e s"/default .*/default $default/" \
    1.14 +				-e s"/timeout .*/timeout $timeout/" \
    1.15 +				-e s"#splashimage=.*#splashimage=$splash#" \
    1.16 +				/boot/grub/menu.lst
    1.17 +		fi
    1.18 +		default=$(cat /boot/grub/menu.lst | grep ^default | cut -d " " -f 2)
    1.19 +		timeout=$(cat /boot/grub/menu.lst | grep ^timeout | cut -d " " -f 2)
    1.20 +		splash=$(cat /boot/grub/menu.lst | grep ^splashimage | cut -d "=" -f 2)
    1.21 +		xhtml_header
    1.22 +				cat << EOT
    1.23 +<div id="wrapper">
    1.24 +	<h2>$(gettext "GRUB Boot loader")</h2>
    1.25 +	<p>
    1.26 +		$(gettext "The first application stated when computer got power on")
    1.27 +	</p>
    1.28 +</div>
    1.29 +
    1.30 +<form method="get" action="$SCRIPT_NAME">
    1.31 +	<input type="hidden" name="grub" />
    1.32 +<pre>
    1.33 +Default entry : <input type="text" name="default" value="$default" />
    1.34 +
    1.35 +Timeout       : <input type="text" name="timeout" value="$timeout" />
    1.36 +
    1.37 +Splash image  : <input type="text" name="splash" value="$splash" size="40" />
    1.38 +</pre>
    1.39 +	<input type="submit" value="$(gettext "Change")" />
    1.40 +	<a class="button" href="index.cgi?file=/boot/grub/menu.lst">
    1.41 +		<img src="$IMAGES/text.png" />View or edit menu.lst</a>
    1.42 +</form>
    1.43 +
    1.44 +<h3>$(gettext "Boot entries")</h3>
    1.45 +EOT
    1.46 +	entry='-1'
    1.47 +	grep ^title /boot/grub/menu.lst | while read title
    1.48 +	do
    1.49 +		entry=$(($entry + 1))
    1.50 +		echo "<strong>$(gettext "Entry") $entry</strong>"
    1.51 +		echo '<pre>'
    1.52 +		grep -A 2 "$title" /boot/grub/menu.lst
    1.53 +		echo '</pre>'
    1.54 +	done
    1.55 +	# Here we could check if an entry for gpxe is present if not
    1.56 +	# display a form to add it.
    1.57 +	[ -f "/boot/gpxe" ] && echo "<h3>gPXE</h3>" && \
    1.58 +		gettext "Web boot is avalaible with gPXE"
    1.59 +	;;
    1.60  	*)
    1.61  		#
    1.62  		# Default content with summary
    1.63  		#
    1.64  		. /etc/rcS.conf
    1.65  		xhtml_header
    1.66 -		
    1.67  		cat << EOT
    1.68  <div id="wrapper">
    1.69 -	<h2>`gettext "Boot &amp; Start services"`</h2>
    1.70 +	<h2>$(gettext "Boot &amp; Start services")</h2>
    1.71  	<p>
    1.72 -		`gettext "Everything that happens before user login"` 
    1.73 +		$(gettext "Everything that happens before user login")
    1.74  	</p>
    1.75  </div>
    1.76  <div>
    1.77  	<a class="button" href="$SCRIPT_NAME?log">
    1.78 -		<img src="$IMAGES/text.png" />`gettext "Boot logs"`</a>
    1.79 +		<img src="$IMAGES/text.png" />$(gettext "Boot logs")</a>
    1.80  	<a class="button" href="$SCRIPT_NAME?daemons">
    1.81 -		<img src="$IMAGES/recharge.png" />`gettext "Manage daemons"`</a>
    1.82 +		<img src="$IMAGES/recharge.png" />$(gettext "Manage daemons")</a>
    1.83 +	<a class="button" href="$SCRIPT_NAME?grub">$(gettext "Boot loader")</a>
    1.84  </div>
    1.85  
    1.86  <h3>`gettext "Configuration files"`</h3>
    1.87  <ul>
    1.88  	<li>`gettext "Main configuration file:"`
    1.89  		<a href="index.cgi?file=/etc/rcS.conf">rcS.conf</a></li>
    1.90 -	<li>`gettext "Grub menu:"`
    1.91 -		<a href="index.cgi?file=/boot/grub/menu.lst">menu.lst</a></li>
    1.92  	<li>`gettext "Login manager settings:"`
    1.93  		<a href="index.cgi?file=/etc/slim.conf">slim.conf</a></li>
    1.94  </ul>
     2.1 --- a/data/tazpanel.conf	Mon Apr 18 01:00:41 2011 +0200
     2.2 +++ b/data/tazpanel.conf	Mon Apr 18 02:44:54 2011 +0200
     2.3 @@ -13,7 +13,7 @@
     2.4  FOOTER="/styles/$STYLE/footer.html"
     2.5  
     2.6  # Display some debug messages
     2.7 -DEBUG="0"
     2.8 +DEBUG="1"
     2.9  
    2.10  # Activity log file
    2.11  LOG_FILE="/var/log/slitaz/tazpanel.log"
     3.1 --- a/lib/libtazpanel	Mon Apr 18 01:00:41 2011 +0200
     3.2 +++ b/lib/libtazpanel	Mon Apr 18 02:44:54 2011 +0200
     3.3 @@ -45,7 +45,9 @@
     3.4  
     3.5  # Remove status and ESC char from tazpkg/tazlito commands output
     3.6  filter_taztools_msgs() {
     3.7 -	grep ^[a-zA-Z0-9] | sed s'/\[^Gm]*.//g'
     3.8 +	grep ^[a-zA-Z0-9] | sed \
     3.9 +		-e s'/\[^Gm]*.//g' \
    3.10 +		-e s'@OK@<span class="diff-add">OK</span>@'
    3.11  }
    3.12  
    3.13  # LOG activities