tazpanel rev 120

Move config file to data/, improve panel activity with syntax_highliter and move diff colors to CSS
author Christophe Lincoln <pankso@slitaz.org>
date Fri Apr 15 12:36:09 2011 +0200 (2011-04-15)
parents 4c348c1d521e
children eeada2e6506d
files data/tazpanel.conf index.cgi lib/libtazpanel styles/default/style.css tazpanel.conf
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/data/tazpanel.conf	Fri Apr 15 12:36:09 2011 +0200
     1.3 @@ -0,0 +1,34 @@
     1.4 +# tazpanel.conf: SliTaz Web Control Panel configuration
     1.5 +#
     1.6 +# Copyright (C) 2011 SliTaz GNU/Linux - BSD License
     1.7 +#
     1.8 +
     1.9 +# Panel location and theme
    1.10 +PANEL="/var/www/tazpanel"
    1.11 +STYLE="default"
    1.12 +
    1.13 +# Absolute path to images and xHTML skel from $PANEL
    1.14 +IMAGES="/styles/$STYLE/images"
    1.15 +HEADER="/styles/$STYLE/header.html"
    1.16 +FOOTER="/styles/$STYLE/footer.html"
    1.17 +
    1.18 +# Display some debug messages
    1.19 +DEBUG="0"
    1.20 +
    1.21 +# Activity log file
    1.22 +LOG_FILE="/var/log/slitaz/tazpanel.log"
    1.23 +
    1.24 +# Terminal settings
    1.25 +TERMINAL="xterm"
    1.26 +TERM_OPTS="-geometry 80x16-0+24 -bg black -fg white"
    1.27 +
    1.28 +# Generic page loading message
    1.29 +LOADING_MSG="Loading..."
    1.30 +
    1.31 +# Busybox HTTP daemon config
    1.32 +HTTPD_CONF="/etc/slitaz/httpd.conf"
    1.33 +HTTPD_PORT="82"
    1.34 +
    1.35 +# Shared Tazpkg paths
    1.36 +LOCALSTATE="/var/lib/tazpkg"
    1.37 +INSTALLED="$LOCALSTATE/installed"
     2.1 --- a/index.cgi	Fri Apr 15 12:18:00 2011 +0200
     2.2 +++ b/index.cgi	Fri Apr 15 12:36:09 2011 +0200
     2.3 @@ -139,8 +139,8 @@
     2.4  </pre>
     2.5  
     2.6  <h3>`gettext "Panel Activity"`</h3>
     2.7 -<pre>
     2.8 -$(cat $LOG_FILE | tail -n 6)
     2.9 +<pre id="panel-activity">
    2.10 +$(cat $LOG_FILE | tail -n 8 | sort -r | syntax_highlighter activity)
    2.11  </pre>
    2.12  
    2.13  EOT
     3.1 --- a/lib/libtazpanel	Fri Apr 15 12:18:00 2011 +0200
     3.2 +++ b/lib/libtazpanel	Fri Apr 15 12:36:09 2011 +0200
     3.3 @@ -35,9 +35,11 @@
     3.4  				-e s"#\"\([^']*\)\"#<span class='sh-val'>\0</span>#"g ;;
     3.5  		diff)
     3.6  			sed -e 's|&|\&amp;|g' -e 's|<|\&lt;|g' -e 's|>|\&gt;|g' \
     3.7 -				-e s"#^-\([^']*\).#<span style='color: red;'>\0</span>#"g \
     3.8 -				-e s"#^+\([^']*\).#<span style='color: green;'>\0</span>#"g \
     3.9 -				-e s"#@@\([^']*\)@@#<span style='color: blue;'>@@\1@@</span>#"g ;;
    3.10 +				-e s"#^-\([^']*\).#<span class='diff-rm'>\0</span>#"g \
    3.11 +				-e s"#^+\([^']*\).#<span class='diff-add'>\0</span>#"g \
    3.12 +				-e s"#@@\([^']*\)@@#<span class='diff-at'>@@\1@@</span>#"g ;;
    3.13 +		activity)
    3.14 +			sed s"#^\([^']*:\)#<span class='activity-log''>\0</span>#"g ;;
    3.15  	esac
    3.16  }
    3.17  
     4.1 --- a/styles/default/style.css	Fri Apr 15 12:18:00 2011 +0200
     4.2 +++ b/styles/default/style.css	Fri Apr 15 12:36:09 2011 +0200
     4.3 @@ -101,6 +101,13 @@
     4.4  #content-sidebar { margin: 20px 120px 20px 40px; }
     4.5  #wrapper { margin: 10px 0 20px; }
     4.6  
     4.7 +#actions {
     4.8 +	height: 20px;
     4.9 +	margin: 16px 0;
    4.10 +}
    4.11 +
    4.12 +#actions p { margin: 6px 0; }
    4.13 +
    4.14  .search {
    4.15  	position: absolute;
    4.16  	right: 40px;
    4.17 @@ -135,13 +142,6 @@
    4.18  	border-bottom-left-radius: 4px;
    4.19  }
    4.20  
    4.21 -#actions {
    4.22 -	height: 20px;
    4.23 -	margin: 16px 0;
    4.24 -}
    4.25 -
    4.26 -#actions p { margin: 6px 0; }
    4.27 -
    4.28  .box {
    4.29  	margin: 10px 0;
    4.30  	padding: 12px;
    4.31 @@ -195,6 +195,10 @@
    4.32  span.conf-var { color: #392600; }
    4.33  span.conf-val, span.sh-val { color: #f35a00; }
    4.34  span.sh-comment { color: #b20000; }
    4.35 +span.activity-log { color: #888; font-size: 95%; }
    4.36 +span.diff-rm { color: red; }
    4.37 +span.diff-add { color: green; }
    4.38 +span.diff-at { color: blue; }
    4.39  
    4.40  /* Misc */
    4.41  
     5.1 --- a/tazpanel.conf	Fri Apr 15 12:18:00 2011 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,34 +0,0 @@
     5.4 -# tazpanel.conf: SliTaz Web Control Panel configuration
     5.5 -#
     5.6 -# Copyright (C) 2011 SliTaz GNU/Linux - BSD License
     5.7 -#
     5.8 -
     5.9 -# Panel location and theme
    5.10 -PANEL="/var/www/tazpanel"
    5.11 -STYLE="default"
    5.12 -
    5.13 -# Absolute path to images and xHTML skel from $PANEL
    5.14 -IMAGES="/styles/$STYLE/images"
    5.15 -HEADER="/styles/$STYLE/header.html"
    5.16 -FOOTER="/styles/$STYLE/footer.html"
    5.17 -
    5.18 -# Display some debug messages
    5.19 -DEBUG="0"
    5.20 -
    5.21 -# Activity log file
    5.22 -LOG_FILE="/var/log/slitaz/tazpanel.log"
    5.23 -
    5.24 -# Terminal settings
    5.25 -TERMINAL="xterm"
    5.26 -TERM_OPTS="-geometry 80x16-0+24 -bg black -fg white"
    5.27 -
    5.28 -# Generic page loading message
    5.29 -LOADING_MSG="Loading..."
    5.30 -
    5.31 -# Busybox HTTP daemon config
    5.32 -HTTPD_CONF="/etc/slitaz/httpd.conf"
    5.33 -HTTPD_PORT="82"
    5.34 -
    5.35 -# Shared Tazpkg paths
    5.36 -LOCALSTATE="/var/lib/tazpkg"
    5.37 -INSTALLED="$LOCALSTATE/installed"