# HG changeset patch # User Christophe Lincoln # Date 1302218257 -7200 # Node ID 13b1019d68d8189255c3154d739974829372dd54 # Parent af4b1f0b31108081951c81a4f3480bb03feb4639 Add a loading mechanism for page that take long to be generated diff -r af4b1f0b3110 -r 13b1019d68d8 README --- a/README Thu Apr 07 03:12:38 2011 +0200 +++ b/README Fri Apr 08 01:17:37 2011 +0200 @@ -7,6 +7,14 @@ and all theming is done with standard CSS 3. +Use it! +------ +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 + + i18n ---- TazPanel have been coded from the beginning with gettext support. Please @@ -43,11 +51,16 @@ 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) - * pkgs.cgi Tazpkg packages CGI interface - * 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 + * settings.cgi System settings such as time, users accounts, locales + * live.cgi All tools related to Live systems (CD, USB, Frugal) + +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 Web server ---------- diff -r af4b1f0b3110 -r 13b1019d68d8 data/tazpanel.png Binary file data/tazpanel.png has changed diff -r af4b1f0b3110 -r 13b1019d68d8 lib/libtazpanel --- a/lib/libtazpanel Thu Apr 07 03:12:38 2011 +0200 +++ b/lib/libtazpanel Fri Apr 08 01:17:37 2011 +0200 @@ -67,6 +67,14 @@ # xHTML 5 (header and footer skel are from the style) # +loading_msg() { + cat << EOT + +EOT +} + xhtml_header() { cat ${PANEL}$HEADER | sed s/'- %TITLE%'/"$TITLE"/ } diff -r af4b1f0b3110 -r 13b1019d68d8 pkgs.cgi --- a/pkgs.cgi Thu Apr 07 03:12:38 2011 +0200 +++ b/pkgs.cgi Fri Apr 08 01:17:37 2011 +0200 @@ -6,7 +6,7 @@ # it own code for some tasks. Please KISS it important and keep speed # in mind. Thanks, Pankso. # -# (C) 2011 SliTaz GNU/Linux - GNU gpl v2 +# (C) 2011 SliTaz GNU/Linux - GNU gpl v3 # echo "Content-Type: text/html" echo "" @@ -77,8 +77,8 @@ cat $LOCALSTATE/packages.list | wc -l gettext "Upgradeable packages : " cat $LOCALSTATE/upgradeable-packages.list | wc -l - gettext "Installed files : " - cat $INSTALLED/*/files.list | wc -l + #gettext "Installed files : " + #cat $INSTALLED/*/files.list | wc -l gettext "Blocked packages : " cat $LOCALSTATE/blocked-packages.list | wc -l } @@ -226,6 +226,8 @@ cd $INSTALLED search_form sidebar + LOADING_MSG="Listing... please wait" + loading_msg cat << EOT

`gettext "My packages"`

diff -r af4b1f0b3110 -r 13b1019d68d8 styles/default/header.html --- a/styles/default/header.html Thu Apr 07 03:12:38 2011 +0200 +++ b/styles/default/header.html Fri Apr 08 01:17:37 2011 +0200 @@ -5,8 +5,20 @@ + + - +
diff -r af4b1f0b3110 -r 13b1019d68d8 styles/default/images/loader.gif Binary file styles/default/images/loader.gif has changed diff -r af4b1f0b3110 -r 13b1019d68d8 styles/default/style.css --- a/styles/default/style.css Thu Apr 07 03:12:38 2011 +0200 +++ b/styles/default/style.css Fri Apr 08 01:17:37 2011 +0200 @@ -25,6 +25,15 @@ a { text-decoration: none; color: #666; } a:hover { color: #000; } +#loading { + /* font-weight: bold; */ + color: #666; + position: fixed; + top: 92px; + right: 80px; + width: 200px; +} + /* Header and main title */ #header { @@ -46,8 +55,10 @@ z-index: 200; cursor: default; } + #menu { margin: 4px 8px; } -#menu a { padding: 2px 4px; color: #000; cursor: default; } +#menu a { padding: 2px 4px; color: #000; + cursor: default; } #menu a:hover { color: #444; } #icons { margin: 2px 8px; float: right; } #icons img { padding: 0; } @@ -193,12 +204,14 @@ input[type=text] { height: 18px; } -div.scroll { height: 200px; overflow: auto; border: 1px solid #ddd; } +div.scroll { height: 200px; overflow: auto; + border: 1px solid #ddd; } div.scroll table { border: 0px solid #fff; } /* Round corner */ -table, pre, input[type=submit], .debug, .box, .button, div.scroll { +table, pre, input[type=submit], .debug, .box, +.button, div.scroll { /*-moz-border-radius: 4px; -webkit-border-radius: 4px; */ border-radius: 4px; diff -r af4b1f0b3110 -r 13b1019d68d8 tazpanel --- a/tazpanel Thu Apr 07 03:12:38 2011 +0200 +++ b/tazpanel Fri Apr 08 01:17:37 2011 +0200 @@ -8,7 +8,7 @@ # Get the configuration file and functions CONFIG="/etc/slitaz/tazpanel.conf" [ -f $CONFIG ] && . $CONFIG -[ -f $PWD/tazpanel.conf ] && . tazpanel.conf +[ -f tazpanel.conf ] && . tazpanel.conf [ ! -f $PANEL/lib/libtazpanel ] && \ echo "No config file or libtazpanel found: $CONFIG" && exit 1 . $PANEL/lib/libtazpanel diff -r af4b1f0b3110 -r 13b1019d68d8 tazpanel.conf --- a/tazpanel.conf Thu Apr 07 03:12:38 2011 +0200 +++ b/tazpanel.conf Fri Apr 08 01:17:37 2011 +0200 @@ -14,7 +14,10 @@ DEBUG="0" # Xterm options -XTERM_OPTS="-geometry 80x16 -bg black -fg white" +XTERM_OPTS="-geometry 80x16-0+24 -bg black -fg white" + +# Generic page loading message +LOADING_MSG="Loading... please wait" # Busybox HTTP deamon config HTTPD_CONF="/etc/slitaz/httpd.conf"