# HG changeset patch # User Aleksej Bobylev # Date 1427161148 -7200 # Node ID 299f204b8f1f27963789d893418d6d74aef1f51a # Parent e4ad3356ac6a09d32e0a02765242f842a46a0437 Bunch of changes. Development in progress, please note it have few known bugs. diff -r e4ad3356ac6a -r 299f204b8f1f COPYING --- a/COPYING Mon Mar 23 21:17:06 2015 +0100 +++ b/COPYING Tue Mar 24 03:39:08 2015 +0200 @@ -1,5 +1,5 @@ -Copyright (c) 2011-2014 SliTaz GNU/Linux. +Copyright (c) 2011-2015 SliTaz GNU/Linux. All rights reserved. Redistribution and use in source and binary forms, with or without diff -r e4ad3356ac6a -r 299f204b8f1f Makefile --- a/Makefile Mon Mar 23 21:17:06 2015 +0100 +++ b/Makefile Tue Mar 24 03:39:08 2015 +0200 @@ -36,22 +36,29 @@ # Installation install: - mkdir -p $(DESTDIR)$(PREFIX)/bin \ + mkdir -p \ + $(DESTDIR)$(PREFIX)/bin \ $(DESTDIR)$(PREFIX)/share/locale \ $(DESTDIR)$(PREFIX)/share/applications \ - $(DESTDIR)$(PREFIX)/share/pixmaps \ $(DESTDIR)$(SYSCONFDIR) \ $(DESTDIR)$(PANEL)/menu.d \ $(DESTDIR)/var/log cp -a tazpanel $(DESTDIR)$(PREFIX)/bin -[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazpanel - cp -a data/*.conf $(DESTDIR)$(SYSCONFDIR) cp -a *.cgi lib/ styles/ doc/ README* $(DESTDIR)$(PANEL) - cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale + cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale + cp -a data/*.conf $(DESTDIR)$(SYSCONFDIR) cp -a data/*.desktop $(DESTDIR)$(PREFIX)/share/applications - cp -a data/*.png $(DESTDIR)$(PREFIX)/share/pixmaps + cp -a data/icons $(DESTDIR)$(PREFIX)/share touch $(DESTDIR)/var/log/tazpanel.log + @# Clean comments in production release + sed -i '/^\t*\/\//d' $(DESTDIR)$(PANEL)/lib/tazpanel.js + + @# Remove this when TazWeb will support OpenType ligatures for web-fonts (maybe, after Webkit upgrade?) + mkdir -p $(DESTDIR)/usr/share/fonts/TTF + ln -fs $(PANEL)/styles/default/tazpanel.ttf $(DESTDIR)/usr/share/fonts/TTF/tazpanel.ttf + # Clean source clean: diff -r e4ad3356ac6a -r 299f204b8f1f README --- a/README Mon Mar 23 21:17:06 2015 +0100 +++ b/README Tue Mar 24 03:39:08 2015 +0200 @@ -2,84 +2,85 @@ ================================================================================ -Tazpanel is the SliTaz Control Panel, a web interface which lets you manage the -full system in a radically simple way. The output xHTML code is valid xHTML 5 -and all theming is done with standard CSS 3. TazPanel is published under a -BSD License. +Tazpanel is the SliTaz Control Panel, a web interface which lets you manage the +full system in a radically simple way. The output xHTML code is valid xHTML 5 +and all theming is done with standard CSS 3. TazPanel is published under +a BSD License. Use it! ------- -You can clone the tazpanel repo into /var/www/tazpanel and work on this -copy or clone it somewhere else and 'make install'. After, add tazpanel to -your /etc/hosts, type './tazpanel start' to start the server and go to the -URL: http://tazpanel:82. Panel user and password are defined in the -httpd.conf and default is root:root +------- +You can clone the tazpanel repo into /var/www/tazpanel and work on this copy or +clone it somewhere else and 'make install'. After, add tazpanel to your +/etc/hosts, type './tazpanel start' to start the server and go to the URL: +http://tazpanel:82. Panel user and password are defined in the httpd.conf and +default is root:root i18n ---- -TazPanel has been coded from the beginning with gettext support. Please -forget 'echo' and use gettext, but remember that gettext "" is equivalent -to echo -n. All scripts use the same TEXTDOMAIN and the same pot files, and -all translations go in the po/ folder. To start a new translation please -use msginit from the pot file directory. Example for French/France -locale (fr_FR): +TazPanel has been coded from the beginning with gettext support. Please forget +'echo' and use gettext, but remember that gettext "" is equivalent to echo -n. +All scripts use the same TEXTDOMAIN and the same pot files, and all translations +go in the po/ folder. To start a new translation please use msginit from the pot +file directory. Example for French/France locale (fr_FR): - $ msginit -l fr_FR -o fr.po -i tazpanel.pot + $ msginit -l fr_FR -o fr.po -i tazpanel.pot To update all translations from a newly updated pot file: - $ make msgmerge + $ make msgmerge User interface -------------- -If you develop an official SliTaz GUI for TazPanel, please follow the default -style. If you need more CSS markup and you are not a coder, please ask an -official developer for the best way to implement your idea. TazPanel is fully -themable and more than one theme can be installed, this will allow us to make -packages in a TazPanel style! All the GUI is done with xHTML 5 and CSS 3; some -javascript can be used, but with precautions... one more time, it's better -to check with a main contributor before adding too much stuff; the goal is, -as for all the SliTaz projects: KISS +If you develop an official SliTaz GUI for TazPanel, please follow the default +style. If you need more CSS markup and you are not a coder, please ask an offi- +cial developer for the best way to implement your idea. TazPanel is fully thema- +ble and more than one theme can be installed, this will allow us to make packa- +ges in a TazPanel style! All the GUI is done with xHTML 5 and CSS 3; some java- +script can be used, but with precautions... one more time, it's better to check +with a main contributor before adding too much stuff; the goal is, as for all +the SliTaz projects: KISS CGI template and files ---------------------- -To start or test a new function with TazPanel you will find a file in -utils/template.cgi that needs to be in the $PANEL root to work, all TazPanel -CGI scripts are in that location. If you think your code is too big to fit -in another script you can eventually create a new CGI page and update all -links, but please to talk to the AUTHORS beforehand. +To start or test a new function with TazPanel you will find a file in +utils/template.cgi that needs to be in the $PANEL root to work, all TazPanel CGI +scripts are in that location. If you think your code is too big to fit in ano- +ther script you can eventually create a new CGI page and update all links, but +please to talk to the AUTHORS beforehand. - * index.cgi Main Tazpanel CGI script - * boot.cgi All what happens before login - * network.cgi All related stuff to networking (eth, wifi, services) - * pkgs.cgi Tazpkg packages CGI interface - * settings.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 - * help.cgi Cat the html doc and this README file + * index.cgi Main TazPanel CGI script + * boot.cgi All what happens before login + * network.cgi All related stuff to networking (Ethernet, Wi-Fi, services) + * pkgs.cgi TazPkg packages CGI interface + * settings.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 + * help.cgi Cat the html doc and this README file -For common functions have a look at lib/libtazpanel, where you may find functions -you need already coded such as a xhtml_header to get the style header.html -in your CGI script. For the loading message you can use loading_msg. When -cat is used: `gettext "Text to translate"` +For common functions have a look at lib/libtazpanel, where you may find functi- +ons you need already coded such as a xhtml_header to get the style header.html +in your CGI script. For the loading message you can use loading_msg. When cat is +used: + + $(gettext "Text to translate") Web server ---------- -Tazpanel can run with the Busybox httpd applet or LightTPD and probably Apache. -Start the webserver with a custom config to listen only on a local port for +Tazpanel can run with the Busybox httpd applet or LightTPD and probably Apache. +Start the webserver with a custom config to listen only on a local port for security reasons since we run as root to perform system actions, example: -# httpd -p 82 u root -c /etc/slitaz/httpd.conf + # httpd -p 82 u root -c /etc/slitaz/httpd.conf Or use a tazpanel cmdline: -# ./tazpanel start + # ./tazpanel start ================================================================================ diff -r e4ad3356ac6a -r 299f204b8f1f README.html --- a/README.html Mon Mar 23 21:17:06 2015 +0100 +++ b/README.html Tue Mar 24 03:39:08 2015 +0200 @@ -1,90 +1,58 @@ -

SliTaz Web Control Panel

+
+
SliTaz Web Control Panel
+
+

TazPanel is the SliTaz Control Panel, a web interface which lets you manage the full system in a radically simple way. The output xHTML code is valid HTML 5 and all theming is done with standard CSS 3. TazPanel is published under a BSD License.

-

Tazpanel is the SliTaz Control Panel, a web interface which lets you manage the -full system in a radically simple way. The output xHTML code is valid xHTML 5 -and all theming is done with standard CSS 3. TazPanel is published under a -BSD License.

+

Use it!

-

Use it!

+

You can clone the tazpanel repo into /var/www/tazpanel and work on this copy or clone it somewhere else and 'make install'. After, add tazpanel to your /etc/hosts, type './tazpanel start' to start the server and go to the URL: http://tazpanel:82. Panel user and password are defined in the httpd.conf and default is root:root

-

You can clone the tazpanel repo into /var/www/tazpanel and work on this -copy or clone it somewhere else and 'make install'. After, add tazpanel to -your /etc/hosts, type './tazpanel start' to start the server and go to the -URL: http://tazpanel:82. Panel user and password are defined in the -httpd.conf and default is root:root

+

i18n

-

i18n

+

TazPanel has been coded from the beginning with gettext support. Please forget 'echo' and use gettext, but remember that gettext "" is equivalent to echo -n. All scripts use the same TEXTDOMAIN and the same pot files, and all translations go in the po/ folder. To start a new translation please use msginit from the pot file directory. Example for French/France locale (fr_FR):

+
$ msginit -l fr_FR -o fr.po -i tazpanel.pot
+

To update all translations from a newly updated pot file:

+
$ make msgmerge
-

TazPanel has been coded from the beginning with gettext support. Please -forget 'echo' and use gettext, but remember that gettext "" is equivalent -to echo -n. All scripts use the same TEXTDOMAIN and the same pot files, and -all translations go in the po/ folder. To start a new translation please -use msginit from the pot file directory. Example for French/France -locale (fr_FR):

-
$ msginit -l fr_FR -o fr.po -i tazpanel.pot
+

User interface

-

To update all translations from a newly updated pot file:

+

If you develop an official SliTaz GUI for TazPanel, please follow the default style. If you need more CSS markup and you are not a coder, please ask an official developer for the best way to implement your idea. TazPanel is fully themable and more than one theme can be installed, this will allow us to make packages in a TazPanel style! All the GUI is done with HTML 5 and CSS 3; some javascript can be used, but with precautions… one more time, it's better to check with a main contributor before adding too much stuff; the goal is, as for all the SliTaz projects: KISS

-
$ make msgmerge
+

CGI template and files

-

User interface

+

To start or test a new function with TazPanel you will find a file in utils/template.cgi that needs to be in the $PANEL root to work, all TazPanel CGI scripts are in that location. If you think your code is too big to fit in another script you can eventually create a new CGI page and update all links, but please to talk to the AUTHORS beforehand.

+
+
index.cgi
+
Main Tazpanel CGI script
+
boot.cgi
+
All what happens before login
+
network.cgi
+
All related stuff to networking (Ethernet, Wi-Fi, services)
+
pkgs.cgi
+
Tazpkg packages CGI interface
+
settings.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
+
help.cgi
+
Cat the html doc and this README file
+
+

For common functions have a look at lib/libtazpanel, where you may find functions you need already coded such as a xhtml_header to get the style header.html in your CGI script. For the loading message you can use loading_msg. When cat is used:

+
$(gettext "Text to translate")
-

If you develop an official SliTaz GUI for TazPanel, please follow the default -style. If you need more CSS markup and you are not a coder, please ask an -official developer for the best way to implement your idea. TazPanel is fully -themable and more than one theme can be installed, this will allow us to make -packages in a TazPanel style! All the GUI is done with xHTML 5 and CSS 3; some -javascript can be used, but with precautions... one more time, it's better -to check with a main contributor before adding too much stuff; the goal is, -as for all the SliTaz projects: KISS

+

Web server

-

CGI template and files

+

TazPanel can run with the Busybox httpd applet or LightTPD and probably Apache. Start the webserver with a custom config to listen only on a local port for security reasons since we run as root to perform system actions, example:

+
# httpd -p 82 u root -c /etc/slitaz/httpd.conf
+

Or use a tazpanel cmdline:

+
# ./tazpanel start
-

To start or test a new function with TazPanel you will find a file in -utils/template.cgi that needs to be in the $PANEL root to work, all TazPanel -CGI scripts are in that location. If you think your code is too big to fit -in another script you can eventually create a new CGI page and update all -links, but please to talk to the AUTHORS beforehand.

- -
-
index.cgi
-
Main Tazpanel CGI script
-
boot.cgi
-
All what happens before login
-
network.cgi
-
All related stuff to networking (eth, wifi, services)
-
pkgs.cgi
-
Tazpkg packages CGI interface
-
settings.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
-
help.cgi
-
Cat the html doc and this README file
- - -

For common functions have a look at lib/libtazpanel, where you may find functions -you need already coded such as a xhtml_header to get the style header.html -in your CGI script. For the loading message you can use loading_msg. When -cat is used: `gettext "Text to translate"`

- - -

Web server

- -

Tazpanel can run with the Busybox httpd applet or LightTPD and probably Apache. -Start the webserver with a custom config to listen only on a local port for -security reasons since we run as root to perform system actions, example:

- -
# httpd -p 82 u root -c /etc/slitaz/httpd.conf
- -

Or use a tazpanel cmdline:

- -
# ./tazpanel start
+
+
diff -r e4ad3356ac6a -r 299f204b8f1f boot.cgi --- a/boot.cgi Mon Mar 23 21:17:06 2015 +0100 +++ b/boot.cgi Tue Mar 24 03:39:08 2015 +0200 @@ -2,73 +2,89 @@ # # Boot CGI script - All what happens before login (grub, rcS, slim) # -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License # + # Common functions from libtazpanel and source main boot config file. + . lib/libtazpanel . /etc/rcS.conf +get_config header -get_config TITLE=$(gettext 'TazPanel - Boot') + +# Print last 40 lines of given file with "more" link + loghead() { - tail -n 40 $1 | htmlize + case $2 in + htmlize) tail -n40 $1 | htmlize;; + *) tail -n40;; + esac [ $(wc -l < $1) -gt 40 ] && cat <$(gettext 'Show more...') +
$(gettext 'Show more...') EOT } + # # Commands # case " $(GET) " in *\ log\ *) - unset actboot actslim actxlog actkernel + unset actboot actslim actxlog actkernel colors case "$(GET log)" in - boot) actboot=' class="active"' - output="$(filter_taztools_msgs < /var/log/boot.log)" - ;; - slim) actslim=' class="active"' - output="$(loghead /var/log/slim.log)" ;; - xlog) actxlog=' class="active"' - output="$(loghead /var/log/Xorg.0.log)" ;; - *) actkernel=' class="active"' - output="$(syntax_highlighter kernel < /var/log/dmesg.log)" + boot) + actboot=' class="active"' + output="$(filter_taztools_msgs < /var/log/boot.log)" + colors=' class="term log"';; + slim) + actslim=' class="active"' + output="$(loghead /var/log/slim.log htmlize)" ;; + xlog) + actxlog=' class="active"' + output="$(syntax_highlighter xlog < /var/log/Xorg.0.log | loghead /var/log/Xorg.0.log)" ;; + *) + actkernel=' class="active"' + output="$(syntax_highlighter kernel < /var/log/dmesg.log | loghead /var/log/dmesg.log)" ;; esac xhtml_header - cat << EOT -
-

$(gettext 'Boot log files')

-
+ cat <$(gettext 'Boot log files') + -
-$output
-
+ +
+
+ $output +
+
EOT ;; + + *\ daemons\ *) # # Everything until user login # - # Start and stop a daemon. I think we don't need a restart since 2 - # clicks and you are done + # Start and stop a daemon. + # (I think we don't need a 'restart' since 2 clicks and you are done) . /etc/rcS.conf xhtml_header - cat << EOT -
-

$(gettext 'Manage daemons')

-

$(gettext 'Check, start and stop daemons on SliTaz')

-
+ cat <$(gettext 'Manage daemons') + +

$(gettext 'Check, start and stop daemons on SliTaz')

EOT daemon=$(GET daemons) case "$daemon" in @@ -85,37 +101,34 @@ done echo "" ;; esac + # Daemon list - table_start - cat << EOT - - - $(gettext 'Name') - $(gettext 'Description') - $(gettext 'Configuration') - $(gettext 'Status') - $(gettext 'Action') - $(gettext 'PID') - - + cat < + + + + + + + + + + + + EOT cd /etc/init.d - list="`ls | sed -e /.sh/d -e /rc./d -e /RE/d -e /daemon/d \ - -e /firewall/d`" - for name in $list - do - pkg="" - pid="" - status="" - SHORT_DESC="" + list="$(ls | sed -e /.sh/d -e /rc./d -e /RE/d -e /daemon/d -e /firewall/d)" + for name in $list; do + unset pkg pid status SHORT_DESC boot cfg echo '' # Name echo "" - # First check if daemon is started at bootime + # First check if daemon is started at boottime [ echo "RUN_DAEMONS" | fgrep $name ] && boot="on boot" # Standard SliTaz busybox daemons and firewall echo -n "" if [ "$pid" ]; then - cat << EOT - - + cat < + - + cat < +' done - table_end ;; + echo '
$(gettext 'Name')$(gettext 'Description')$(gettext 'Configuration')$(gettext 'Status')$(gettext 'Action')$(gettext 'PID')
$name" - cfg="" grep -qi "^${name}_OPTIONS=" /etc/daemons.conf && cfg="options|$cfg" for i in /etc/slitaz /etc /etc/$name ; do [ -s $i/$name.conf ] && cfg="edit::$i/$name.conf|$cfg" @@ -156,6 +169,7 @@ [ -d "$LOCALSTATE/installed/${name}-pam" ] && pkg=${name}-pam if [ "$pkg" ]; then unset SHORT_DESC TAZPANEL_DAEMON +#FIXME $PKGS_DB . $LOCALSTATE/installed/$pkg/receipt echo -n "$SHORT_DESC" cfg="${TAZPANEL_DAEMON:-$cfg|web::$WEB_SITE}" @@ -167,44 +181,47 @@ # Attempt to get daemon status pidfile=$(find /var/run -name *$name*.pid) [ "$pidfile" ] && pid=$(cat $pidfile) - # dbus + # Dbus [ -f /var/run/${name}/pid ] && pid=$(cat /var/run/${name}/pid) - # apache + # Apache [ "$name" = "apache" ] && pid=$(cat /var/run/$name/httpd.pid) # Pidof works for many daemons [ "$pid" ] || pid=$(pidof $name) - echo -n "" - if [ "$cfg" ]; then + + echo -n "" + if [ -n "$cfg" ]; then IFS="|" for i in $cfg ; do IFS=":" set -- $i case "$1" in - edit) cat < - + edit) + cat < EOT ;; options) - key=$(echo $name | tr [a-z] [A-Z])_OPTIONS + key=$(echo -n $name | tr [a-z] [A-Z])_OPTIONS cat < - + EOT ;; - man) cat < - + man) + cat < EOT ;; - help) cat < - + help) + help='--help' + case $name in + cupsd|dropbear|gpm|slim|wpa_supplicant) help='-h' + esac + cat < EOT ;; web) cat < - + EOT ;; esac @@ -212,28 +229,27 @@ fi echo "Started - Stop EOT for i in $pid; do - cat << EOT + cat <$i EOT done else - cat << EOT -Stopped - Start ----- EOT fi echo '
' ;; + *\ grub\ *) GRUBMENU="/boot/grub/menu.lst" @@ -247,93 +263,126 @@ -e s"|splashimage=.*|splashimage=$splash|" \ $GRUBMENU fi - default=$(cat $GRUBMENU | grep ^default | cut -d " " -f 2) - timeout=$(cat $GRUBMENU | grep ^timeout | cut -d " " -f 2) - splash=$(cat $GRUBMENU | grep ^splashimage | cut -d "=" -f 2) + default=$(cat $GRUBMENU | grep ^default | cut -d' ' -f2) + timeout=$(cat $GRUBMENU | grep ^timeout | cut -d' ' -f2) + splash=$(cat $GRUBMENU | grep ^splashimage | cut -d' ' -f2) xhtml_header - cat << EOT -
-

$(gettext 'GRUB Boot loader')

+ cat <$(gettext 'GRUB Boot loader') -

$(gettext 'The first application started when the computer powers on')

-
+

$(gettext 'The first application started when the computer powers on')

-
- - - - - - - - -
$(gettext 'Default entry:')
$(gettext 'Timeout:')
$(gettext 'Splash image:')
- - - $(gettext 'View or edit menu.lst') + +
+
+ + + + + + + + +
$(gettext 'Default entry:')
$(gettext 'Timeout:')
$(gettext 'Splash image:')
+
+
+ +
+
-

$(gettext 'Boot entries')

+
+ + +
+ + +
+
$(gettext 'Boot entries')
+
EOT -menu=$(tail -q -n +$(grep -n ^title $GRUBMENU | head -n1 | cut -d: -f1) $GRUBMENU \ - | sed -e "s|^$||g" \ - | sed -e "s|^title|\n

$(gettext 'Entry') #

\n
\0|g" \
-	| sed '/^[ \t]*$/d' \
-	| tail -q -n +2)"
" +menu=$(tail -q -n +$(grep -n ^title $GRUBMENU | head -n1 | cut -d: -f1) $GRUBMENU | \ + sed -e "s|^$||g" | \ + sed -e "s|^title|
\n
\n\n
\n\t
$(gettext 'Entry') #
\n
\0|g" | \
+	sed '/^[ \t]*$/d' | \
+	tail -q -n +2)"
" entry='-1' echo "$menu" | while read line do - if [ -n "$(echo $line | grep '#')" ]; then + if [ -n "$(echo $line | grep '#')" ]; then entry=$(($entry + 1)) fi - echo $line | sed "s|#|$entry|" + echo $line | sed "s|#|$entry|" done + echo '
' + + # Here we could check if an entry for gpxe is present if not # display a form to add it. - [ -f "/boot/gpxe" ] && echo "

gPXE

" && \ - gettext 'Web boot is available with gPXE' + [ -f "/boot/gpxe" ] && cat < +
gPXE
+
$(gettext 'Web boot is available with gPXE')
+ +EOT ;; + + *) # # Default content with summary # . /etc/rcS.conf xhtml_header - cat << EOT -
-

$(gettext 'Boot & Start services')

-

$(gettext 'Everything that happens before user login')

-
- + cat <$(gettext 'Boot & Start services') -

$(gettext 'Configuration files')

-
    -
  • $(gettext 'Main configuration file:') - rcS.conf
  • -
  • $(gettext 'Login manager settings:') - slim.conf
  • -
+

$(gettext 'Everything that happens before user login')

-

$(gettext 'Kernel cmdline')

+
+ + + +
-
$(cat /proc/cmdline)
-

$(gettext 'Local startup commands')

+
+
$(gettext 'Configuration files')
+
+ + + + + +
$(gettext 'Main configuration file:') rcS.conf
$(gettext 'Login manager settings:') slim.conf
+
+
-
$(cat /etc/init.d/local.sh | syntax_highlighter sh)
- -$(gettext 'Edit script') +
+
$(gettext 'Kernel cmdline')
+
+
$(cat /proc/cmdline)
+
+
+ + +
+
$(gettext 'Local startup commands')
+
+
$(cat /etc/init.d/local.sh | syntax_highlighter sh)
+
+
+
+ + +
+
+
EOT ;; esac diff -r e4ad3356ac6a -r 299f204b8f1f data/httpd.conf --- a/data/httpd.conf Mon Mar 23 21:17:06 2015 +0100 +++ b/data/httpd.conf Tue Mar 24 03:39:08 2015 +0200 @@ -1,6 +1,18 @@ +# /etc/slitaz/httpd.conf: Busybox HTTP web server configuration file for TazPanel + +# Deny addresses +D:* +# Allow addresses +A:127.0.0.1 + +# Server root H:/var/www/tazpanel -A:127.0.0.1 -D:* +# File to open by default +I:index.cgi +# Require user "*", password "*" on URLs starting with "/" +/:*:* + +# CGI interpreter path *.cgi:/bin/sh -I:index.cgi -/:*:* +# Additional MIME types +.js:text/javascript diff -r e4ad3356ac6a -r 299f204b8f1f data/icons/hicolor/16x16/apps/tazpanel.png Binary file data/icons/hicolor/16x16/apps/tazpanel.png has changed diff -r e4ad3356ac6a -r 299f204b8f1f data/icons/hicolor/32x32/apps/tazpanel.png Binary file data/icons/hicolor/32x32/apps/tazpanel.png has changed diff -r e4ad3356ac6a -r 299f204b8f1f data/icons/hicolor/48x48/apps/tazpanel.png Binary file data/icons/hicolor/48x48/apps/tazpanel.png has changed diff -r e4ad3356ac6a -r 299f204b8f1f data/tazpanel.png Binary file data/tazpanel.png has changed diff -r e4ad3356ac6a -r 299f204b8f1f doc/tazpanel.en.html --- a/doc/tazpanel.en.html Mon Mar 23 21:17:06 2015 +0100 +++ b/doc/tazpanel.en.html Tue Mar 24 03:39:08 2015 +0200 @@ -1,73 +1,82 @@
-

English Help

+
+
English Help
+
-

+

TazPanel is the SliTaz administration and settings center from where you can control your entire system such as managing packages, adding or removing users, creating Live systems and much more. Navigation is done with the toolbar at the top of the application window and in some cases with a submenu or a side bar as in the packages interface. -

+

-

+

In most cases you will get a description and useful information with - the section concerned. TazPanel uses the latest XHTML 5 and CSS 3 technology + the section concerned. TazPanel uses the latest HTML 5 and CSS 3 technology to provide a clean and easy to use frontend for all the administration tasks that you can do on SliTaz. TazPanel has also been coded from the beginning with speed and quality in mind and it also supports full internationalization. -

+

-

+

TazPanel is run as a web server on port 82 by default and can be used only from the local system. If you wish to control your system from a remote host you can change the server configuration file to allow connections from a local network or the entire world wide web, but in this last case make sure that you set a strong password for the panel. The server configuration file is - /etc/slitaz/httpd.conf. -

+ /etc/slitaz/httpd.conf. +

-

Terminal

-

+ +

Terminal

+ +

TazPanel provides a small terminal emulator which lets you execute commands as root on the remote or local system. Not all available commands are usable and you should use a SSH connection for most tasks. That said, having access - to a few commands within the web interface can be useful and wget is + to a few commands within the web interface can be useful and wget is supported to allow file uploads on a remote machine. The download directory - is /var/www/downloads by default. All commands can use options such as - -R -l etc. -

+ is /var/www/downloads by default. All commands can use options such as + -R -l etc. +

-

Get Support

-

- You can get support on the Slitaz forum, +

Get Support

+ +

+ You can get support on the SliTaz forum, the mailing list or the IRC channel. The official SliTaz IRC channel is on Freenode (note that you can use LostIRC, Xchat or Pidgin on SliTaz). Freenode also - provides a nice IRC web interface. -

+ provides a nice IRC web interface. +

-

Get involved

-

+

Get involved

+ +

If you want to help and get involved in SliTaz, TazPanel maybe for you! We need help in translating, styling, documenting and coding. If you need more information or want to publish a new graphical style, - you can go to the SliTaz Community + you can go to the SliTaz Community and post on the Devel forum or post an update with a PM to a SliTaz contributor so that we can get in touch and include your work in TazPanel or in an extra styles package. -

+

-

Bugs and features

-

+

Bugs and features

+ +

TazPanel is still a young application which will be improved and polished in time. If you find a bug, please post on the SliTaz tracker: - bugs.slitaz.org. Tazpanel has a - debug mode that can be enabled in the configuration file tazpanel.conf - and also provides a debug page. -

+ bugs.slitaz.org. Tazpanel has a + debug mode that can be enabled in the configuration file tazpanel.conf + and also provides a debug page. +

+
+
diff -r e4ad3356ac6a -r 299f204b8f1f doc/tazpanel.fr.html --- a/doc/tazpanel.fr.html Mon Mar 23 21:17:06 2015 +0100 +++ b/doc/tazpanel.fr.html Tue Mar 24 03:39:08 2015 +0200 @@ -1,49 +1,56 @@
-

Francais - Aide

+
+
Francais - Aide
+
-

+

TazPanel is the SliTaz administration and settings center from where you can control your entire system such as package management, adding or removing users, creating Live systems and much more. Navigation is done with the toolbar at the top of the application window and in some cases with a submenu. -

+

-

+

In most cases you will get a description and useful information with - the section concerned. TazPanel uses the latest XHTML 5 and CSS 3 technology + the section concerned. TazPanel uses the latest HTML 5 and CSS 3 technology to provide a clean and easy to use frontend for all administration tasks you can do on SliTaz. TazPanel has also been coded from the beginning with speed and qualility in mind and it also supports full internationalization. -

+

-

Assistance

-

- Pour obtenir de l'aide sur SliTaz rendez-vous sur le forum forum, +

Assistance

+ +

+ Pour obtenir de l'aide sur SliTaz rendez-vous sur le forum forum, la liste de diffusion ou le canal IRC. -

+

-

Get involve

-

+

Get involve

+ +

If you want to help and get involved in SliTaz, TazPanel maybe for you! We need help in translating, styling, documentation and coding. If you need more information or want to publish a new graphical style, - you can go to the SliTaz Community + you can go to the SliTaz Community and post on the Devel forum or post an update with a PM to a SliTaz contributor so that we can get in touch and include your work in TazPanel or in an extra styles package. -

+

-

Bugs et fonctionnalités

-

+

Bugs et fonctionnalités

+ +

Tazpanel est une nouvelle application qui sera améliorée et paufinée avec le temps. Si vous trouvez un bug, merci de le signaler sur le système de bugs de SliTaz: - bugs.slitaz.org -

+ bugs.slitaz.org +

+
+
diff -r e4ad3356ac6a -r 299f204b8f1f doc/tazpanel.pt.html --- a/doc/tazpanel.pt.html Mon Mar 23 21:17:06 2015 +0100 +++ b/doc/tazpanel.pt.html Tue Mar 24 03:39:08 2015 +0200 @@ -1,8 +1,10 @@
-

Ajuda em Português do Brasil

+
+
Ajuda em Português do Brasil
+
-

+

O TazPanel é o centro de administração do SliTaz, de onde se pode controlar todo o sistema, como gerenciamento de pacotes, adição ou remoção de usuários, criação de sistemas Live e outras atividades. @@ -10,41 +12,46 @@ aplicativo e, em alguns casos, por submenus. Na maioria das vezes será mostrada uma descrição e informações úteis relativas à seção em que o usuário se encontra. -

+

-

- O TazPanel se utiliza das tecnologias mais recentes como xHTML5 e CSS 3 +

+ O TazPanel se utiliza das tecnologias mais recentes como HTML 5 e CSS 3 para fornecer um ambiente limpo e fácil de usar que centraliza todas as tarefas de administração do SliTaz. Também foi criado desde o início no intuito de ser rápido e ter suporte total a internacionalização. -

+

-

Suporte

-

- Pode-se obter suporte no fórum, +

Suporte

+ +

+ Pode-se obter suporte no fórum, na lista de discussão e no canal IRC da distribuição. -

+

-

Envolva-se

-

+

Envolva-se

+ +

Caso tenha interesse em ajudar no desenvolvimento do SliTaz, talvez possa participar do desenvolvimento desta ferramenta. Precisamos de ajuda na tradução, documentação, código e criação de estilos. Para maiores informaçõe ou enviar um novo estilo, por exemplo, pode-se criar uma conta - na Comunidade do SliTaz e postar + na Comunidade do SliTaz e postar seu trabalho ou entrar em contato com um dos desenvolvedores da distribuição. Desta forma, podemos incluir seu trabalho numa próxima versão do programa. -

+

-

Bugs and features

-

+

Bugs and features

+ +

O TazPanel é um aplicativo ainda novo que será melhorado com o tempo. Caso encontre um bug ou queira pedir alguma nova funcionalidade, por - favor postar em bugs.slitaz.org. -

+ favor postar em bugs.slitaz.org. +

+
+
diff -r e4ad3356ac6a -r 299f204b8f1f doc/tazpanel.ru.html --- a/doc/tazpanel.ru.html Mon Mar 23 21:17:06 2015 +0100 +++ b/doc/tazpanel.ru.html Tue Mar 24 03:39:08 2015 +0200 @@ -1,62 +1,80 @@
-

Справка TazPanel

+
+
Справка TazPanel
+
-

TazPanel — это центр управления и настроек, из которого вы можете - контролировать всю систему — управлять пакетами, добавлять и удалять - пользователей, создавать «живые» системы и многое другое. Навигация - осуществляется при помощи панели инструментов в верхней части окна - приложения, а в некоторых случаях, как в интерфейсе пакетного менеджера, — - при помощи меню и боковой панели.

-

В большинстве случаев вы получите описание и полезную информацию по - соответствующему разделу. TazPanel использует новые технологии — xHTML 5 - и CSS 3 для того, чтобы получить чистый и простой в использовании - интерфейс для всех задач управления, которые можно выполнить в SliTaz. - С самого начала TazPanel создавалась с расчётом на скорость, качество и - полную поддержку интернационализации.

-

TazPanel работает как веб-сервер на порту 82 (по умолчанию), её можно - использовать только в локальной системе. Если вы хотите управлять вашей - системой с удалённой машины, вы можете изменить файл конфигурации сервера, - чтобы разрешить соединения из локальной сети, или даже из всего интернета, - но в последнем случае убедитесь, что вы установили надёжный пароль для - панели. Файл конфигурации сервера — /etc/slitaz/httpd.conf.

+

TazPanel — это центр управления и настроек, из которого вы можете + контролировать всю систему — управлять пакетами, добавлять и удалять + пользователей, создавать «живые» системы и многое другое. Навигация + осуществляется при помощи панели инструментов в верхней части окна + приложения, а в некоторых случаях, как в интерфейсе пакетного + менеджера, — при помощи меню и боковой панели.

+

В большинстве случаев вы получите описание и полезную информацию + по соответствующему разделу. TazPanel использует современные + технологии — HTML 5 и CSS 3 для того, чтобы получить чистый и + простой в использовании интерфейс для всех задач управления, которые + можно выполнить в SliTaz. С самого начала TazPanel создавалась с + расчётом на скорость, качество и полную поддержку + интернационализации.

+

TazPanel работает как веб-сервер на порту 82 (по умолчанию), её + можно использовать только в локальной системе. Если вы хотите + управлять вашей системой с удалённой машины, вы можете изменить файл + конфигурации сервера, чтобы разрешить соединения из локальной сети, + или даже из всего интернета, но в последнем случае убедитесь, что вы + установили надёжный пароль для панели. Файл конфигурации сервера — + /etc/slitaz/httpd.conf.

-

Терминал

-

TazPanel содержит небольшой эмулятор терминала, который позволяет выполнять - команды от имени администратора на удалённой или локальной системе. - Использоваться могут не все команды, и в большинстве случаев вы должны - использовать соединение SSH. Тем не менее, несколько команд, имеющиеся в - веб-интерфейсе, могут оказаться полезными, например, Wget поддерживает - загрузку файлов на удалённую машину. Папка загрузки по умолчанию — - /var/www/downloads. Все команды могут использовать параметры, такие как - -R -l и т.д.

+

Терминал

-

Поддержка

+

TazPanel содержит небольшой эмулятор терминала, который позволяет + выполнять команды от имени администратора на удалённой или локальной + системе. Использоваться могут не все команды, и в большинстве + случаев вы должны использовать соединение SSH. Тем не менее, + несколько команд, имеющиеся в веб-интерфейсе, могут оказаться + полезными, например, wget поддерживает загрузку файлов на + удалённую машину. Папка загрузки по умолчанию — + /var/www/downloads. Все команды могут использовать + параметры, такие как -R, -l и т.д.

-

Вы можете получить поддержку на форуме - SliTaz, в рассылке или на канале IRC. Официальный IRC-канал SliTaz - находится на Freenode; вы можете использовать в - SliTaz программы LostIRC, Xchat или Pidgin. Freenode также поддерживает - хороший веб-интерфейс.

-

Присоединяйтесь

+

Поддержка

-

Если вы хотите помочь и присоединиться к SliTaz, вы можете заняться TazPanel! - Нам нужна помощь в переводе, дизайне, написании документации и кода. Если - вам нужна дополнительная информация, или вы хотите опубликовать новый - дизайн, заходите в сообщество, а там - оставьте сообщение на форуме Devel, или личное сообщение одному из - разработчиков SliTaz, чтобы мы могли связаться с вами и включить вашу работу - в TazPanel или в дополнительный пакет стилей.

+

Вы можете получить поддержку на форуме SliTaz, в + рассылке или на канале IRC. Официальный IRC-канал SliTaz находится + на Freenode; вы можете использовать в SliTaz программы LostIRC, + Xchat или Pidgin. Freenode также поддерживает хороший веб-интерфейс.

-

Баги и особенности

-

TazPanel — всё ещё молодое приложение, которое со временем будет - совершенствоваться и отшлифовываться. Если вы нашли ошибку, пожалуйста, - сообщите на баг-трекер SliTaz: - bugs.slitaz.org. Tazpanel имеет режим - отладки, который можно включить в файле конфигурации tazpanel.conf; также - имеется отладочная страница.

+

Присоединяйтесь

+

Если вы хотите помочь и присоединиться к SliTaz, вы можете + заняться TazPanel! Нам нужна помощь в переводе, дизайне, написании + документации и кода. Если вам нужна дополнительная информация, или + вы хотите опубликовать новый дизайн, заходите в сообщество, а там + оставьте сообщение на форуме Devel, или личное сообщение одному из + разработчиков SliTaz, чтобы мы могли связаться с вами и включить + вашу работу в TazPanel или в дополнительный пакет стилей.

+ + +

Баги и особенности

+ +

TazPanel — всё ещё молодое приложение, которое со временем будет + совершенствоваться и отшлифовываться. Если вы нашли ошибку, + пожалуйста, сообщите на баг-трекер SliTaz: bugs.slitaz.org. + Tazpanel имеет режим отладки, который можно включить в файле + конфигурации tazpanel.conf; + также имеется отладочная + страница.

+ +
+
diff -r e4ad3356ac6a -r 299f204b8f1f hardware.cgi --- a/hardware.cgi Mon Mar 23 21:17:06 2015 +0100 +++ b/hardware.cgi Tue Mar 24 03:39:08 2015 +0200 @@ -2,7 +2,7 @@ # # Hardware part of TazPanel - Devices, drivers, printing # -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License # # Common functions from libtazpanel @@ -20,10 +20,11 @@ [ -s $module ] && . $module "$@" } + lsusb_table() { - cat << EOT - + cat < EOT @@ -35,10 +36,11 @@ echo "
BusDeviceIDName
" } + lspci_table() { - cat << EOT - + cat < EOT @@ -56,51 +58,64 @@ case " $(GET) " in *\ print\ *) xhtml_header - echo "

TODO

" ;; + echo "

TODO

" + ;; + + *\ tazx\ *) xhtml_header - cat << EOT + cat <$(tazx auto) EOT ;; + + *\ detect\ *) # Front end for Tazhw # TODO: Add button to detect webcam, etc. Like in tazhw box. xhtml_header - cat << EOT -
-

$(gettext 'Detect hardware')

-

$(gettext 'Detect PCI and USB hardware')

-
+ cat <$(gettext 'Detect hardware') +

$(gettext 'Detect PCI and USB hardware')

-
$(tazhw detect-pci | sed 's|^>|\>|g')
- -
$(tazhw detect-usb | sed 's|^>|\>|g')
+
+
+
$(tazhw detect-pci | sed 's|^>|\>|g')
+
$(tazhw detect-usb | sed 's|^>|\>|g')
+
+
EOT ;; + + *\ modules\ *|*\ modinfo\ *) xhtml_header - cat << EOT -
-

$(gettext 'Kernel modules')

-
-
- - - -
-

$(gettext 'Manage, search or get information about the Linux kernel modules')

-
+ cat <$(gettext 'Kernel modules') + +
+ + $(gettext 'Manage, search or get information about the Linux kernel modules') + + + EOT # Request may be modinfo output that we want in the page itself get_modinfo="$(GET modinfo)" if [ -n "$get_modinfo" ]; then - cat << EOT -$(eval_gettext 'Detailed information for module: $get_modinfo') + cat < +
$(eval_gettext 'Detailed information for module: $get_modinfo')
-
$(modinfo $get_modinfo)
EOT + modinfo $get_modinfo | awk 'BEGIN{print "
SlotDeviceName
"} + { + printf("", $1) + $1=""; printf("", $0) + } + END{print "
%s%s
"}' fi + if [ -n "$(GET modprobe)" ]; then echo "
$(modprobe -v $(GET modprobe))
" fi @@ -120,56 +135,73 @@ done echo '' fi - cat << EOT - $(table_start) - - $(gettext 'Module') - $(gettext 'Size') - $(gettext 'Used') - $(gettext 'by') - + cat < + + + + + + + + + + + EOT # Get the list of modules and link to modinfo - lsmod | grep ^[a-z] | while read MOD SIZE USED BY - do - cat << EOT - - - - - - + lsmod | tail -n+2 | awk '{ + gsub(",", " ", $4); + printf("", $2, $3, $4); + }' + cat < +
$(gettext 'Module')$(gettext 'Description')$(gettext 'Size')$(gettext 'Used')$(gettext 'by')
$MOD$SIZE$USED$(echo $BY | sed s/","/" "/g)
%s", $1, $1); + system("modinfo -d " $1); + printf("%s%s%s
+ EOT - done - table_end ;; + ;; + + *\ lsusb\ *) xhtml_header vidpid="$(GET lsusb)" - cat << EOT -
-

$(eval_gettext 'Information for USB Device $vidpid')

-

$(gettext 'Detailed information about specified device.')

-EOT - lsusb_table - cat << EOT -
-
$(lsusb -vd $vidpid | syntax_highlighter lsusb)
+ cat <$(eval_gettext 'Information for USB Device $vidpid') + +

$(gettext 'Detailed information about specified device.')

+ +
$(lsusb_table)
+ +
+
+
$(lsusb -vd $vidpid | syntax_highlighter lsusb)
+
+
EOT ;; + + *\ lspci\ *) xhtml_header slot="$(GET lspci)" - cat << EOT -
-

$(eval_gettext 'Information for PCI Device $slot')

-

$(gettext 'Detailed information about specified device.')

-EOT - lspci_table - cat << EOT -
-
$(lspci -vs $slot | syntax_highlighter lspci)
+ cat <$(eval_gettext 'Information for PCI Device $slot') + +

$(gettext 'Detailed information about specified device.')

+ +
$(lspci_table)
+ +
+
+
$(lspci -vs $slot | syntax_highlighter lspci)
+
+
EOT ;; + + *) [ -n "$(GET brightness)" ] && echo -n $(GET brightness) > /sys/devices/virtual/backlight/$(GET dev)/brightness @@ -178,43 +210,47 @@ # Default to summary with mounted filesystem, loaded modules # xhtml_header - cat << EOT -
-

$(gettext 'Drivers & Devices')

-

$(gettext 'Manage your computer hardware')

-
- + cat <$(gettext 'Drivers & Devices') +

$(gettext 'Manage your computer hardware')

+ +
+
EOT - if [ -n "$(ls /proc/acpi/battery/*/info 2> /dev/null)" ]; then - echo "" + + + # Battery state + if [ -n "$(ls /proc/acpi/battery/*/info 2>/dev/null)" ]; then + cat < +
$(gettext 'Battery')
+
+
+EOT for dev in /proc/acpi/battery/*; do grep ^present $dev/info | grep -q yes || continue - design=$(sed '/design capacity:/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) - remain=$(sed '/remaining capacity/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/state) - rate=$(sed '/present rate/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/state) - full=$(sed '/last full capacity/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) + design=$(sed '/design capacity:/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) + remain=$(sed '/remaining capacity/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/state) + rate=$(sed '/present rate/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/state) + full=$(sed '/last full capacity/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) warning=$(sed '/design capacity warning/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) - low=$(sed '/design capacity low/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) - state=$(sed '/charging state/!d;s/\([^:]*:[ ]\+\)\([a-z]\+\)/\2/' < $dev/state) + low=$(sed '/design capacity low/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) + state=$(sed '/charging state/!d; s/\([^:]*:[ ]\+\)\([a-z]\+\)/\2/' < $dev/state) rempct=$(( $remain * 100 / $full )) - cat << EOT - - - - + + ' + cat < + + +EOT done - echo "
- $(gettext 'Battery') $(grep "^battery type" $dev/info | sed 's/.*: *//') - $(grep "^design capacity:" $dev/info | sed 's/.*: *//') $(gettext 'health') $(( (100*$full)/$design))% - + cat < + $(gettext 'Battery') + $(grep "^battery type" $dev/info | sed 's/.*: *//') + $(grep "^design capacity:" $dev/info | sed 's/.*: *//') $(gettext 'health') $(( (100*$full)/$design))% + EOT case "$state" in "discharging") @@ -228,30 +264,41 @@ "charged") gettext 'Charged 100%' ;; esac - echo '
" + cat < + + +EOT fi - if [ -n "$(ls /sys/devices/virtual/thermal/*/temp 2> /dev/null)" ]; then - echo -n '

'; gettext 'Temperature:' + + # Thermal sensors + if [ -n "$(ls /sys/devices/virtual/thermal/*/temp 2>/dev/null)" ]; then + echo "

$(gettext 'Temperature:')" for temp in /sys/devices/virtual/thermal/*/temp; do - awk '{ print $1/1000 }' < $temp + awk '{ print $1/1000 "℃" }' < $temp done echo '

' fi - if [ -n "$(ls /sys/devices/virtual/backlight/*/brightness 2> /dev/null)" ]; then - cat < -EOT - for dev in /sys/devices/virtual/backlight/*/brightness ; do + + # Brightness + if [ -n "$(ls /sys/devices/virtual/backlight/*/brightness 2>/dev/null)" ]; then + echo '
' + for dev in /sys/devices/virtual/backlight/*/brightness; do name=$(echo $dev | sed 's|.*/backlight/\([^/]*\).*|\1|') cat < -$(gettext 'Brightness') \ + +$(gettext 'Brightness') \ $(sed 's/.*\.//;s/_*$//' < /sys/devices/virtual/backlight/$name/device/path): - EOT max=$(cat /sys/devices/virtual/backlight/$name/max_brightness) for i in $(seq 0 $max); do @@ -260,22 +307,19 @@ echo -n " selected=\"selected\"" echo "> $(( (($i + 1) * 100) / ($max + 1) ))% " done - cat < -EOT + echo '' done - cat << EOT - -EOT + echo '' fi - cat << EOT -

$(gettext 'Filesystem usage statistics')

- -
-$(fdisk -l | fgrep Disk)
-
+ cat < +
+
$(gettext 'Filesystem usage statistics')
+
+
$(fdisk -l | fgrep Disk)
+
EOT @@ -293,6 +337,8 @@ file="$(GET backingfile)" [ -n "$file" ] && losetup -o $(GET offset) $ro $device $file esac + + # # Disk stats and management (mount, umount, check) # @@ -309,13 +355,12 @@ umount\ *|swapon\ *|swapoff\ *) $device ;; esac - cat << EOT - - + cat < EOT df_thead echo '' - for fs in $(blkid | sed 's/:.*//') + for fs in $(blkid | sort | sed 's/:.*//') do set -- $(df -h | grep "^$fs ") size=$2 @@ -325,6 +370,8 @@ av="$av" pct=$5 mp=$6 + + # action action="mount" [ -n "$mp" ] && action="umount" type=$(blkid $fs | sed '/TYPE=/!d;s/.*TYPE="\([^"]*\).*/\1/') @@ -338,132 +385,216 @@ pct=$(((100*$4)/$3))% mp=swap fi + + # size [ -z "$size" ] && size="$(blk2h $(cat /sys/block/${fs#/dev/}/size /sys/block/*/${fs#/dev/}/size))" - img="harddisk.png" - case "$(cat /sys/block/${fs#/dev/}/removable 2> /dev/null || - cat /sys/block/${fs:5:3}/removable 2> /dev/null)" in - 1) img="floppy.png" ;; + + # image + disktype="hdd" + case "$(cat /sys/block/${fs#/dev/}/removable 2>/dev/null || + cat /sys/block/${fs:5:3}/removable 2>/dev/null)" in + 1) disktype="removable" ;; esac - case "$(cat /sys/block/${fs#/dev/}/ro 2> /dev/null || - cat /sys/block/${fs:5:3}/ro 2> /dev/null)" in - 1) img="tazlito.png" ;; + case "$(cat /sys/block/${fs#/dev/}/ro 2>/dev/null || + cat /sys/block/${fs:5:3}/ro 2>/dev/null)" in + 1) disktype="cd" ;; esac - [ -s ".$IMAGES/$img" ] || img="harddisk.png" - cat << EOT - - - - - - + + cat < + + + + + EOT if [ -n "$pct" ]; then - cat << EOT - + cat < + $used - $pct + EOT else - cat << EOT - + cat <  EOT fi - cat << EOT - - - + cat <$mp + + EOT done - cat << EOT - -
- ${fs#/dev/}$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')$type$size$av$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')$type$size$av - $used - $pct -  $mp$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')
$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')
-$(lib crypto input) - - -new mount point - - read-only -
+ cat < + + $(lib crypto input) - -

$(gettext 'Filesystems table')

+
+ - + $(gettext 'new mount point:') - + +
+ + EOT -grep -v '^#' /etc/fstab | awk 'BEGIN{print "\ - "}\ - {print ""} + + # + # /etc/fstab + # + cat < +
$(gettext 'Filesystems table')
+
$(gettext 'Disk')$(gettext 'Mount point')\ - $(gettext 'Type')$(gettext 'Options')\ - $(gettext 'Freq')$(gettext 'Pass')
"$1""$2\ - ""$3""$4""$5""$6"
+ + + + + + + + + + + +EOT + +grep -v '^#' /etc/fstab | awk '{ + print "" +} END{print "
$(gettext 'Disk')$(gettext 'Mount point')$(gettext 'Type')$(gettext 'Options')$(gettext 'Freq')$(gettext 'Pass')
" $1 "" $2 "" $3 "" $4 + print "" $5 "" $6 "
"}' - cat << EOT - - $(gettext 'Manual Edit') + cat < +
+ + +
+ + +EOT -

$(gettext 'Loop devices')

+ # + # Loop device management GUI + # + cat < +
$(gettext 'Loop devices')
+ +
+ + + + + + + + + + EOT - # - # Loop device management gui - # - cat << EOT - -
$(gettext 'Device')$(gettext 'Backing file')$(gettext 'Access')$(gettext 'Offset')
- - - - -EOT -for loop in $(ls /dev/loop[0-9]*); do - case "$(cat /sys/block/${loop#/dev/}/ro 2> /dev/null)" in - 0) ro="read/write" ;; - 1) ro="read only" ;; +for devloop in $(ls /dev/loop[0-9]*); do + loop="${devloop#/dev/}" + case "$(cat /sys/block/$loop/ro 2>/dev/null)" in + 0) ro="$(gettext "read/write")" ;; + 1) ro="$(gettext "read only")" ;; *) ro="" ;; esac - set -- $(losetup | grep ^$loop:) $ro - cat << EOT - - - - + set -- $(losetup | grep ^$devloop:) ${ro// / } + cat < + + EOT done - cat << EOT - -
DeviceBacking fileAccessOffset
- ${loop#/dev/}$3$4$2
$3$4$2
+ cat < + + $(lib crypto input) - - -new backing file - -offset in bytes - - read-only - + +
+ - + $(gettext 'new backing file:') - + $(gettext 'offset in bytes:') - + +
+ + EOT - cat << EOT -

$(gettext 'System memory')

+ + # + # System memory + # + mem_total=$(free -m | awk '$1 ~ "M" {print $2}') + mem_used=$((100 * $(free -m | awk '$1 ~ "+" {print $3}') / mem_total)) + mem_buff=$((100 * $(free -m | awk '$1 ~ "M" {print $6}') / mem_total)) + mem_free=$((100 - mem_used - mem_buff)) + + cat < +
$(gettext 'System memory')
+ +
${mem_used}%${mem_buff}%${mem_free}%
+ + + + + + + + + + + + + EOT -echo "
 totalusedfreesharedbuffers
\ -" -freem=$(free -m) -echo "$freem" | grep Mem: | awk '{print ""}' -echo "$freem" | grep buffers: | awk '{print "\ - "}' -echo "$freem" | grep Swap: | awk '{print "
 totalusedfreesharedbuffers
"$1""$2""$3\ - ""$4""$5""$6"
"$1 $2" "$3""$4"  
"$1""$2""$3\ - ""$4"  
"}' +free -m | awk ' +$1 ~ "M" {print ""$1""$2""$3""$4""$5""$6""} +$1 ~ "+" {print ""$1 $2""$3""$4""} +$1 ~ "S" {print ""$1""$2""$3""$4""}' - cat << EOT -

lspci

-$(lspci_table) + cat < + + +EOT -

lsusb

-$(lsusb_table) + + # + # lspci and lsusb summary tables + # + cat < +
lspci
+ $(lspci_table) + + + +
+
lsusb
+ $(lsusb_table) +
EOT - ;; + ;; esac xhtml_footer diff -r e4ad3356ac6a -r 299f204b8f1f help.cgi --- a/help.cgi Mon Mar 23 21:17:06 2015 +0100 +++ b/help.cgi Tue Mar 24 03:39:08 2015 +0200 @@ -2,7 +2,7 @@ # # help.cgi - Display TazPanel doc and README. # -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License # # Common functions from libtazpanel @@ -10,43 +10,33 @@ get_config header + # ENTER will search but user may search for a button, so put one. + search_form() { - cat << EOT - + cat < EOT } + # Cat translated help content + TITLE=$(gettext 'TazPanel - Help & Doc') xhtml_header search_form -if [ "$(GET manual)" ]; then - echo '
'
+if [ -n "$(GET manual)" ]; then
+	echo "
"
 	man $(GET manual)
-	echo '
' + echo "
" else - if [ -d doc ]; then - cat doc/tazpanel.html - else - cat /usr/share/doc/tazpanel/tazpanel.html - fi - -# cat << EOT -#

README

-#
$(cat $PANEL/README)
-#EOT + cat doc/tazpanel.html cat $PANEL/README.html - fi xhtml_footer diff -r e4ad3356ac6a -r 299f204b8f1f index.cgi --- a/index.cgi Mon Mar 23 21:17:06 2015 +0100 +++ b/index.cgi Tue Mar 24 03:39:08 2015 +0200 @@ -1,54 +1,56 @@ #!/bin/sh # -# Main CGI interface for TazPanel. In on word: KISS. Use the main css form +# Main CGI interface for TazPanel. In on word: KISS. Use the main CSS form # command so we are faster and do not load unneeded functions. If necessary # you can use the lib/ dir to handle external resources. # -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License # + # Common functions from libtazpanel + . lib/libtazpanel get_config -header TITLE="TazPanel" + + # Check whether a configuration file has been modified after installation + file_is_modified() { grep -l " $1$" $INSTALLED/*/md5sum | while read file; do - # Found, but can we do diff ? + # Found, but can we do diff? [ "$(grep -h " $1$" $file)" != "$(md5sum $1)" ] || break - org=$(dirname $file)/volatile.cpio.gz - zcat $org 2>/dev/null | cpio -t 2>/dev/null | \ - grep -q "^${1#/}$" || break + orig=$(dirname $file)/volatile.cpio.gz + zcat $orig 2>/dev/null | cpio -t 2>/dev/null | grep -q "^${1#/}$" || break case "$2" in - diff) - tmp=/tmp/tazpanel$$ - mkdir -p $tmp - ( cd $tmp ; zcat $org | cpio -id ${1#/} ) - diff -abu $tmp$1 $1 | sed "s|$tmp||" - rm -rf $tmp ;; - button) - cat < - $(gettext 'Differences') -EOT + diff) + tmp=$(mktemp -d) + ( cd $tmp; zcat $orig | cpio -id ${1#/} ) + diff -abu $tmp$1 $1 | sed "s|$tmp||" + rm -rf $tmp;; + button) + echo -n '';; esac break done } + # OK status in table + ok_status_t() { - echo " [ OK ]" + echo '' } + # # Things to do before displaying the page # @@ -56,66 +58,96 @@ [ -n "$(GET panel_pass)" ] && sed -i s@/:root:.*@/:root:$(GET panel_pass)@ $HTTPD_CONF + + + + # # Commands # case " $(GET) " in + + *\ exec\ *) + # Execute command and display its result in a terminal-like window + + header; TITLE=$(gettext 'TazPanel - exec'); xhtml_header + exec="$(GET exec)" - TITLE=$(gettext 'TazPanel - exec') - xhtml_header - cat << EOT -

$exec

-
-$($exec 2>&1 | htmlize)
-
+ font="${TERM_FONT:-monospace}" + palette=$(echo $TERM_PALETTE | tr A-Z a-z) + + cat < +
+ $exec + $(back_button "$(GET back)" "$(GET back_caption)" "$(GET back_icon)") +
+
+
$($exec 2>&1 | htmlize | filter_taztools_msgs)
+
+ EOT ;; + + *\ file\ *) # # Handle files # + header file="$(GET file)" + action="$(POST action)"; [ -z "$action" ] && action="$(GET action)" # receive 'action' both on POST or GET + case $file in *.html) - cat $file && exit 0 ;; + cat $file; exit 0 ;; *) - TITLE=$(gettext 'TazPanel - File') - xhtml_header - echo "

$file

" ;; + TITLE=$(gettext 'TazPanel - File'); xhtml_header ;; esac - if [ "$(GET action)" == "edit" ]; then - cat < - - - - $(gettext 'Differences') - - + case "$action" in + edit) + cat < +
+ $file +
+ + +
+
+ + EOT #The space before textarea gets muddled when the form is submitted. #It prevents anything else from getting messed up - elif [ "$(GET action)" == "setvar" ]; then + ;; + + setvar) data="$(. $(GET file) ;eval echo \$$(GET var))" cat < - - - $(GET var) : - - - +
+
$(GET var)
+
+ + + +
+
EOT - elif [ "$(GET action)" == "diff" ]; then - echo '
'
-			file_is_modified $file diff | syntax_highlighter diff
-			echo '
' - else + ;; + + diff) + cat < +
$(file_is_modified $file diff | syntax_highlighter diff)
+ +EOT + ;; + + *) R=$(echo -en '\r') if [ -n "$(POST content)" ]; then if [ -n "$(POST var)" ]; then @@ -126,15 +158,19 @@ EOT fi fi + cat < - - $(gettext 'Edit') -EOT - file_is_modified $file button - cat << EOT - -
+
+
$file +
+ + $(file_is_modified $file button) +
+
+ +
+
 EOT
 			# Handle file type by extension as a Web Server does it.
 			case "$file" in
@@ -142,110 +178,305 @@
 					syntax_highlighter conf ;;
 				*.sh|*.cgi)
 					syntax_highlighter sh ;;
+				*Xorg.0.log)
+					syntax_highlighter xlog ;;
+				*dmesg.log)
+					syntax_highlighter kernel ;;
 				*)
 					cat | htmlize ;;
 			esac < $file
-			echo '
' - fi ;; + cat < +
+
+EOT + esac + ;; + *\ terminal\ *|*\ cmd\ *) - # Cmdline terminal. - commands='cat du help ls ping pwd who wget' + # Cmdline terminal + + TITLE=$(gettext 'TazPanel - Terminal'); header; xhtml_header + + historyfile=/root/.ash_history + #commands='cat cd date du fdisk help ls ping pwd who wget' cmd=$(GET cmd) - TITLE=$(gettext 'TazPanel - Terminal') - xhtml_header - cat << EOT + + path="$(GET path)"; path="${path:-/tmp}"; cd "${path/~//root}" + [ "$path" == '/root' ] && path='~' + user="$REMOTE_USER" + [ -z "$HOME" ] && HOME=/root # for apps that modified user settings + + font="${TERM_FONT:-monospace}" + palette=$(echo $TERM_PALETTE | tr A-Z a-z) + + [ -n "$cmd" -a "$cmd" != "$(tail -n1 $historyfile)" ] && echo "$cmd" >> $historyfile + + + # Terminal history + + if [ "$cmd" == 'history' ]; then + cat < -
-
- root@$(hostname):~# -
-
+
+ $(gettext 'History') +
+
+
+ +
 EOT
-	echo '
'
-	# Allow only a few commands for the moment.
-	case "$cmd" in
+			htmlize < $historyfile | awk -vrun="$(gettext 'run')" -vpath="$path" '
+			BEGIN { num=1 }
+			{
+			printf("%3d ", num);
+			cmd = $0
+			gsub("%",  "%25", cmd); gsub("+",  "%2B", cmd); gsub(" ",    "+",   cmd);
+			gsub("\"", "%22", cmd); gsub("!",  "%21", cmd); gsub("'\''", "%27", cmd);
+			printf("%s ", cmd, path, run);
+			printf("", num, num);
+			printf("\n", num, $0);
+			num++
+			}'
+			cat <
+		
+ +
+ + +EOT + xhtml_footer + exit 0 + fi + + + # Terminal window + + cat < +
+
+EOT
+		if [ -n "$cmd" ]; then
+			echo -n "$user@$(hostname):$path# "
+			echo "$cmd" | htmlize
+		fi
+
+		case "$cmd" in
 		usage|help)
-			gettext 'Small terminal emulator, commands options are supported.'
-			echo ""
-			eval_gettext 'Commands: $commands'
-			echo ;;
+			gettext 'Small non-interactive terminal emulator.'; echo
+			gettext 'Run any command at your own risk, avoid interactive commands (nano, mc, ...)'; echo
+			;;
 		wget*)
 			dl=/var/cache/downloads
 			[ ! -d "$dl" ] && mkdir -p $dl
-			eval_gettext 'Downloading to: $dl' && echo
-			cd $dl && $cmd ;;
-		du*|ls*|ping*|pwd|who)
-			$cmd ;;
-		cat*)
+			eval_gettext 'Downloading to: $dl'; echo
+			cd $dl; $cmd 2>&1 ;;
+		cd|cd\ *)
+			path="${cmd#cd}"; path="${path:-/root}"; path="$(realpath $path)" ;;
+		ls|ls\ *)
+			$cmd -w80 --color=always 2>&1 | filter_taztools_msgs ;;
+		cat)
 			# Cmd must be used with an arg.
-			arg=$(echo $cmd | awk '{print $2}')
-			[ "$arg" == "" ] && eval_gettext '$cmd needs an argument' && break
-			$cmd ;;
+			eval_gettext '$cmd needs an argument' ;;
+		mc|nano)
+			# List of restricted (interactive) commands
+			eval_gettext "Please, don't run interactive command \"$cmd\""; echo; echo ;;
 		*)
-			[ "$cmd" == "" ] || \
-				eval_gettext 'Unknown command: $cmd' && echo
-			eval_gettext 'Commands: $commands' ;;
+			unset HTTP_REFERER  # for fooling /lib/libtaz.sh formatting utils (
in the terminal is so-so) + export DISPLAY=:0.0 # for run X applications + /bin/sh -c "$cmd" 2>&1 | htmlize | filter_taztools_msgs + ;; esac - echo '
' + + [ "$path" == '/root' ] && path='~' + cat < +
$user@$(hostname):$path#
+ + + +
+ + +
+ + +
+ + +EOT ;; + *\ rmhistory\ *) + # Manage shell commandline history + historyfile=/root/.ash_history + + # Return sed command for removing history lines ('8d12d' to remove 8 and 12 lines) + rms=$(echo $QUERY_STRING | awk 'BEGIN{RS="&";FS="="}{if($1=="rm")printf "%dd", $2}') + + if [ -n "$rms" ]; then + # Actually remove lines + sed -i $rms $historyfile + # Redirects back to the history table + header "HTTP/1.1 301 Moved Permanently" "Location: ?terminal&cmd=history&path=$(GET path)" + exit 0 + fi + ;; + + + *\ termsettings\ *) + # Terminal settings + TITLE=$(gettext 'TazPanel - Terminal'); header; xhtml_header; + user="$REMOTE_USER" + font="$(GET font)"; font="${font:-$TERM_FONT}" + palette="$(GET palette)"; palette="${palette:-$TERM_PALETTE}" + pal=$(echo $palette | tr A-Z a-z) + + # Add or change settings in TazPanel config + if [ -z "$TERM_FONT" ]; then + echo -e "\n# Terminal font family\nTERM_FONT=\"$font\"" >> $CONFIG + else + sed -i "s|TERM_FONT=.*|TERM_FONT=\"$font\"|" $CONFIG + fi + if [ -z "$TERM_PALETTE" ]; then + echo -e "\n# Terminal color palette\nTERM_PALETTE=\"$palette\"" >> $CONFIG + else + sed -i "s|TERM_PALETTE=.*|TERM_PALETTE=\"$palette\"|" $CONFIG + fi + + cat < +
+ $(gettext 'Terminal settings') +
+ +
+
+
+$user@$(hostname):~# palette
+
+$(
+	for i in $(seq 30 37); do
+		for b in 0 1; do
+			for j in $(seq 40 47); do
+				echo -n "$i:$j"
+			done
+		done
+		echo
+	done
+)
+	
+
+
+ $(gettext 'Font:') + + $(gettext 'Palette:') + + +
+
+ +EOT + + ;; + + *\ top\ *) - TITLE=$(gettext 'TazPanel - Process activity') - xhtml_header - echo $(gettext 'Refresh:') $(GET refresh) - cat << EOT -
-
+ TITLE=$(gettext 'TazPanel - Process activity'); header; xhtml_header + + r=$(GET refresh) + cat < +

$(gettext 'Refresh:') - - - - + + + + + + + + +

EOT - if [ -n "$(GET refresh)" ]; then - echo -n '' - fi + [ -n "$r" ] && echo "" - echo '
'
+		echo '
'
 		top -n1 -b | htmlize | sed \
-			-e s"#^[A-Z].*:\([^']\)#\0#"g \
-			-e s"#PID.*\([^']\)#\0#"g
-		echo '
' ;; + -e 's|^[A-Z].*:|\0|g' \ + -e 's|^\ *PID|\0|g' + echo '
' ;; *\ debug\ *) - TITLE=$(gettext 'TazPanel - Debug') - xhtml_header - cat << EOT + TITLE=$(gettext 'TazPanel - Debug'); header; xhtml_header + + cat <$(gettext 'HTTP Environment') -
$(httpinfo)
+
+
+
$(httpinfo | syntax_highlighter conf)
+
+
EOT ;; *\ report\ *) - TITLE=$(gettext 'TazPanel - System report') + TITLE=$(gettext 'TazPanel - System report'); header; xhtml_header + [ -d /var/cache/slitaz ] || mkdir -p /var/cache/slitaz output=/var/cache/slitaz/sys-report.html - xhtml_header - cat << EOT -

$(eval_gettext 'Reporting to: $output')

- - - + + cat < +
$(eval_gettext 'Reporting to: $output')
+
$(gettext 'Creating report header...')
+ + EOT - cat > $output << EOT + cat > $output < - + $(gettext 'SliTaz system report') + +
$(gettext 'Creating report header...')
+ + +
+ +
+ +EOT + fi + + cat < +
+ $(gettext 'Configuration file') +
+ + +
+
+
$(gettext "These values are the wifi settings in the main /etc/network.conf configuration file")
+
$(grep ^WIFI /etc/network.conf | sed '/WIFI_KEY=/s|".*"|"********"|' | syntax_highlighter conf)
+ + + +
+
$(gettext 'Output of iwconfig')
+
$(iwconfig)
EOT ;; - *\ wifi\ *) - # Wireless connections settings - xhtml_header - LOADING_MSG=$(gettext 'Scanning wireless interface...') - loading_msg - . /etc/network.conf - cat << EOT -

$(gettext 'Wireless connection')

- -$(detect_wifi_networks) -EOT - WIFI_AP="$(GET ap)" - WIFI_KEY="$(GET key)" - case "$(GET keytype)" in - ''|off) WIFI_KEY_TYPE=none ;; - *) WIFI_KEY_TYPE=any ;; - esac - if [ "$(GET essid)" ]; then - /etc/init.d/network.sh stop | log - sed -i \ - -e s"/^WIFI_ESSID=.*/WIFI_ESSID=\"$(GET essid)\""/ \ - -e s"/^WIFI_KEY=.*/WIFI_KEY=\"$WIFI_KEY\"/" \ - -e s"/^WIFI_KEY_TYPE=.*/WIFI_KEY_TYPE=\"$WIFI_KEY_TYPE\"/" \ - -e s"/^WIFI_AP=.*/WIFI_AP=\"$WIFI_AP\"/" \ - /etc/network.conf - . /etc/network.conf - start_wifi - fi - # ESSID names are clickable - if [ "$(GET select)" ]; then - if [ "$(GET select)" != "$WIFI_ESSID" ]; then - WIFI_KEY="" - fi - WIFI_ESSID="$(GET select)" - fi - cat << EOT -
-

$(gettext 'Connection')

-
- - $(table_start) - - - $(gettext 'Name') - $(gettext 'Value') - - - - $(gettext 'Wifi name (ESSID)') - - - - $(gettext 'Password (Wifi key)') - - - - $(gettext 'Encryption type') - - - - $(gettext 'Access point') - - - $(table_end) - -
-
-
-

$(gettext 'Configuration file')

-

$(gettext "These values are the wifi settings in the main /etc/network.conf \ -configuration file")

- -
$(grep ^WIFI /etc/network.conf | sed '/WIFI_KEY=/s|".*"|"********"|' | \
-syntax_highlighter conf)
- - - $(gettext 'Manual Edit') -
- -
-

$(gettext 'Output of iwconfig')

- -
$(iwconfig)
-
-EOT - ;; *) # Main Network page starting with a summary xhtml_header - hostname=$(cat /etc/hostname) - cat << EOT + + stop_disabled=''; start_disabled='' + if cat /sys/class/net/*/operstate | fgrep -q up; then + start_disabled='disabled' + else + stop_disabled='disabled' + fi + + cat <$(gettext 'Networking')

$(gettext 'Manage network connections and services')

-
-
- -
- $(gettext 'Configuration:') - network.conf - Ethernet - Wireless -
+
+ +
+
+
$(gettext 'Configuration:')
-$(list_network_interfaces) + +
+
$(gettext 'Network interfaces')
+ $(list_network_interfaces)
+
-

$(gettext 'Hosts')

- -
$(cat /etc/hosts)
- - - $(gettext 'Edit hosts') +
$(gettext 'Hosts')
+
$(cat /etc/hosts)
+
+
+ + +
+
+
-

$(gettext 'Hostname')

- -
- - -
+
$(gettext 'Hostname')
+
+
+ + +
+
+
-

$(gettext 'Output of ifconfig')

- -
$(ifconfig)
+
$(gettext 'Output of ifconfig')
+
$(ifconfig)
+
-

$(gettext 'Routing table')

- -
$(route -n)
+
$(gettext 'Routing table')
+
$(route -n)
+
-

$(gettext 'Domain name resolution')

- -
$(cat /etc/resolv.conf)
+
$(gettext 'Domain name resolution')
+
$(cat /etc/resolv.conf)
+
-

$(gettext 'ARP table')

- -
$(arp)
+
$(gettext 'ARP table')
+
$(arp)
+
-

$(gettext 'IP Connections')

- -
-$(netstat -anp 2> /dev/null | sed -e '/UNIX domain sockets/,$d' \
--e 's#\([0-9]*\)/#\1/#')
-
+
$(gettext 'IP Connections')
+
$(netstat -anp 2>/dev/null | sed -e '/UNIX domain sockets/,$d' \
+-e 's#\([0-9]*\)/#\1/#')
EOT ;; diff -r e4ad3356ac6a -r 299f204b8f1f settings.cgi --- a/settings.cgi Mon Mar 23 21:17:06 2015 +0100 +++ b/settings.cgi Tue Mar 24 03:39:08 2015 +0200 @@ -4,17 +4,21 @@ # don't have multiple pages here there is only one case used to get command # values and the full content is followed directly. # -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License # + # Common functions from libtazpanel + . lib/libtazpanel get_config header TITLE=$(gettext 'TazPanel - Settings') + # Get system database. LDAP compatible. + getdb() { getent $1 2>/dev/null || cat /etc/$1 @@ -27,63 +31,209 @@ done } + +############################# +# Get info from locale file # +############################# + +get_locale_info() +{ + # Commands like `LC_ALL=fr_FR locale -k LC_MEASUREMENT` will do the job + # only when your locale is generated and exists in the /usr/lib/locale. + # Here we manually parse locale definition files from /usr/share/i18n/locales/. + # Strange, bloated and not script-friendly format :( + + [ ! -e /usr/share/i18n/locales/$1 ] && return + + # Prepare file + if [ ! -e /tmp/tazpanel-$1 ]; then + sed 's|^[ \t]*||;/^%/d;/^comment_char/d;/^escape_char/d' /usr/share/i18n/locales/$1 | tr '\n' '&' | sed 's|/&||g' | tr '&' '\n' | sed 's||\&#x\1;|g' | sed 's|�|\&#x|g' > /tmp/tazpanel-$1 + fi + + local ANS=$(grep -e "^$2[ ]" /tmp/tazpanel-$1 | sed 's|^[^ \t][^ \t]* *||') + if [ -z "$ANS" ]; then + # Not found, then section is copied from other locale definition file... + case $2 in + measurement) + section='LC_MEASUREMENT';; + width|height) + section='LC_PAPER';; + currency_symbol|int_curr_symbol) + section='LC_MONETARY';; + day|abday|mon|abmon|d_t_fmt|d_fmt|t_fmt|am_pm|t_fmt_ampm|date_fmt) + section='LC_TIME';; + esac + # Recursive call + get_locale_info $(sed -n '/^'$section'/,/^END '$section'/p' /tmp/tazpanel-$1 | grep 'copy' | cut -d'"' -f2) $2 + else + case $2 in + day|abday|mon|abmon|am_pm) # semicolon-separated list in double quotes + echo "$ANS";; + *) # single value in double qoutes + echo "$ANS" | cut -d'"' -f2;; + esac + fi +} + + +# Get info from locale file about measurement system + +get_locale_info_measurement() +{ + # faster to use pre-processed values + case $1 in + en_AG|en_US|es_PR|es_US|nl_AW|yi_US) gettext 'US' ;; + POSIX) ;; + *) gettext 'metric' ;; + esac +} + + +# Get info from locale file about paper size + +get_locale_info_paper() +{ + # faster to use pre-processed values + case $1 in + en_AG|en_US|es_PR|es_US|nl_AW|yi_US) echo '8½×11 (US Letter)';; + en_CA|en_PH|es_CL|es_CO|es_CR|es_GT|es_MX|es_NI|es_PA|es_SV|es_VE|fil_PH|fr_CA|ik_CA|iu_CA|shs_CA|tl_PH) echo '216×279 (US Letter)';; + POSIX) ;; + *) echo '210×297 (A4)';; + esac +} + + +# Get info from locale file about date and time format + +get_locale_info_date_time() +{ + case $2 in + c) get_locale_info $1 d_t_fmt ;; + x) get_locale_info $1 d_fmt ;; + X) get_locale_info $1 t_fmt ;; + r) get_locale_info $1 t_fmt_ampm ;; + *) get_locale_info $1 date_fmt ;; + esac | sed 's| | |g; s|%|%|g; s|,|,|g; s|-|-|g; s|.|.|g; s|/|/|g; s|:|:|g; s|A|A|g; s|B|B|g; s|C|C|g; s|F|F|g; s|H|H|g; s|I|I|g; s|M|M|g; s|O|O|g; s|R|R|g; s|S|S|g; s|T|T|g; s|X|X|g; s|Y|Y|g; s|Z|Z|g; s|a|a|g; s|b|b|g; s|e|e|g; s|d|d|g; s|k|k|g; s|m|m|g; s|n|n|g; s|o|o|g; s|p|p|g; s|r|r|g; s|t|t|g; s|x|x|g; s|y|y|g; s|z|z|g;' + +} + + +parse_date() +{ + local weekday month day abday mon abmon rtime d_fmt t_fmt am_pm + weekday=$(( $(date +%w) + 1 )) # 1=Sunday ... + month=$(date +%-m) # 1=January ... + day=$(get_locale_info $1 day | cut -d'"' -f$(( 2 * $weekday )) | sed 's|&|\\\&|g') # translated day of week + abday=$(get_locale_info $1 abday | cut -d'"' -f$(( 2 * $weekday )) | sed 's|&|\\\&|g') # same, abbreviated + mon=$(get_locale_info $1 mon | cut -d'"' -f$(( 2 * $month )) | sed 's|&|\\\&|g') # translated month + abmon=$(get_locale_info $1 abmon | cut -d'"' -f$(( 2 * $month )) | sed 's|&|\\\&|g') # same, abbreviated + # next %-codes expanded into other %-codes + rtime=$(get_locale_info_date_time $1 r | sed 's|&|\\\&|g') # %r: 12-hour time + d_fmt=$(get_locale_info_date_time $1 x | sed 's|&|\\\&|g') # %x: date + t_fmt=$(get_locale_info_date_time $1 X | sed 's|&|\\\&|g') # %X: time + + case $(LC_ALL=POSIX date +%P) in # translated am/pm + am) am_pm=$(get_locale_info $1 am_pm | cut -d'"' -f2 | sed 's|&|\\\&|g');; + pm) am_pm=$(get_locale_info $1 am_pm | cut -d'"' -f4 | sed 's|&|\\\&|g');; + esac + + # r x X | OC | Y y Oy Ey | m -m Om | d -d Od | e -e Oe | F | H OH k | I OI l | M OM | S OS | R T | Z z | t | P p Op A a B b + # Note: %P=am/pm; %p=AM/PM. But here they the same because it is not a simple job to convert letters. + echo "$2" | sed "s|%r|$rtime|; s|%x|$d_fmt|; s|%X|$t_fmt|; \ + s|%OC|S(date +%OC)|; \ + s|%Y|$(date +%Y)|; s|%y|$(date +%y )|; s|%Oy|$(date +%Oy)|; s|%Ey|$(date +%Ey)|; \ + s|%m|$(date +%m)|; s|%-m|$(date +%-m)|; s|%Om|$(date +%Om)|; \ + s|%d|$(date +%d)|; s|%-d|$(date +%-d)|; s|%Od|$(date +%Od)|; \ + s|%e|$(date +%e)|; s|%-e|$(date +%-e)|; s|%Oe|$(date +%Oe)|; \ + s|%F|$(date +%F)|; \ + s|%H|$(date +%H)|; s|%OH|$(date +%OH)|; s|%k|$(date +%k)|; \ + s|%I|$(date +%I)|; s|%OI|$(date +%OI)|; s|%l|$(date +%l)|; \ + s|%M|$(date +%M)|; s|%OM|$(date +%OM)|; \ + s|%S|$(date +%S)|; s|%OS|$(date +%OS)|; \ + s|%R|$(date +%R)|; s|%T|$(date +%T )|; \ + s|%Z|$(date +%Z)|; s|%z|$(date +%z )|; \ + s|%t|\t|; \ + s|%P|$am_pm|; s|%p|$am_pm|; s|%Op|$am_pm|; s|%A|$day|; s|%a|$abday|; s|%B|$mon|; s|%b|$abmon|;" + +} + +list_of() +{ + cd /usr/share/i18n/locales + #mon=$(date +%-m); monn=$(( $mon * 2 )) + #echo "mon=\"$mon\" monn=\"$monn\"" + + echo '
'
+for LOC in be_BY ca_IT el_CY fr_CH ru_RU ru_UA; do
+	case $LOC in
+		iso*|translit*) ;;
+		*)
+			#echo -e "$LOC:\t$(parse_date $LOC $(get_locale_info_date_time $LOC c | sed 's|&|\\\&|g'))";;
+			FMT="$(get_locale_info_date_time $LOC c)"
+			echo -e "$LOC:\t$FMT"
+			parse_date $LOC "$FMT"
+			echo;;
+	esac
+done
+	echo '
' +} + + + + + # # Commands executed before page loading. # case " $(GET) " in *\ do\ *) - # Assume no array support in httpd_helper.sh ;^) - users="" - groups="" - IFS="&" - for i in $QUERY_STRING ; do - case "$i" in - user=*) users="$users ${i#user=}" ;; - group=*) groups="$groups ${i#group=}" ;; - esac - done - unset IFS - for cmd in "Delete group" ; do - [ "$(GET do)" == "$(gettext "$cmd")" ] || continue - for group in $groups ; do - case "$cmd" in - Delete*) delgroup $group ;; - esac - done - done - for cmd in "Delete user" "Lock user" "Unlock user" \ - "Change password" ; do - [ "$(GET do)" == "$(gettext "$cmd")" ] || continue # BUGGY - for user in $users ; do - case "$cmd" in - Delete*) deluser $user ;; - Lock*) passwd -l $user | log ;; - Unlock*) passwd -u $user | log ;; - Change*) echo "$user:$(GET password)" | chpasswd -m | log ;; - esac - done - done ;; - *\ addmember\ *) - addgroup $(GET member) $(GET group) ;; - *\ delmember\ *) - delgroup $(GET member) $(GET group) ;; - *\ addgroup\ *) - addgroup $(GET addgroup) ;; - *\ adduser\ *) - # - # Manage system user accounts - # - user=$(GET adduser) - passwd=$(GET passwd) - if [ -n "$user" ]; then - adduser -D -s /bin/sh -g "SliTaz User" -G users -h /home/$user $user - echo "$user:$passwd" | chpasswd -m | log - for g in audio cdrom floppy video tty - do - addgroup $user $g - done - fi ;; + users=$(echo $QUERY_STRING | awk 'BEGIN{RS="&";FS="="}{if($1=="user") print $2}') + groups=$(echo $QUERY_STRING | awk 'BEGIN{RS="&";FS="="}{if($1=="group")print $2}') + + case $(GET do) in + + # Groups page + delgroups) + for i in $groups; do delgroup $i; done ;; + addgroup) + addgroup $groups ;; + addmember) + addgroup $(GET member) $groups ;; + delmember) + delgroup $(GET member) $groups ;; + + # Users page + delusers) + for i in $users; do deluser $i; done ;; + lockusers) + for i in $users; do passwd -l $i | log; done ;; + unlockusers) + for i in $users; do passwd -u $i | log; done ;; + chpasswd) + echo "$users:$(GET password)" | chpasswd -m | log ;; + adduser) + if [ -n "$users" ]; then + name=$(GET name); name=${name:-SliTaz User} + adduser -D -s /bin/sh -g "$name" -G users -h /home/$users $users + echo "$user:$(GET passwd)" | chpasswd -m | log + for i in audio cdrom floppy video tty; do addgroup $users $i; done + fi ;; + + # System time + settz) + GET tz > /etc/TZ;; + date) # normalize to two digits + date $(printf '%02d%02d%02d%02d%d.%02d' "$(GET month)" "$(GET day)" "$(GET hour)" "$(GET min)" "$(GET year)" "$(GET sec)") >/dev/null;; + rdate) + rdate -s tick.greyware.com ;; + hwclock) + hwclock -w -u ;; + + esac + ;; + + *\ gen_locale\ *) new_locale=$(GET gen_locale) ;; *\ gen_keymap\ *) @@ -91,24 +241,21 @@ *\ apply_xorg_kbd\ *) sed -i "s/XkbLayout.*/XkbLayout \" \"$(GET apply_xorg_kbd)\"/" \ /etc/X11/xorg.conf.d/40-Keyboard.conf ;; - *\ date\ *) - date $(GET month)$(GET day)$(GET hour)$(GET min)$(GET year).$(GET sec) ;; - *\ rdate\ *) - rdate -s tick.greyware.com ;; - *\ hwclock\ *) - hwclock -w -u ;; *\ panel_pass*) sed -i s@/:root:.*@/:root:$(GET panel_pass)@ $HTTPD_CONF ;; *\ style*) sed -i s/'^STYLE.*'/"STYLE=\"$(GET style)\""/ $CONFIG . $CONFIG ;; - *\ settz\ *) - GET tz > /etc/TZ ;; esac + + + + # # Default xHTML content # + xhtml_header case " $(GET) " in @@ -117,116 +264,123 @@ # Groups management # cat <$(gettext 'Manage groups') +

$(gettext 'Manage groups')

-
- -
-
- $(gettext 'Selection:') - -
-
- - - - - - - - - +
+ +
+ + + +
+ +
+
$(gettext 'Group')$(gettext 'Group ID')$(gettext 'Members')
+ + + + + + + + EOT - for group in `getdb group | cut -d ":" -f 1` - do + for group in $(getdb group | cut -d ":" -f 1); do IFS=':' set -- $(getdb group | grep "^$group:") unset IFS gid=$3 members=$4 cat < - - - - + + + + + EOT done - cat << EOT - -
$(gettext 'Group')$(gettext 'Group ID')$(gettext 'Members')
- $group$gid${members//,/, }
+ $gid${members//,/, }
-
+ cat < + +
+ +
+
-

$(gettext 'Add a new group')

- -
- - - - - -
$(gettext 'Group name:') -
-
+
$(gettext 'Add a new group')
+
+ + + + + + +
$(gettext 'Group name:')
+ +
+
+
-

$(gettext 'Manage group membership')

- -
- - - - - - - -
$(gettext 'Group name:')$(gettext 'User name:')
-
-
+
$(gettext 'Manage group membership')
+
+ + + + + + + + + + + + +
$(gettext 'Group name:')$(gettext 'User name:')
+ + + +
+
EOT ;; + *\ user*) # # Users management # cat <$(gettext 'Manage users') +

$(gettext 'Manage users')

-
-
-
- $(gettext 'Selection:') - - - -
-
+
+ +
+ + + + +
- - - - - - - - - - - +
$(gettext 'Login')$(gettext 'User ID')$(gettext 'Name')$(gettext 'Home')$(gettext 'Shell')
+ + + + + + + + + + EOT - for login in `getdb passwd | cut -d ":" -f 1` - do + for login in $(getdb passwd | cut -d ":" -f 1); do if [ -d /home/$login ]; then colorlogin=$login grep -qs "^$login:!" /etc/shadow && @@ -234,61 +388,65 @@ IFS=':' set -- $(getdb passwd | grep "^$login:") unset IFS - uid=$3 - gid=$4 - name="$(echo $5 | sed s/,.*//)" - home="$6" - shell=$7 cat < - - - - - + + + + + EOT fi done - cat << EOT - -
$(gettext 'Login')$(gettext 'User ID')$(gettext 'Name')$(gettext 'Home')$(gettext 'Shell')
- $colorlogin$uid:$gid$name$home$shell + + $3:$4$(echo $5 | sed s/,.*//)$6$7
+ cat < + EOT - cat << EOT -

- $(gettext 'Password:') - - -

- + cat < +
+ $(gettext 'Password:') + + +
+ + +
+
-

$(gettext 'Add a new user')

+
$(gettext 'Add a new user')
-
- - - - - - - -
$(gettext 'User login:')
$(gettext 'User password:')
-
-
+
+ + + + + + + + +
$(gettext 'User login:')
$(gettext 'User name:')
$(gettext 'User password:')
+ +
+ +
+
+
-

$(gettext 'Current user sessions')

- -
$(who)
+
$(gettext 'Current user sessions')
+
$(who)
+
-

$(gettext 'Last user sessions')

- -
$(last)
+
$(gettext 'Last user sessions')
+
$(last)
EOT ;; @@ -298,19 +456,25 @@ # # Choose locale # - LOADING_MSG="$(gettext 'Please wait...')" - loading_msg + LOADING_MSG="$(gettext 'Please wait...')"; loading_msg + cur_loc=$(locale | grep LANG | cut -d= -f2) - cat << EOT -

$(gettext 'Choose locale')

+ cat <$(gettext 'Choose locale') -

$(gettext 'Current locale settings:')

-
$(locale)
+
+
$(gettext 'Current locale settings:')
+
+
$(locale)
+
+
-

$(gettext 'Locales that are currently installed on the machine:')

-
$(locale -a)
- -

$(gettext 'Available locales:')

+
+
$(gettext 'Locales that are currently installed on the machine:')
+
+
$(locale -a)
+
+
EOT is_installed "glibc-locale" @@ -320,49 +484,48 @@ install glibc-locale \ to see a larger list of available locales.") - cat << EOT -
-
- - - - - - - - -
$(gettext 'Code')$(gettext 'Language')$(gettext 'Territory')$(gettext 'Description')
-
- - - - - - + cat < +
$(gettext 'Available locales:')
+ +
+ + + + + + + + EOT - for locale in $(find /usr/share/i18n/locales -type f | sort) - do + for locale in $(find /usr/share/i18n/locales -type f | sort); do locale_name=$(basename $locale) locale_title=$(grep -m 1 -e '^ *title' $locale | cut -d'"' -f2) if [ -n "$locale_title" ]; then - sel=""; [ "$locale_name" == "$cur_loc" ] && sel="checked" - cat << EOT - - - - - + sel=''; [ "$locale_name" == "$cur_loc" ] && sel='checked="checked"' + cat < + + + + + EOT fi done - cat << EOT - -
$(gettext 'Code')$(gettext 'Language')$(gettext 'Territory')$(gettext 'Description')
$locale_name$(gettext -d iso_639 "$(grep -m 1 -e '^ *language' $locale | cut -d '"' -f2)")$(gettext -d iso_3166 "$(grep -m 1 -e '^ *territory' $locale | cut -d '"' -f2)")$locale_title
+ + + $(gettext -d iso_639 "$(grep -m 1 -e '^ *language' $locale | cut -d '"' -f2)")$(gettext -d iso_3166 "$(grep -m 1 -e '^ *territory' $locale | cut -d '"' -f2)")$locale_title
-
-
-

-
+ cat < + + +
+ +
+ + EOT ;; @@ -371,64 +534,72 @@ # # Default system settings page # - cat << EOT -
-

$(gettext 'System settings')

-

$(gettext 'Manage system time, users or language settings')

-

- + list_of + cat <$(gettext 'System settings') + +

$(gettext 'Manage system time, users or language settings')

+ +

+
-

$(gettext 'System time')

+
$(gettext 'System time')
+
+
+
$(gettext 'Time zone:') + + +
+
$(gettext 'System time:') + $(date | sed 's|[0-9][0-9]:[0-9:]*|&|') + +
+
$(gettext 'Hardware clock:') + $(hwclock -ur | sed 's|0.000000 seconds||') + +
+
$(gettext 'Set date') + + + + - :: + +
+
+
-
- - - - -
$(gettext 'Time zone:') - -
$(gettext 'System time:')$(date)
$(gettext 'Hardware clock:')$(hwclock -r)
-
- -
- - - - -- -: -: -
- -$(gettext 'Sync online') -$(gettext 'Set hardware clock') +
EOT + + # # Locale settings # - cat << EOT + cat < -

$(gettext 'System language')

-

+

$(gettext 'System language')
+
+
EOT # Check if a new locale was requested if [ -n "$new_locale" ]; then @@ -441,16 +612,21 @@ msg warn "$(eval_gettext \ 'You must logout and login again to your current session to use $new_locale locale.')" else - gettext 'Current system locale:'; echo -n " " - locale | grep LANG | cut -d= -f2 + cat <$(locale | grep LANG | cut -d= -f2) + +EOT fi - cat << EOT - $(gettext 'Change')

+ cat < + +
-

$(gettext 'Console keymap')

-

+

$(gettext 'Keyboard layout')
+
EOT # Check if a new keymap was requested if [ -n "$new_keymap" ]; then @@ -461,15 +637,15 @@ loadkmap < /usr/share/kmap/$new_keymap.kmap fi fi + keymap=$(cat /etc/keymap.conf) eval_gettext 'Current console keymap: $keymap' - echo "

" if [ -n "$keymap" ]; then case "$keymap" in fr_CH*) keymap="ch" ;; ru) - keymap="us,ru(winkeys)" ;; + keymap="us,ru" ;; slovene) keymap=si ;; *) @@ -477,55 +653,52 @@ keymap=${keymap%-abnt2} ;; esac keyboard_config=/etc/X11/xorg.conf.d/40-Keyboard.conf - cat << EOT -
- $(gettext 'Suggested keymap for Xorg:') - - - $(gettext 'Edit') -
+ cat < +
+
+ $(gettext 'Suggested keymap for Xorg:') $keymap + + +
EOT fi - cat << EOT -
- $(gettext 'Available keymaps:') - - -
+ cat < + $(gettext 'Available keymaps:') + + + +
+
-

$(gettext 'Panel configuration')

+
$(gettext 'Panel configuration')
+
+
+
$(gettext 'Style:') + + +
- -

- $(gettext 'Style:') - - +

$(gettext 'Panel password:') + + +
+
+ +
$(gettext 'Configuration files:') + + +
+ +

$(gettext 'TazPanel provides a debugging mode and page:') + debug

- -
-

- $(gettext 'Panel password:') - - -

-
-

- $(gettext 'Configuration files:') - - $(gettext 'Panel') - - $(gettext 'Server') -

-

- $(gettext 'TazPanel provides a debugging mode and page:') - debug -

+
EOT ;; diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/base.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/styles/default/base.css Tue Mar 24 03:39:08 2015 +0200 @@ -0,0 +1,731 @@ +/** + * CSS style for TazPanel - (C) 2011-2015 SliTaz GNU/Linux + */ + + +/* To always have a scroll bar */ +/*html { min-height: 102%; } */ + +body { color: CaptionText; font: caption; margin: 72px 0 0 0; } + + + +/** + * Header and main title + */ + +body > header { + position: fixed; top: 0; left: 0; + /*height: 40px;*/ width: 100%; + /*background: #222 url(images/logo.png) no-repeat left; padding-left: 40px;*/ + background-color: #222; +} + +body > header h1 { + margin: 0; + color: #fff; + font-size: 20px; line-height: 40px; /* center vertical */ + font-style: italic; + white-space: nowrap; overflow: hidden; + vertical-align: middle; +} + + + +/** + * Toolbar with menu + */ + +nav { + position: fixed; top: 40px; left: 0; + width: 100%; + display: table; + border: 1px solid; border-right: none; border-left: none; +} + + + +/* menu panel */ +#toolbarMenu { margin: 0; padding: 0; height: 100%; font: menu; } + +/* menu items */ +#toolbarMenu li { + list-style: none; + float: left; + display: block; + padding: 0; + color: inherit; background: inherit; + cursor: pointer; + outline: none; +} +#toolbarMenu > li > span { + display: inline-block; + padding: 0.2rem; +} + +#toolbarMenu menu li { + padding: 0.2rem; +} + +/* Selected menu item */ +#toolbarMenu li:focus span, +#toolbarMenu li:hover span, +#toolbarMenu menu li:focus, +#toolbarMenu menu li:hover { + background-color: hsla(30, 100%, 50%, 0.5); +} + + + + +#toolbarMenu menu { + position: absolute; + margin: 0; padding: 0; + white-space: nowrap; + border: 1px solid; + display: none; +} + +/* Submenus */ +#toolbarMenu menu menu { + left: 100%; top: 0; + min-width: 100%; +} + +/* Show menu list */ +#toolbarMenu menu.opened { + display: block; z-index: 10; +} + +/* By default hide submenus */ +#toolbarMenu menu.opened menu { + display: none; +} +/* Show submenu on mouse over */ +.opened li:hover menu { display: block !important; } + +/* Menu items one below the other */ +#toolbarMenu menu li { + position: relative; + float: none; +} +/* Show arrow for submenu */ +#toolbarMenu a:after { content: "‣"; float: right; } +#toolbarMenu a:only-child:after { content: " "; } + +#toolbarMenu a { display: block; color: inherit; text-decoration: none; } + +#noMenu { + position: fixed; + background-color: transparent; /*hsla(40, 100%, 60%, 0.5);*/ + display: none; + height: 100%; width: 100%; +} + + +/** + * Panes, sections + */ + +section { + display: block; + border: 1pt solid; border-radius: 0.3rem; + padding: 0; margin: 0.5rem 0 0 0; +} + +section header { + padding: 0.2rem 0.3rem; margin: 0; + display: table; width: 100%; + border-radius: 0.3rem 0.3rem 0 0; + font-weight: bold; font-size: 1.1rem;/* line-height: 0;*/ + text-shadow: 0 1px 1px hsla(0, 0%, 0%, 0.5); + overflow: auto; /* provide break after floated objects */ + vertical-align: baseline; +} +section header form, section footer form { + display: table-cell; vertical-align: baseline; line-height: 0; width: 1px; white-space: nowrap; +} +section header button, section footer button { margin: 0; } + +section footer { + padding: 0 0.3rem 0.2rem; margin: 0; + display: block; + overflow: auto; /* provide break after floated objects */ + vertical-align: baseline; +} + +section > pre, +section div { padding: 0.3rem 0.3rem 0.2rem 0.3rem; margin: 0; } +section td:nth-child(1) { padding-left: 0.3rem; } +section table { margin-bottom: 0.3rem; } +.nogap { word-spacing: 0; } /* remove gap between buttons in line */ + + + + + + + + + + +#actions { + display: block; + margin: 0; padding: 0.2rem 0.3rem; + overflow: auto; /* provide break after floated objects */ +} +.float-left, .float-right { display: table-cell; padding: 0; margin: 0; } +.float-left { float: left; } +.float-right { float: right; } + + + + fieldset { border: 1pt solid; border-radius: 0.3rem; margin-bottom: 0.2rem; } + + + + + + +/* Icons on the right of the toolbar */ +#icons { + display: table-cell; vertical-align: middle; /* center vertical */ + padding: 0.1rem 0.3rem; + white-space: nowrap; width: 1rem; /* minimal width */ +} +#icons img { vertical-align: middle; } + + + +/* Loading notification bar */ +#loading { + position: fixed; top: 76px; right: 140px; width: 248px; + padding: 4px 4px 2px; + background-color: #f8f8f8; color: #666; + border: 1px solid #ddd; + cursor: progress; +} + + + +/* Page content container */ +#content { margin: 1ex; } + + +/* Page first header */ +h2 { font-size: 1.5rem; padding: 0.5rem 0 0 0; margin: 0; } + + +/* Additional headers (obsolete) */ +h3 { font-size: 1.3rem; margin: 0; } +h4 { font-size: 1.1rem; margin: 0; } + + +/* Plain paragraph */ +p { margin: 1ex 0; } + + +#actions p { margin: 6px 0; } + + + + + +button img { padding: 0 3px 0 0; margin: 0; } +button, input, select { + /*color: ButtonText;*/ + vertical-align: middle; } +button:before, input:before, select:before { + padding: 3px; } + +ul { list-style-type: square; } +li { padding: 4px 0; } + + +/* Blocks */ + +#block { float: left; } + +#wrapper, .wrapper { margin: 20px 0; } + +.box { + margin: 10px 0; + padding: 12px; + background: #f8f8f8; + border: 1px solid #ddd; +} + +.box ul { list-style-type: none; padding: 0; } + +.debug { + position: fixed; + bottom: 0px; + right: 10px; + left: 10px; + margin: 5px; + padding: 4px 10px; + background-color: #111; + color: #fff; + border: 0; + /*font-size: 12px;*/ + opacity: 0.9; +} + + + + +/********** + * Tables * + **********/ + +/* Base style */ +table { margin: 0; padding: 0; border: 0 none; border-collapse: collapse; } + +/* Bold header */ +thead { font-weight: bold; } + +/* Wide table */ +.wide { width: 100%; } + +/* Center content excluding first column */ +.center tr td { text-align: center; } +.center tr td:nth-child(1) { text-align: left; padding-left: 0.3rem; } + +/* Table Zebra */ +.zebra thead td { line-height: 1.5em; text-align: center; vertical-align: middle; border: 1pt solid; } + + + +.borders.zebra td + td { border-left: 1px solid; } + + + +.outbox { box-shadow: 0 0 2px 4px #ddd; } +.fixed { table-layout: fixed; } + + +.borders tr { border-bottom: 1pt solid; } + +.hborders thead tr { border-top: 1.5pt solid; border-bottom: 1.5pt solid; } + +td.small { min-width: 60px; } +td.pct { min-width: 200px; background: #eee; } +div.pct { background: #ccc; } +td.pct, div.pct { border-radius: 2px; } +td img {vertical-align: middle; } + +table.daemons td:nth-child(4), table.daemons td:nth-child(5) { text-align: center; } + + + + + +/* Misc */ + +a { text-decoration: none; color: #268bd2; cursor: pointer; } +a:not([data-img]):hover { text-decoration: underline; } + + +form { display: inline-block; padding: 0; margin: 0; } + +pre { margin: 0; padding: 0; color: CaptionText; } + +.pre-main { margin: 16px 0; } + +.scroll { height: 12rem; overflow: auto; border: 1px solid; } +.scroll table { border: 0px solid #fff; } + + +/* Round corner */ + +#loading, .debug, .box, div.scroll, .outbox, section { + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} + +/* Help page */ + +#help { text-align: justify; } +#help a { text-decoration: underline; } +#help a:hover { text-decoration: none; } + + + +/* + * Page footer + */ + +body > footer { + border-top: 1px solid; + text-align: center; + padding: 0.5em; + font-size: smaller; +} + + +/*************** + * HTML5 Meter * + ***************/ + +.meter { + height: 1.2rem; + min-width: 150px; + color: #222; + /*cursor: default;*/ +} +.meter meter { + height: inherit; + width: 100%; + display: block; + border: 1px solid #ddd; + border-radius: 4px; +} +.meter span { + display: block; + white-space: nowrap; + position: absolute; + margin: -1.1rem auto 0 0.3rem; +} + + + +/************** + * Animations * + **************/ + +a.button { + -webkit-transition: all 0.3s ease-in-out; + -moz-transition: all 0.3s ease-in-out; + -o-transition: all 0.3s ease-in-out; + -ms-transition: all 0.3s ease-in-out; + transition: all 0.3s ease-in-out; +} + +/*section { + margin: 20pt -0.7em; + padding: 0.8em 0.7em 1.2em; + background-color: #fdfdfd; + border: 1px solid #ddd; + border-radius: 1em; + box-shadow: 0 0 3pt 2pt #eee; +} +section h4 { + margin: 0 0 0.5em 0; +} +section h3 { + margin: 0 0 0.5em 0; } +*/ + +#tabs { + font-weight: bold; + /*font-size: 14px;*/ + list-style-type: none; + padding-bottom: 25px; + border-bottom: 1px solid #aaa; +} + +#tabs li { + float: left; + height: 16px; + background-color: #eee; + margin: 0 40px 0 -40px; + border: 1px solid #aaa; + text-align: center; + min-width: 100px; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; + -webkit-appearance: tab; + appearance: tab; +} + +#tabs li.active { + border-bottom: 1px solid #fff; + background-color: #fff; +} + +#tabs a { + padding: 8px; +} + + + +/**************** + * Search block * + ****************/ +.search { + display: block; white-space: nowrap; + position: fixed; right: 7px; top: 7px; + margin: 0; padding: 0; border: none; +} +.search input { + display: inline-block; + width: 200px; height: 24px; +} +.search button { + -webkit-appearance: button; + height: 100%; margin: 0; +} + + + +/********************** + * Buttons with icons * + **********************/ +@font-face { + font-family: TazPanelWeb; + src: url('/styles/default/tazpanel.ttf'); +} + +[data-icon]:before, [data-img] { + vertical-align: baseline; + padding: 0; + margin: 0 /*0 0 -0.5em*/; + font-size: 1.2em; + font-family: TazPanel, TazPanelWeb; + + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1.2em; + display: inline-block; + text-decoration: none; + width: 1.2em; text-align: center; + + -webkit-font-feature-settings: "liga", "dlig"; + -moz-font-feature-settings: "liga=1, dlig=1"; + -o-font-feature-settings: "liga", "dlig"; + font-feature-settings: "liga", "dlig"; + + -webkit-text-rendering: optimizeLegibility; + -moz-text-rendering: optimizeLegibility; + -o-text-rendering: optimizeLegibility; + text-rendering: optimizeLegibility; + + -webkit-font-smoothing: antialiased; + -moz-font-smoothing: antialiased; + -o-font-smoothing: antialiased; + font-smoothing: antialiased; +} +button[data-icon]::before { font-size: 16px; line-height: 16px; width: 16px; } + +[data-icon]::before { content: attr(data-icon); } +[data-img]::before { content: attr(data-img); } + +[data-icon], [data-img] { display: inline-block; } + + +/* Solarized: + red #dc322f + orange #cb4b16 + yellow #b58900 + green #859900 + cyan #2aa198 + blue #268bd2 + magenta #d33682 +*/ + + +[data-icon="tazpanel"]::before { + display: inline-block; + content: '\f13d'; + color: #EBEBEB; + border: 1pt solid hsl(5, 85%, 35%); border-radius: 0.2rem; + font-size: 32px; line-height: 32px; + + height: 32px; width: 32px; + margin: 0.2rem; + padding: 0; + vertical-align: top; + background-image: -webkit-linear-gradient(top, hsl(10, 100%, 40%), hsl(0, 70%, 30%)); +} +.light [data-icon="tazpanel"]::before { + text-shadow: 0 1pt 2pt hsla(0, 0%, 0%, 0.9), 0 0 2pt hsla(0, 0%, 0%, 0.6); +} + + + +/******************* + * Terminal colors * + *******************/ + +/* Using color palettes from Sakura terminal source */ + +.term { + padding: 0.3rem; + height: 24rem; max-height: 24rem; + white-space: pre-wrap; + overflow: auto; + z-index: 4; + background: transparent; +} + +/* SliTaz Spider on background */ +/*.term_ { display: block; position: relative; z-index: 2; } +.term_::after { + display: block; border: 1pt solid; + font-family: TazPanel; + font-size: 16rem; + position: absolute; right: 0; bottom: 0; + content: '\f13f'; + opacity: 1; + color: orange; + z-index: 1; +}*/ + +.term.log { white-space: pre; } +/*.term input[type="text"] { + width: 100%!important; padding: 0; margin: 0; vertical-align: middle; + -webkit-appearance: none!important; -moz-appearance: none; appearance: none; + display: inline; + background-color: transparent; color: inherit; border: none; outline: none; + font: inherit; line-height: 1rem; +}*/ +.term .cmdline { + /*position: relative; float: left; display: inline-block; white-space: pre-wrap; + width: 100%; overflow: hidden; left: 0; + vertical-align: middle;*/ + padding: 0; +} +#typeField { + outline-style: none !important; + -webkit-user-modify: read-write; + word-wrap: break-word; + -webkit-nbsp-mode: space; + -webkit-line-break: after-white-space; +} +#num_hist { + display: inline-block; + position: absolute; right: 0.5rem; float: right; + height: 0; + color: #FFF; background: #FFF; +} + +/* Tango palette (default) */ +.color30{color:#2E3436} .color1.color30{color:#555753} .color40{background:#2E3436} +.color31{color:#CC0000} .color1.color31{color:#EF2929} .color41{background:#CC0000} +.color32{color:#4E9A06} .color1.color32{color:#8AE234} .color42{background:#4E9A06} +.color33{color:#C4A000} .color1.color33{color:#FCE94F} .color43{background:#C4A000} +.color34{color:#3465A4} .color1.color34{color:#729FCF} .color44{background:#3465A4} +.color35{color:#75507B} .color1.color35{color:#AD7FA8} .color45{background:#75507B} +.color36{color:#06989A} .color1.color36{color:#34E2E2} .color46{background:#06989A} +.color37{color:#D3D7CF} .color1.color37{color:#EEEEEC} .color47{background:#D3D7CF} +.term {color:#D3D7CF; background:#2E3436} + +/* Linux palette */ +.linux .color30{color:#000} .linux .color1.color30{color:#555} .linux .color40{background:#000} +.linux .color31{color:#A00} .linux .color1.color31{color:#F55} .linux .color41{background:#A00} +.linux .color32{color:#0A0} .linux .color1.color32{color:#5F5} .linux .color42{background:#0A0} +.linux .color33{color:#A50} .linux .color1.color33{color:#FF5} .linux .color43{background:#A50} +.linux .color34{color:#00A} .linux .color1.color34{color:#55F} .linux .color44{background:#00A} +.linux .color35{color:#A0A} .linux .color1.color35{color:#F5F} .linux .color45{background:#A0A} +.linux .color36{color:#0AA} .linux .color1.color36{color:#5FF} .linux .color46{background:#0AA} +.linux .color37{color:#AAA} .linux .color1.color37{color:#FFF} .linux .color47{background:#AAA} +.linux.term {color:#AAA; background:#000} + +/* Xterm palette */ +.xterm .color30{color:#000000} .xterm .color1.color30{color:#4C4C4C} .xterm .color40{background:#000000} +.xterm .color31{color:#CD0000} .xterm .color1.color31{color:#FF0000} .xterm .color41{background:#CD0000} +.xterm .color32{color:#00CD00} .xterm .color1.color32{color:#00FFFF} .xterm .color42{background:#00CD00} +.xterm .color33{color:#CDCD00} .xterm .color1.color33{color:#FFFF00} .xterm .color43{background:#CDCD00} +.xterm .color34{color:#1E90FF} .xterm .color1.color34{color:#4682B4} .xterm .color44{background:#1E90FF} +.xterm .color35{color:#CD00CD} .xterm .color1.color35{color:#FF00FF} .xterm .color45{background:#CD00CD} +.xterm .color36{color:#00CDCD} .xterm .color1.color36{color:#00FFFF} .xterm .color46{background:#00CDCD} +.xterm .color37{color:#E5E5E5} .xterm .color1.color37{color:#FFFFFF} .xterm .color47{background:#E5E5E5} +.xterm.term {color:#E5E5E5; background:#000000} + +/* Rxvt palette */ +.rxvt .color30{color:#000000} .rxvt .color1.color30{color:#404040} .rxvt .color40{background:#000000} +.rxvt .color31{color:#CD0000} .rxvt .color1.color31{color:#FF0000} .rxvt .color41{background:#CD0000} +.rxvt .color32{color:#00CD00} .rxvt .color1.color32{color:#00FFFF} .rxvt .color42{background:#00CD00} +.rxvt .color33{color:#CDCD00} .rxvt .color1.color33{color:#FFFF00} .rxvt .color43{background:#CDCD00} +.rxvt .color34{color:#0000CD} .rxvt .color1.color34{color:#0000FF} .rxvt .color44{background:#0000CD} +.rxvt .color35{color:#CD00CD} .rxvt .color1.color35{color:#FF00FF} .rxvt .color45{background:#CD00CD} +.rxvt .color36{color:#00CDCD} .rxvt .color1.color36{color:#00FFFF} .rxvt .color46{background:#00CDCD} +.rxvt .color37{color:#FAEBD7} .rxvt .color1.color37{color:#FFFFFF} .rxvt .color47{background:#FAEBD7} +.rxvt.term {color:#FAEBD7; background:#000000} + +/* Echo palette (http://mso-chronicles.blogspot.com/2013/02/xfce-terminal-and-xchat-colour-scheme.html) */ +.echo .color30{color:#000000} .echo .color1.color30{color:#5E5E5E} .echo .color40{background:#000000} +.echo .color31{color:#B40000} .echo .color1.color31{color:#FF5200} .echo .color41{background:#B40000} +.echo .color32{color:#00AA00} .echo .color1.color32{color:#93DA00} .echo .color42{background:#00AA00} +.echo .color33{color:#CB7C00} .echo .color1.color33{color:#FFE139} .echo .color43{background:#CB7C00} +.echo .color34{color:#003F68} .echo .color1.color34{color:#0073A2} .echo .color44{background:#003F68} +.echo .color35{color:#BF00EF} .echo .color1.color35{color:#DB81FF} .echo .color45{background:#BF00EF} +.echo .color36{color:#00A6D0} .echo .color1.color36{color:#81E3FF} .echo .color46{background:#00A6D0} +.echo .color37{color:#C6C6C6} .echo .color1.color37{color:#FFFFFF} .echo .color47{background:#C6C6C6} +.echo.term {color:#C6C6C6; background:#000000} + +.color1 { font-weight: bold; } + +/* History table for terminal */ +.history { width: 100%; } +.history td:nth-child(1), .history td:nth-child(2), .history td:nth-child(3) { + white-space: nowrap; + width: 1px; +} + + + +/********** + * Inputs * + **********/ + +:default { outline: 1px dotted hsla(240, 100%, 50%, 0.5); outline-offset: -4px; } +:required { outline: 1px solid hsla( 30, 100%, 50%, 0.7); outline-offset: -3px; } +:invalid { outline: 2px solid hsla( 0, 100%, 50%, 0.7); outline-offset: -3px; } + + +/* HACK for Tazweb (as clean Webkit browser): remove 1px white border around textfield */ +input[type="text"], input[type="password"], input[type="number"], textarea { -webkit-appearance: searchfield; } + +textarea { display: block; color: CaptionText; font-family: monospace; box-sizing: border-box; } + + + + + +/*********************** + * System memory gauge * + ***********************/ + +.sysmem { + margin: 0.2rem; padding: 0; + border: 1pt solid; + border-radius: 0.2rem; + box-shadow: inset 0 0 0 1pt hsla(0, 0%, 100%, 0.05); + width: 100%; margin: 0; padding: 0; +} + +.sysmem_used, .sysmem_buff, .sysmem_free { + display: inline-block; + padding: 0.2rem 0; margin: 0; + height: 120%; + text-align: center; vertical-align: middle; + text-shadow: 0 1px 1px hsla(0, 0%, 0%, 0.5); + text-align: center; +} + +.sysmem_used { + background-color: #f28f68; + background-image: -webkit-linear-gradient(top, hsla(0, 0%, 100%, 0.25), hsla(0, 0%, 0%, 0.2)); + border-radius: 0.2rem 0 0 0.2rem; +} +.sysmem_buff { + background-color: #f28f68; + background-image: + -webkit-linear-gradient(top, hsla(0, 0%, 100%, 0.25), hsla(0, 0%, 0%, 0.2)), + -webkit-linear-gradient(135deg, + transparent, transparent 25%, + #719fd1 25%, #719fd1 50%, + transparent 50%, transparent 75%, + #719fd1 75%); + background-size: 100% 100%; +} +.sysmem_free { + background-color: #719fd1; + background-image: -webkit-linear-gradient(top, hsla(0, 0%, 100%, 0.25), hsla(0, 0%, 0%, 0.2)); + border-radius: 0 0.2rem 0.2rem 0; +} diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/footer.html --- a/styles/default/footer.html Mon Mar 23 21:17:06 2015 +0100 +++ b/styles/default/footer.html Tue Mar 24 03:39:08 2015 +0200 @@ -4,13 +4,14 @@
diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/header.html --- a/styles/default/header.html Mon Mar 23 21:17:06 2015 +0100 +++ b/styles/default/header.html Tue Mar 24 03:39:08 2015 +0200 @@ -3,91 +3,85 @@ $TITLE - -$(printf '\t\n' \ - $(cd /var/www/tazpanel; ls styles/$STYLE/*.css)) - - + +$(printf '\t\n' $(cd /var/www/tazpanel; ls styles/$STYLE/*.css)) +$(printf '\t\n' $(cd /var/www/tazpanel; ls lib/*.js)) - + +
-

$TITLE

+

$TITLE

-
-
- - Help -
- -
+ +
+
diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/images/harddisk.png Binary file styles/default/images/harddisk.png has changed diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/images/removable.png Binary file styles/default/images/removable.png has changed diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/images/tux.png Binary file styles/default/images/tux.png has changed diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/style.css --- a/styles/default/style.css Mon Mar 23 21:17:06 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,513 +0,0 @@ -/* - * CSS style for TazPanel - (C) 2011-2015 SliTaz GNU/Linux -*/ - -/* To always have a scroll bar */ -html { - min-height: 102%; -} - -body { - background: #fff; - color: black; - font: 13px "DejaVu Sans", Ubuntu, "Droid Sans", "Liberation Sans", FreeSans, sans-serif; - margin: 80px 0 0; -} - -h2 { color: #333; font-size: 180%; margin: 10px 0 10px; } -h3 { color: #444; font-size: 160%; } -h4 { color: #666; font-size: 140%; } -img { border: 0pt none; vertical-align: middle; padding: 0px 6px 2px 0;} -p { margin: 10px 0; } -ul { list-style-type: square; } -li { padding: 4px 0; } -a { text-decoration: none; color: #666; } -a:hover { color: #000; } - - - -/* - * Header and main title - */ - -header { - height: 40px; - /*border-bottom: 4px solid #afafaf;*/ - background: #222 url(images/logo.png) no-repeat left; - position: fixed; - top: 0; - width: 100%; -} - -header h1 { - margin: 0; - padding: 8px 0 0 42px; - color: #fff; - font-size: 20px; - font-style: italic; -} - - - -/* - * Desktop GUI style bar - */ - -#toolbar { - position: fixed; - top: 40px; - left: 0; - height: 23px; - width: 100%; - padding: 0; - background-color: #f1efeb; - border-bottom: 1px solid #c1baad; - z-index: 200; - cursor: default; -} - -#menu { - margin: 0; - padding: 0; -} -#menu li { - list-style: none; - float: left; - padding: 0; -} -#menu li a { - display: block; - padding: 4px 6px; - background-color: inherit; - text-decoration: none; - cursor: default; - color: #000; -} -#menu li a:hover { - color: #ffffff; - background-color: #d66018; -} -#menu li ul { - display: none; - min-width: 180px; - background-color: #f1efeb; - border: 1px solid #c1baad; -} -#menu li ul a { - padding: 4px 6px 2px; -} -#menu li:hover ul { - display: block; - position: absolute; - margin: 0; - padding: 0; -} -#menu li:hover li { - float: none; - position: relative; -} -#menu li:hover li a { - background-color: #f1efeb; - color: #000; -} -#menu li li a { border: 1px solid #f1efeb; } -#menu li li a:hover { - background-color: #d66018; - color: #ffffff; - border-radius: 2px; - /* border: 1px solid #c1baad; */ -} - -/* submenus */ -#menu li:hover li ul { - display: none; - position: absolute; - left: 180px; - top: 0px; - z-index:1; -} -#menu li:hover li:hover ul { - display: block; -} - -#icons { margin: 3px 8px; float: right; } -#icons img { padding: 0; } - -#loading { - /* font-weight: bold; */ - background-color: #f8f8f8; - border: 1px solid #ddd; - color: #666; - cursor: progress; - position: fixed; - top: 76px; - right: 140px; - width: 248px; - padding: 4px 4px 2px; -} - -/* Blocks */ - -#block { float: left; } - -/* Sidebar menus */ - -#sidebar { - position: fixed; - top: 124px; - right: 5px; - width: 116px; -} - -#sidebar a { - display: block; - padding: 0px 0 0px 12px; - margin: 0; -} - -#sidebar a.active { - color: #000; - font-weight: bold; -} - -#sidebar h4 { margin: 0 0 2px 12px; font-size: 16px; color: #222; } -#sidebar ul { list-style-type: none; padding: 0; } - - -/* Content */ - -#content { margin: 20px; } -#content-sidebar { margin: 20px 120px 20px 20px; } -#wrapper, .wrapper { margin: 20px 0; } - -#actions { - min-height: 20px; - padding: 0; -} - -#actions p { margin: 6px 0; } - -.search { - position: fixed; - right: 10px; - top: -8px; -} - -.search input[type=submit] { - padding: 5px; - margin-left: -4px; - background-color: #f1f1f1; - border: 1px solid #ddd; - cursor: pointer; - color: #000; - font-weight: bold; - border-radius: 0px; -} - -.search input[type=submit].radius { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-top-left-radius: 0px; - border-bottom-left-radius: 0px; -} - -.search input[type=text] { - border: 1px solid #ddd; - padding: 4px; - height: 18px; - margin: 0; - width: 200px; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} - -.box { - margin: 10px 0; - padding: 12px; - background: #f8f8f8; - border: 1px solid #ddd; -} - -.box ul { list-style-type: none; padding: 0; } - -.debug { - position: fixed; - bottom: 0px; - right: 10px; - left: 10px; - margin: 5px; - padding: 4px 10px; - background-color: #111; - color: #fff; - border: 0; - font-size: 12px; - opacity: 0.9; -} - -.float-left { - float: left; -} -.float-right { - float: right; -} - - - -/* - * Table - */ - -table { - background-color: #f8f8f8; - border: 4px solid #ddd; - padding: 10px; - width: 100%; - margin: 0 0 6px 0; -} - -table a { color: #000; } -table a:hover { color: #666; } -td.small { min-width: 60px; } -td.pct { min-width: 200px; background: #eee; } -div.pct { background: #ccc; } -td.pct, div.pct { border-radius: 2px; } - -#thead, .thead, thead { - height: 10px; - font-weight: bold; -} - -/* Table Zebra */ - -table.zebra { - border: none; - border-collapse: collapse; - margin: 20px 0; -} -table.zebra tr:nth-child(even) { - background-color: rgba(0,0,0,0.05); -} -table.zebra thead tr td { - height: 22px; - background-color: #eee; - text-align: center; - vertical-align: middle; -} -table.zebra td + td { - border-left: 1px solid #ddd; - height: 22px; -} -table.zebra td:first-child { padding-left: 6px; } -.outbox { - box-shadow: 0 0 2px 4px #ddd; -} -.fixed { - table-layout: fixed; -} - - - -/* - * syntax_highlighter - */ - -.conf-comment { color: #666; } -.conf-var { color: #392600; } -.conf-val, .sh-val { color: #f35a00; } -.sh-comment { color: #b20000; } -.activity-log { color: #888; } -.diff-rm { color: red; } -.diff-add { color: green; } -.diff-at { color: blue; } -.top { color: #00c800; font-weight: normal; } -.kernel-hex { color: #18A423; } -.kernel-id { color: #287FC7; } -.kernel-id2 { color: #843523; } -.lsusb-h, .lspci-h { color: #800; font-weight: bold; } -.lsusb-t, .lspci-t { color: #448; font-weight: bold; } - - - -/* Misc */ - -pre, .pre-main { - font: 13px "DejaVu Sans Mono", "Droid Sans Mono", "Liberation Mono", FreeMono, monospace; - background-color: #f8f8f8; - border: 4px solid #ddd; - padding: 10px; - margin: 10px 0; - overflow: auto; -} - -.pre-main { margin: 16px 0; } - -input[type=submit], .button { - color: #444444; - border: 1px solid #afafaf; - padding: 4px; - /*margin: 4px 0px;*/ - font-size: 14px; - /*line-height: 1.2em;*/ - background-image: -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); - background-image: -moz-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); - /*-webkit-appearance: none; - -webkit-padding-end: 12px; - -webkit-padding-start: 6px;*/ -} -input[type="submit"] { - -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); - box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); -} -/*select { - background-image: url(images/down.png), - -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); - background-position: center right; - background-repeat: no-repeat; -}*/ -a.button { - white-space: nowrap; - height: 16px; - margin: 2px 0; - display: inline-block; - -webkit-appearance: button; -moz-appearance: button; -} - -input[type=submit]:hover, .button:hover { - background-color: #ddd; - border: 1px solid #999; -} - -input[type=text], input[type=password] { height: 18px; } - -div.scroll { height: 200px; overflow: auto; - border: 1px solid #ddd; } -div.scroll table { border: 0px solid #fff; } - -#terminal { - background: #000; - color: #fff; - border: 1px solid #444; - min-height: 240px; -} - -/* Round corner */ - -#loading, table, pre, input[type=submit], .debug, .box, -.button, div.scroll, .outbox, section { - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; -} - -/* Help page */ - -#help { text-align: justify; } -#help a { color: #215090; text-decoration: underline; } -#help a:hover { text-decoration: none; color: blue; } - - - -/* - * Footer - */ - -footer { - /* border-bottom: 1px solid #c1baad; */ - height: 25px; - text-align: center; - padding: 40px 10px; - font-size: 11px; - color: #bbb; -} - -footer a { color: #bbb; } -footer a:hover { color: #555; } - - - -/* - * HTML5 Meter - */ - -.meter { - height: 22px; - min-width: 200px; - cursor: default; -} -.meter meter { - height: inherit; - width: 100%; - display: block; - border: 1px solid #ddd; - border-radius: 4px; -} -.meter span { - height: 22px; - display: block; - white-space: nowrap; - position: absolute; - margin: -18px auto 0 2px; -} - - - -/* - * Animations - */ - -a.button, input { - -webkit-transition: all 0.3s ease-in-out; - -moz-transition: all 0.3s ease-in-out; - -o-transition: all 0.3s ease-in-out; - -ms-transition: all 0.3s ease-in-out; - transition: all 0.3s ease-in-out; -} - -/*section { - margin: 20pt -0.7em; - padding: 0.8em 0.7em 1.2em; - background-color: #fdfdfd; - border: 1px solid #ddd; - border-radius: 1em; - box-shadow: 0 0 3pt 2pt #eee; -} -section h4 { - margin: 0 0 0.5em 0; -} -section h3 { - margin: 0 0 0.5em 0; } -*/ - -#tabs { - font-weight: bold; - font-size: 14px; - list-style-type: none; - padding-bottom: 25px; - border-bottom: 1px solid #aaa; -} - -#tabs li { - float: left; - height: 16px; - background-color: #eee; - margin: 0 40px 0 -40px; - border: 1px solid #aaa; - text-align: center; - min-width: 100px; - -moz-border-top-right-radius: 4px; - -moz-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-top-left-radius: 4px; -} - -#tabs li.active { - border-bottom: 1px solid #fff; - background-color: #fff; -} - -#tabs a { - padding: 8px; -} diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/tazpanel.ttf Binary file styles/default/tazpanel.ttf has changed diff -r e4ad3356ac6a -r 299f204b8f1f styles/default/tweaks.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/styles/default/tweaks.css Tue Mar 24 03:39:08 2015 +0200 @@ -0,0 +1,244 @@ +/** + * CSS style for TazPanel - (C) 2011-2015 SliTaz GNU/Linux + */ + + +body.light { background: #EBEBEB; } +body.dark { background: #3C3C3C; } + + + +/********************* + * Toolbar with menu * + *********************/ + +.dark nav { + background-image: -webkit-linear-gradient(#3B3B3B, #393939); + border-top-color: #454545; border-bottom-color: #313131; } /*ok*/ +.light nav { + background-image: -webkit-linear-gradient(#EAEAEA, #E0E0E0); + border-top-color: #F5F5F5; border-bottom-color: #C1C1C1; } /*ok*/ + + + +.light #toolbarMenu menu { background-color: #F7F7F7; border-color: #A4A4A4;} /*ok*/ +.dark #toolbarMenu menu { background-color: #333333; border-color: #222222;} /*ok*/ + + + +/******************* + * Panes, sections * + *******************/ + +.dark #sidebar, .dark section { + border-color: #2E2E2E; /*ok*/ + background-color: #454545; /*ok*/ + box-shadow: inset 0 0 0 1pt hsla(0, 0%, 100%, 0.05); +} +.light #sidebar, .light section { + border-color: #A3A3A3; /*ok*/ + background-color: #F5F5F5; /*ok*/ + box-shadow: inset 1pt 1pt 0 0 #FFF, inset -1pt -1pt 0 0 #EBEBEB; /*ok*/ +} + +.dark #sidebar, .dark section header { + background-image: -webkit-linear-gradient(hsla(0, 0%, 100%, 0.04), transparent); /*ok*/ +} +.light #sidebar, .light section header { + background-image: -webkit-linear-gradient(hsla(0, 0%, 100%, 1), hsla(0, 0%, 100%, 0)); /*ok*/ +} + +.dark section footer { + background-image: -webkit-linear-gradient(transparent, hsla(0, 0%, 0%, 0.1)); /*ok*/ +} +.light section footer { + background-image: -webkit-linear-gradient(transparent, hsla(0, 0%, 0%, 0.1)); /*ok*/ +} + + + +.dark fieldset { + border-color: #313131; + box-shadow: inset 1pt 1pt 0 0 #3E3E3E, 1pt 1pt 0 0 #3E3E3E; /*ok*/ +} +.light fieldset { + border-color: #C1C1C1; } +.dark legend { background-color: #454545; } + + + +/* Page first header */ + +.light h2 { color: #333; } +.dark h2 { color: #CCC; } + + + +/* Additional headers (obsolete) */ + +.light h3 { color: hsla(0, 0%, 0%, 0.7); } /*#444*/ +.dark h3 { color: hsla(0, 0%, 100%, 0.7); } +.light h4 { color: hsla(0, 0%, 0%, 0.6); } /*#666*/ +.dark h4 { color: hsla(0, 0%, 100%, 0.6); } + + + +/********** + * Tables * + **********/ + +/* Table Zebra */ +.light .zebra tr:nth-child(odd) { background-color: #FFFFFF; } /*ok*/ +.light .zebra tr:nth-child(even) { background-color: #ECECEC; } /*ok*/ +.dark .zebra tr:nth-child(odd) { background-color: #4C4C4C; } /*ok*/ +.dark .zebra tr:nth-child(even) { background-color: #484848; } /*ok*/ +.light .zebra thead td { + background-image: -webkit-linear-gradient(#FFFFFF, #FFFFFF 49%, #F4F4F4 50%, #D9D9D9); /*ok*/ + border-color: #9C9C9C hsla(0, 0%, 0%, 0.1) #B1B1B1 transparent; /*ok*/ + box-shadow: inset 1px 0 0 hsla(0, 0%, 100%, 0.5); +} +.dark .zebra thead td { + background-image: -webkit-linear-gradient(#565656, #515151 49%, #484848 50%, #414141); /*ok*/ + border-color: #282828 hsla(0, 0%, 0%, 0.1) #2F2F2F transparent; /*ok*/ + box-shadow: inset 1px 0 0 hsla(0, 0%, 100%, 0.1); +} +.dark .zebra thead td:nth-child(1) { box-shadow: none; } /*fix*/ + + + +.light .borders.zebra td + td { border-color: #ddd; } +.dark .borders.zebra td + td { border-color: #383838; } + +.light .borders tr { border-color: rgba(92, 92, 92, 0.1); } +.dark .borders tr { border-color: #111; } + +.light .hborders thead tr { border-color: rgba(92, 92, 92, 0.1); } +.dark .hborders thead tr { border-color: #333; } + + + +/********************** + * Syntax highlighter * + **********************/ + +.sh-comment, .conf-comment {font-style:italic} + +.light .conf-var {color:hsl(40, 100%, 30%)} .dark .conf-var {color:hsl(40, 100%, 50%)} /*brown*/ +.light .conf-val {color:hsl(22, 100%, 50%)} .dark .conf-val {color:hsl(22, 100%, 60%)} /*orange*/ +.light .conf-comment {color:hsl( 0, 0%, 40%)} .dark .conf-comment {color:hsl( 0, 0%, 50%)} /*gray*/ + +.light .sh-var {color:hsl(40, 100%, 30%)} .dark .sh-var {color:hsl(40, 100%, 50%)} /*brown*/ +.light .sh-val {color:hsl(22, 100%, 50%)} .dark .sh-val {color:hsl(22, 100%, 60%)} /*orange*/ +.light .sh-comment {color:hsl( 0, 100%, 35%)} .dark .sh-comment {color:hsl( 0, 100%, 60%)} /*tomato*/ + + + +.activity-log { color: #888; } + +.light .diff-rm {color:hsl( 0, 100%, 50%)} .dark .diff-rm {color:hsl( 0, 100%, 70%)} /*red*/ +.light .diff-add{color:hsl(120, 100%, 40%)} .dark .diff-add{color:hsl(120, 100%, 40%)} /*green*/ +.light .diff-at {color:hsl(240, 100%, 50%)} .dark .diff-at {color:hsl(240, 100%, 70%)} /*blue*/ + +.top { color: #00C800; font-weight: normal; } +.kernel-hex { color: #18A423; } +.kernel-id { color: #287FC7; } +.kernel-id2 { color: #843523; } +.kernel-trace { background-color: red; } + +.lsusb-h, .lspci-h, .lsusb-t, .lspci-t { font-weight: bold; } +.light .lsusb-h, .light .lspci-h { color: #800; } +.dark .lsusb-h, .dark .lspci-h { color: #C66; } +.light .lsusb-t, .light .lspci-t { color: #448; } +.dark .lsusb-t, .dark .lspci-t { color: #66C; } + +.xlog-timestamp { color: #287FC7; } +.xlog-probed, .xlog-config, .xlog-default, .xlog-cmdline, .xlog-info { color: #5A0; } +.xlog-notice, .xlog-warn { color: #A50; } +.xlog-error, .xlog-ni, .xlog-unknown { color: #F00; } +.xlog { cursor: help; } + + + +/* Misc */ + +.dark .scroll { border-color: #2E2E2E; } + + + +/*************** + * Page footer * + ***************/ + +.light > footer { border-color: #C1C1C1; background-color: #EBEBEB; color: #888; } +.dark > footer { border-color: #313131; background-color: #3C3C3C; color: #666; } + +.light > footer a { color: #666; } +.light > footer a:hover { color: #888; } + +.dark > footer a { color: #bbb; } +.dark > footer a:hover { color: #555; } + + + +/********************** + * Buttons with icons * + **********************/ + +.light .icon:before, +.light .icon2:before, +.light [class|="icon"]:before { + text-shadow: 0 1px 0 hsla(0, 0%, 100%, 0.3), 0 0 3px hsla(0, 0%, 100%, 0.7); } +.dark .icon:before, +.dark .icon2:before { + text-shadow: 0 0 3px hsla(0, 0%, 0%, 0.7), 0 1px 0 hsla(0, 0%, 0%, 0.3); } + +.dark.nowebkit [data-icon]::before { + text-shadow: + 0 1px 0 hsla(0, 0%, 0%, 0.7), 0 -1px 0 hsla(0, 0%, 0%, 0.4), + 1px 0 0 hsla(0, 0%, 0%, 0.4), -1px 0 0 hsla(0, 0%, 0%, 0.4); } +.light button[data-icon]::before, button { + text-shadow: + 0 1px 0 hsla(0, 0%, 100%, 0.9) /*, 0 -1px 0 hsla(0, 0%, 100%, 0.6), + 1px 0 0 hsla(0, 0%, 100%, 0.6), -1px 0 0 hsla(0, 0%, 100%, 0.6)*/; } + +.dark [data-icon]:before, .dark [data-img] { + /* Experimental webkit-only styles */ + background-image: -webkit-radial-gradient(25% 25%, #fff, #777); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} +/*.light a[data-icon]:before { color: #333; }*/ +a[data-icon] { white-space: pre-line; } + +[data-icon="cancel"]::before, [data-icon="delete"]::before, +[data-icon="remove"]::before, [data-icon="stop"]::before, +[data-img="help"]::before, [data-img="man"]::before, +[data-img="off"]::before, [data-img="remove"]::before, +[data-img="stop"]::before {color:#dc322f} /*red*/ + +[data-icon="restart"]::before, [data-img="conf"]::before {color:#cb4b16} /*orange*/ + +[data-icon="ok"]::before, [data-icon="run"]::before, +[data-icon="start"]::before, [data-img="on"]::before, +[data-img="opt"]::before, [data-img="run"]::before {color:#859900} /*green*/ + +[data-img="web"]::before {color:#268bd2} /*blue*/ + + + +/********** + * Inputs * + **********/ + +.dark textarea { border-color: #2E2E2E; } +.light textarea { border-color: #A3A3A3; } + + + +/*********************** + * System memory gauge * + ***********************/ + +.dark .sysmem { border-color: #2E2E2E; } +.light .sysmem { border-color: #A3A3A3; } + diff -r e4ad3356ac6a -r 299f204b8f1f tazpanel --- a/tazpanel Mon Mar 23 21:17:06 2015 +0100 +++ b/tazpanel Tue Mar 24 03:39:08 2015 +0200 @@ -2,11 +2,13 @@ # # Tiny Tazpanel cmdline interface # -# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License +# Copyright (C) 2012-2015 SliTaz GNU/Linux - BSD License # VERSION=1.8.2 + # Get the configuration file and functions + CONFIG="/etc/slitaz/tazpanel.conf" [ -f "$CONFIG" ] && . $CONFIG [ -f "data/tazpanel.conf" ] && . data/tazpanel.conf @@ -14,10 +16,13 @@ . /lib/libtaz.sh + # I18n + TEXTDOMAIN='tazpanel' export TEXTDOMAIN + # # Commands # @@ -29,12 +34,12 @@ case "$1" in -h|*help|*usage) - echo "" + echo gettext 'Usage: tazpanel [start|stop|passwd|app]'; echo - echo "" ;; - start) + echo ;; + start) if [ -f $PIDFILE ]; then - gettext 'TazPanel is already running.'; echo + gettext 'TazPanel is already running.'; echo exit 1 fi eval_gettext 'Starting TazPanel web server on port $HTTPD_PORT...' @@ -43,27 +48,27 @@ ps | grep "httpd -p $HTTPD_PORT " | grep -v grep | \ awk '{ print $1 }' > $PIDFILE status ;; - stop) - if [ ! -f $PIDFILE ]; then - gettext 'TazPanel is not running.'; echo - exit 1 - fi + stop) + if [ ! -f $PIDFILE ]; then + gettext 'TazPanel is not running.'; echo + exit 1 + fi gettext 'Stopping TazPanel web server...' - kill $(pgrep -f TazPanel) + kill $(pgrep -f TazPanel) rm -f $PIDFILE status ;; passwd|-p) - echo "" + echo gettext 'Changing password for TazPanel'; echo gettext 'New password: ' && read pass - sed -i s"/\/:root:.*/\/:root:$pass/" $HTTPD_CONF + sed -i "s/\/:root:.*/\/:root:$pass/" $HTTPD_CONF gettext 'Password changed successfully'; echo - echo "" ;; + echo ;; *) . /etc/slitaz/applications.conf USER_CONFIG="$HOME/.config/slitaz/applications.conf" - [ -f "$USER_CONFIG" ] && . $USER_CONFIG - [ "$1" ] && app="/${1}.cgi" + [ -f "$USER_CONFIG" ] && . $USER_CONFIG + [ -n "$1" ] && app="/${1}.cgi" echo http://localhost:82${app} case "$BROWSER" in tazweb) tazweb --notoolbar http://localhost:82${app} & ;; diff -r e4ad3356ac6a -r 299f204b8f1f test.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test.cgi Tue Mar 24 03:39:08 2015 +0200 @@ -0,0 +1,153 @@ +#!/bin/sh +# +# test.cgi - Test TazPanel styles. +# +# Copyright (C) 2015 SliTaz GNU/Linux - BSD License +# + +# Common functions from libtazpanel +. lib/libtazpanel +get_config +header + +TITLE='TazPanel - Test' + +xhtml_header + +cat < +
Buttons with font icons
+ + + + +
+
Links with font icons
+ +
+ + +
+
Links with font icons only (small buttons)
+

+Conf Help Man +Off On Opt +Remove Run Stop +Web +

+
+ +
+
User input elements
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Text:
Password:
Button:
Checkbox:
Radio: + + + +
File:
Image:
Reset:
Submit:
Select:
HTML 5 inputs:
Search:
Number:
Range:
Color:
Tel:
URL:
E-mail:
Date:
Month:
Week:
Time:
Date & Time:
Date & Time Local:
+
+
+ +EOT +xhtml_footer +exit 0