tazpanel rev 419
Bunch of changes. Development in progress, please note it have few known bugs.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Mar 24 03:39:08 2015 +0200 (2015-03-24) |
parents | e4ad3356ac6a |
children | a279382f786f |
files | COPYING Makefile README README.html boot.cgi data/httpd.conf data/icons/hicolor/16x16/apps/tazpanel.png data/icons/hicolor/32x32/apps/tazpanel.png data/icons/hicolor/48x48/apps/tazpanel.png data/tazpanel.png doc/tazpanel.en.html doc/tazpanel.fr.html doc/tazpanel.pt.html doc/tazpanel.ru.html hardware.cgi help.cgi index.cgi lib/libtazpanel lib/tazpanel.js network.cgi settings.cgi styles/default/base.css styles/default/footer.html styles/default/header.html styles/default/images/harddisk.png styles/default/images/removable.png styles/default/images/tux.png styles/default/style.css styles/default/tazpanel.ttf styles/default/tweaks.css tazpanel test.cgi |
line diff
1.1 --- a/COPYING Mon Mar 23 21:17:06 2015 +0100 1.2 +++ b/COPYING Tue Mar 24 03:39:08 2015 +0200 1.3 @@ -1,5 +1,5 @@ 1.4 1.5 -Copyright (c) 2011-2014 SliTaz GNU/Linux. 1.6 +Copyright (c) 2011-2015 SliTaz GNU/Linux. 1.7 All rights reserved. 1.8 1.9 Redistribution and use in source and binary forms, with or without
2.1 --- a/Makefile Mon Mar 23 21:17:06 2015 +0100 2.2 +++ b/Makefile Tue Mar 24 03:39:08 2015 +0200 2.3 @@ -36,22 +36,29 @@ 2.4 # Installation 2.5 2.6 install: 2.7 - mkdir -p $(DESTDIR)$(PREFIX)/bin \ 2.8 + mkdir -p \ 2.9 + $(DESTDIR)$(PREFIX)/bin \ 2.10 $(DESTDIR)$(PREFIX)/share/locale \ 2.11 $(DESTDIR)$(PREFIX)/share/applications \ 2.12 - $(DESTDIR)$(PREFIX)/share/pixmaps \ 2.13 $(DESTDIR)$(SYSCONFDIR) \ 2.14 $(DESTDIR)$(PANEL)/menu.d \ 2.15 $(DESTDIR)/var/log 2.16 cp -a tazpanel $(DESTDIR)$(PREFIX)/bin 2.17 -[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazpanel 2.18 - cp -a data/*.conf $(DESTDIR)$(SYSCONFDIR) 2.19 cp -a *.cgi lib/ styles/ doc/ README* $(DESTDIR)$(PANEL) 2.20 - cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale 2.21 + cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale 2.22 + cp -a data/*.conf $(DESTDIR)$(SYSCONFDIR) 2.23 cp -a data/*.desktop $(DESTDIR)$(PREFIX)/share/applications 2.24 - cp -a data/*.png $(DESTDIR)$(PREFIX)/share/pixmaps 2.25 + cp -a data/icons $(DESTDIR)$(PREFIX)/share 2.26 touch $(DESTDIR)/var/log/tazpanel.log 2.27 2.28 + @# Clean comments in production release 2.29 + sed -i '/^\t*\/\//d' $(DESTDIR)$(PANEL)/lib/tazpanel.js 2.30 + 2.31 + @# Remove this when TazWeb will support OpenType ligatures for web-fonts (maybe, after Webkit upgrade?) 2.32 + mkdir -p $(DESTDIR)/usr/share/fonts/TTF 2.33 + ln -fs $(PANEL)/styles/default/tazpanel.ttf $(DESTDIR)/usr/share/fonts/TTF/tazpanel.ttf 2.34 + 2.35 # Clean source 2.36 2.37 clean:
3.1 --- a/README Mon Mar 23 21:17:06 2015 +0100 3.2 +++ b/README Tue Mar 24 03:39:08 2015 +0200 3.3 @@ -2,84 +2,85 @@ 3.4 ================================================================================ 3.5 3.6 3.7 -Tazpanel is the SliTaz Control Panel, a web interface which lets you manage the 3.8 -full system in a radically simple way. The output xHTML code is valid xHTML 5 3.9 -and all theming is done with standard CSS 3. TazPanel is published under a 3.10 -BSD License. 3.11 +Tazpanel is the SliTaz Control Panel, a web interface which lets you manage the 3.12 +full system in a radically simple way. The output xHTML code is valid xHTML 5 3.13 +and all theming is done with standard CSS 3. TazPanel is published under 3.14 +a BSD License. 3.15 3.16 3.17 Use it! 3.18 ------- 3.19 -You can clone the tazpanel repo into /var/www/tazpanel and work on this 3.20 -copy or clone it somewhere else and 'make install'. After, add tazpanel to 3.21 -your /etc/hosts, type './tazpanel start' to start the server and go to the 3.22 -URL: http://tazpanel:82. Panel user and password are defined in the 3.23 -httpd.conf and default is root:root 3.24 +------- 3.25 +You can clone the tazpanel repo into /var/www/tazpanel and work on this copy or 3.26 +clone it somewhere else and 'make install'. After, add tazpanel to your 3.27 +/etc/hosts, type './tazpanel start' to start the server and go to the URL: 3.28 +http://tazpanel:82. Panel user and password are defined in the httpd.conf and 3.29 +default is root:root 3.30 3.31 3.32 i18n 3.33 ---- 3.34 -TazPanel has been coded from the beginning with gettext support. Please 3.35 -forget 'echo' and use gettext, but remember that gettext "" is equivalent 3.36 -to echo -n. All scripts use the same TEXTDOMAIN and the same pot files, and 3.37 -all translations go in the po/ folder. To start a new translation please 3.38 -use msginit from the pot file directory. Example for French/France 3.39 -locale (fr_FR): 3.40 +TazPanel has been coded from the beginning with gettext support. Please forget 3.41 +'echo' and use gettext, but remember that gettext "" is equivalent to echo -n. 3.42 +All scripts use the same TEXTDOMAIN and the same pot files, and all translations 3.43 +go in the po/ folder. To start a new translation please use msginit from the pot 3.44 +file directory. Example for French/France locale (fr_FR): 3.45 3.46 - $ msginit -l fr_FR -o fr.po -i tazpanel.pot 3.47 + $ msginit -l fr_FR -o fr.po -i tazpanel.pot 3.48 3.49 To update all translations from a newly updated pot file: 3.50 3.51 - $ make msgmerge 3.52 + $ make msgmerge 3.53 3.54 3.55 User interface 3.56 -------------- 3.57 -If you develop an official SliTaz GUI for TazPanel, please follow the default 3.58 -style. If you need more CSS markup and you are not a coder, please ask an 3.59 -official developer for the best way to implement your idea. TazPanel is fully 3.60 -themable and more than one theme can be installed, this will allow us to make 3.61 -packages in a TazPanel style! All the GUI is done with xHTML 5 and CSS 3; some 3.62 -javascript can be used, but with precautions... one more time, it's better 3.63 -to check with a main contributor before adding too much stuff; the goal is, 3.64 -as for all the SliTaz projects: KISS 3.65 +If you develop an official SliTaz GUI for TazPanel, please follow the default 3.66 +style. If you need more CSS markup and you are not a coder, please ask an offi- 3.67 +cial developer for the best way to implement your idea. TazPanel is fully thema- 3.68 +ble and more than one theme can be installed, this will allow us to make packa- 3.69 +ges in a TazPanel style! All the GUI is done with xHTML 5 and CSS 3; some java- 3.70 +script can be used, but with precautions... one more time, it's better to check 3.71 +with a main contributor before adding too much stuff; the goal is, as for all 3.72 +the SliTaz projects: KISS 3.73 3.74 3.75 CGI template and files 3.76 ---------------------- 3.77 -To start or test a new function with TazPanel you will find a file in 3.78 -utils/template.cgi that needs to be in the $PANEL root to work, all TazPanel 3.79 -CGI scripts are in that location. If you think your code is too big to fit 3.80 -in another script you can eventually create a new CGI page and update all 3.81 -links, but please to talk to the AUTHORS beforehand. 3.82 +To start or test a new function with TazPanel you will find a file in 3.83 +utils/template.cgi that needs to be in the $PANEL root to work, all TazPanel CGI 3.84 +scripts are in that location. If you think your code is too big to fit in ano- 3.85 +ther script you can eventually create a new CGI page and update all links, but 3.86 +please to talk to the AUTHORS beforehand. 3.87 3.88 - * index.cgi Main Tazpanel CGI script 3.89 - * boot.cgi All what happens before login 3.90 - * network.cgi All related stuff to networking (eth, wifi, services) 3.91 - * pkgs.cgi Tazpkg packages CGI interface 3.92 - * settings.cgi System settings and services such as time, users 3.93 - accounts, locales or daemons management 3.94 - * live.cgi All tools related to Live systems (CD, USB, Frugal) 3.95 - * hardware.cgi Devices drivers, firmware, printing 3.96 - * help.cgi Cat the html doc and this README file 3.97 + * index.cgi Main TazPanel CGI script 3.98 + * boot.cgi All what happens before login 3.99 + * network.cgi All related stuff to networking (Ethernet, Wi-Fi, services) 3.100 + * pkgs.cgi TazPkg packages CGI interface 3.101 + * settings.cgi System settings and services such as time, users accounts, 3.102 + locales or daemons management 3.103 + * live.cgi All tools related to Live systems (CD, USB, Frugal) 3.104 + * hardware.cgi Devices drivers, firmware, printing 3.105 + * help.cgi Cat the html doc and this README file 3.106 3.107 -For common functions have a look at lib/libtazpanel, where you may find functions 3.108 -you need already coded such as a xhtml_header to get the style header.html 3.109 -in your CGI script. For the loading message you can use loading_msg. When 3.110 -cat is used: `gettext "Text to translate"` 3.111 +For common functions have a look at lib/libtazpanel, where you may find functi- 3.112 +ons you need already coded such as a xhtml_header to get the style header.html 3.113 +in your CGI script. For the loading message you can use loading_msg. When cat is 3.114 +used: 3.115 + 3.116 + $(gettext "Text to translate") 3.117 3.118 3.119 Web server 3.120 ---------- 3.121 -Tazpanel can run with the Busybox httpd applet or LightTPD and probably Apache. 3.122 -Start the webserver with a custom config to listen only on a local port for 3.123 +Tazpanel can run with the Busybox httpd applet or LightTPD and probably Apache. 3.124 +Start the webserver with a custom config to listen only on a local port for 3.125 security reasons since we run as root to perform system actions, example: 3.126 3.127 -# httpd -p 82 u root -c /etc/slitaz/httpd.conf 3.128 + # httpd -p 82 u root -c /etc/slitaz/httpd.conf 3.129 3.130 Or use a tazpanel cmdline: 3.131 3.132 -# ./tazpanel start 3.133 + # ./tazpanel start 3.134 3.135 3.136 ================================================================================
4.1 --- a/README.html Mon Mar 23 21:17:06 2015 +0100 4.2 +++ b/README.html Tue Mar 24 03:39:08 2015 +0200 4.3 @@ -1,90 +1,58 @@ 4.4 -<h2>SliTaz Web Control Panel</h2> 4.5 +<section> 4.6 + <header>SliTaz Web Control Panel</header> 4.7 + <div> 4.8 + <p>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.</p> 4.9 4.10 -<p>Tazpanel is the SliTaz Control Panel, a web interface which lets you manage the 4.11 -full system in a radically simple way. The output xHTML code is valid xHTML 5 4.12 -and all theming is done with standard CSS 3. TazPanel is published under a 4.13 -BSD License.</p> 4.14 4.15 + <h3>Use it!</h3> 4.16 4.17 -<h3>Use it!</h3> 4.18 + <p>You can clone the tazpanel repo into <tt>/var/www/tazpanel</tt> and work on this copy or clone it somewhere else and <tt>'make install'</tt>. After, add <tt>tazpanel</tt> to your <tt>/etc/hosts</tt>, type <tt>'./tazpanel start'</tt> to start the server and go to the URL: <tt>http://tazpanel:82</tt>. Panel user and password are defined in the <tt>httpd.conf</tt> and default is <tt>root:root</tt></p> 4.19 4.20 -<p>You can clone the tazpanel repo into /var/www/tazpanel and work on this 4.21 -copy or clone it somewhere else and 'make install'. After, add tazpanel to 4.22 -your /etc/hosts, type './tazpanel start' to start the server and go to the 4.23 -URL: http://tazpanel:82. Panel user and password are defined in the 4.24 -httpd.conf and default is root:root</p> 4.25 4.26 + <h3>i18n</h3> 4.27 4.28 -<h3>i18n</h3> 4.29 + <p>TazPanel has been coded from the beginning with gettext support. Please forget <tt>'echo'</tt> and use <tt>gettext</tt>, but remember that <tt>gettext ""</tt> is equivalent to <tt>echo -n</tt>. All scripts use the same <tt>TEXTDOMAIN</tt> and the same pot files, and all translations go in the <tt>po/</tt> folder. To start a new translation please use <tt>msginit</tt> from the pot file directory. Example for French/France locale (fr_FR):</p> 4.30 + <pre>$ msginit -l fr_FR -o fr.po -i tazpanel.pot</pre> 4.31 + <p>To update all translations from a newly updated pot file:</p> 4.32 + <pre>$ make msgmerge</pre> 4.33 4.34 -<p>TazPanel has been coded from the beginning with gettext support. Please 4.35 -forget 'echo' and use gettext, but remember that gettext "" is equivalent 4.36 -to echo -n. All scripts use the same TEXTDOMAIN and the same pot files, and 4.37 -all translations go in the po/ folder. To start a new translation please 4.38 -use msginit from the pot file directory. Example for French/France 4.39 -locale (fr_FR):</p> 4.40 4.41 -<pre>$ msginit -l fr_FR -o fr.po -i tazpanel.pot</pre> 4.42 + <h3>User interface</h3> 4.43 4.44 -<p>To update all translations from a newly updated pot file:</p> 4.45 + <p>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</p> 4.46 4.47 -<pre>$ make msgmerge</pre> 4.48 4.49 + <h3>CGI template and files</h3> 4.50 4.51 -<h3>User interface</h3> 4.52 + <p>To start or test a new function with TazPanel you will find a file in <tt>utils/template.cgi</tt> that needs to be in the <tt>$PANEL</tt> 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.</p> 4.53 + <dl> 4.54 + <dt>index.cgi</dt> 4.55 + <dd>Main Tazpanel CGI script</dd> 4.56 + <dt>boot.cgi</dt> 4.57 + <dd>All what happens before login</dd> 4.58 + <dt>network.cgi</dt> 4.59 + <dd>All related stuff to networking (Ethernet, Wi-Fi, services)</dd> 4.60 + <dt>pkgs.cgi</dt> 4.61 + <dd>Tazpkg packages CGI interface</dd> 4.62 + <dt>settings.cgi</dt> 4.63 + <dd>System settings and services such as time, users accounts, locales or daemons management</dd> 4.64 + <dt>live.cgi</dt> 4.65 + <dd>All tools related to Live systems (CD, USB, Frugal)</dd> 4.66 + <dt>hardware.cgi</dt> 4.67 + <dd>Devices drivers, firmware, printing</dd> 4.68 + <dt>help.cgi</dt> 4.69 + <dd>Cat the html doc and this README file</dd> 4.70 + </dl> 4.71 + <p>For common functions have a look at <tt>lib/libtazpanel</tt>, where you may find functions you need already coded such as a <tt>xhtml_header</tt> to get the style <tt>header.html</tt> in your CGI script. For the loading message you can use <tt>loading_msg</tt>. When cat is used:</p> 4.72 + <pre>$(gettext "Text to translate")</pre> 4.73 4.74 -<p>If you develop an official SliTaz GUI for TazPanel, please follow the default 4.75 -style. If you need more CSS markup and you are not a coder, please ask an 4.76 -official developer for the best way to implement your idea. TazPanel is fully 4.77 -themable and more than one theme can be installed, this will allow us to make 4.78 -packages in a TazPanel style! All the GUI is done with xHTML 5 and CSS 3; some 4.79 -javascript can be used, but with precautions... one more time, it's better 4.80 -to check with a main contributor before adding too much stuff; the goal is, 4.81 -as for all the SliTaz projects: KISS</p> 4.82 4.83 + <h3>Web server</h3> 4.84 4.85 -<h3>CGI template and files</h3> 4.86 + <p>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:</p> 4.87 + <pre># httpd -p 82 u root -c /etc/slitaz/httpd.conf</pre> 4.88 + <p>Or use a tazpanel cmdline:</p> 4.89 + <pre># ./tazpanel start</pre> 4.90 4.91 -<p>To start or test a new function with TazPanel you will find a file in 4.92 -utils/template.cgi that needs to be in the $PANEL root to work, all TazPanel 4.93 -CGI scripts are in that location. If you think your code is too big to fit 4.94 -in another script you can eventually create a new CGI page and update all 4.95 -links, but please to talk to the AUTHORS beforehand.</p> 4.96 - 4.97 -<dl> 4.98 - <dt>index.cgi</dt> 4.99 - <dd>Main Tazpanel CGI script</dd> 4.100 - <dt>boot.cgi</dt> 4.101 - <dd>All what happens before login</dd> 4.102 - <dt>network.cgi</dt> 4.103 - <dd>All related stuff to networking (eth, wifi, services)</dd> 4.104 - <dt>pkgs.cgi</dt> 4.105 - <dd>Tazpkg packages CGI interface</dd> 4.106 - <dt>settings.cgi</dt> 4.107 - <dd>System settings and services such as time, users accounts, 4.108 - locales or daemons management</dd> 4.109 - <dt>live.cgi</dt> 4.110 - <dd>All tools related to Live systems (CD, USB, Frugal)</dd> 4.111 - <dt>hardware.cgi</dt> 4.112 - <dd>Devices drivers, firmware, printing</dd> 4.113 - <dt>help.cgi</dt> 4.114 - <dd>Cat the html doc and this README file</dd> 4.115 -</ul> 4.116 - 4.117 -<p>For common functions have a look at lib/libtazpanel, where you may find functions 4.118 -you need already coded such as a xhtml_header to get the style header.html 4.119 -in your CGI script. For the loading message you can use loading_msg. When 4.120 -cat is used: `gettext "Text to translate"`</p> 4.121 - 4.122 - 4.123 -<h3>Web server</h3> 4.124 - 4.125 -<p>Tazpanel can run with the Busybox httpd applet or LightTPD and probably Apache. 4.126 -Start the webserver with a custom config to listen only on a local port for 4.127 -security reasons since we run as root to perform system actions, example:</p> 4.128 - 4.129 -<pre># httpd -p 82 u root -c /etc/slitaz/httpd.conf</pre> 4.130 - 4.131 -<p>Or use a tazpanel cmdline:</p> 4.132 - 4.133 -<pre># ./tazpanel start</pre> 4.134 + </div> 4.135 +</section>
5.1 --- a/boot.cgi Mon Mar 23 21:17:06 2015 +0100 5.2 +++ b/boot.cgi Tue Mar 24 03:39:08 2015 +0200 5.3 @@ -2,73 +2,89 @@ 5.4 # 5.5 # Boot CGI script - All what happens before login (grub, rcS, slim) 5.6 # 5.7 -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License 5.8 +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License 5.9 # 5.10 5.11 + 5.12 # Common functions from libtazpanel and source main boot config file. 5.13 + 5.14 . lib/libtazpanel 5.15 . /etc/rcS.conf 5.16 +get_config 5.17 header 5.18 -get_config 5.19 5.20 TITLE=$(gettext 'TazPanel - Boot') 5.21 5.22 + 5.23 +# Print last 40 lines of given file with "more" link 5.24 + 5.25 loghead() 5.26 { 5.27 - tail -n 40 $1 | htmlize 5.28 + case $2 in 5.29 + htmlize) tail -n40 $1 | htmlize;; 5.30 + *) tail -n40;; 5.31 + esac 5.32 [ $(wc -l < $1) -gt 40 ] && cat <<EOT 5.33 -<hr /><a href="/index.cgi?file=$1">$(gettext 'Show more...')</a> 5.34 +<hr/><a href="/index.cgi?file=$1">$(gettext 'Show more...')</a> 5.35 EOT 5.36 } 5.37 5.38 + 5.39 # 5.40 # Commands 5.41 # 5.42 5.43 case " $(GET) " in 5.44 *\ log\ *) 5.45 - unset actboot actslim actxlog actkernel 5.46 + unset actboot actslim actxlog actkernel colors 5.47 case "$(GET log)" in 5.48 - boot) actboot=' class="active"' 5.49 - output="$(filter_taztools_msgs < /var/log/boot.log)" 5.50 - ;; 5.51 - slim) actslim=' class="active"' 5.52 - output="$(loghead /var/log/slim.log)" ;; 5.53 - xlog) actxlog=' class="active"' 5.54 - output="$(loghead /var/log/Xorg.0.log)" ;; 5.55 - *) actkernel=' class="active"' 5.56 - output="$(syntax_highlighter kernel < /var/log/dmesg.log)" 5.57 + boot) 5.58 + actboot=' class="active"' 5.59 + output="$(filter_taztools_msgs < /var/log/boot.log)" 5.60 + colors=' class="term log"';; 5.61 + slim) 5.62 + actslim=' class="active"' 5.63 + output="$(loghead /var/log/slim.log htmlize)" ;; 5.64 + xlog) 5.65 + actxlog=' class="active"' 5.66 + output="$(syntax_highlighter xlog < /var/log/Xorg.0.log | loghead /var/log/Xorg.0.log)" ;; 5.67 + *) 5.68 + actkernel=' class="active"' 5.69 + output="$(syntax_highlighter kernel < /var/log/dmesg.log | loghead /var/log/dmesg.log)" ;; 5.70 esac 5.71 xhtml_header 5.72 - cat << EOT 5.73 -<div id="wrapper"> 5.74 - <h2>$(gettext 'Boot log files')</h2> 5.75 -</div> 5.76 + cat <<EOT 5.77 +<h2>$(gettext 'Boot log files')</h2> 5.78 + 5.79 <ul id="tabs"> 5.80 <li$actkernel><a href="?log=kernel">$(gettext 'Kernel messages')</a></li> 5.81 - <li$actboot><a href="?log=boot">$(gettext 'Boot scripts')</a></li> 5.82 - <li$actxlog><a href="?log=xlog">$(gettext 'X server')</a></li> 5.83 - <li$actslim><a href="?log=slim">$(gettext 'X session')</a></li> 5.84 + <li$actboot ><a href="?log=boot" >$(gettext 'Boot scripts' )</a></li> 5.85 + <li$actxlog ><a href="?log=xlog" >$(gettext 'X server' )</a></li> 5.86 + <li$actslim ><a href="?log=slim" >$(gettext 'X session' )</a></li> 5.87 </ul> 5.88 -<pre> 5.89 -$output 5.90 -</pre> 5.91 + 5.92 +<section> 5.93 + <div> 5.94 + <pre$colors>$output</pre> 5.95 + </div> 5.96 +</section> 5.97 EOT 5.98 ;; 5.99 + 5.100 + 5.101 *\ daemons\ *) 5.102 # 5.103 # Everything until user login 5.104 # 5.105 - # Start and stop a daemon. I think we don't need a restart since 2 5.106 - # clicks and you are done 5.107 + # Start and stop a daemon. 5.108 + # (I think we don't need a 'restart' since 2 clicks and you are done) 5.109 . /etc/rcS.conf 5.110 xhtml_header 5.111 5.112 - cat << EOT 5.113 -<div id="wrapper"> 5.114 - <h2>$(gettext 'Manage daemons')</h2> 5.115 - <p>$(gettext 'Check, start and stop daemons on SliTaz')</p> 5.116 -</div> 5.117 + cat <<EOT 5.118 +<h2>$(gettext 'Manage daemons')</h2> 5.119 + 5.120 +<p>$(gettext 'Check, start and stop daemons on SliTaz')</p> 5.121 EOT 5.122 daemon=$(GET daemons) 5.123 case "$daemon" in 5.124 @@ -85,37 +101,34 @@ 5.125 done 5.126 echo "</pre>" ;; 5.127 esac 5.128 + 5.129 # Daemon list 5.130 - table_start 5.131 - cat << EOT 5.132 -<thead> 5.133 - <tr> 5.134 - <td>$(gettext 'Name')</td> 5.135 - <td>$(gettext 'Description')</td> 5.136 - <td>$(gettext 'Configuration')</td> 5.137 - <td>$(gettext 'Status')</td> 5.138 - <td>$(gettext 'Action')</td> 5.139 - <td>$(gettext 'PID')</td> 5.140 - </tr> 5.141 -</thead> 5.142 + cat <<EOT 5.143 +<section> 5.144 + <table class="zebra wide daemons"> 5.145 + <thead> 5.146 + <tr> 5.147 + <td>$(gettext 'Name')</td> 5.148 + <td>$(gettext 'Description')</td> 5.149 + <td>$(gettext 'Configuration')</td> 5.150 + <td>$(gettext 'Status')</td> 5.151 + <td>$(gettext 'Action')</td> 5.152 + <td>$(gettext 'PID')</td> 5.153 + </tr> 5.154 + </thead> 5.155 + <tbody> 5.156 EOT 5.157 cd /etc/init.d 5.158 - list="`ls | sed -e /.sh/d -e /rc./d -e /RE/d -e /daemon/d \ 5.159 - -e /firewall/d`" 5.160 - for name in $list 5.161 - do 5.162 - pkg="" 5.163 - pid="" 5.164 - status="" 5.165 - SHORT_DESC="" 5.166 + list="$(ls | sed -e /.sh/d -e /rc./d -e /RE/d -e /daemon/d -e /firewall/d)" 5.167 + for name in $list; do 5.168 + unset pkg pid status SHORT_DESC boot cfg 5.169 echo '<tr>' 5.170 # Name 5.171 echo "<td>$name</td>" 5.172 - # First check if daemon is started at bootime 5.173 + # First check if daemon is started at boottime 5.174 [ echo "RUN_DAEMONS" | fgrep $name ] && boot="on boot" 5.175 # Standard SliTaz busybox daemons and firewall 5.176 echo -n "<td>" 5.177 - cfg="" 5.178 grep -qi "^${name}_OPTIONS=" /etc/daemons.conf && cfg="options|$cfg" 5.179 for i in /etc/slitaz /etc /etc/$name ; do 5.180 [ -s $i/$name.conf ] && cfg="edit::$i/$name.conf|$cfg" 5.181 @@ -156,6 +169,7 @@ 5.182 [ -d "$LOCALSTATE/installed/${name}-pam" ] && pkg=${name}-pam 5.183 if [ "$pkg" ]; then 5.184 unset SHORT_DESC TAZPANEL_DAEMON 5.185 +#FIXME $PKGS_DB 5.186 . $LOCALSTATE/installed/$pkg/receipt 5.187 echo -n "$SHORT_DESC" 5.188 cfg="${TAZPANEL_DAEMON:-$cfg|web::$WEB_SITE}" 5.189 @@ -167,44 +181,47 @@ 5.190 # Attempt to get daemon status 5.191 pidfile=$(find /var/run -name *$name*.pid) 5.192 [ "$pidfile" ] && pid=$(cat $pidfile) 5.193 - # dbus 5.194 + # Dbus 5.195 [ -f /var/run/${name}/pid ] && pid=$(cat /var/run/${name}/pid) 5.196 - # apache 5.197 + # Apache 5.198 [ "$name" = "apache" ] && pid=$(cat /var/run/$name/httpd.pid) 5.199 # Pidof works for many daemons 5.200 [ "$pid" ] || pid=$(pidof $name) 5.201 - echo -n "<td>" 5.202 - if [ "$cfg" ]; then 5.203 + 5.204 + echo -n "<td style='white-space: nowrap'>" 5.205 + if [ -n "$cfg" ]; then 5.206 IFS="|" 5.207 for i in $cfg ; do 5.208 IFS=":" 5.209 set -- $i 5.210 case "$1" in 5.211 - edit) cat <<EOT 5.212 -<a href="index.cgi?file=${3:-/etc/$name.conf}&action=edit"> 5.213 -<img title="${2:-$name Configuration}" src="$IMAGES/edit.png" /></a> 5.214 + edit) 5.215 + cat <<EOT 5.216 +<a href="index.cgi?file=${3:-/etc/$name.conf}&action=edit" title="${2:-$name Configuration}" data-img="conf"></a> 5.217 EOT 5.218 ;; 5.219 options) 5.220 - key=$(echo $name | tr [a-z] [A-Z])_OPTIONS 5.221 + key=$(echo -n $name | tr [a-z] [A-Z])_OPTIONS 5.222 cat <<EOT 5.223 -<a href="index.cgi?file=/etc/daemons.conf&action=setvar&var=$key&default=$3"> 5.224 -<img title="${2:-$key}" src="$IMAGES/tux.png" /></a> 5.225 +<a href="index.cgi?file=/etc/daemons.conf&action=setvar&var=$key&default=$3" title="${2:-$key}" data-img="opt"></a> 5.226 EOT 5.227 ;; 5.228 - man) cat <<EOT 5.229 -<a href="index.cgi?exec=man ${3:-$name}"> 5.230 -<img title="${2:-$name Manual}" src="$IMAGES/text.png" /></a> 5.231 + man) 5.232 + cat <<EOT 5.233 +<a href="index.cgi?exec=man ${3:-$name}&back=boot.cgi%3Fdaemons" title="${2:-$name Manual}" data-img="man"></a> 5.234 EOT 5.235 ;; 5.236 - help) cat <<EOT 5.237 -<a href="index.cgi?exec=$(which ${3:-$name}) --help"> 5.238 -<img title="${2:-$name Help}" src="$IMAGES/help.png" /></a> 5.239 + help) 5.240 + help='--help' 5.241 + case $name in 5.242 + cupsd|dropbear|gpm|slim|wpa_supplicant) help='-h' 5.243 + esac 5.244 + cat <<EOT 5.245 +<a href="index.cgi?exec=$(which ${3:-$name}) $help&back=boot.cgi%3Fdaemons" title="${2:-$name Help}" data-img="help"></a> 5.246 EOT 5.247 ;; 5.248 web) cat <<EOT 5.249 -<a href="${i#$1:$2:}"> 5.250 -<img title="${2:-$name website:} ${i#$1:$2:}" src="$IMAGES/browser.png" /></a> 5.251 +<a href="${i#$1:$2:}" title="${2:-$name website:} ${i#$1:$2:}" target="_blank" data-img="web"></a> 5.252 EOT 5.253 ;; 5.254 esac 5.255 @@ -212,28 +229,27 @@ 5.256 fi 5.257 echo "</td>" 5.258 if [ "$pid" ]; then 5.259 - cat << EOT 5.260 -<td><img src="$IMAGES/started.png" alt="Started" title="$(gettext 'Started')" /></td> 5.261 -<td><a href="?daemons=stop=$name"> 5.262 - <img src="$IMAGES/stop.png" alt="Stop" title="$(gettext 'Stop')" /></a></td> 5.263 + cat <<EOT 5.264 +<td><span title="$(gettext 'Started')" data-img="on"></span></td> 5.265 +<td><a href="?daemons=stop=$name" title="$(gettext 'Stop')" data-img="stop"></a></td> 5.266 <td> 5.267 EOT 5.268 for i in $pid; do 5.269 - cat << EOT 5.270 + cat <<EOT 5.271 <a href="?daemons=pid=$i">$i</a> 5.272 EOT 5.273 done 5.274 else 5.275 - cat << EOT 5.276 -<td><img src="$IMAGES/stopped.png" alt="Stopped" title="$(gettext 'Stopped')" /></td> 5.277 -<td><a href="?daemons=start=$name"> 5.278 - <img src="$IMAGES/start.png" alt="Start" title="$(gettext 'Start')" /></a></td> 5.279 + cat <<EOT 5.280 +<td><span title="$(gettext 'Stopped')" data-img="off"></span></td> 5.281 +<td><a href="?daemons=start=$name" title="$(gettext 'Start')" data-img="start"></a></td> 5.282 <td>----- 5.283 EOT 5.284 fi 5.285 echo '</td></tr>' 5.286 done 5.287 - table_end ;; 5.288 + echo '</thead></table></section>' ;; 5.289 + 5.290 5.291 *\ grub\ *) 5.292 GRUBMENU="/boot/grub/menu.lst" 5.293 @@ -247,93 +263,126 @@ 5.294 -e s"|splashimage=.*|splashimage=$splash|" \ 5.295 $GRUBMENU 5.296 fi 5.297 - default=$(cat $GRUBMENU | grep ^default | cut -d " " -f 2) 5.298 - timeout=$(cat $GRUBMENU | grep ^timeout | cut -d " " -f 2) 5.299 - splash=$(cat $GRUBMENU | grep ^splashimage | cut -d "=" -f 2) 5.300 + default=$(cat $GRUBMENU | grep ^default | cut -d' ' -f2) 5.301 + timeout=$(cat $GRUBMENU | grep ^timeout | cut -d' ' -f2) 5.302 + splash=$(cat $GRUBMENU | grep ^splashimage | cut -d' ' -f2) 5.303 xhtml_header 5.304 - cat << EOT 5.305 -<div id="wrapper"> 5.306 - <h2>$(gettext 'GRUB Boot loader')</h2> 5.307 + cat <<EOT 5.308 +<h2>$(gettext 'GRUB Boot loader')</h2> 5.309 5.310 - <p>$(gettext 'The first application started when the computer powers on')</p> 5.311 -</div> 5.312 +<p>$(gettext 'The first application started when the computer powers on')</p> 5.313 5.314 -<form method="get" action=""> 5.315 - <input type="hidden" name="grub" /> 5.316 -<table> 5.317 -<tr><td>$(gettext 'Default entry:')</td> 5.318 - <td><input type="text" name="default" value="$default" /></td></tr> 5.319 -<tr><td>$(gettext 'Timeout:')</td> 5.320 - <td><input type="text" name="timeout" value="$timeout" /></td></tr> 5.321 -<tr><td>$(gettext 'Splash image:')</td> 5.322 - <td><input type="text" name="splash" value="$splash" size="40" /></td></tr> 5.323 -</table> 5.324 - <input type="submit" value="$(gettext 'Change')" /> 5.325 - <a class="button" href="index.cgi?file=$GRUBMENU"> 5.326 - <img src="$IMAGES/text.png" />$(gettext 'View or edit menu.lst')</a> 5.327 +<form class="wide"> 5.328 + <section> 5.329 + <div> 5.330 + <input type="hidden" name="grub"/> 5.331 + <table> 5.332 + <tr><td>$(gettext 'Default entry:')</td> 5.333 + <td><input type="text" name="default" value="${default##*=}"/></td></tr> 5.334 + <tr><td>$(gettext 'Timeout:')</td> 5.335 + <td><input type="text" name="timeout" value="${timeout##*=}"/></td></tr> 5.336 + <tr><td>$(gettext 'Splash image:')</td> 5.337 + <td><input type="text" name="splash" value="${splash##*=}" size="40"/></td></tr> 5.338 + </table> 5.339 + </div> 5.340 + <footer> 5.341 + <button type="submit" data-icon="ok">$(gettext 'Change')</button> 5.342 + </footer> 5.343 + </section> 5.344 </form> 5.345 5.346 -<h3>$(gettext 'Boot entries')</h3> 5.347 +<form action="index.cgi"> 5.348 + <input type="hidden" name="file" value="$GRUBMENU"/> 5.349 + <button data-icon="text">$(gettext 'View or edit menu.lst')</button> 5.350 +</form> 5.351 + 5.352 + 5.353 +<section> 5.354 + <header>$(gettext 'Boot entries')</header> 5.355 + <div> 5.356 EOT 5.357 5.358 5.359 -menu=$(tail -q -n +$(grep -n ^title $GRUBMENU | head -n1 | cut -d: -f1) $GRUBMENU \ 5.360 - | sed -e "s|^$||g" \ 5.361 - | sed -e "s|^title|</pre></li>\n<p><strong>$(gettext 'Entry') #</strong></p>\n<pre>\0|g" \ 5.362 - | sed '/^[ \t]*$/d' \ 5.363 - | tail -q -n +2)"</pre>" 5.364 +menu=$(tail -q -n +$(grep -n ^title $GRUBMENU | head -n1 | cut -d: -f1) $GRUBMENU | \ 5.365 + sed -e "s|^$||g" | \ 5.366 + sed -e "s|^title|</pre></div>\n</section>\n\n<section>\n\t<header>$(gettext 'Entry') #</header>\n<div><pre style=\"white-space:pre-wrap\">\0|g" | \ 5.367 + sed '/^[ \t]*$/d' | \ 5.368 + tail -q -n +2)"</pre>" 5.369 5.370 entry='-1' 5.371 echo "$menu" | while read line 5.372 do 5.373 - if [ -n "$(echo $line | grep '#</strong>')" ]; then 5.374 + if [ -n "$(echo $line | grep '#</header>')" ]; then 5.375 entry=$(($entry + 1)) 5.376 fi 5.377 - echo $line | sed "s|#</strong>|$entry</strong>|" 5.378 + echo $line | sed "s|#</header>|$entry</header>|" 5.379 done 5.380 5.381 + echo '</section>' 5.382 + 5.383 + 5.384 # Here we could check if an entry for gpxe is present if not 5.385 # display a form to add it. 5.386 - [ -f "/boot/gpxe" ] && echo "<h3>gPXE</h3>" && \ 5.387 - gettext 'Web boot is available with gPXE' 5.388 + [ -f "/boot/gpxe" ] && cat <<EOT 5.389 +<section> 5.390 + <header>gPXE</header> 5.391 + <div>$(gettext 'Web boot is available with gPXE')</div> 5.392 +</section> 5.393 +EOT 5.394 ;; 5.395 + 5.396 + 5.397 *) 5.398 # 5.399 # Default content with summary 5.400 # 5.401 . /etc/rcS.conf 5.402 xhtml_header 5.403 - cat << EOT 5.404 -<div id="wrapper"> 5.405 - <h2>$(gettext 'Boot & Start services')</h2> 5.406 - <p>$(gettext 'Everything that happens before user login')</p> 5.407 -</div> 5.408 -<div> 5.409 - <a class="button" href="?log"> 5.410 - <img src="$IMAGES/text.png" />$(gettext 'Boot logs')</a> 5.411 - <a class="button" href="?daemons"> 5.412 - <img src="$IMAGES/recharge.png" />$(gettext 'Manage daemons')</a> 5.413 - <a class="button" href="?grub">$(gettext 'Boot loader')</a> 5.414 -</div> 5.415 + cat <<EOT 5.416 +<h2>$(gettext 'Boot & Start services')</h2> 5.417 5.418 -<h3>$(gettext 'Configuration files')</h3> 5.419 -<ul> 5.420 - <li>$(gettext 'Main configuration file:') 5.421 - <a href="index.cgi?file=/etc/rcS.conf">rcS.conf</a></li> 5.422 - <li>$(gettext 'Login manager settings:') 5.423 - <a href="index.cgi?file=/etc/slim.conf">slim.conf</a></li> 5.424 -</ul> 5.425 +<p>$(gettext 'Everything that happens before user login')</p> 5.426 5.427 -<h3>$(gettext 'Kernel cmdline')</h3> 5.428 +<form> 5.429 + <button name="log" data-icon="logs" >$(gettext 'Boot logs' )</button> 5.430 + <button name="daemons" data-icon="daemons">$(gettext 'Manage daemons')</button> 5.431 + <button name="grub" data-icon="grub" >$(gettext 'Boot loader' )</button> 5.432 +</form> 5.433 5.434 -<pre>$(cat /proc/cmdline)</pre> 5.435 5.436 -<h3>$(gettext 'Local startup commands')</h3> 5.437 +<section> 5.438 + <header>$(gettext 'Configuration files')</header> 5.439 + <form action="index.cgi" class="wide"> 5.440 + <table> 5.441 + <tr><td>$(gettext 'Main configuration file:') <b>rcS.conf</b></td> 5.442 + <td><button name="file" value="/etc/rcS.conf" data-icon="view">$(gettext 'View')</button></td></tr> 5.443 + <tr><td>$(gettext 'Login manager settings:') <b>slim.conf</b></td> 5.444 + <td><button name="file" value="/etc/slim.conf" data-icon="view">$(gettext 'View')</button></td></tr> 5.445 + </table> 5.446 + </form> 5.447 +</section> 5.448 5.449 -<pre>$(cat /etc/init.d/local.sh | syntax_highlighter sh)</pre> 5.450 5.451 -<a class="button" href="index.cgi?file=/etc/init.d/local.sh&action=edit"> 5.452 -<img src="$IMAGES/edit.png" />$(gettext 'Edit script')</a> 5.453 +<section> 5.454 + <header>$(gettext 'Kernel cmdline')</header> 5.455 + <div> 5.456 + <pre>$(cat /proc/cmdline)</pre> 5.457 + </div> 5.458 +</section> 5.459 + 5.460 + 5.461 +<section> 5.462 + <header>$(gettext 'Local startup commands')</header> 5.463 + <div> 5.464 + <pre>$(cat /etc/init.d/local.sh | syntax_highlighter sh)</pre> 5.465 + </div> 5.466 + <footer> 5.467 + <form action="index.cgi"> 5.468 + <input type="hidden" name="file" value="/etc/init.d/local.sh"/> 5.469 + <button name="action" value="edit" data-icon="edit">$(gettext 'Edit script')</button> 5.470 + </form> 5.471 + </footer> 5.472 +</section> 5.473 EOT 5.474 ;; 5.475 esac
6.1 --- a/data/httpd.conf Mon Mar 23 21:17:06 2015 +0100 6.2 +++ b/data/httpd.conf Tue Mar 24 03:39:08 2015 +0200 6.3 @@ -1,6 +1,18 @@ 6.4 +# /etc/slitaz/httpd.conf: Busybox HTTP web server configuration file for TazPanel 6.5 + 6.6 +# Deny addresses 6.7 +D:* 6.8 +# Allow addresses 6.9 +A:127.0.0.1 6.10 + 6.11 +# Server root 6.12 H:/var/www/tazpanel 6.13 -A:127.0.0.1 6.14 -D:* 6.15 +# File to open by default 6.16 +I:index.cgi 6.17 +# Require user "*", password "*" on URLs starting with "/" 6.18 +/:*:* 6.19 + 6.20 +# CGI interpreter path 6.21 *.cgi:/bin/sh 6.22 -I:index.cgi 6.23 -/:*:* 6.24 +# Additional MIME types 6.25 +.js:text/javascript
7.1 Binary file data/icons/hicolor/16x16/apps/tazpanel.png has changed
8.1 Binary file data/icons/hicolor/32x32/apps/tazpanel.png has changed
9.1 Binary file data/icons/hicolor/48x48/apps/tazpanel.png has changed
10.1 Binary file data/tazpanel.png has changed
11.1 --- a/doc/tazpanel.en.html Mon Mar 23 21:17:06 2015 +0100 11.2 +++ b/doc/tazpanel.en.html Tue Mar 24 03:39:08 2015 +0200 11.3 @@ -1,73 +1,82 @@ 11.4 <div id="help"> 11.5 11.6 -<h2>English Help</h2> 11.7 + <section> 11.8 + <header>English Help</header> 11.9 + <div> 11.10 11.11 -<p> 11.12 + <p> 11.13 TazPanel is the SliTaz administration and settings center from where 11.14 you can control your entire system such as managing packages, adding 11.15 or removing users, creating Live systems and much more. Navigation 11.16 is done with the toolbar at the top of the application window and 11.17 in some cases with a submenu or a side bar as in the packages interface. 11.18 -</p> 11.19 + </p> 11.20 11.21 -<p> 11.22 + <p> 11.23 In most cases you will get a description and useful information with 11.24 - the section concerned. TazPanel uses the latest XHTML 5 and CSS 3 technology 11.25 + the section concerned. TazPanel uses the latest HTML 5 and CSS 3 technology 11.26 to provide a clean and easy to use frontend for all the administration tasks 11.27 that you can do on SliTaz. TazPanel has also been coded from the beginning 11.28 with speed and quality in mind and it also supports full 11.29 internationalization. 11.30 -</p> 11.31 + </p> 11.32 11.33 -<p> 11.34 + <p> 11.35 TazPanel is run as a web server on port 82 by default and can be used only 11.36 from the local system. If you wish to control your system from a remote host 11.37 you can change the server configuration file to allow connections from a 11.38 local network or the entire world wide web, but in this last case make sure 11.39 that you set a strong password for the panel. The server configuration file is 11.40 - /etc/slitaz/httpd.conf. 11.41 -</p> 11.42 + <a data-icon="text" href="index.cgi?file=/etc/slitaz/httpd.conf">/etc/slitaz/httpd.conf</a>. 11.43 + </p> 11.44 11.45 -<h3>Terminal</h3> 11.46 -<p> 11.47 + 11.48 + <h3>Terminal</h3> 11.49 + 11.50 + <p> 11.51 TazPanel provides a small terminal emulator which lets you execute commands as 11.52 root on the remote or local system. Not all available commands are usable 11.53 and you should use a SSH connection for most tasks. That said, having access 11.54 - to a few commands within the web interface can be useful and wget is 11.55 + to a few commands within the web interface can be useful and <tt>wget</tt> is 11.56 supported to allow file uploads on a remote machine. The download directory 11.57 - is /var/www/downloads by default. All commands can use options such as 11.58 - -R -l etc. 11.59 -</p> 11.60 + is <tt>/var/www/downloads</tt> by default. All commands can use options such as 11.61 + <tt>-R</tt> <tt>-l</tt> etc. 11.62 + </p> 11.63 11.64 -<h3>Get Support</h3> 11.65 11.66 -<p> 11.67 - You can get support on the Slitaz <a href="http://forum.slitaz.org/">forum</a>, 11.68 + <h3>Get Support</h3> 11.69 + 11.70 + <p> 11.71 + You can get support on the SliTaz <a data-icon="web" href="http://forum.slitaz.org/" target="_blank">forum</a>, 11.72 the mailing list or the IRC channel. The official SliTaz IRC channel is on 11.73 Freenode (note that you can use LostIRC, Xchat or Pidgin on SliTaz). Freenode also 11.74 - provides a nice IRC <a href="http://webchat.freenode.net/">web interface</a>. 11.75 -</p> 11.76 + provides a nice IRC <a data-icon="web" href="http://webchat.freenode.net/" target="_blank">web interface</a>. 11.77 + </p> 11.78 11.79 -<h3>Get involved</h3> 11.80 11.81 -<p> 11.82 + <h3>Get involved</h3> 11.83 + 11.84 + <p> 11.85 If you want to help and get involved in SliTaz, TazPanel maybe for you! 11.86 We need help in translating, styling, documenting and coding. If 11.87 you need more information or want to publish a new graphical style, 11.88 - you can go to the SliTaz <a href="http://scn.slitaz.org/">Community</a> 11.89 + you can go to the SliTaz <a data-icon="web" href="http://scn.slitaz.org/" target="_blank">Community</a> 11.90 and post on the Devel forum or post an update with a PM to a SliTaz 11.91 contributor so that we can get in touch and include your work in TazPanel 11.92 or in an extra styles package. 11.93 -</p> 11.94 + </p> 11.95 11.96 -<h3>Bugs and features</h3> 11.97 11.98 -<p> 11.99 + <h3>Bugs and features</h3> 11.100 + 11.101 + <p> 11.102 TazPanel is still a young application which will be improved and polished in 11.103 time. If you find a bug, please post on the SliTaz tracker: 11.104 - <a href="http://bugs.slitaz.org/">bugs.slitaz.org</a>. Tazpanel has a 11.105 - debug mode that can be enabled in the configuration file tazpanel.conf 11.106 - and also provides a <a href="/index.cgi?debug">debug page</a>. 11.107 -</p> 11.108 + <a data-icon="web" href="http://bugs.slitaz.org/" target="_blank">bugs.slitaz.org</a>. Tazpanel has a 11.109 + debug mode that can be enabled in the configuration file <a data-icon="text" href="index.cgi?file=/etc/slitaz/tazpanel.conf">tazpanel.conf</a> 11.110 + and also provides a <a data-icon="info" href="index.cgi?debug">debug page</a>. 11.111 + </p> 11.112 11.113 + </div> 11.114 + </section> 11.115 </div>
12.1 --- a/doc/tazpanel.fr.html Mon Mar 23 21:17:06 2015 +0100 12.2 +++ b/doc/tazpanel.fr.html Tue Mar 24 03:39:08 2015 +0200 12.3 @@ -1,49 +1,56 @@ 12.4 <div id="help"> 12.5 12.6 -<h2>Francais - Aide</h2> 12.7 + <section> 12.8 + <header>Francais - Aide</header> 12.9 + <div> 12.10 12.11 -<p> 12.12 + <p> 12.13 TazPanel is the SliTaz administration and settings center from where 12.14 you can control your entire system such as package management, adding 12.15 or removing users, creating Live systems and much more. Navigation 12.16 is done with the toolbar at the top of the application window and 12.17 in some cases with a submenu. 12.18 -</p> 12.19 + </p> 12.20 12.21 -<p> 12.22 + <p> 12.23 In most cases you will get a description and useful information with 12.24 - the section concerned. TazPanel uses the latest XHTML 5 and CSS 3 technology 12.25 + the section concerned. TazPanel uses the latest HTML 5 and CSS 3 technology 12.26 to provide a clean and easy to use frontend for all administration tasks 12.27 you can do on SliTaz. TazPanel has also been coded from the beginning 12.28 with speed and qualility in mind and it also supports full 12.29 internationalization. 12.30 -</p> 12.31 + </p> 12.32 12.33 -<h3>Assistance</h3> 12.34 12.35 -<p> 12.36 - Pour obtenir de l'aide sur SliTaz rendez-vous sur le forum <a href="http://forum.slitaz.org/">forum</a>, 12.37 + <h3>Assistance</h3> 12.38 + 12.39 + <p> 12.40 + Pour obtenir de l'aide sur SliTaz rendez-vous sur le forum <a data-icon="web" href="http://forum.slitaz.org/" target="_blank">forum</a>, 12.41 la liste de diffusion ou le canal IRC. 12.42 -</p> 12.43 + </p> 12.44 12.45 -<h3>Get involve</h3> 12.46 12.47 -<p> 12.48 + <h3>Get involve</h3> 12.49 + 12.50 + <p> 12.51 If you want to help and get involved in SliTaz, TazPanel maybe for you! 12.52 We need help in translating, styling, documentation and coding. If 12.53 you need more information or want to publish a new graphical style, 12.54 - you can go to the SliTaz <a href="http://scn.slitaz.org/">Community</a> 12.55 + you can go to the SliTaz <a data-icon="web" href="http://scn.slitaz.org/" target="_blank">Community</a> 12.56 and post on the Devel forum or post an update with a PM to a SliTaz 12.57 contributor so that we can get in touch and include your work in TazPanel 12.58 or in an extra styles package. 12.59 -</p> 12.60 + </p> 12.61 12.62 -<h3>Bugs et fonctionnalités</h3> 12.63 12.64 -<p> 12.65 + <h3>Bugs et fonctionnalités</h3> 12.66 + 12.67 + <p> 12.68 Tazpanel est une nouvelle application qui sera améliorée et paufinée avec le temps. 12.69 Si vous trouvez un bug, merci de le signaler sur le système de bugs de SliTaz: 12.70 - <a href="http://bugs.slitaz.org/">bugs.slitaz.org</a> 12.71 -</p> 12.72 + <a data-icon="web" href="http://bugs.slitaz.org/" target="_blank">bugs.slitaz.org</a> 12.73 + </p> 12.74 12.75 + </div> 12.76 + </section> 12.77 </div>
13.1 --- a/doc/tazpanel.pt.html Mon Mar 23 21:17:06 2015 +0100 13.2 +++ b/doc/tazpanel.pt.html Tue Mar 24 03:39:08 2015 +0200 13.3 @@ -1,8 +1,10 @@ 13.4 <div id="help"> 13.5 13.6 -<h2>Ajuda em Português do Brasil</h2> 13.7 + <section> 13.8 + <header>Ajuda em Português do Brasil</header> 13.9 + <div> 13.10 13.11 -<p> 13.12 + <p> 13.13 O TazPanel é o centro de administração do SliTaz, de onde se pode 13.14 controlar todo o sistema, como gerenciamento de pacotes, adição ou 13.15 remoção de usuários, criação de sistemas Live e outras atividades. 13.16 @@ -10,41 +12,46 @@ 13.17 aplicativo e, em alguns casos, por submenus. Na maioria das vezes será 13.18 mostrada uma descrição e informações úteis relativas à seção em que o 13.19 usuário se encontra. 13.20 -</p> 13.21 + </p> 13.22 13.23 -<p> 13.24 - O TazPanel se utiliza das tecnologias mais recentes como xHTML5 e CSS 3 13.25 + <p> 13.26 + O TazPanel se utiliza das tecnologias mais recentes como HTML 5 e CSS 3 13.27 para fornecer um ambiente limpo e fácil de usar que centraliza todas as 13.28 tarefas de administração do SliTaz. Também foi criado desde o início 13.29 no intuito de ser rápido e ter suporte total a internacionalização. 13.30 -</p> 13.31 + </p> 13.32 13.33 -<h3>Suporte</h3> 13.34 13.35 -<p> 13.36 - Pode-se obter suporte no <a href="http://forum.slitaz.org/">fórum</a>, 13.37 + <h3>Suporte</h3> 13.38 + 13.39 + <p> 13.40 + Pode-se obter suporte no <a data-icon="web" href="http://forum.slitaz.org/" target="_blank">fórum</a>, 13.41 na lista de discussão e no canal IRC da distribuição. 13.42 -</p> 13.43 + </p> 13.44 13.45 -<h3>Envolva-se</h3> 13.46 13.47 -<p> 13.48 + <h3>Envolva-se</h3> 13.49 + 13.50 + <p> 13.51 Caso tenha interesse em ajudar no desenvolvimento do SliTaz, talvez possa 13.52 participar do desenvolvimento desta ferramenta. Precisamos de ajuda na 13.53 tradução, documentação, código e criação de estilos. Para maiores 13.54 informaçõe ou enviar um novo estilo, por exemplo, pode-se criar uma conta 13.55 - na <a href="http://scn.slitaz.org/">Comunidade do SliTaz</a> e postar 13.56 + na <a data-icon="web" href="http://scn.slitaz.org/" target="_blank">Comunidade do SliTaz</a> e postar 13.57 seu trabalho ou entrar em contato com um dos desenvolvedores da 13.58 distribuição. Desta forma, podemos incluir seu trabalho numa próxima 13.59 versão do programa. 13.60 -</p> 13.61 + </p> 13.62 13.63 -<h3>Bugs and features</h3> 13.64 13.65 -<p> 13.66 + <h3>Bugs and features</h3> 13.67 + 13.68 + <p> 13.69 O TazPanel é um aplicativo ainda novo que será melhorado com o tempo. 13.70 Caso encontre um bug ou queira pedir alguma nova funcionalidade, por 13.71 - favor postar em <a href="http://bugs.slitaz.org/">bugs.slitaz.org</a>. 13.72 -</p> 13.73 + favor postar em <a data-icon="web" href="http://bugs.slitaz.org/" target="_blank">bugs.slitaz.org</a>. 13.74 + </p> 13.75 13.76 + </div> 13.77 + </section> 13.78 </div>
14.1 --- a/doc/tazpanel.ru.html Mon Mar 23 21:17:06 2015 +0100 14.2 +++ b/doc/tazpanel.ru.html Tue Mar 24 03:39:08 2015 +0200 14.3 @@ -1,62 +1,80 @@ 14.4 <div id="help"> 14.5 14.6 -<h2>Справка TazPanel</h2> 14.7 + <section> 14.8 + <header>Справка TazPanel</header> 14.9 + <div> 14.10 14.11 -<p>TazPanel — это центр управления и настроек, из которого вы можете 14.12 - контролировать всю систему — управлять пакетами, добавлять и удалять 14.13 - пользователей, создавать «живые» системы и многое другое. Навигация 14.14 - осуществляется при помощи панели инструментов в верхней части окна 14.15 - приложения, а в некоторых случаях, как в интерфейсе пакетного менеджера, — 14.16 - при помощи меню и боковой панели.</p> 14.17 -<p>В большинстве случаев вы получите описание и полезную информацию по 14.18 - соответствующему разделу. TazPanel использует новые технологии — xHTML 5 14.19 - и CSS 3 для того, чтобы получить чистый и простой в использовании 14.20 - интерфейс для всех задач управления, которые можно выполнить в SliTaz. 14.21 - С самого начала TazPanel создавалась с расчётом на скорость, качество и 14.22 - полную поддержку интернационализации.</p> 14.23 -<p>TazPanel работает как веб-сервер на порту 82 (по умолчанию), её можно 14.24 - использовать только в локальной системе. Если вы хотите управлять вашей 14.25 - системой с удалённой машины, вы можете изменить файл конфигурации сервера, 14.26 - чтобы разрешить соединения из локальной сети, или даже из всего интернета, 14.27 - но в последнем случае убедитесь, что вы установили надёжный пароль для 14.28 - панели. Файл конфигурации сервера — /etc/slitaz/httpd.conf.</p> 14.29 + <p>TazPanel — это центр управления и настроек, из которого вы можете 14.30 + контролировать всю систему — управлять пакетами, добавлять и удалять 14.31 + пользователей, создавать «живые» системы и многое другое. Навигация 14.32 + осуществляется при помощи панели инструментов в верхней части окна 14.33 + приложения, а в некоторых случаях, как в интерфейсе пакетного 14.34 + менеджера, — при помощи меню и боковой панели.</p> 14.35 + <p>В большинстве случаев вы получите описание и полезную информацию 14.36 + по соответствующему разделу. TazPanel использует современные 14.37 + технологии — HTML 5 и CSS 3 для того, чтобы получить чистый и 14.38 + простой в использовании интерфейс для всех задач управления, которые 14.39 + можно выполнить в SliTaz. С самого начала TazPanel создавалась с 14.40 + расчётом на скорость, качество и полную поддержку 14.41 + интернационализации.</p> 14.42 + <p>TazPanel работает как веб-сервер на порту 82 (по умолчанию), её 14.43 + можно использовать только в локальной системе. Если вы хотите 14.44 + управлять вашей системой с удалённой машины, вы можете изменить файл 14.45 + конфигурации сервера, чтобы разрешить соединения из локальной сети, 14.46 + или даже из всего интернета, но в последнем случае убедитесь, что вы 14.47 + установили надёжный пароль для панели. Файл конфигурации сервера — 14.48 + <a data-icon="text" 14.49 + href="index.cgi?file=/etc/slitaz/httpd.conf">/etc/slitaz/httpd.conf</a>.</p> 14.50 14.51 -<h3>Терминал</h3> 14.52 14.53 -<p>TazPanel содержит небольшой эмулятор терминала, который позволяет выполнять 14.54 - команды от имени администратора на удалённой или локальной системе. 14.55 - Использоваться могут не все команды, и в большинстве случаев вы должны 14.56 - использовать соединение SSH. Тем не менее, несколько команд, имеющиеся в 14.57 - веб-интерфейсе, могут оказаться полезными, например, Wget поддерживает 14.58 - загрузку файлов на удалённую машину. Папка загрузки по умолчанию — 14.59 - /var/www/downloads. Все команды могут использовать параметры, такие как 14.60 - -R -l и т.д.</p> 14.61 + <h3>Терминал</h3> 14.62 14.63 -<h3>Поддержка</h3> 14.64 + <p>TazPanel содержит небольшой эмулятор терминала, который позволяет 14.65 + выполнять команды от имени администратора на удалённой или локальной 14.66 + системе. Использоваться могут не все команды, и в большинстве 14.67 + случаев вы должны использовать соединение SSH. Тем не менее, 14.68 + несколько команд, имеющиеся в веб-интерфейсе, могут оказаться 14.69 + полезными, например, <tt>wget</tt> поддерживает загрузку файлов на 14.70 + удалённую машину. Папка загрузки по умолчанию — 14.71 + <tt>/var/www/downloads</tt>. Все команды могут использовать 14.72 + параметры, такие как <tt>-R</tt>, <tt>-l</tt> и т.д.</p> 14.73 14.74 -<p>Вы можете получить поддержку на <a href="http://forum.slitaz.org/">форуме</a> 14.75 - SliTaz, в рассылке или на канале IRC. Официальный IRC-канал SliTaz 14.76 - находится на Freenode; вы можете использовать в 14.77 - SliTaz программы LostIRC, Xchat или Pidgin. Freenode также поддерживает 14.78 - хороший <a href="http://webchat.freenode.net/">веб-интерфейс</a>.</p> 14.79 14.80 -<h3>Присоединяйтесь</h3> 14.81 + <h3>Поддержка</h3> 14.82 14.83 -<p>Если вы хотите помочь и присоединиться к SliTaz, вы можете заняться TazPanel! 14.84 - Нам нужна помощь в переводе, дизайне, написании документации и кода. Если 14.85 - вам нужна дополнительная информация, или вы хотите опубликовать новый 14.86 - дизайн, заходите в <a href="http://scn.slitaz.org/">сообщество</a>, а там 14.87 - оставьте сообщение на форуме Devel, или личное сообщение одному из 14.88 - разработчиков SliTaz, чтобы мы могли связаться с вами и включить вашу работу 14.89 - в TazPanel или в дополнительный пакет стилей.</p> 14.90 + <p>Вы можете получить поддержку на <a data-icon="web" 14.91 + href="http://forum.slitaz.org/" target="_blank">форуме</a> SliTaz, в 14.92 + рассылке или на канале IRC. Официальный IRC-канал SliTaz находится 14.93 + на Freenode; вы можете использовать в SliTaz программы LostIRC, 14.94 + Xchat или Pidgin. Freenode также поддерживает хороший <a 14.95 + data-icon="web" href="http://webchat.freenode.net/" 14.96 + target="_blank">веб-интерфейс</a>.</p> 14.97 14.98 -<h3>Баги и особенности</h3> 14.99 14.100 -<p>TazPanel — всё ещё молодое приложение, которое со временем будет 14.101 - совершенствоваться и отшлифовываться. Если вы нашли ошибку, пожалуйста, 14.102 - сообщите на баг-трекер SliTaz: 14.103 - <a href="http://bugs.slitaz.org/">bugs.slitaz.org</a>. Tazpanel имеет режим 14.104 - отладки, который можно включить в файле конфигурации tazpanel.conf; также 14.105 - имеется <a href="/index.cgi?debug">отладочная страница</a>.</p> 14.106 + <h3>Присоединяйтесь</h3> 14.107 14.108 + <p>Если вы хотите помочь и присоединиться к SliTaz, вы можете 14.109 + заняться TazPanel! Нам нужна помощь в переводе, дизайне, написании 14.110 + документации и кода. Если вам нужна дополнительная информация, или 14.111 + вы хотите опубликовать новый дизайн, заходите в <a data-icon="web" 14.112 + href="http://scn.slitaz.org/" target="_blank">сообщество</a>, а там 14.113 + оставьте сообщение на форуме Devel, или личное сообщение одному из 14.114 + разработчиков SliTaz, чтобы мы могли связаться с вами и включить 14.115 + вашу работу в TazPanel или в дополнительный пакет стилей.</p> 14.116 + 14.117 + 14.118 + <h3>Баги и особенности</h3> 14.119 + 14.120 + <p>TazPanel — всё ещё молодое приложение, которое со временем будет 14.121 + совершенствоваться и отшлифовываться. Если вы нашли ошибку, 14.122 + пожалуйста, сообщите на баг-трекер SliTaz: <a data-icon="web" 14.123 + href="http://bugs.slitaz.org/" target="_blank">bugs.slitaz.org</a>. 14.124 + Tazpanel имеет режим отладки, который можно включить в файле 14.125 + конфигурации <a data-icon="text" 14.126 + href="index.cgi?file=/etc/slitaz/tazpanel.conf">tazpanel.conf</a>; 14.127 + также имеется <a data-icon="info" href="/index.cgi?debug">отладочная 14.128 + страница</a>.</p> 14.129 + 14.130 + </div> 14.131 + </section> 14.132 </div>
15.1 --- a/hardware.cgi Mon Mar 23 21:17:06 2015 +0100 15.2 +++ b/hardware.cgi Tue Mar 24 03:39:08 2015 +0200 15.3 @@ -2,7 +2,7 @@ 15.4 # 15.5 # Hardware part of TazPanel - Devices, drivers, printing 15.6 # 15.7 -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License 15.8 +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License 15.9 # 15.10 15.11 # Common functions from libtazpanel 15.12 @@ -20,10 +20,11 @@ 15.13 [ -s $module ] && . $module "$@" 15.14 } 15.15 15.16 + 15.17 lsusb_table() 15.18 { 15.19 - cat << EOT 15.20 -<table class="zebra outbox"> 15.21 + cat <<EOT 15.22 +<table class="wide zebra"> 15.23 <thead><tr><td>Bus</td><td>Device</td><td>ID</td><td>Name</td></thead> 15.24 <tbody> 15.25 EOT 15.26 @@ -35,10 +36,11 @@ 15.27 echo "</tbody></table>" 15.28 } 15.29 15.30 + 15.31 lspci_table() 15.32 { 15.33 - cat << EOT 15.34 -<table class="zebra outbox"> 15.35 + cat <<EOT 15.36 +<table class="wide zebra"> 15.37 <thead><tr><td>Slot</td><td>Device</td><td>Name</td></thead> 15.38 <tbody> 15.39 EOT 15.40 @@ -56,51 +58,64 @@ 15.41 case " $(GET) " in 15.42 *\ print\ *) 15.43 xhtml_header 15.44 - echo "<h2>TODO</h2>" ;; 15.45 + echo "<h2>TODO</h2>" 15.46 + ;; 15.47 + 15.48 + 15.49 *\ tazx\ *) 15.50 xhtml_header 15.51 - cat << EOT 15.52 + cat <<EOT 15.53 <pre>$(tazx auto)</pre> 15.54 EOT 15.55 ;; 15.56 + 15.57 + 15.58 *\ detect\ *) 15.59 # Front end for Tazhw 15.60 # TODO: Add button to detect webcam, etc. Like in tazhw box. 15.61 xhtml_header 15.62 - cat << EOT 15.63 -<div id="wrapper"> 15.64 - <h2>$(gettext 'Detect hardware')</h2> 15.65 - <p>$(gettext 'Detect PCI and USB hardware')</p> 15.66 -</div> 15.67 + cat <<EOT 15.68 +<h2>$(gettext 'Detect hardware')</h2> 15.69 +<p>$(gettext 'Detect PCI and USB hardware')</p> 15.70 15.71 -<pre>$(tazhw detect-pci | sed 's|^>|\>|g')</pre> 15.72 - 15.73 -<pre>$(tazhw detect-usb | sed 's|^>|\>|g')</pre> 15.74 +<section> 15.75 + <div> 15.76 + <pre>$(tazhw detect-pci | sed 's|^>|\>|g')</pre> 15.77 + <pre>$(tazhw detect-usb | sed 's|^>|\>|g')</pre> 15.78 + </div> 15.79 +</section> 15.80 EOT 15.81 ;; 15.82 + 15.83 + 15.84 *\ modules\ *|*\ modinfo\ *) 15.85 xhtml_header 15.86 - cat << EOT 15.87 -<div id="wrapper"> 15.88 - <h2>$(gettext 'Kernel modules')</h2> 15.89 - <div class="float-right"> 15.90 - <form method="get" action=""> 15.91 - <input type="hidden" name="modules" /> 15.92 - <input type="search" placeholder="$(gettext 'Modules search')" name="search" /> 15.93 - </form> 15.94 - </div> 15.95 - <p>$(gettext 'Manage, search or get information about the Linux kernel modules')</p> 15.96 -</div> 15.97 + cat <<EOT 15.98 +<h2>$(gettext 'Kernel modules')</h2> 15.99 + 15.100 +<form id="actions"> 15.101 + <input type="hidden" name="modules"/> 15.102 + $(gettext 'Manage, search or get information about the Linux kernel modules') 15.103 + 15.104 + <input type="search" name="search" class="float-right" placeholder="$(gettext 'Modules search')" results="5" autosave="modsearch" autocomplete="on"/> 15.105 +</form> 15.106 EOT 15.107 # Request may be modinfo output that we want in the page itself 15.108 get_modinfo="$(GET modinfo)" 15.109 if [ -n "$get_modinfo" ]; then 15.110 - cat << EOT 15.111 -<strong>$(eval_gettext 'Detailed information for module: $get_modinfo')</strong> 15.112 + cat <<EOT 15.113 +<section> 15.114 + <header>$(eval_gettext 'Detailed information for module: $get_modinfo')</header> 15.115 15.116 -<pre>$(modinfo $get_modinfo)</pre> 15.117 EOT 15.118 + modinfo $get_modinfo | awk 'BEGIN{print "<table class=\"wide zebra\">"} 15.119 + { 15.120 + printf("<tr><td><b>%s</b></td>", $1) 15.121 + $1=""; printf("<td>%s</td></tr>", $0) 15.122 + } 15.123 + END{print "</table></section>"}' 15.124 fi 15.125 + 15.126 if [ -n "$(GET modprobe)" ]; then 15.127 echo "<pre>$(modprobe -v $(GET modprobe))</pre>" 15.128 fi 15.129 @@ -120,56 +135,73 @@ 15.130 done 15.131 echo '</pre>' 15.132 fi 15.133 - cat << EOT 15.134 - $(table_start) 15.135 - <tr class="thead"> 15.136 - <td>$(gettext 'Module')</td> 15.137 - <td>$(gettext 'Size')</td> 15.138 - <td>$(gettext 'Used')</td> 15.139 - <td>$(gettext 'by')</td> 15.140 - </tr> 15.141 + cat <<EOT 15.142 +<section> 15.143 + <table class="zebra borders hborders"> 15.144 + <thead> 15.145 + <tr> 15.146 + <td>$(gettext 'Module')</td> 15.147 + <td>$(gettext 'Description')</td> 15.148 + <td>$(gettext 'Size')</td> 15.149 + <td>$(gettext 'Used')</td> 15.150 + <td>$(gettext 'by')</td> 15.151 + </tr> 15.152 + <thead> 15.153 + <tbody> 15.154 EOT 15.155 # Get the list of modules and link to modinfo 15.156 - lsmod | grep ^[a-z] | while read MOD SIZE USED BY 15.157 - do 15.158 - cat << EOT 15.159 - <tr> 15.160 - <td><a href="?modinfo=$MOD">$MOD</a></td> 15.161 - <td>$SIZE</td> 15.162 - <td>$USED</td> 15.163 - <td>$(echo $BY | sed s/","/" "/g)</td> 15.164 - </tr> 15.165 + lsmod | tail -n+2 | awk '{ 15.166 + gsub(",", " ", $4); 15.167 + printf("<tr><td><a href=\"?modinfo=%s\">%s</a></td><td>", $1, $1); 15.168 + system("modinfo -d " $1); 15.169 + printf("</td><td>%s</td><td>%s</td><td>%s</td></tr>", $2, $3, $4); 15.170 + }' 15.171 + cat <<EOT 15.172 + </thead> 15.173 + </table> 15.174 +</section> 15.175 EOT 15.176 - done 15.177 - table_end ;; 15.178 + ;; 15.179 + 15.180 + 15.181 *\ lsusb\ *) 15.182 xhtml_header 15.183 vidpid="$(GET lsusb)" 15.184 - cat << EOT 15.185 -<div id="wrapper"> 15.186 - <h2>$(eval_gettext 'Information for USB Device $vidpid')</h2> 15.187 - <p>$(gettext 'Detailed information about specified device.')</p> 15.188 -EOT 15.189 - lsusb_table 15.190 - cat << EOT 15.191 -</div> 15.192 -<pre>$(lsusb -vd $vidpid | syntax_highlighter lsusb)</pre> 15.193 + cat <<EOT 15.194 +<h2>$(eval_gettext 'Information for USB Device $vidpid')</h2> 15.195 + 15.196 +<p>$(gettext 'Detailed information about specified device.')</p> 15.197 + 15.198 +<section>$(lsusb_table)</section> 15.199 + 15.200 +<section> 15.201 + <div> 15.202 + <pre style="white-space: pre-wrap">$(lsusb -vd $vidpid | syntax_highlighter lsusb)</pre> 15.203 + </div> 15.204 +</section> 15.205 EOT 15.206 ;; 15.207 + 15.208 + 15.209 *\ lspci\ *) 15.210 xhtml_header 15.211 slot="$(GET lspci)" 15.212 - cat << EOT 15.213 -<div id="wrapper"> 15.214 - <h2>$(eval_gettext 'Information for PCI Device $slot')</h2> 15.215 - <p>$(gettext 'Detailed information about specified device.')</p> 15.216 -EOT 15.217 - lspci_table 15.218 - cat << EOT 15.219 -</div> 15.220 -<pre>$(lspci -vs $slot | syntax_highlighter lspci)</pre> 15.221 + cat <<EOT 15.222 +<h2>$(eval_gettext 'Information for PCI Device $slot')</h2> 15.223 + 15.224 +<p>$(gettext 'Detailed information about specified device.')</p> 15.225 + 15.226 +<section>$(lspci_table)</section> 15.227 + 15.228 +<section> 15.229 + <div> 15.230 + <pre style="white-space: pre-wrap">$(lspci -vs $slot | syntax_highlighter lspci)</pre> 15.231 + </div> 15.232 +</section> 15.233 EOT 15.234 ;; 15.235 + 15.236 + 15.237 *) 15.238 [ -n "$(GET brightness)" ] && 15.239 echo -n $(GET brightness) > /sys/devices/virtual/backlight/$(GET dev)/brightness 15.240 @@ -178,43 +210,47 @@ 15.241 # Default to summary with mounted filesystem, loaded modules 15.242 # 15.243 xhtml_header 15.244 - cat << EOT 15.245 -<div id="wrapper"> 15.246 - <h2>$(gettext 'Drivers & Devices')</h2> 15.247 - <p>$(gettext 'Manage your computer hardware')</p> 15.248 -</div> 15.249 -<div> 15.250 - <a class="button" href="?modules"> 15.251 - <img src="$IMAGES/tux.png" />$(gettext 'Kernel modules')</a> 15.252 - <a class="button" href="?detect"> 15.253 - <img src="$IMAGES/monitor.png" />$(gettext 'Detect PCI/USB')</a> 15.254 - <a class="button" href="?tazx"> 15.255 - <img src="$IMAGES/terminal.png" />$(gettext 'Auto-install Xorg video driver')</a> 15.256 -</div> 15.257 + cat <<EOT 15.258 +<h2>$(gettext 'Drivers & Devices')</h2> 15.259 +<p>$(gettext 'Manage your computer hardware')</p> 15.260 + 15.261 +<form><!-- 15.262 + --><button name="modules" data-icon="modules">$(gettext 'Kernel modules')</button><!-- 15.263 + --><button name="detect" data-icon="detect" >$(gettext 'Detect PCI/USB')</button><!-- 15.264 + --><button name="tazx" data-icon="tazx" >$(gettext 'Auto-install Xorg video driver')</button> 15.265 +</form> 15.266 15.267 EOT 15.268 - if [ -n "$(ls /proc/acpi/battery/*/info 2> /dev/null)" ]; then 15.269 - echo "<table>" 15.270 + 15.271 + 15.272 + # Battery state 15.273 + if [ -n "$(ls /proc/acpi/battery/*/info 2>/dev/null)" ]; then 15.274 + cat <<EOT 15.275 +<section> 15.276 + <header>$(gettext 'Battery')</header> 15.277 + <div> 15.278 + <table class="wide"> 15.279 +EOT 15.280 for dev in /proc/acpi/battery/*; do 15.281 grep ^present $dev/info | grep -q yes || continue 15.282 - design=$(sed '/design capacity:/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) 15.283 - remain=$(sed '/remaining capacity/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/state) 15.284 - rate=$(sed '/present rate/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/state) 15.285 - full=$(sed '/last full capacity/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) 15.286 + design=$(sed '/design capacity:/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) 15.287 + remain=$(sed '/remaining capacity/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/state) 15.288 + rate=$(sed '/present rate/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/state) 15.289 + full=$(sed '/last full capacity/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) 15.290 warning=$(sed '/design capacity warning/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) 15.291 - low=$(sed '/design capacity low/!d;s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) 15.292 - state=$(sed '/charging state/!d;s/\([^:]*:[ ]\+\)\([a-z]\+\)/\2/' < $dev/state) 15.293 + low=$(sed '/design capacity low/!d; s/[^0-9]*\([0-9]*\).*/\1/' < $dev/info) 15.294 + state=$(sed '/charging state/!d; s/\([^:]*:[ ]\+\)\([a-z]\+\)/\2/' < $dev/state) 15.295 15.296 rempct=$(( $remain * 100 / $full )) 15.297 - cat << EOT 15.298 -<tr> 15.299 - <td><img src="$IMAGES/battery.png" /> 15.300 - $(gettext 'Battery') $(grep "^battery type" $dev/info | sed 's/.*: *//') 15.301 - $(grep "^design capacity:" $dev/info | sed 's/.*: *//') </td> 15.302 - <td>$(gettext 'health') $(( (100*$full)/$design))%</td> 15.303 - <td class="meter"><meter min="0" max="$full" value="$remain" low="$low" 15.304 - high="$warning" optimum="$full"></meter> 15.305 - <span> 15.306 + cat <<EOT 15.307 + <tr> 15.308 + <td><span data-icon="battery">$(gettext 'Battery')</span> 15.309 + $(grep "^battery type" $dev/info | sed 's/.*: *//') 15.310 + $(grep "^design capacity:" $dev/info | sed 's/.*: *//') </td> 15.311 + <td>$(gettext 'health') $(( (100*$full)/$design))%</td> 15.312 + <td class="meter"><meter min="0" max="$full" value="$remain" low="$low" 15.313 + high="$warning" optimum="$full"></meter> 15.314 + <span> 15.315 EOT 15.316 case "$state" in 15.317 "discharging") 15.318 @@ -228,30 +264,41 @@ 15.319 "charged") 15.320 gettext 'Charged 100%' ;; 15.321 esac 15.322 - echo '</span></td></tr>' 15.323 + cat <<EOT 15.324 + 15.325 + </span> 15.326 + </td> 15.327 + </tr> 15.328 +EOT 15.329 done 15.330 - echo "</table>" 15.331 + cat <<EOT 15.332 + </table> 15.333 + </div> 15.334 +</section> 15.335 +EOT 15.336 fi 15.337 15.338 - if [ -n "$(ls /sys/devices/virtual/thermal/*/temp 2> /dev/null)" ]; then 15.339 - echo -n '<p>'; gettext 'Temperature:' 15.340 + 15.341 + # Thermal sensors 15.342 + if [ -n "$(ls /sys/devices/virtual/thermal/*/temp 2>/dev/null)" ]; then 15.343 + echo "<p><span data-icon=\"temperature\">$(gettext 'Temperature:')</span>" 15.344 for temp in /sys/devices/virtual/thermal/*/temp; do 15.345 - awk '{ print $1/1000 }' < $temp 15.346 + awk '{ print $1/1000 "℃" }' < $temp 15.347 done 15.348 echo '</p>' 15.349 fi 15.350 15.351 - if [ -n "$(ls /sys/devices/virtual/backlight/*/brightness 2> /dev/null)" ]; then 15.352 - cat <<EOT 15.353 -<form method="get" action=""> 15.354 -EOT 15.355 - for dev in /sys/devices/virtual/backlight/*/brightness ; do 15.356 + 15.357 + # Brightness 15.358 + if [ -n "$(ls /sys/devices/virtual/backlight/*/brightness 2>/dev/null)" ]; then 15.359 + echo '<form>' 15.360 + for dev in /sys/devices/virtual/backlight/*/brightness; do 15.361 name=$(echo $dev | sed 's|.*/backlight/\([^/]*\).*|\1|') 15.362 cat <<EOT 15.363 -<input type="hidden" name="dev" value="$name" /> 15.364 -$(gettext 'Brightness') \ 15.365 +<input type="hidden" name="dev" value="$name"/> 15.366 +<span data-icon="brightness">$(gettext 'Brightness')</span> \ 15.367 $(sed 's/.*\.//;s/_*$//' < /sys/devices/virtual/backlight/$name/device/path): 15.368 -<select class="button" name="brightness" onchange="submit();"> 15.369 +<select name="brightness" onchange="submit();"> 15.370 EOT 15.371 max=$(cat /sys/devices/virtual/backlight/$name/max_brightness) 15.372 for i in $(seq 0 $max); do 15.373 @@ -260,22 +307,19 @@ 15.374 echo -n " selected=\"selected\"" 15.375 echo "> $(( (($i + 1) * 100) / ($max + 1) ))% </option>" 15.376 done 15.377 - cat <<EOT 15.378 -</select> 15.379 -EOT 15.380 + echo '</select>' 15.381 done 15.382 - cat << EOT 15.383 -</form> 15.384 -EOT 15.385 + echo '</form>' 15.386 fi 15.387 - cat << EOT 15.388 15.389 15.390 -<h3 id="disk">$(gettext 'Filesystem usage statistics')</h3> 15.391 - 15.392 -<pre> 15.393 -$(fdisk -l | fgrep Disk) 15.394 -</pre> 15.395 + cat <<EOT 15.396 +<section> 15.397 + <form action="#mount" class="wide"> 15.398 + <header id="disk">$(gettext 'Filesystem usage statistics')</header> 15.399 + <div> 15.400 + <pre>$(fdisk -l | fgrep Disk)</pre> 15.401 + </div> 15.402 EOT 15.403 15.404 15.405 @@ -293,6 +337,8 @@ 15.406 file="$(GET backingfile)" 15.407 [ -n "$file" ] && losetup -o $(GET offset) $ro $device $file 15.408 esac 15.409 + 15.410 + 15.411 # 15.412 # Disk stats and management (mount, umount, check) 15.413 # 15.414 @@ -309,13 +355,12 @@ 15.415 umount\ *|swapon\ *|swapoff\ *) 15.416 $device ;; 15.417 esac 15.418 - cat << EOT 15.419 -<form method="get" action="#mount"> 15.420 -<table id="mount" class="zebra outbox nowrap"> 15.421 + cat <<EOT 15.422 + <table id="mount" class="zebra wide center"> 15.423 EOT 15.424 df_thead 15.425 echo '<tbody>' 15.426 - for fs in $(blkid | sed 's/:.*//') 15.427 + for fs in $(blkid | sort | sed 's/:.*//') 15.428 do 15.429 set -- $(df -h | grep "^$fs ") 15.430 size=$2 15.431 @@ -325,6 +370,8 @@ 15.432 av="<del>$av</del>" 15.433 pct=$5 15.434 mp=$6 15.435 + 15.436 + # action 15.437 action="mount" 15.438 [ -n "$mp" ] && action="umount" 15.439 type=$(blkid $fs | sed '/TYPE=/!d;s/.*TYPE="\([^"]*\).*/\1/') 15.440 @@ -338,132 +385,216 @@ 15.441 pct=$(((100*$4)/$3))% 15.442 mp=swap 15.443 fi 15.444 + 15.445 + # size 15.446 [ -z "$size" ] && 15.447 size="$(blk2h $(cat /sys/block/${fs#/dev/}/size /sys/block/*/${fs#/dev/}/size))" 15.448 - img="harddisk.png" 15.449 - case "$(cat /sys/block/${fs#/dev/}/removable 2> /dev/null || 15.450 - cat /sys/block/${fs:5:3}/removable 2> /dev/null)" in 15.451 - 1) img="floppy.png" ;; 15.452 + 15.453 + # image 15.454 + disktype="hdd" 15.455 + case "$(cat /sys/block/${fs#/dev/}/removable 2>/dev/null || 15.456 + cat /sys/block/${fs:5:3}/removable 2>/dev/null)" in 15.457 + 1) disktype="removable" ;; 15.458 esac 15.459 - case "$(cat /sys/block/${fs#/dev/}/ro 2> /dev/null || 15.460 - cat /sys/block/${fs:5:3}/ro 2> /dev/null)" in 15.461 - 1) img="tazlito.png" ;; 15.462 + case "$(cat /sys/block/${fs#/dev/}/ro 2>/dev/null || 15.463 + cat /sys/block/${fs:5:3}/ro 2>/dev/null)" in 15.464 + 1) disktype="cd" ;; 15.465 esac 15.466 - [ -s ".$IMAGES/$img" ] || img="harddisk.png" 15.467 - cat << EOT 15.468 -<tr> 15.469 - <td><input type="radio" name="device" value="$action $fs" /> 15.470 - <img src="$IMAGES/$img" />${fs#/dev/}</td> 15.471 - <td>$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td> 15.472 - <td>$type</td> 15.473 - <td>$size</td> 15.474 - <td>$av</td> 15.475 + 15.476 + cat <<EOT 15.477 + <tr> 15.478 + <td><input type="radio" name="device" value="$action $fs" id="${fs#/dev/}"/><!-- 15.479 + --><label for="${fs#/dev/}" data-icon="$disktype"> ${fs#/dev/}</label></td> 15.480 + <td>$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td> 15.481 + <td>$type</td> 15.482 + <td>$size</td> 15.483 + <td>$av</td> 15.484 EOT 15.485 if [ -n "$pct" ]; then 15.486 - cat << EOT 15.487 - <td class="meter"><meter min="0" max="100" value="${pct%%%}" low="70" 15.488 - high="90" optimum="10"></meter> 15.489 - <span>$used - $pct</span> 15.490 - </td> 15.491 + cat <<EOT 15.492 + <td class="meter"><meter min="0" max="100" value="${pct%%%}" low="70" 15.493 + high="90" optimum="10"></meter> 15.494 + <span>$used - $pct</span> 15.495 + </td> 15.496 EOT 15.497 else 15.498 - cat << EOT 15.499 - <td> </td> 15.500 + cat <<EOT 15.501 + <td> </td> 15.502 EOT 15.503 fi 15.504 - cat << EOT 15.505 - <td>$mp</td> 15.506 - <td>$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td> 15.507 -</tr> 15.508 + cat <<EOT 15.509 + <td>$mp</td> 15.510 + <td>$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td> 15.511 + </tr> 15.512 EOT 15.513 done 15.514 - cat << EOT 15.515 -</tbody> 15.516 -</table> 15.517 -$(lib crypto input) 15.518 -<input type="submit" value="mount / umount" /> - 15.519 -new mount point <input type=text" name="mountpoint" value="/media/usbdisk" /> - 15.520 -<input type="checkbox" name="readonly"> read-only 15.521 -</form> 15.522 + cat <<EOT 15.523 + </tbody> 15.524 + </table> 15.525 + $(lib crypto input) 15.526 15.527 - 15.528 -<h3>$(gettext 'Filesystems table')</h3> 15.529 + <footer> 15.530 + <button type="submit">mount / umount</button> - 15.531 + $(gettext 'new mount point:') <input type="text" name="mountpoint" value="/media/usbdisk"/> - 15.532 + <input type="checkbox" name="readonly" id="ro"><label for="ro"> $(gettext 'read-only')</label> 15.533 + </footer> 15.534 + </form> 15.535 +</section> 15.536 EOT 15.537 15.538 -grep -v '^#' /etc/fstab | awk 'BEGIN{print "<table class=\"zebra outbox\">\ 15.539 - <thead><tr><td>$(gettext 'Disk')</td><td>$(gettext 'Mount point')</td><td>\ 15.540 - $(gettext 'Type')</td><td>$(gettext 'Options')</td><td>\ 15.541 - $(gettext 'Freq')</td><td>$(gettext 'Pass')</td></thead><tbody>"}\ 15.542 - {print "<tr><td>"$1"</td><td>"$2\ 15.543 - "</td><td>"$3"</td><td>"$4"</td><td>"$5"</td><td>"$6"</td></tr>"} 15.544 + 15.545 + # 15.546 + # /etc/fstab 15.547 + # 15.548 + cat <<EOT 15.549 +<section> 15.550 + <header>$(gettext 'Filesystems table')</header> 15.551 + <table class="wide zebra center"> 15.552 + <thead> 15.553 + <tr> 15.554 + <td>$(gettext 'Disk')</td> 15.555 + <td>$(gettext 'Mount point')</td> 15.556 + <td>$(gettext 'Type')</td> 15.557 + <td>$(gettext 'Options')</td> 15.558 + <td>$(gettext 'Freq')</td> 15.559 + <td>$(gettext 'Pass')</td> 15.560 + </tr> 15.561 + </thead> 15.562 + <tbody> 15.563 +EOT 15.564 + 15.565 +grep -v '^#' /etc/fstab | awk '{ 15.566 + print "<tr><td>" $1 "</td><td>" $2 "</td><td>" $3 "</td><td>" $4 15.567 + print "</td><td>" $5 "</td><td>" $6 "</td></tr>" 15.568 +} 15.569 END{print "</tbody></table>"}' 15.570 15.571 - cat << EOT 15.572 -<a class="button" href="index.cgi?file=/etc/fstab&action=edit"> 15.573 - <img src="$IMAGES/edit.png" />$(gettext 'Manual Edit')</a> 15.574 + cat <<EOT 15.575 + <footer> 15.576 + <form action="index.cgi"> 15.577 + <input type="hidden" name="file" value="/etc/fstab"/> 15.578 + <button name="action" value="edit" data-icon="edit">$(gettext 'Edit')</button> 15.579 + </form> 15.580 + </footer> 15.581 +</section> 15.582 +EOT 15.583 15.584 15.585 -<h3>$(gettext 'Loop devices')</h3> 15.586 + # 15.587 + # Loop device management GUI 15.588 + # 15.589 + cat <<EOT 15.590 +<section> 15.591 + <header>$(gettext 'Loop devices')</header> 15.592 + 15.593 + <form action="#loop" class="wide"> 15.594 + <table id="loop" class="wide zebra"> 15.595 + <thead> 15.596 + <tr> 15.597 + <td>$(gettext 'Device')</td> 15.598 + <td>$(gettext 'Backing file')</td> 15.599 + <td>$(gettext 'Access')</td> 15.600 + <td>$(gettext 'Offset')</td> 15.601 + </tr> 15.602 + </thead> 15.603 + <tbody> 15.604 EOT 15.605 - # 15.606 - # Loop device management gui 15.607 - # 15.608 - cat << EOT 15.609 -<form method="get" action="#loop"> 15.610 -<table id="loop" class="zebra outbox nowrap"> 15.611 -<thead> 15.612 -<tr><td>Device</td><td>Backing file</td><td>Access</td><td>Offset</td></tr> 15.613 -</thead> 15.614 -<tbody> 15.615 -EOT 15.616 -for loop in $(ls /dev/loop[0-9]*); do 15.617 - case "$(cat /sys/block/${loop#/dev/}/ro 2> /dev/null)" in 15.618 - 0) ro="read/write" ;; 15.619 - 1) ro="read only" ;; 15.620 +for devloop in $(ls /dev/loop[0-9]*); do 15.621 + loop="${devloop#/dev/}" 15.622 + case "$(cat /sys/block/$loop/ro 2>/dev/null)" in 15.623 + 0) ro="$(gettext "read/write")" ;; 15.624 + 1) ro="$(gettext "read only")" ;; 15.625 *) ro="" ;; 15.626 esac 15.627 - set -- $(losetup | grep ^$loop:) $ro 15.628 - cat << EOT 15.629 -<tr> 15.630 - <td><input type="radio" name="loopdev" value="$loop" /> 15.631 - <img src="$IMAGES/harddisk.png" />${loop#/dev/}</td> 15.632 - <td>$3</td><td align="center">$4</td><td align="right">$2</td> 15.633 -</tr> 15.634 + set -- $(losetup | grep ^$devloop:) ${ro// / } 15.635 + cat <<EOT 15.636 + <tr><td><input type="radio" name="loopdev" value="$devloop" id="$loop"/><!-- 15.637 + --><label for="$loop" data-icon="loopback">$loop</label></td> 15.638 + <td>$3</td><td align="center">$4</td><td align="right">$2</td> 15.639 + </tr> 15.640 EOT 15.641 done 15.642 - cat << EOT 15.643 -</tbody> 15.644 -</table> 15.645 + cat <<EOT 15.646 + </tbody> 15.647 + </table> 15.648 + 15.649 $(lib crypto input) 15.650 -<input type="submit" value="Setup" /> - 15.651 -new backing file <input type="text" name="backingfile" /> - 15.652 -offset in bytes <input type="text" name="offset" size="8" value="0" /> - 15.653 -<input type="checkbox" name="readonly"> read-only 15.654 -</form> 15.655 + 15.656 + <footer> 15.657 + <button type="submit" data-icon="ok">$(gettext 'Setup')</button> - 15.658 + $(gettext 'new backing file:') <input type="text" name="backingfile"/> - 15.659 + $(gettext 'offset in bytes:') <input type="text" name="offset" value="0" size="8"/> - 15.660 + <input type="checkbox" name="readonly" id="ro"/><label for="ro">$(gettext 'read only')</label> 15.661 + </footer> 15.662 + </form> 15.663 +</section> 15.664 EOT 15.665 15.666 - cat << EOT 15.667 -<h3>$(gettext 'System memory')</h3> 15.668 + 15.669 + # 15.670 + # System memory 15.671 + # 15.672 + mem_total=$(free -m | awk '$1 ~ "M" {print $2}') 15.673 + mem_used=$((100 * $(free -m | awk '$1 ~ "+" {print $3}') / mem_total)) 15.674 + mem_buff=$((100 * $(free -m | awk '$1 ~ "M" {print $6}') / mem_total)) 15.675 + mem_free=$((100 - mem_used - mem_buff)) 15.676 + 15.677 + cat <<EOT 15.678 +<section> 15.679 + <header>$(gettext 'System memory')</header> 15.680 + 15.681 + <div class="sysmem"><!-- 15.682 + --><span class="sysmem_used" style="width: ${mem_used}%" title="$(gettext 'Used')" ><span>${mem_used}%</span></span><!-- 15.683 +EOT 15.684 + [ $mem_buff != 0 ] && cat <<EOT 15.685 + --><span class="sysmem_buff" style="width: ${mem_buff}%" title="$(gettext 'Buffers')"><span>${mem_buff}%</span></span><!-- 15.686 +EOT 15.687 + cat <<EOT 15.688 + --><span class="sysmem_free" style="width: ${mem_free}%" title="$(gettext 'Free')" ><span>${mem_free}%</span></span><!-- 15.689 + --></div> 15.690 + 15.691 + <table class="wide zebra center"> 15.692 + <thead> 15.693 + <tr> 15.694 + <td> </td> 15.695 + <td>total</td> 15.696 + <td>used</td> 15.697 + <td>free</td> 15.698 + <td>shared</td> 15.699 + <td>buffers</td> 15.700 + </tr> 15.701 + </thead> 15.702 + <tbody> 15.703 EOT 15.704 15.705 -echo "<table class=\"zebra outbox\"><thead><tr><td> </td><td>total</td>\ 15.706 -<td>used</td><td>free</td><td>shared</td><td>buffers</td></tr></thead><tbody>" 15.707 -freem=$(free -m) 15.708 -echo "$freem" | grep Mem: | awk '{print "<tr><td>"$1"</td><td>"$2"</td><td>"$3\ 15.709 - "</td><td>"$4"</td><td>"$5"</td><td>"$6"</td></tr>"}' 15.710 -echo "$freem" | grep buffers: | awk '{print "<tr><td>"$1 $2"</td><td> </td>\ 15.711 - <td>"$3"</td><td>"$4"</td><td> </td><td> </td></tr>"}' 15.712 -echo "$freem" | grep Swap: | awk '{print "<tr><td>"$1"</td><td>"$2"</td><td>"$3\ 15.713 - "</td><td>"$4"</td><td> </td><td> </td></tr></tbody></table>"}' 15.714 +free -m | awk ' 15.715 +$1 ~ "M" {print "<tr><td>"$1"</td><td>"$2"</td><td>"$3"</td><td>"$4"</td><td>"$5"</td><td>"$6"</td></tr>"} 15.716 +$1 ~ "+" {print "<tr><td>"$1 $2"</td><td></td><td>"$3"</td><td>"$4"</td><td></td><td></td></tr>"} 15.717 +$1 ~ "S" {print "<tr><td>"$1"</td><td>"$2"</td><td>"$3"</td><td>"$4"</td><td></td><td></td></tr>"}' 15.718 15.719 - cat << EOT 15.720 -<h3>lspci</h3> 15.721 -$(lspci_table) 15.722 + cat <<EOT 15.723 + </tbody> 15.724 + </table> 15.725 +</section> 15.726 +EOT 15.727 15.728 -<h3>lsusb</h3> 15.729 -$(lsusb_table) 15.730 + 15.731 + # 15.732 + # lspci and lsusb summary tables 15.733 + # 15.734 + cat <<EOT 15.735 +<section> 15.736 + <header>lspci</header> 15.737 + $(lspci_table) 15.738 +</section> 15.739 + 15.740 + 15.741 +<section> 15.742 + <header>lsusb</header> 15.743 + $(lsusb_table) 15.744 +</section> 15.745 EOT 15.746 - ;; 15.747 + ;; 15.748 esac 15.749 15.750 xhtml_footer
16.1 --- a/help.cgi Mon Mar 23 21:17:06 2015 +0100 16.2 +++ b/help.cgi Tue Mar 24 03:39:08 2015 +0200 16.3 @@ -2,7 +2,7 @@ 16.4 # 16.5 # help.cgi - Display TazPanel doc and README. 16.6 # 16.7 -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License 16.8 +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License 16.9 # 16.10 16.11 # Common functions from libtazpanel 16.12 @@ -10,43 +10,33 @@ 16.13 get_config 16.14 header 16.15 16.16 + 16.17 # ENTER will search but user may search for a button, so put one. 16.18 + 16.19 search_form() { 16.20 - cat << EOT 16.21 -<div class="search"> 16.22 - <form method="get" action=""> 16.23 - <p> 16.24 - <input type="text" name="manual" size="20"> 16.25 - <input type="submit" class="radius" value="$(gettext 'Manual')"> 16.26 - </p> 16.27 - </form> 16.28 -</div> 16.29 + cat <<EOT 16.30 +<form class="search"><!-- 16.31 + --><input type="search" name="manual" results="5" autosave="pkgsearch" autocomplete="on"><!-- 16.32 + --><button type="submit">$(gettext 'Manual')</button><!-- 16.33 +--></form> 16.34 EOT 16.35 } 16.36 16.37 + 16.38 # Cat translated help content 16.39 + 16.40 TITLE=$(gettext 'TazPanel - Help & Doc') 16.41 16.42 xhtml_header 16.43 search_form 16.44 16.45 -if [ "$(GET manual)" ]; then 16.46 - echo '<pre>' 16.47 +if [ -n "$(GET manual)" ]; then 16.48 + echo "<pre>" 16.49 man $(GET manual) 16.50 - echo '</pre>' 16.51 + echo "</pre>" 16.52 else 16.53 - if [ -d doc ]; then 16.54 - cat doc/tazpanel.html 16.55 - else 16.56 - cat /usr/share/doc/tazpanel/tazpanel.html 16.57 - fi 16.58 - 16.59 -# cat << EOT 16.60 -#<h3>README</h3> 16.61 -#<pre>$(cat $PANEL/README)</pre> 16.62 -#EOT 16.63 + cat doc/tazpanel.html 16.64 cat $PANEL/README.html 16.65 - 16.66 fi 16.67 16.68 xhtml_footer
17.1 --- a/index.cgi Mon Mar 23 21:17:06 2015 +0100 17.2 +++ b/index.cgi Tue Mar 24 03:39:08 2015 +0200 17.3 @@ -1,54 +1,56 @@ 17.4 #!/bin/sh 17.5 # 17.6 -# Main CGI interface for TazPanel. In on word: KISS. Use the main css form 17.7 +# Main CGI interface for TazPanel. In on word: KISS. Use the main CSS form 17.8 # command so we are faster and do not load unneeded functions. If necessary 17.9 # you can use the lib/ dir to handle external resources. 17.10 # 17.11 -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License 17.12 +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License 17.13 # 17.14 17.15 + 17.16 # Common functions from libtazpanel 17.17 + 17.18 . lib/libtazpanel 17.19 get_config 17.20 -header 17.21 17.22 TITLE="TazPanel" 17.23 17.24 + 17.25 + 17.26 # Check whether a configuration file has been modified after installation 17.27 + 17.28 file_is_modified() 17.29 { 17.30 grep -l " $1$" $INSTALLED/*/md5sum | while read file; do 17.31 17.32 - # Found, but can we do diff ? 17.33 + # Found, but can we do diff? 17.34 [ "$(grep -h " $1$" $file)" != "$(md5sum $1)" ] || break 17.35 - org=$(dirname $file)/volatile.cpio.gz 17.36 - zcat $org 2>/dev/null | cpio -t 2>/dev/null | \ 17.37 - grep -q "^${1#/}$" || break 17.38 + orig=$(dirname $file)/volatile.cpio.gz 17.39 + zcat $orig 2>/dev/null | cpio -t 2>/dev/null | grep -q "^${1#/}$" || break 17.40 17.41 case "$2" in 17.42 - diff) 17.43 - tmp=/tmp/tazpanel$$ 17.44 - mkdir -p $tmp 17.45 - ( cd $tmp ; zcat $org | cpio -id ${1#/} ) 17.46 - diff -abu $tmp$1 $1 | sed "s|$tmp||" 17.47 - rm -rf $tmp ;; 17.48 - button) 17.49 - cat <<EOT 17.50 - <a class="button" href="?file=$1&action=diff"> 17.51 - <img src="$IMAGES/help.png" />$(gettext 'Differences')</a> 17.52 -EOT 17.53 + diff) 17.54 + tmp=$(mktemp -d) 17.55 + ( cd $tmp; zcat $orig | cpio -id ${1#/} ) 17.56 + diff -abu $tmp$1 $1 | sed "s|$tmp||" 17.57 + rm -rf $tmp;; 17.58 + button) 17.59 + echo -n '<button name="action" value="diff" data-icon="diff">'$(gettext 'Differences')'</button>';; 17.60 esac 17.61 break 17.62 done 17.63 } 17.64 17.65 17.66 + 17.67 # OK status in table 17.68 + 17.69 ok_status_t() { 17.70 - echo " <td>[<span class='diff-add'> OK </span>]</td></tr>" 17.71 + echo '<td><span class="diff-add" data-img="ok"></span></td></tr>' 17.72 } 17.73 17.74 17.75 + 17.76 # 17.77 # Things to do before displaying the page 17.78 # 17.79 @@ -56,66 +58,96 @@ 17.80 [ -n "$(GET panel_pass)" ] && 17.81 sed -i s@/:root:.*@/:root:$(GET panel_pass)@ $HTTPD_CONF 17.82 17.83 + 17.84 + 17.85 + 17.86 + 17.87 # 17.88 # Commands 17.89 # 17.90 17.91 case " $(GET) " in 17.92 + 17.93 + 17.94 *\ exec\ *) 17.95 + # Execute command and display its result in a terminal-like window 17.96 + 17.97 + header; TITLE=$(gettext 'TazPanel - exec'); xhtml_header 17.98 + 17.99 exec="$(GET exec)" 17.100 - TITLE=$(gettext 'TazPanel - exec') 17.101 - xhtml_header 17.102 - cat << EOT 17.103 -<h2>$exec</h2> 17.104 -<pre> 17.105 -$($exec 2>&1 | htmlize) 17.106 -</pre> 17.107 + font="${TERM_FONT:-monospace}" 17.108 + palette=$(echo $TERM_PALETTE | tr A-Z a-z) 17.109 + 17.110 + cat <<EOT 17.111 +<section> 17.112 + <header> 17.113 + $exec 17.114 + $(back_button "$(GET back)" "$(GET back_caption)" "$(GET back_icon)") 17.115 + </header> 17.116 + <div class="term_"> 17.117 + <pre class="term $palette" style="font-family: '$font'">$($exec 2>&1 | htmlize | filter_taztools_msgs)</pre> 17.118 + </div> 17.119 +</section> 17.120 EOT 17.121 ;; 17.122 + 17.123 + 17.124 *\ file\ *) 17.125 # 17.126 # Handle files 17.127 # 17.128 + header 17.129 file="$(GET file)" 17.130 + action="$(POST action)"; [ -z "$action" ] && action="$(GET action)" # receive 'action' both on POST or GET 17.131 + 17.132 case $file in 17.133 *.html) 17.134 - cat $file && exit 0 ;; 17.135 + cat $file; exit 0 ;; 17.136 *) 17.137 - TITLE=$(gettext 'TazPanel - File') 17.138 - xhtml_header 17.139 - echo "<h2>$file</h2>" ;; 17.140 + TITLE=$(gettext 'TazPanel - File'); xhtml_header ;; 17.141 esac 17.142 17.143 - if [ "$(GET action)" == "edit" ]; then 17.144 - cat <<EOT 17.145 -<form method="post" action="?file=$file"> 17.146 - <img src="$IMAGES/edit.png" /> 17.147 - <input type="submit" value="$(gettext 'Save')"> 17.148 - <a class="button" href="?file=$file&action=diff"> 17.149 - <img src="$IMAGES/help.png" />$(gettext 'Differences')</a> 17.150 - <textarea name="content" rows="30" style="width: 100%;"> 17.151 -$(cat $file | htmlize) 17.152 -</textarea> 17.153 -</form> 17.154 + case "$action" in 17.155 + edit) 17.156 + cat <<EOT 17.157 +<section> 17.158 + <header> 17.159 + <span data-icon="edit">$file</span> 17.160 + <form id="editform" method="post" action="?file=$file" class="nogap"> 17.161 + <button data-icon="save">$(gettext 'Save')</button> 17.162 + <button name="action" value="diff" data-icon="diff">$(gettext 'Differences')</button> 17.163 + </form> 17.164 + </header> 17.165 + <textarea form="editform" name="content" class="wide" rows="30" autofocus>$(cat $file | htmlize)</textarea> 17.166 +</section> 17.167 EOT 17.168 #The space before textarea gets muddled when the form is submitted. 17.169 #It prevents anything else from getting messed up 17.170 - elif [ "$(GET action)" == "setvar" ]; then 17.171 + ;; 17.172 + 17.173 + setvar) 17.174 data="$(. $(GET file) ;eval echo \$$(GET var))" 17.175 cat <<EOT 17.176 -<form method="post" action="?file=$file"> 17.177 - <img src="$IMAGES/edit.png" /> 17.178 - <input type="submit" value="$(gettext 'Save')"> 17.179 - $(GET var) : 17.180 - <input type="hidden" name="var" value="$(GET var)"> 17.181 - <input type="text" name="content" value="${data:-$(GET default)}"> 17.182 -</form> 17.183 +<section> 17.184 + <header>$(GET var)</header> 17.185 + <form method="post" action="?file=$file" class="nogap"> 17.186 + <input type="hidden" name="var" value="$(GET var)"> 17.187 + <input type="text" name="content" value="${data:-$(GET default)}"> 17.188 + <button type="submit" data-icon="save">$(gettext 'Save')</button> 17.189 + </form> 17.190 +</section> 17.191 EOT 17.192 - elif [ "$(GET action)" == "diff" ]; then 17.193 - echo '<pre id="diff">' 17.194 - file_is_modified $file diff | syntax_highlighter diff 17.195 - echo '</pre>' 17.196 - else 17.197 + ;; 17.198 + 17.199 + diff) 17.200 + cat <<EOT 17.201 +<section> 17.202 + <pre id="diff">$(file_is_modified $file diff | syntax_highlighter diff)</pre> 17.203 +</section> 17.204 +EOT 17.205 + ;; 17.206 + 17.207 + *) 17.208 R=$(echo -en '\r') 17.209 if [ -n "$(POST content)" ]; then 17.210 if [ -n "$(POST var)" ]; then 17.211 @@ -126,15 +158,19 @@ 17.212 EOT 17.213 fi 17.214 fi 17.215 + 17.216 cat <<EOT 17.217 -<div id="actions"> 17.218 - <a class="button" href="?file=$file&action=edit"> 17.219 - <img src="$IMAGES/edit.png" />$(gettext 'Edit')</a> 17.220 -EOT 17.221 - file_is_modified $file button 17.222 - cat << EOT 17.223 -</div> 17.224 -<pre> 17.225 +<section> 17.226 + <header><span data-icon="text">$file</span> 17.227 + <form class="nogap"> 17.228 + <input type="hidden" name="file" value="$file"/> 17.229 + <button name="action" value="edit" data-icon="edit">$(gettext 'Edit')</button><!-- 17.230 + -->$(file_is_modified $file button) 17.231 + </form> 17.232 + </header> 17.233 + 17.234 + <div> 17.235 + <pre> 17.236 EOT 17.237 # Handle file type by extension as a Web Server does it. 17.238 case "$file" in 17.239 @@ -142,110 +178,305 @@ 17.240 syntax_highlighter conf ;; 17.241 *.sh|*.cgi) 17.242 syntax_highlighter sh ;; 17.243 + *Xorg.0.log) 17.244 + syntax_highlighter xlog ;; 17.245 + *dmesg.log) 17.246 + syntax_highlighter kernel ;; 17.247 *) 17.248 cat | htmlize ;; 17.249 esac < $file 17.250 - echo '</pre>' 17.251 - fi ;; 17.252 + cat <<EOT 17.253 + </pre> 17.254 + </div> 17.255 +</section> 17.256 +EOT 17.257 + esac 17.258 + ;; 17.259 + 17.260 17.261 17.262 *\ terminal\ *|*\ cmd\ *) 17.263 - # Cmdline terminal. 17.264 - commands='cat du help ls ping pwd who wget' 17.265 + # Cmdline terminal 17.266 + 17.267 + TITLE=$(gettext 'TazPanel - Terminal'); header; xhtml_header 17.268 + 17.269 + historyfile=/root/.ash_history 17.270 + #commands='cat cd date du fdisk help ls ping pwd who wget' 17.271 cmd=$(GET cmd) 17.272 - TITLE=$(gettext 'TazPanel - Terminal') 17.273 - xhtml_header 17.274 - cat << EOT 17.275 + 17.276 + path="$(GET path)"; path="${path:-/tmp}"; cd "${path/~//root}" 17.277 + [ "$path" == '/root' ] && path='~' 17.278 + user="$REMOTE_USER" 17.279 + [ -z "$HOME" ] && HOME=/root # for apps that modified user settings 17.280 + 17.281 + font="${TERM_FONT:-monospace}" 17.282 + palette=$(echo $TERM_PALETTE | tr A-Z a-z) 17.283 + 17.284 + [ -n "$cmd" -a "$cmd" != "$(tail -n1 $historyfile)" ] && echo "$cmd" >> $historyfile 17.285 + 17.286 + 17.287 + # Terminal history 17.288 + 17.289 + if [ "$cmd" == 'history' ]; then 17.290 + cat <<EOT 17.291 <section> 17.292 -<form method="get" action=""> 17.293 - <div class="box"> 17.294 - root@$(hostname):~# <input autofocus type="text" name="cmd" style="width: 80%;" /> 17.295 - </div> 17.296 -</form> 17.297 + <header> 17.298 + $(gettext 'History') 17.299 + <form><button name="terminal" data-icon="terminal">$(gettext 'Back')</button></form> 17.300 + </header> 17.301 + <form> 17.302 + <input type="hidden" name="path" value="$path"/> 17.303 + <pre class="term $palette" style="font-family: '$font'"> 17.304 EOT 17.305 - echo '<pre id="terminal">' 17.306 - # Allow only a few commands for the moment. 17.307 - case "$cmd" in 17.308 + htmlize < $historyfile | awk -vrun="$(gettext 'run')" -vpath="$path" ' 17.309 + BEGIN { num=1 } 17.310 + { 17.311 + printf("%3d ", num); 17.312 + cmd = $0 17.313 + gsub("%", "%25", cmd); gsub("+", "%2B", cmd); gsub(" ", "+", cmd); 17.314 + gsub("\"", "%22", cmd); gsub("!", "%21", cmd); gsub("'\''", "%27", cmd); 17.315 + printf("<a data-icon=\"run\" href=\"?cmd=%s&path=%s\">%s</a> ", cmd, path, run); 17.316 + printf("<input type=\"checkbox\" name=\"rm\" value=\"%d\" id=\"hist%d\">", num, num); 17.317 + printf("<label for=\"hist%d\">%s</label>\n", num, $0); 17.318 + num++ 17.319 + }' 17.320 + cat <<EOT 17.321 + </pre> 17.322 + <footer> 17.323 + <button name="rmhistory" data-icon="remove">$(gettext 'Clear')</button> 17.324 + </footer> 17.325 + </form> 17.326 +</section> 17.327 +EOT 17.328 + xhtml_footer 17.329 + exit 0 17.330 + fi 17.331 + 17.332 + 17.333 + # Terminal window 17.334 + 17.335 + cat <<EOT 17.336 +<span id="num_hist"></span> 17.337 +<section> 17.338 + <pre class="term $palette" style="font-family: '$font'" onclick="document.getElementById('typeField').focus()"> 17.339 +EOT 17.340 + if [ -n "$cmd" ]; then 17.341 + echo -n "<span class='color31'>$user@$(hostname)</span>:<span class='color33'>$path</span># " 17.342 + echo "$cmd" | htmlize 17.343 + fi 17.344 + 17.345 + case "$cmd" in 17.346 usage|help) 17.347 - gettext 'Small terminal emulator, commands options are supported.' 17.348 - echo "" 17.349 - eval_gettext 'Commands: $commands' 17.350 - echo ;; 17.351 + gettext 'Small non-interactive terminal emulator.'; echo 17.352 + gettext 'Run any command at your own risk, avoid interactive commands (nano, mc, ...)'; echo 17.353 + ;; 17.354 wget*) 17.355 dl=/var/cache/downloads 17.356 [ ! -d "$dl" ] && mkdir -p $dl 17.357 - eval_gettext 'Downloading to: $dl' && echo 17.358 - cd $dl && $cmd ;; 17.359 - du*|ls*|ping*|pwd|who) 17.360 - $cmd ;; 17.361 - cat*) 17.362 + eval_gettext 'Downloading to: $dl'; echo 17.363 + cd $dl; $cmd 2>&1 ;; 17.364 + cd|cd\ *) 17.365 + path="${cmd#cd}"; path="${path:-/root}"; path="$(realpath $path)" ;; 17.366 + ls|ls\ *) 17.367 + $cmd -w80 --color=always 2>&1 | filter_taztools_msgs ;; 17.368 + cat) 17.369 # Cmd must be used with an arg. 17.370 - arg=$(echo $cmd | awk '{print $2}') 17.371 - [ "$arg" == "" ] && eval_gettext '$cmd needs an argument' && break 17.372 - $cmd ;; 17.373 + eval_gettext '$cmd needs an argument' ;; 17.374 + mc|nano) 17.375 + # List of restricted (interactive) commands 17.376 + eval_gettext "Please, don't run interactive command \"$cmd\""; echo; echo ;; 17.377 *) 17.378 - [ "$cmd" == "" ] || \ 17.379 - eval_gettext 'Unknown command: $cmd' && echo 17.380 - eval_gettext 'Commands: $commands' ;; 17.381 + unset HTTP_REFERER # for fooling /lib/libtaz.sh formatting utils (<hr> in the terminal is so-so) 17.382 + export DISPLAY=:0.0 # for run X applications 17.383 + /bin/sh -c "$cmd" 2>&1 | htmlize | filter_taztools_msgs 17.384 + ;; 17.385 esac 17.386 - echo '</pre></section>' 17.387 + 17.388 + [ "$path" == '/root' ] && path='~' 17.389 + cat <<EOT 17.390 +<form id="term"> 17.391 +<div class="cmdline" id="cmdline"><span id="prompt"><span class="color31">$user@$(hostname)</span>:<span class="color33">$path</span># </span><span id="typeField"> </span></div> 17.392 +<input type="hidden" name="path" value="$path"/> 17.393 +<input type="hidden" name="cmd" id="cmd"/> 17.394 +</form> 17.395 +</pre> 17.396 +</section> 17.397 + 17.398 +<form> 17.399 + <button name="termsettings" data-icon="settings">$(gettext 'Settings')</button> 17.400 + <button name="cmd" value="history" data-icon="history">$(gettext 'History')</button> 17.401 +</form> 17.402 + 17.403 +<script type="text/javascript"> 17.404 +with (document.getElementById('typeField')) { 17.405 + contentEditable=true; 17.406 + focus(); 17.407 +} 17.408 +document.onkeydown=keydownHandler; 17.409 +EOT 17.410 + 17.411 + # Export history as array. 17.412 + # Escape "all \"quotes\" in quotes", and all '\' 17.413 + # (because \u, \x, \c has special meaning and can produce syntax error and stop js) 17.414 + sed 's|\\|\\\\|g; s|"|\\"|g' $historyfile | awk ' 17.415 + BEGIN{ i=1; printf("ash_history=[") } 17.416 + { printf("\"%s\",", $0); i++ } 17.417 + END{ 17.418 + printf("\"\"];") 17.419 + i--; printf("cur_hist=\"%d\";max_hist=\"%d\";", i, i) 17.420 + }' 17.421 + cat <<EOT 17.422 +</script> 17.423 +EOT 17.424 ;; 17.425 17.426 17.427 + *\ rmhistory\ *) 17.428 + # Manage shell commandline history 17.429 + historyfile=/root/.ash_history 17.430 + 17.431 + # Return sed command for removing history lines ('8d12d' to remove 8 and 12 lines) 17.432 + rms=$(echo $QUERY_STRING | awk 'BEGIN{RS="&";FS="="}{if($1=="rm")printf "%dd", $2}') 17.433 + 17.434 + if [ -n "$rms" ]; then 17.435 + # Actually remove lines 17.436 + sed -i $rms $historyfile 17.437 + # Redirects back to the history table 17.438 + header "HTTP/1.1 301 Moved Permanently" "Location: ?terminal&cmd=history&path=$(GET path)" 17.439 + exit 0 17.440 + fi 17.441 + ;; 17.442 + 17.443 + 17.444 + *\ termsettings\ *) 17.445 + # Terminal settings 17.446 + TITLE=$(gettext 'TazPanel - Terminal'); header; xhtml_header; 17.447 + user="$REMOTE_USER" 17.448 + font="$(GET font)"; font="${font:-$TERM_FONT}" 17.449 + palette="$(GET palette)"; palette="${palette:-$TERM_PALETTE}" 17.450 + pal=$(echo $palette | tr A-Z a-z) 17.451 + 17.452 + # Add or change settings in TazPanel config 17.453 + if [ -z "$TERM_FONT" ]; then 17.454 + echo -e "\n# Terminal font family\nTERM_FONT=\"$font\"" >> $CONFIG 17.455 + else 17.456 + sed -i "s|TERM_FONT=.*|TERM_FONT=\"$font\"|" $CONFIG 17.457 + fi 17.458 + if [ -z "$TERM_PALETTE" ]; then 17.459 + echo -e "\n# Terminal color palette\nTERM_PALETTE=\"$palette\"" >> $CONFIG 17.460 + else 17.461 + sed -i "s|TERM_PALETTE=.*|TERM_PALETTE=\"$palette\"|" $CONFIG 17.462 + fi 17.463 + 17.464 + cat <<EOT 17.465 +<section> 17.466 + <header> 17.467 + $(gettext 'Terminal settings') 17.468 + <form> 17.469 + <button name="terminal" data-icon="terminal">$(gettext 'Terminal')</button> 17.470 + </form> 17.471 + </header> 17.472 + <pre class="term $pal" style="height: auto; font-family: '$font'"> 17.473 +<span class='color31'>$user@$(hostname)</span>:<span class='color33'>~</span># palette 17.474 + 17.475 +$( 17.476 + for i in $(seq 30 37); do 17.477 + for b in 0 1; do 17.478 + for j in $(seq 40 47); do 17.479 + echo -n "<span class=\"color$b color$i color$j\">$i:$j</span>" 17.480 + done 17.481 + done 17.482 + echo 17.483 + done 17.484 +) 17.485 + </pre> 17.486 + <footer> 17.487 + <form class="wide"> 17.488 + $(gettext 'Font:') 17.489 + <select name="font"> 17.490 + <option value="">$(gettext 'Default')</option> 17.491 + $(fc-list :spacing=mono:lang=en family | sed '/\.pcf/d;/,/d;s|\\-|-|g' | sort -u | \ 17.492 + awk -vfont="$font" '{ 17.493 + printf("<option value=\"%s\"%s>%s</option>\n", $0, ($0 == font)?" selected":"", $0) 17.494 + }') 17.495 + </select> 17.496 + $(gettext 'Palette:') 17.497 + <select name="palette"> 17.498 + $(echo -e 'Tango\nLinux\nXterm\nRxvt\nEcho' | awk -vpal="$palette" '{ 17.499 + printf("<option value=\"%s\"%s>%s</option>\n", $0, ($0 == pal)?" selected":"", $0) 17.500 + }') 17.501 + </select> 17.502 + <button name="termsettings" data-icon="ok">$(gettext 'Apply')</button> 17.503 + </form> 17.504 + </footer> 17.505 +</section> 17.506 +EOT 17.507 + 17.508 + ;; 17.509 + 17.510 + 17.511 *\ top\ *) 17.512 - TITLE=$(gettext 'TazPanel - Process activity') 17.513 - xhtml_header 17.514 - echo $(gettext 'Refresh:') $(GET refresh) 17.515 - cat << EOT 17.516 -<br/> 17.517 -<form method="get"> 17.518 + TITLE=$(gettext 'TazPanel - Process activity'); header; xhtml_header 17.519 + 17.520 + r=$(GET refresh) 17.521 + cat <<EOT 17.522 +<form> 17.523 + <p>$(gettext 'Refresh:') 17.524 <input type="hidden" name="top"/> 17.525 - <input type="submit" name="refresh" value="$(gettext '1s')"/> 17.526 - <input type="submit" name="refresh" value="$(gettext '5s')"/> 17.527 - <input type="submit" name="refresh" value="$(gettext '10s')"/> 17.528 - <input type="submit" value="$(gettext 'none')"/> 17.529 + <input type="radio" name="refresh" value="1" id="r1" $([ "$r" == 1 ] && echo checked) onchange="this.form.submit()"/> 17.530 + <label for="r1">$(gettext '1s' )</label> 17.531 + <input type="radio" name="refresh" value="5" id="r2" $([ "$r" == 5 ] && echo checked) onchange="this.form.submit()"/> 17.532 + <label for="r2">$(gettext '5s' )</label> 17.533 + <input type="radio" name="refresh" value="10" id="r3" $([ "$r" == 10 ] && echo checked) onchange="this.form.submit()"/> 17.534 + <label for="r3">$(gettext '10s' )</label> 17.535 + <input type="radio" name="refresh" value="" id="r4" $([ -z "$r" ] && echo checked) onchange="this.form.submit()"/> 17.536 + <label for="r4">$(gettext 'none')</label> 17.537 + </p> 17.538 </form> 17.539 EOT 17.540 - if [ -n "$(GET refresh)" ]; then 17.541 - echo -n '<meta http-equiv="refresh" content="' 17.542 - echo -n "$(GET refresh)" | sed 's|\([^0-9]*\)\([0-9]\+\).*|\2|' 17.543 - echo '">' 17.544 - fi 17.545 + [ -n "$r" ] && echo "<meta http-equiv=\"refresh\" content=\"$r\">" 17.546 17.547 - echo '<pre>' 17.548 + echo '<section><div><pre class="term log">' 17.549 top -n1 -b | htmlize | sed \ 17.550 - -e s"#^[A-Z].*:\([^']\)#<span class='sh-comment'>\0</span>#"g \ 17.551 - -e s"#PID.*\([^']\)#<span class='top'>\0</span>#"g 17.552 - echo '</pre>' ;; 17.553 + -e 's|^[A-Z].*:|<span class="color1 color31">\0</span>|g' \ 17.554 + -e 's|^\ *PID|<span class="color1 color32">\0</span>|g' 17.555 + echo '</pre></div></section>' ;; 17.556 17.557 17.558 *\ debug\ *) 17.559 - TITLE=$(gettext 'TazPanel - Debug') 17.560 - xhtml_header 17.561 - cat << EOT 17.562 + TITLE=$(gettext 'TazPanel - Debug'); header; xhtml_header 17.563 + 17.564 + cat <<EOT 17.565 <h2>$(gettext 'HTTP Environment')</h2> 17.566 17.567 -<pre>$(httpinfo)</pre> 17.568 +<section> 17.569 + <div> 17.570 + <pre>$(httpinfo | syntax_highlighter conf)</pre> 17.571 + </div> 17.572 +</section> 17.573 EOT 17.574 ;; 17.575 17.576 17.577 *\ report\ *) 17.578 - TITLE=$(gettext 'TazPanel - System report') 17.579 + TITLE=$(gettext 'TazPanel - System report'); header; xhtml_header 17.580 + 17.581 [ -d /var/cache/slitaz ] || mkdir -p /var/cache/slitaz 17.582 output=/var/cache/slitaz/sys-report.html 17.583 - xhtml_header 17.584 - cat << EOT 17.585 -<h2>$(eval_gettext 'Reporting to: $output')</h2> 17.586 -<table class="zebra outbox"> 17.587 -<tbody> 17.588 - <tr><td>$(gettext 'Creating report header...')</td> 17.589 + 17.590 + cat <<EOT 17.591 + 17.592 +<section> 17.593 + <header>$(eval_gettext 'Reporting to: $output')</header> 17.594 + <table class="wide zebra"> 17.595 + <tbody> 17.596 + <tr><td>$(gettext 'Creating report header...')</td> 17.597 EOT 17.598 - cat > $output << EOT 17.599 + cat > $output <<EOT 17.600 <!DOCTYPE html> 17.601 <html xmlns="http://www.w3.org/1999/xhtml"> 17.602 <head> 17.603 - <meta charset="utf-8" /> 17.604 + <meta charset="utf-8"/> 17.605 <title>$(gettext 'SliTaz system report')</title> 17.606 <style type="text/css"> 17.607 body { padding: 20px 60px; font-size: 13px; } 17.608 @@ -258,11 +489,11 @@ 17.609 </head> 17.610 <body> 17.611 EOT 17.612 - cat << EOT 17.613 + cat <<EOT 17.614 $(ok_status_t) 17.615 <tr><td>$(gettext 'Creating system summary...')</td> 17.616 EOT 17.617 - cat >> $output << EOT 17.618 + cat >> $output <<EOT 17.619 <h1>$(gettext 'SliTaz system report')</h1> 17.620 $(gettext 'Date:') $(date) 17.621 <pre> 17.622 @@ -273,11 +504,11 @@ 17.623 kernel : $(uname -r) 17.624 </pre> 17.625 EOT 17.626 - cat << EOT 17.627 + cat <<EOT 17.628 $(ok_status_t) 17.629 <tr><td>$(gettext 'Getting hardware info...')</td> 17.630 EOT 17.631 - cat >> $output << EOT 17.632 + cat >> $output <<EOT 17.633 <h2>free</h2> 17.634 <pre>$(free)</pre> 17.635 17.636 @@ -291,11 +522,11 @@ 17.637 <pre>$(lsmod)</pre> 17.638 17.639 EOT 17.640 - cat << EOT 17.641 + cat <<EOT 17.642 $(ok_status_t) 17.643 <tr><td>$(gettext 'Getting networking info...')</td> 17.644 EOT 17.645 - cat >> $output << EOT 17.646 + cat >> $output <<EOT 17.647 <h2>ifconfig -a</h2> 17.648 <pre>$(ifconfig -a)</pre> 17.649 17.650 @@ -305,11 +536,11 @@ 17.651 <h2>/etc/resolv.conf</h2> 17.652 <pre>$(cat /etc/resolv.conf)</pre> 17.653 EOT 17.654 - cat << EOT 17.655 + cat <<EOT 17.656 $(ok_status_t) 17.657 <tr><td>$(gettext 'Getting filesystems info...')</td> 17.658 EOT 17.659 - cat >> $output << EOT 17.660 + cat >> $output <<EOT 17.661 <h2>blkid</h2> 17.662 <pre>$(blkid)</pre> 17.663 17.664 @@ -325,34 +556,37 @@ 17.665 <h2>df -i</h2> 17.666 <pre>$(df -i)</pre> 17.667 EOT 17.668 - cat << EOT 17.669 + cat <<EOT 17.670 $(ok_status_t) 17.671 <tr><td>$(gettext 'Getting boot logs...')</td> 17.672 EOT 17.673 - cat >> $output << EOT 17.674 + cat >> $output <<EOT 17.675 <h2>$(gettext 'Kernel messages')</h2> 17.676 <pre>$(cat /var/log/dmesg.log)</pre> 17.677 17.678 <h2>$(gettext 'Boot scripts')</h2> 17.679 <pre>$(cat /var/log/boot.log | filter_taztools_msgs)</pre> 17.680 EOT 17.681 - cat << EOT 17.682 + cat <<EOT 17.683 $(ok_status_t) 17.684 <tr><td>$(gettext 'Creating report footer...')</td> 17.685 EOT 17.686 - cat cat >> $output << EOT 17.687 + cat cat >> $output <<EOT 17.688 </body> 17.689 </html> 17.690 EOT 17.691 - cat << EOT 17.692 + cat <<EOT 17.693 $(ok_status_t) 17.694 -</tbody> 17.695 -</table> 17.696 -<p><a class="button" href="?file=$output"> 17.697 - <img src="/styles/default/images/browser.png" /> 17.698 - $(gettext 'View report')</a> 17.699 + </tbody> 17.700 + </table> 17.701 + <footer> 17.702 + <form><button name="file" value="$output" data-icon="view">$(gettext 'View report')</button></form> 17.703 + </footer> 17.704 +</section> 17.705 + 17.706 + 17.707 $(msg tip "$(gettext 'This report can be attached with a bug report on:') 17.708 - <a href="http://bugs.slitaz.org/">bugs.slitaz.org</a></p>") 17.709 + <a href="http://bugs.slitaz.org/" target="_blank">bugs.slitaz.org</a></p>") 17.710 EOT 17.711 ;; 17.712 17.713 @@ -361,92 +595,96 @@ 17.714 # 17.715 # Default xHTML content 17.716 # 17.717 - xhtml_header 17.718 + header; xhtml_header 17.719 [ -n "$(GET gen_locale)" ] && new_locale=$(GET gen_locale) 17.720 [ -n "$(GET rdate)" ] && echo "" 17.721 hostname=$(hostname) 17.722 - cat << EOT 17.723 -<div id="wrapper"> 17.724 - <h2>$(eval_gettext 'Host: $hostname')</h2> 17.725 - <p>$(gettext 'SliTaz administration and configuration Panel')<p> 17.726 -</div> 17.727 -<div id="actions"> 17.728 - <a class="button" href="?terminal"> 17.729 - <img src="$IMAGES/terminal.png" />$(gettext 'Terminal')</a> 17.730 - <a class="button" href="?top"> 17.731 - <img src="$IMAGES/monitor.png" />$(gettext 'Process activity')</a> 17.732 - <a class="button" href="?report"> 17.733 - <img src="$IMAGES/text.png" />$(gettext 'Create a report')</a> 17.734 -</div> 17.735 + 17.736 + cat <<EOT 17.737 +<h2>$(eval_gettext 'Host: $hostname')</h2> 17.738 +<p>$(gettext 'SliTaz administration and configuration Panel')<p> 17.739 + 17.740 +<form class="nogap"><!-- 17.741 + --><button name="terminal" data-icon="terminal">$(gettext 'Terminal' )</button><!-- 17.742 + --><button name="top" data-icon="proc" >$(gettext 'Process activity')</button><!-- 17.743 + --><button name="report" data-icon="report" >$(gettext 'Create a report' )</button> 17.744 +</form> 17.745 17.746 <section> 17.747 -<h3>$(gettext 'Summary')</h3> 17.748 -<div id="summary"> 17.749 -<table> 17.750 - <tr><td>$(gettext 'Uptime:')</td> 17.751 - <td>$(uptime)</td> 17.752 - </tr> 17.753 - <tr><td>$(gettext 'Memory in Mb:')</td> 17.754 + <header>$(gettext 'Summary')</header> 17.755 + <table> 17.756 + <tr><td>$(gettext 'Uptime:')</td> 17.757 + <td id="uptime">$(uptime | sed 's|\([0-9.:][0-9.:]*\)|<b>\1</b>|g')</td> 17.758 + </tr> 17.759 + <tr><td>$(gettext 'Memory in Mb:')</td> 17.760 + <td>$(free -m | grep Mem: | \ 17.761 + awk -vline="$(gettext 'Total: %d, Used: %d, Free: %d')" \ 17.762 + '{ printf(line, $2, $3, $4) }' | \ 17.763 + sed 's|\([0-9][0-9]*\)|<b>\1</b>|g')</td> 17.764 + </tr> 17.765 + <tr><td>$(gettext 'Linux kernel:')</td> 17.766 + <td>$(uname -r)</td> 17.767 + </tr> 17.768 + </table> 17.769 +</section> 17.770 + 17.771 + 17.772 +<section> 17.773 + <header> 17.774 + $(gettext 'Network status') 17.775 + <form action="network.cgi"> 17.776 + <button data-icon="wifi">$(gettext 'Network')</button> 17.777 + </form> 17.778 + </header> 17.779 + $(list_network_interfaces) 17.780 +</section> 17.781 + 17.782 + 17.783 +<section> 17.784 + <header> 17.785 + $(gettext 'Filesystem usage statistics') 17.786 + <form action="hardware.cgi"> 17.787 + <button data-icon="hdd">$(gettext 'Disks')</button> 17.788 + </form> 17.789 + </header> 17.790 + <table class="wide zebra center"> 17.791 EOT 17.792 - free -m | grep Mem: | awk '{print $2, $3, $4}' | while read memtotal memused memfree 17.793 - do 17.794 - cat << EOT 17.795 - <td>$(eval_gettext 'Total: $memtotal, Used: $memused, Free: $memfree')</td> 17.796 + # Disk stats (management is done as hardware.cgi) 17.797 + df_thead 17.798 + echo '<tbody>' 17.799 + df -h | grep ^/dev | while read fs size used av pct mp; do 17.800 + cat <<EOT 17.801 + <tr> 17.802 + <td><span data-icon="hdd">${fs#/dev/}</span></td> 17.803 + <td>$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td> 17.804 + <td>$(blkid $fs | sed '/TYPE=/!d;s/.*TYPE="\([^"]*\).*/\1/')</td> 17.805 + <td>$size</td> 17.806 + <td>$av</td> 17.807 + <td class="meter"><meter min="0" max="100" value="$(echo $pct | cut -d% -f1)" 17.808 + low="$DU_WARN" high="$DU_CRIT" optimum="10"></meter> 17.809 + <span>$used - $pct</span> 17.810 + </td> 17.811 + <td>$mp</td> 17.812 + <td>$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td> 17.813 + </tr> 17.814 EOT 17.815 done 17.816 - cat << EOT 17.817 - </tr> 17.818 - <tr><td>$(gettext 'Linux kernel:')</td> 17.819 - <td>$(uname -r)</td> 17.820 - </tr> 17.821 -</table> 17.822 -<!-- Close summary --> 17.823 -</div> 17.824 + cat <<EOT 17.825 + </tbody> 17.826 + </table> 17.827 </section> 17.828 17.829 <section> 17.830 -<h4>$(gettext 'Network status')</h4> 17.831 -$(list_network_interfaces) 17.832 -</section> 17.833 - 17.834 -<section> 17.835 -<h4>$(gettext 'Filesystem usage statistics')</h4> 17.836 -EOT 17.837 - # Disk stats (management is done as hardware.cgi) 17.838 - cat << EOT 17.839 -<table class="zebra outbox"> 17.840 -EOT 17.841 - df_thead 17.842 - echo '<tbody>' 17.843 - df -h | grep ^/dev | while read fs size used av pct mp 17.844 - do 17.845 - cat << EOT 17.846 -<tr> 17.847 - <td><a href="hardware.cgi"> 17.848 - <img src="$IMAGES/harddisk.png" />${fs#/dev/}</a></td> 17.849 - <td>$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td> 17.850 - <td>$(blkid $fs | sed '/TYPE=/!d;s/.*TYPE="\([^"]*\).*/\1/')</td> 17.851 - <td>$size</td> 17.852 - <td>$av</td> 17.853 - <td class="meter"><meter min="0" max="100" value="$(echo $pct | cut -d% -f1)" 17.854 - low="$DU_WARN" high="$DU_CRIT" optimum="10"></meter> 17.855 - <span>$used - $pct</span> 17.856 - </td> 17.857 - <td>$mp</td> 17.858 - <td>$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td> 17.859 -</tr> 17.860 -EOT 17.861 - done 17.862 - cat << EOT 17.863 -</tbody> 17.864 -</table> 17.865 -</section> 17.866 - 17.867 -<section> 17.868 -<h3>$(gettext 'Panel Activity')</h3> 17.869 -<pre id="panel-activity"> 17.870 -$(cat $LOG_FILE | tail -n 8 | sort -r | syntax_highlighter activity) 17.871 -</pre> 17.872 + <header> 17.873 + $(gettext 'Panel Activity') 17.874 + <form> 17.875 + <button name="file" value="$LOG_FILE" data-icon="view">$(gettext 'View')</button> 17.876 + </form> 17.877 + </header> 17.878 + <div> 17.879 + <pre id="panel-activity"> 17.880 +$(cat $LOG_FILE | tail -n 8 | sort -r | syntax_highlighter activity)</pre> 17.881 + </div> 17.882 </section> 17.883 EOT 17.884 ;;
18.1 --- a/lib/libtazpanel Mon Mar 23 21:17:06 2015 +0100 18.2 +++ b/lib/libtazpanel Tue Mar 24 03:39:08 2015 +0200 18.3 @@ -2,58 +2,79 @@ 18.4 # 18.5 # Common functions for TazPanel CGI and cmdline interface 18.6 # 18.7 +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License 18.8 +# 18.9 + 18.10 18.11 [ "$(id -un)" == "${REMOTE_USER:-root}" ] || exec su -c "$(realpath $0) $@" $REMOTE_USER 18.12 18.13 + 18.14 # Get parameters with GET, POST and FILE functions 18.15 + 18.16 . /usr/lib/slitaz/httphelper 18.17 18.18 + 18.19 # I18n 18.20 + 18.21 . /etc/locale.conf 18.22 . /usr/bin/gettext.sh 18.23 TEXTDOMAIN='tazpanel' 18.24 export TEXTDOMAIN LANG LC_ALL 18.25 18.26 + 18.27 # We need a config file first 18.28 + 18.29 get_config() { 18.30 - CONFIG="/etc/slitaz/tazpanel.conf" 18.31 - [ -f data/tazpanel.conf ] && CONFIG="data/tazpanel.conf" 18.32 - [ -f "$CONFIG" ] && . $CONFIG 18.33 - [ ! -f "$PANEL/lib/libtazpanel" ] && \ 18.34 - echo "No config file or libtazpanel found: $CONFIG" && \ 18.35 + CONFIG='/etc/slitaz/tazpanel.conf' 18.36 + if [ -f "$CONFIG" ]; then 18.37 + . $CONFIG 18.38 + else 18.39 + echo "No config file found: $CONFIG" 18.40 exit 1 18.41 + fi 18.42 } 18.43 18.44 + 18.45 # Display < > & 18.46 + 18.47 htmlize() { 18.48 sed -e 's|\&|\&|g; s|<|\<|g; s|>|\>|g' 18.49 } 18.50 18.51 + 18.52 # Syntax highlighting for config file and SHell scripts 18.53 + 18.54 syntax_highlighter() { 18.55 case $1 in 18.56 conf) 18.57 htmlize | sed \ 18.58 - -e s"#^\#\([^']*\)#<span class='conf-comment'>\0</span>#"g \ 18.59 - -e s"#^[A-Z]\([^']*\)=#<span class='conf-var'>\0</span>#"g \ 18.60 - -e s"#^[a-z]\([^']*\)#<span class='conf-var'>\0</span>#"g \ 18.61 - -e s"#\"\([^']*\)\"#<span class='conf-val'>\0</span>#"g ;; 18.62 + -e 's|^\([ \t]*[A-Za-z0-9_][A-Za-z0-9_]*\)\(="*.*\)|<span class="conf-var">\1</span><span class="conf-val">\2</span>|g' \ 18.63 + -e 's|^[ \t]*#.*|<span class="conf-comment">\0</span>|g' ;; 18.64 + #-e s"#^\#\([^']*\)#<span class='conf-comment'>\0</span>#"g \ 18.65 + #-e s"#^[A-Z]\([^']*\)=#<span class='conf-var'>\0</span>#"g \ 18.66 + #-e s"#^[a-z]\([^']*\)#<span class='conf-var'>\0</span>#"g \ 18.67 + #-e s"#[\"']\([^']*\)[\"']#<span class='conf-val'>\0</span>#"g ;; 18.68 sh) 18.69 htmlize | sed \ 18.70 - -e s"#^\#\([^']*\)#<span class='sh-comment'>\0</span>#"g \ 18.71 - -e s"#\"\([^']*\)\"#<span class='sh-val'>\0</span>#"g ;; 18.72 + -e 's|^\([ \t]*[A-Za-z0-9_][A-Za-z0-9_]*\)\(="*.*\)|<span class="sh-var">\1</span><span class="sh-val">\2</span>|g' \ 18.73 + -e 's|^#.*|<span class="sh-comment">\0</span>|g' ;; 18.74 + #-e s"#^\#\([^']*\)#<span class='sh-comment'>\0</span>#"g \ 18.75 + #-e s"#\"\([^']*\)\"#<span class='sh-val'>\0</span>#"g ;; 18.76 diff) 18.77 htmlize | sed \ 18.78 - -e s"#^-\(.*\).#<span class='diff-rm'>\0</span>#"g \ 18.79 - -e s"#^+\(.*\).#<span class='diff-add'>\0</span>#"g \ 18.80 - -e s"#@@\(.*\)@@#<span class='diff-at'>@@\1@@</span>#"g ;; 18.81 + -e 's|^-.*|<span class="diff-rm">\0</span>|g' \ 18.82 + -e 's|^+.*|<span class="diff-add">\0</span>|g' \ 18.83 + -e 's|^@.*|<span class="diff-at">\0</span>|g' ;; 18.84 activity) 18.85 - sed -e s"#^\([^']*:\)#<span class='activity-log'>\0</span>#"g ;; 18.86 + # realize lazy quantification 18.87 + sed -e "s|: |ⓒ|; s|^\(.*\)ⓒ|<span class='activity-log'>\1:</span> |" ;; 18.88 kernel) 18.89 + # line with "ⓒ": realize lazy quantification 18.90 htmlize | sed \ 18.91 -e "s|\([^0-9]\)\(0x[0-9a-f]\+\)|\1<span class='kernel-hex'>\2</span>|g" \ 18.92 - -e "s|^\([^(,\[]\+: \)|<span class='kernel-id'>\0</span>|g" \ 18.93 - -e "s|\(\[[^ ]\+\]\)|<span class='kernel-id2'>\0</span>|g" ;; 18.94 + -e "s|: |ⓒ|; s|^\(.*\)ⓒ|<span class='kernel-id'>\1:</span> |" \ 18.95 + -e "s|\(\[[^ ]\+\]\)|<span class='kernel-id2'>\0</span>|g" \ 18.96 + -e "s|Call Trace:|<span class='kernel-trace'>\0</span>|" ;; 18.97 lsusb) 18.98 htmlize | sed \ 18.99 -e 's|^[^:]*:[ x0-9a-f^:]*$|<span class="lsusb-t">\0</span>|g' \ 18.100 @@ -62,50 +83,71 @@ 18.101 htmlize | sed \ 18.102 -e 's|^[0-9a-f].*$|<span class="lspci-t">\0</span>|g' \ 18.103 -e 's|^ \([^:]*:\)| <span class="lspci-h">\1</span>|g' ;; 18.104 - 18.105 + xlog) 18.106 + htmlize | sed \ 18.107 + -e 's|^[^]]*]|<span class="xlog xlog-timestamp">\0</span>|' \ 18.108 + -e 's|(--)|<span class="xlog xlog-probed" title="probed">\0</span>|' \ 18.109 + -e 's|(\*\*)|<span class="xlog xlog-config" title="from config file">\0</span>|' \ 18.110 + -e 's|(==)|<span class="xlog xlog-default" title="default setting">\0</span>|' \ 18.111 + -e 's|(++)|<span class="xlog xlog-cmdline" title="from command line">\0</span>|' \ 18.112 + -e 's|(!!)|<span class="xlog xlog-notice" title="notice">\0</span>|' \ 18.113 + -e 's|(II)|<span class="xlog xlog-info" title="informational">\0</span>|' \ 18.114 + -e 's|(WW)|<span class="xlog xlog-warn" title="warning">\0</span>|' \ 18.115 + -e 's|(EE)|<span class="xlog xlog-error" title="error">\0</span>|' \ 18.116 + -e 's|(NI)|<span class="xlog xlog-ni" title="not implemented">\0</span>|' \ 18.117 + -e 's|(??)|<span class="xlog xlog-unknown" title="unknown">\0</span>|' \ 18.118 + ;; 18.119 esac 18.120 } 18.121 18.122 + 18.123 # Remove status and ESC char from tazpkg/tazlito commands output 18.124 + 18.125 filter_taztools_msgs() { 18.126 - sed -e s'|\\[1;32m|<span style="color: green">|g' \ 18.127 - -e s'|\\[1;31m|<span style="color: red">|g' \ 18.128 - -e s'|\\[1;33m|<span style="color: yellow">|g' \ 18.129 - -e s'|\\[1;34m|<span style="color: blue">|g' \ 18.130 - -e s'|\\[1;36m|<span style="color: lightblue">|g' \ 18.131 - -e s'|\\[0;39m|</span>|g' \ 18.132 + sed \ 18.133 + -e 's|\\[0m|</span>|g' \ 18.134 + -e 's|\\[0;39m|</span>|g' \ 18.135 + -e 's|\\[0*\([0-7]*\);\([0-7]*\)m|<span class="color\1 color\2">|g' \ 18.136 -e ':a;s/^\(.\{0,69\}\)\(\\[[0-9]*G\[\)/\1 \2/;ta' \ 18.137 - -e s'/\[^Gm]*.//g' 18.138 + -e ':b;s|^\([^\]*\)\\[\([0-9]*\)G|<span style="display:inline-block;width:\2ex">\1</span>|;tb' \ 18.139 + -e 's/\[^Gm]*.//g' 18.140 } 18.141 18.142 + 18.143 # LOG activities 18.144 + 18.145 log() { 18.146 - date=$(date "+%Y-%m-%d %H:%M") 18.147 - filter_taztools_msgs | \ 18.148 - sed s"#[^']*#$date : \0#" >> $LOG_FILE 18.149 + date=$(date "+%F %R") 18.150 + filter_taztools_msgs | sed "s|[^']*|$date : \0|" >> $LOG_FILE 18.151 } 18.152 18.153 + 18.154 ok_status() { 18.155 - echo "[<span class='diff-add'> OK </span>]" 18.156 + echo '[<span class="diff-add"> OK </span>]' 18.157 } 18.158 18.159 + 18.160 # Network interface status 18.161 + 18.162 interface_status() { 18.163 - if ifconfig | grep -A 1 $i | grep -q inet; then 18.164 - ip=`ifconfig | grep -A 1 $i | grep inet | \ 18.165 - awk '{ print $2 }' | cut -d ":" -f 2` 18.166 - echo "<td>$(gettext 'connected')</td><td>$ip</td>" 18.167 - echo "<td><a href='/network.cgi?scan=$ip'>" 18.168 - echo "<img src='$IMAGES/recharge.png' /></a></td>" 18.169 + if ifconfig | grep -A1 $1 | grep -q inet; then 18.170 + ip=$(ifconfig | grep -A1 $1 | grep inet | awk '{ print $2 }' | cut -d: -f2) 18.171 + cat <<EOT 18.172 + <td>$(gettext 'connected')</td> 18.173 + <td>$ip</td> 18.174 + <td><a data-icon="scan" href='network.cgi?scan=$ip&back=network.cgi'>$(gettext 'Scan')</a></td> 18.175 +EOT 18.176 else 18.177 echo "<td>----</td><td>----</td><td></td>" 18.178 fi 18.179 } 18.180 18.181 + 18.182 # Catch network interface (used in summary and network main page) 18.183 + 18.184 list_network_interfaces() { 18.185 - cat << EOT 18.186 -<table class="zebra outbox"> 18.187 + cat <<EOT 18.188 +<table class="wide zebra center"> 18.189 <thead> 18.190 <tr> 18.191 <td>$(gettext 'Interface')</td> 18.192 @@ -117,31 +159,30 @@ 18.193 </thead> 18.194 <tbody> 18.195 EOT 18.196 - for i in `ls /sys/class/net` 18.197 - do 18.198 + for i in $(ls /sys/class/net); do 18.199 case $i in 18.200 eth*) 18.201 - echo " <tr><td><a href='/network.cgi?eth'> 18.202 - <img src='$IMAGES/ethernet.png' />$i</a></td> 18.203 - <td>Ethernet</td> $(interface_status)</tr>" ;; 18.204 + echo " <tr><td><a data-icon='eth' href='/network.cgi?eth'>$i</a></td> 18.205 + <td>Ethernet</td> $(interface_status $i)</tr>" ;; 18.206 wlan*|ath*|ra*) 18.207 - echo " <tr><td><a href='/network.cgi?wifi'> 18.208 - <img src='$IMAGES/wireless.png' />$i</a></td> 18.209 - <td>Wireless</td> $(interface_status)</tr>" ;; 18.210 + echo " <tr><td><a data-icon='wifi' href='/network.cgi?wifi'>$i</a></td> 18.211 + <td>Wireless</td> $(interface_status $i)</tr>" ;; 18.212 lo) 18.213 - echo " <tr><td><img src='$IMAGES/loopback.png' />$i</td> 18.214 - <td>Loopback</td> $(interface_status)</tr>" ;; 18.215 + echo " <tr><td><span data-icon='loopback'>$i</span></td> 18.216 + <td>Loopback</td> $(interface_status $i)</tr>" ;; 18.217 *) 18.218 continue ;; 18.219 esac 18.220 done 18.221 - cat << EOT 18.222 + cat <<EOT 18.223 </tbody> 18.224 </table> 18.225 EOT 18.226 } 18.227 18.228 + 18.229 # Get the list of panel styles 18.230 + 18.231 list_styles() { 18.232 for style in $PANEL/styles/* 18.233 do 18.234 @@ -150,7 +191,9 @@ 18.235 done 18.236 } 18.237 18.238 + 18.239 # Get the list of system locales 18.240 + 18.241 list_locales() { 18.242 for locale in $(find /usr/share/i18n/locales -type f -name "[a-z][a-z]_[A-Z][A-Z]") 18.243 do 18.244 @@ -158,26 +201,28 @@ 18.245 done 18.246 } 18.247 18.248 + 18.249 # Get the list of console keymaps 18.250 + 18.251 list_keymaps() { 18.252 - for keymap in /usr/share/kmap/*.kmap 18.253 - do 18.254 + for keymap in /usr/share/kmap/*.kmap; do 18.255 basename $keymap .kmap | sed "s|.*|<option value='&'>&</option>|" 18.256 done 18.257 } 18.258 18.259 + 18.260 # 18.261 # xHTML 5 (header and footer skel are from the style) 18.262 # 18.263 18.264 loading_msg() { 18.265 - cat << EOT 18.266 -<script type="text/javascript"> 18.267 - document.write('<div id="loading"><img src="/styles/default/images/loader.gif" />$LOADING_MSG</div>'); 18.268 -</script> 18.269 + local MSG=${1:-$LOADING_MSG} 18.270 + cat <<EOT 18.271 +<div id="loading"><img src="/styles/default/images/loader.gif"/>$MSG</div> 18.272 EOT 18.273 } 18.274 18.275 + 18.276 xhtml_header() { 18.277 . ${PANEL}$HEADER 18.278 if [ $DEBUG == "1" ]; then 18.279 @@ -185,8 +230,8 @@ 18.280 local j 18.281 local x 18.282 args="" 18.283 - for x in GET POST COOKIE ; do 18.284 - for i in $($x) ; do 18.285 + for x in GET POST COOKIE; do 18.286 + for i in $($x); do 18.287 if [ $($x $i count) -gt 1 ]; then 18.288 for j in $(seq 1 $($x $i count)); do 18.289 args="$args $x($i,$j)='$($x $i $j)'" 18.290 @@ -197,32 +242,36 @@ 18.291 done 18.292 done 18.293 for i in $(FILE); do 18.294 - for j in name size type tmpname ; do 18.295 + for j in name size type tmpname; do 18.296 args="$args FILE($i,$j)=$(FILE $i $j)" 18.297 done 18.298 done 18.299 - cat << EOT 18.300 -<pre class='debug'> 18.301 + cat <<EOT 18.302 +<pre class="debug"> 18.303 QUERY_STRING="$QUERY_STRING"$args 18.304 </pre> 18.305 EOT 18.306 fi 18.307 } 18.308 18.309 + 18.310 xhtml_footer() { 18.311 . ${PANEL}$FOOTER 18.312 } 18.313 18.314 + 18.315 table_start() { 18.316 echo '<table>' 18.317 } 18.318 18.319 + 18.320 table_end() { 18.321 echo '</table>' 18.322 } 18.323 18.324 + 18.325 df_thead() { 18.326 - cat << EOT 18.327 + cat <<EOT 18.328 <thead> 18.329 <tr> 18.330 <td>$(gettext 'Disk')</td> 18.331 @@ -238,6 +287,7 @@ 18.332 EOT 18.333 } 18.334 18.335 + 18.336 msg() { 18.337 msgtype="$1"; shift 18.338 case "$msgtype" in 18.339 @@ -247,7 +297,7 @@ 18.340 up) MSG_ICON="$IMAGES/msg-up.png" ;; 18.341 *) MSG_ICON="$IMAGES/msg.png" ;; 18.342 esac 18.343 - cat << EOT 18.344 + cat <<EOT 18.345 <section class="box" style="width:50%;margin:0.5em auto;"> 18.346 <image src="$MSG_ICON" alt="$msgtype" class="float-left" /> 18.347 $@ 18.348 @@ -255,10 +305,12 @@ 18.349 EOT 18.350 } 18.351 18.352 + 18.353 is_installed() { 18.354 [ -d "$INSTALLED/$1" ] 18.355 } 18.356 18.357 + 18.358 blk2h() { 18.359 echo $1 | awk '{ 18.360 n = $0/2 18.361 @@ -270,3 +322,22 @@ 18.362 printf f,n,substr("KMGT", i, 1) 18.363 }' 18.364 } 18.365 + 18.366 + 18.367 +# Show "Back" button 18.368 + 18.369 +back_button() { 18.370 + local URL="$1" default_caption="$(gettext 'Back')" 18.371 + local caption="${2:-$default_caption}" icon="${3:-back}" 18.372 + 18.373 + if [ -n "$1" ]; then 18.374 + printf '<form action="%s" method="post"><button data-icon="%s">%s</button></form>' "$URL" "$icon" "$caption" 18.375 + fi 18.376 +} 18.377 + 18.378 + 18.379 +# Mark select option as checked 18.380 + 18.381 +selected() { 18.382 + [ "$1" == "$2" ] && echo -n 'selected' 18.383 +}
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 19.2 +++ b/lib/tazpanel.js Tue Mar 24 03:39:08 2015 +0200 19.3 @@ -0,0 +1,406 @@ 19.4 + 19.5 +// Hide Loading panel 19.6 +function hideLoading() { 19.7 + var loading = document.getElementById("loading"); 19.8 + // If element presents on page 19.9 + if (loading) loading.style.display='none'; 19.10 +} 19.11 +// Attach event handler 19.12 +window.onload = hideLoading; 19.13 + 19.14 + 19.15 + 19.16 +// Confirm page loading break 19.17 +function confirmExit() { 19.18 + return "$(_ 'Confirm break')"; 19.19 +} 19.20 +// Attach event handler 19.21 +window.onbeforeunload = confirmExit; 19.22 + 19.23 + 19.24 + 19.25 +// Set light or dark color theme 19.26 +function setColorTheme() { 19.27 + // Goal: to produce pages that fit the user's defined look and feel, and 19.28 + // may be more accessible as the current user settings (contrast color 19.29 + // schemes, big font sizes, etc.) 19.30 + // Realization in the CSS2: 19.31 + // http://www.w3.org/TR/REC-CSS2/ui.html#system-colors 19.32 + // We can use colors from user's color theme to mimic plain desktop application. 19.33 + // 19.34 + // Alas, nowadays it not works. Webkit-based browser returns hard-coded values, 19.35 + // with exception of these two: 19.36 + // * ButtonText - text on push buttons. 19.37 + // * CaptionText - text in caption, size box, and scrollbar arrow box. 19.38 + // 19.39 + // When user changes color theme, browser re-draws page, so all input elements 19.40 + // (buttons, checkboxes, radiobuttons, drop-down lists, scrollbars, text inputs) 19.41 + // automagically fits user-defined theme. We need to change web document's 19.42 + // colors manually. We can't ask for exact user defined colors for document's 19.43 + // background in any way, we can only imagine if it dark or light. 19.44 + // So, plan is follows: 19.45 + // We use 'ButtonText' color for base document's color, and calculate if it 19.46 + // dark or light. If color of button's text is dark, then color of button's body 19.47 + // is light, and we define entire web document as light; and vice versa. 19.48 + 19.49 + // Get 'ButtonText' color value (as current text's color of body) 19.50 + var body = document.getElementsByTagName('body')[0]; 19.51 + var bodyColor = window.getComputedStyle(body, null).color; 19.52 + console.info("Set bodyColor: %s", bodyColor); 19.53 + 19.54 + // Returned value must be in format like "rgb(212, 212, 212)" or "rgba(192, 68, 1, 0)" 19.55 + if (bodyColor.indexOf("rgb") != -1) { 19.56 + // Make array with color components 19.57 + var results = bodyColor.match(/^rgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})/); 19.58 + 19.59 + // Calculate luminance (brightness) in range 0..1 19.60 + if (results && results.length >= 3) { 19.61 + r = parseInt(results[1], 10); 19.62 + g = parseInt(results[2], 10); 19.63 + b = parseInt(results[3], 10); 19.64 + min = Math.min(r, g, b); max = Math.max(r, g, b); 19.65 + } 19.66 + var luminance = (min + max) / 2 / 255; 19.67 + 19.68 + // Set class for body 19.69 + body.className = (luminance > 0.5) ? 'dark' : 'light'; 19.70 + } 19.71 + // Now we can use cascade styles for any elements lying on light or dark body: 19.72 + // .light h2 { color: #222; } 19.73 + // .dark h2 { color: #CCC; } 19.74 + // Also we can use semi-transparent colors in some cases: 19.75 + // body footer { color: rgba(128, 128, 128, 0.5); } 19.76 +} 19.77 + 19.78 + 19.79 + 19.80 +// Set base font size 19.81 +function setBaseFont() { 19.82 + // Goal: to have on page the same font sizes as in user's system. 19.83 + // User input elements changed its font size automatically, so we can read 19.84 + // font size from (hidden) button and apply this size to document's body. 19.85 + // All other sizes will be relative, and will grow or shrink automatically. 19.86 + 19.87 + // Get document's body 19.88 + var body = document.getElementsByTagName('body')[0]; 19.89 + 19.90 + // Make button in the hidden DOM 19.91 + var hiddenButton = document.createElement('BUTTON'); 19.92 + 19.93 + // Move button away from look 19.94 + hiddenButton.style.setProperty('position', 'absolute', 1); 19.95 + hiddenButton.style.setProperty('left', '0', 1); 19.96 + 19.97 + // Add some text to button 19.98 + hiddenButton.appendChild(document.createTextNode("SliTaz")); 19.99 + 19.100 + // Add button to DOM 19.101 + body.appendChild(hiddenButton); 19.102 + 19.103 + // Focus to button (it will get colored outline!) 19.104 + hiddenButton.focus(); 19.105 + 19.106 + // Get button's style 19.107 + var buttonStyle = getComputedStyle(hiddenButton, null); 19.108 + 19.109 + // Copy styles from button to body 19.110 + with (body.style) { 19.111 + fontFamily = buttonStyle.fontFamily; 19.112 + fontSize = buttonStyle.fontSize; 19.113 + fontWeight = 'normal'; 19.114 + } 19.115 + 19.116 + //body.style.color = buttonStyle.outlineColor; 19.117 + 19.118 + console.info('Set fontFamily: %s, fontSize: %s', body.style.fontFamily, body.style.fontSize); 19.119 + console.info('Theme color: %s', buttonStyle.outlineColor); 19.120 + // Remove button from hidden DOM 19.121 + body.removeChild(hiddenButton); 19.122 +} 19.123 + 19.124 + 19.125 + 19.126 +// 19.127 +function dupTableHead() { 19.128 + if (! document.getElementById('head2')) return 19.129 + var tableHead = document.createElement("TABLE"); 19.130 + with (tableHead) { 19.131 + innerHTML = '<thead>' + document.getElementById('head2').innerHTML + '</thead>' 19.132 + setAttribute("id", "head1h"); 19.133 + setAttribute("class", "zebra pkglist"); 19.134 + } 19.135 + 19.136 + document.body.appendChild(tableHead); 19.137 +} 19.138 + 19.139 + 19.140 + 19.141 +// 19.142 +function scrollHandler(){ 19.143 + console.log("about head1: %s.", document.getElementById('head1')); 19.144 + toolbar = document.getElementById('toolbar'); 19.145 + paddingTop = toolbar.offsetTop + toolbar.offsetHeight; 19.146 + paddingTopPx = paddingTop + 'px'; 19.147 + 19.148 + headerOffset = document.getElementById('head1').offsetTop; 19.149 + windowScrolled = document.body.scrollTop; 19.150 + if ((headerOffset - windowScrolled) < paddingTop) 19.151 + { 19.152 +// document.getElementById('miscinfo1').innerText = '<'; 19.153 + var head1h = document.getElementById('head1h'); 19.154 + var head1 = document.getElementById('head1'); 19.155 + 19.156 + with (head1h.style) { 19.157 + setProperty('top', paddingTopPx, 1); 19.158 + setProperty('display', 'table', 1); 19.159 + setProperty('left', head1.offsetLeft + 'px', 1); 19.160 + setProperty('width', head1.offsetWidth + 'px', 1); 19.161 + } 19.162 + 19.163 +// document.getElementById('miscinfo1').innerText = '(' + toopop +')P^' + paddingTop + 'L' + head1h.offsetLeft + ':W' + head1h.offsetWidth + ':H' + head1h.offsetHeight + ':T' + head1h.clientTop +',' + head1h.offsetTop; 19.164 + 19.165 + } 19.166 + else 19.167 + { 19.168 + document.getElementById('miscinfo1').innerText = '>'; 19.169 + document.getElementById('head1h').style.display = 'none'; 19.170 + } 19.171 + 19.172 + tHeadTr = document.getElementById('head1h').children[0].children[0]; 19.173 + tHeadTrO = document.getElementById('head1').children[0].children[0]; 19.174 + tHeadTr.children[0].style.setProperty('width', tHeadTrO.children[0].offsetWidth -1 + 'px', 1); 19.175 + tHeadTr.children[1].style.setProperty('width', tHeadTrO.children[1].offsetWidth -1 + 'px', 1); 19.176 + tHeadTr.children[2].style.setProperty('width', tHeadTrO.children[2].offsetWidth -1 + 'px', 1); 19.177 + tHeadTr.children[3].style.setProperty('width', tHeadTrO.children[3].offsetWidth -1 + 'px', 1); 19.178 + 19.179 +} 19.180 + 19.181 + 19.182 + 19.183 +// Handler for History scroller for Terminal 19.184 +function keydownHandler(e) { 19.185 + // Get code for pressed key 19.186 + var evt = e ? e:event; 19.187 + var keyCode = evt.keyCode; 19.188 + 19.189 + // If pressed "up" or "down" 19.190 + if (keyCode==38 || keyCode==40) { 19.191 + // Local storage used as global variables storage 19.192 + // Get current position in the History, and History size 19.193 + //var cur_hist = window.localStorage.getItem("cur_hist"); 19.194 + //var max_hist = window.localStorage.getItem("max_hist"); 19.195 + switch(keyCode) { 19.196 + case 38: 19.197 + // "up" key pressed; decrement and normalize position 19.198 + cur_hist--; if (cur_hist < 0) cur_hist = 0; 19.199 + break; 19.200 + case 40: 19.201 + // "down" key pressed; increment and normalize position 19.202 + cur_hist++; if (cur_hist > max_hist) cur_hist = max_hist; 19.203 + break; 19.204 + } 19.205 + // Element "cmd" is a text input, put History element there 19.206 + var cmd = document.getElementById('typeField'); 19.207 + cmd.focus(); 19.208 + cmd.innerText = ash_history[cur_hist]; 19.209 + 19.210 + var hint = '' 19.211 + if (cur_hist < max_hist) hint = '[' + cur_hist + '/' + (max_hist - 1) + '] '; 19.212 + document.getElementById('num_hist').innerText = hint; 19.213 + 19.214 + //window.localStorage.setItem('cur_hist', cur_hist); 19.215 + return false 19.216 + } 19.217 + if (keyCode==13) { 19.218 + document.getElementById('cmd').value=document.getElementById('typeField').innerText; 19.219 + document.getElementById('term').submit(); 19.220 + return false 19.221 + } 19.222 + return true 19.223 +} 19.224 + 19.225 + 19.226 + 19.227 +// Add hover effect for menu 19.228 +function menuAddHover() { 19.229 + var toolbarMenu = document.getElementById('toolbarMenu'); 19.230 + toolbarMenu.className = 'hover'; 19.231 + 19.232 + menus = toolbarMenu.getElementsByTagName('li'); 19.233 + for (i = 0; i < menus.length; i++) 19.234 + menus[i].blur(); 19.235 + 19.236 + toolbarMenu.focus(); 19.237 + toolbarMenu.onblur = menuRmHover; 19.238 + console.log('Add finished'); 19.239 +} 19.240 + 19.241 +// Remove hover effect for menu 19.242 +function menuRmHover() { 19.243 + var toolbarMenu = document.getElementById('toolbarMenu'); 19.244 + toolbarMenu.className = 'nohover'; 19.245 + 19.246 + menus = toolbarMenu.getElementsByTagName('li'); 19.247 + for (i = 0; i < menus.length; i++) 19.248 + menus[i].onclick = menuAddHover; 19.249 + 19.250 + console.log('Rm finished'); 19.251 +} 19.252 + 19.253 + 19.254 +// Close main menu 19.255 +function closeMenu() { 19.256 + document.getElementById('noMenu').style.display = 'none'; 19.257 + closeItem(itemOpened); 19.258 + menuIsClosed = true; 19.259 + //console.log('Menu closed'); 19.260 +} 19.261 +// Open main menu 19.262 +function openMenu() { 19.263 + //console.log('openMenu') 19.264 + document.getElementById('noMenu').style.display = 'block'; 19.265 + menuIsClosed = false; 19.266 +} 19.267 +// Open main menu item 19.268 +function openItem(el) { 19.269 + if (itemOpened != el) { 19.270 + if (itemOpened) 19.271 + closeItem(itemOpened); 19.272 + el.children[1].className = 'opened'; 19.273 + el.focus(); 19.274 + itemOpened = el; 19.275 + menuIsClosed = false; openMenu(); 19.276 + //console.log('Opened %s', el.tabIndex); 19.277 + //console.log('Menu opened (open)'); 19.278 + } 19.279 +} 19.280 +// Close main menu item 19.281 +function closeItem(el) { 19.282 + //console.log('<closeItem: "%s">', el) 19.283 + thisMenu = el.children[1]; 19.284 + if (thisMenu.className == 'opened') { 19.285 + thisMenu.className = 'closed'; 19.286 + el.blur(); 19.287 + itemOpened = '' 19.288 + //console.log('Closed %s', el.tabIndex); 19.289 + } 19.290 +} 19.291 + 19.292 +itemOpened = ''; 19.293 +menuIsClosed = true; 19.294 + 19.295 +// Add event handler 19.296 +function addMenuHandlers() { 19.297 + menus = document.getElementById('toolbarMenu').children; 19.298 + for (i = 0; i < menus.length; i++) { 19.299 + menus[i].firstElementChild.onclick = function() {menuItemClick(this)}; 19.300 + menus[i].firstElementChild.onmouseover = function() {menuItemHover(this)}; 19.301 + menus[i].onblur = function() {menuItemBlur(this)}; 19.302 + } 19.303 + 19.304 + // Close menu when click outside menu 19.305 + document.getElementById('noMenu').onclick = closeMenu; 19.306 +} 19.307 + 19.308 +function menuItemClick(el) { 19.309 + topItem = el.parentElement; 19.310 + thisMenu = topItem.children[1]; 19.311 + //console.log('Clicked %s class %s', topItem.tabIndex, thisMenu.className); 19.312 + if (thisMenu.className == 'opened') { 19.313 + closeItem(topItem); 19.314 + menuIsClosed = true; closeMenu(); 19.315 + //console.log('Menu closed (click)'); 19.316 + } 19.317 + else { 19.318 + openItem(topItem); 19.319 + menuIsClosed = false; openMenu(); 19.320 + //console.log('Menu opened (click)'); 19.321 + } 19.322 +} 19.323 + 19.324 +function menuItemHover(el) { 19.325 + hoverElem = el.parentElement; 19.326 + //console.log('Hovered %s', hoverElem.tabIndex); 19.327 + if (! menuIsClosed) { 19.328 + closeItem(itemOpened); 19.329 + openItem(hoverElem); 19.330 + } 19.331 +} 19.332 +function menuItemBlur(el) { 19.333 + elem = el; //.parentElement; 19.334 + //console.log('Blurred %s', elem.tabIndex); 19.335 + //closeItem(elem); 19.336 + //menuIsClosed = true; 19.337 + //console.log('Menu closed (blur)'); 19.338 +} 19.339 + 19.340 + 19.341 + 19.342 +// 19.343 +// AJAX code for dynamic requests 19.344 +// 19.345 + 19.346 +function ajax(cgiUrl, command, ajaxOut) { 19.347 + // (1) create object for server request 19.348 + var req = new XMLHttpRequest(); 19.349 + 19.350 + // (2) show request status 19.351 + var statusElem = document.getElementById('ajaxStatus'); 19.352 + 19.353 + req.onreadystatechange = function() { 19.354 + // onreadystatechange activates on server answer receiving 19.355 + 19.356 + if (req.readyState == XMLHttpRequest.DONE) { 19.357 + // if request done 19.358 + statusElem.innerHTML = req.statusText // show status (Not Found, ОК..) 19.359 + 19.360 + // if status 200 (ОК) - show answer to user 19.361 + if (req.status == 200) 19.362 + document.getElementById(ajaxOut).innerHTML = req.responseText; 19.363 + // here we can add "else" with request errors processing 19.364 + } 19.365 + } 19.366 + 19.367 + // (3) set request address 19.368 + req.open('POST', cgiUrl, true); 19.369 + 19.370 + // (4) request object is ready 19.371 + req.send(command); // send request 19.372 + 19.373 + // (5) 19.374 + statusElem.innerHTML = '<img src="/styles/default/images/loader.gif" />' 19.375 +} 19.376 + 19.377 + 19.378 + 19.379 +// 19.380 +// Load configuration for new and stored networks 19.381 +// 19.382 + 19.383 +function loadcfg(essid, bssid, keyType) { 19.384 + // looking for stored network 19.385 + for (i = 0; i < networks.length; i++) { 19.386 + if (networks[i].ssid == essid) break; 19.387 + if (typeof networks[i].bssid != 'undefined') { 19.388 + if (networks[i].bssid == bssid) { 19.389 + essid = networks[i].ssid; 19.390 + break; 19.391 + } 19.392 + } 19.393 + } 19.394 + document.getElementById('essid').value = essid; 19.395 + document.getElementById('keyType').value = keyType; 19.396 + 19.397 + password = document.getElementById('password') 19.398 + password.value = ''; 19.399 + if (typeof networks[i] != 'undefined') { 19.400 + if (typeof networks[i].psk != 'undefined') 19.401 + password.value = networks[i].psk; 19.402 + else if (typeof networks[i].wep_key0 != 'undefined') 19.403 + password.value = networks[i].wep_key0; 19.404 + else if (typeof networks[i].password != 'undefined') 19.405 + password.value = networks[i].password; 19.406 + } 19.407 + 19.408 + wifiSettingsChange(); 19.409 +}
20.1 --- a/network.cgi Mon Mar 23 21:17:06 2015 +0100 20.2 +++ b/network.cgi Tue Mar 24 03:39:08 2015 +0200 20.3 @@ -2,125 +2,130 @@ 20.4 # 20.5 # Network configuration CGI interface 20.6 # 20.7 -# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License 20.8 +# Copyright (C) 2012-2015 SliTaz GNU/Linux - BSD License 20.9 # 20.10 20.11 + 20.12 # Common functions from libtazpanel 20.13 + 20.14 . lib/libtazpanel 20.15 get_config 20.16 header 20.17 20.18 TITLE=$(gettext 'TazPanel - Network') 20.19 20.20 -# Catch ESSIDs and format output for GTK tree. We get the list of 20.21 -# networks by Cell and without spaces. 20.22 -detect_wifi_networks() 20.23 -{ 20.24 - cat << EOT 20.25 -<table class="zebra outbox"> 20.26 - <thead> 20.27 - <tr> 20.28 - <td>$(gettext 'Name')</td> 20.29 - <td>$(gettext 'Quality')</td> 20.30 - <td>$(gettext 'Encryption')</td> 20.31 - <td>$(gettext 'Status')</td> 20.32 - </tr> 20.33 - </thead> 20.34 - <tbody> 20.35 -EOT 20.36 - if [ -d /sys/class/net/$WIFI_INTERFACE/wireless ]; then 20.37 - ifconfig $WIFI_INTERFACE up 20.38 - for i in $(iwlist $WIFI_INTERFACE scan | sed '/Cell /!d;s/.*Cell \([^ ]*\).*/Cell.\1/') 20.39 - do 20.40 - SCAN=$(iwlist $WIFI_INTERFACE scan last | sed "/$i/,/Cell/!d" | sed '$d') 20.41 - ESSID=$(echo $SCAN | sed 's/.*ESSID:"\([^"]*\).*/\1/') 20.42 - if echo "$SCAN" | grep -q Quality; then 20.43 - QUALITY=$(echo $SCAN | sed '/ *Quality/s/.*Quality[:=]\([^ ]*\).*/\1/') 20.44 - else 20.45 - QUALITY="-" 20.46 - fi 20.47 - ENCRYPTION=$(echo $SCAN | sed 's/.*key:\([^ ]*\).*/\1/') 20.48 - # Check encryption type 20.49 - if echo "$SCAN" | grep -q WPA*; then 20.50 - ENCRYPTION="WPA" 20.51 - fi 20.52 - if echo $SCAN | grep -q 'Mode:Managed'; then 20.53 - AP="ap=$(echo $SCAN | sed 's/.*Address: \([^ ]*\).*/\1/')" 20.54 - else 20.55 - AP="" 20.56 - fi 20.57 - # Connected or not connected... 20.58 - if ifconfig | grep -A 1 $WIFI_INTERFACE | \ 20.59 - fgrep -q inet && iwconfig $WIFI_INTERFACE | \ 20.60 - fgrep -q "ESSID:\"$ESSID\""; then 20.61 - status=$(gettext 'Connected') 20.62 - else 20.63 - status="---" 20.64 - fi 20.65 - echo '<tr>' 20.66 - echo "<td><a href=\"?wifi&select=$ESSID&keytype=$ENCRYPTION&$AP\"> 20.67 - <img src='$IMAGES/wireless.png' />$ESSID</a></td>" 20.68 - echo "<td>$QUALITY</td><td>$ENCRYPTION</td><td>$status $ip</td>" 20.69 - echo '</tr>' 20.70 - done 20.71 - fi 20.72 - cat << EOT 20.73 - </tbody> 20.74 -</table> 20.75 -EOT 20.76 -} 20.77 20.78 -# Start a wifi connection 20.79 +# Start a Wi-Fi connection 20.80 + 20.81 start_wifi() { 20.82 sed -i \ 20.83 - -e s'/^DHCP=.*/DHCP="yes"/' \ 20.84 - -e s'/^WIFI=.*/WIFI="yes"/' \ 20.85 - -e s'/^STATIC=.*/STATIC="no"/' /etc/network.conf 20.86 + -e 's|^WIFI=.*|WIFI="yes"|' \ 20.87 + -e 's|^DHCP=.*|DHCP="yes"|' \ 20.88 + -e 's|^STATIC=.*|STATIC="no"|' /etc/network.conf 20.89 ifconfig $WIFI_INTERFACE up 20.90 iwconfig $WIFI_INTERFACE txpower auto 20.91 /etc/init.d/network.sh restart | log 20.92 - sleep 2 20.93 + # Sleep until connection established (max 20 seconds) 20.94 + for i in $(seq 20); do 20.95 + [ -n "$(iwconfig 2>/dev/null | fgrep Link)" ] && break 20.96 + sleep 1 20.97 + done 20.98 +} 20.99 + 20.100 + 20.101 +# Use /etc/wpa/wpa.conf as single database for known networks, passwords, etc. 20.102 +# Translate this data to use in javascript. 20.103 + 20.104 +parse_wpa_conf() { 20.105 + awk ' 20.106 + BEGIN { print "networks = ["; begin_list = 1; network = 0; } 20.107 + { 20.108 + if ($0 == "network={") { 20.109 + if (begin_list == 0) print ","; 20.110 + begin_list = 0; 20.111 + printf "{"; begin_obj = 1; 20.112 + network = 1; next; 20.113 + } 20.114 + if (network == 1) { 20.115 + if ($0 ~ "=") { 20.116 + if (begin_obj == 0) printf ", "; 20.117 + begin_obj = 0; 20.118 + split($0, a, "="); 20.119 + if (a[2] ~ "\"") 20.120 + printf "%s:%s", a[1], a[2]; 20.121 + else 20.122 + printf "%s:\"%s\"", a[1], a[2]; 20.123 + } 20.124 + } 20.125 + if (network == 1 && $0 ~ "}") { printf "}"; network = 0; next; } 20.126 + } 20.127 + END {print "\n];"} 20.128 + ' /etc/wpa/wpa.conf | sed 's|\t||g;' 20.129 +} 20.130 + 20.131 + 20.132 +# Waiting for network link up 20.133 + 20.134 +wait_up() { 20.135 + for i in $(seq 10); do 20.136 + [ -z "$(cat /sys/class/net/*/operstate | fgrep up)"] && sleep 1 20.137 + done 20.138 } 20.139 20.140 # Actions commands before page is displayed 20.141 + 20.142 case " $(GET) " in 20.143 *\ start\ *) 20.144 + /etc/init.d/network.sh start | log 20.145 # Here we sleep a bit to let udhcp get the lease before reloading 20.146 # the page with status 20.147 - /etc/init.d/network.sh start | log 20.148 - sleep 2 ;; 20.149 + wait_up ;; 20.150 *\ stop\ *) 20.151 /etc/init.d/network.sh stop | log ;; 20.152 *\ restart\ *) 20.153 - /etc/init.d/network.sh restart | log ;; 20.154 - *\ start-wifi\ *) start_wifi ;; 20.155 - *\ hostname\ *) 20.156 - get_hostname="$(GET hostname)" 20.157 + /etc/init.d/network.sh restart | log 20.158 + wait_up ;; 20.159 + *\ start-wifi\ *) 20.160 + start_wifi ;; 20.161 + *\ host\ *) 20.162 + get_hostname="$(GET host)" 20.163 echo $(eval_gettext 'Changed hostname: $get_hostname') | log 20.164 echo "$get_hostname" > /etc/hostname ;; 20.165 esac 20.166 20.167 + 20.168 # Get values only now since they could have been modified by actions. 20.169 + 20.170 . /etc/network.conf 20.171 20.172 + 20.173 + 20.174 + 20.175 + 20.176 # 20.177 # Main Commands for pages 20.178 # 20.179 20.180 case " $(GET) " in 20.181 + 20.182 *\ scan\ *) 20.183 # Scan open ports 20.184 - scan=$(GET scan) 20.185 + scan=$(GET scan); back=$(GET back) 20.186 xhtml_header 20.187 - LOADING_MSG=$(gettext 'Scanning open ports...') 20.188 - loading_msg 20.189 - cat << EOT 20.190 -<h2>$(eval_gettext 'Port scanning for $scan')</h2> 20.191 + LOADING_MSG=$(gettext 'Scanning open ports...'); loading_msg 20.192 20.193 -<pre>$(pscan -b $scan)</pre> 20.194 + cat <<EOT 20.195 +<section> 20.196 + <header> 20.197 + $(eval_gettext 'Port scanning for $scan') 20.198 + $(back_button "$back" "$(gettext 'Network')" "") 20.199 + </header> 20.200 + <pre>$(pscan -b $scan)</pre> 20.201 +</section> 20.202 EOT 20.203 ;; 20.204 20.205 + 20.206 *\ eth\ *) 20.207 # Wired connections settings 20.208 xhtml_header 20.209 @@ -129,8 +134,8 @@ 20.210 STATIC=no 20.211 [ -n "$(GET dhcp)" ] && DHCP=yes 20.212 [ -n "$(GET static)" ] && STATIC=yes 20.213 - LOADING_MSG=$(gettext 'Setting up IP...') 20.214 - loading_msg 20.215 + LOADING_MSG=$(gettext 'Setting up IP...'); loading_msg 20.216 + 20.217 sed -i \ 20.218 -e s"/^INTERFACE=.*/INTERFACE=\"$(GET iface)\""/ \ 20.219 -e s"/^DHCP=.*/DHCP=\"$DHCP\"/" \ 20.220 @@ -144,239 +149,475 @@ 20.221 /etc/init.d/network start | log 20.222 . /etc/network.conf 20.223 fi 20.224 - cat << EOT 20.225 + 20.226 + PAR1="size=\"20\" required"; PAR="$PAR1 pattern=\"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\" data-x=\"Four numbers, each in range 0-255, delimited by full stop.\"" 20.227 + cat <<EOT 20.228 <h2>$(gettext 'Ethernet connection')</h2> 20.229 20.230 <p>$(gettext "Here you can configure a wired connection using DHCP to \ 20.231 automatically get a random IP or configure a static/fixed IP")</p> 20.232 20.233 <section> 20.234 -<h3>$(gettext 'Configuration')</h3> 20.235 -<form method="get" action=""> 20.236 - <input type="hidden" name="eth" /> 20.237 - <table> 20.238 + <header>$(gettext 'Configuration')</header> 20.239 + <form id="conf"> 20.240 + <input type="hidden" name="eth"/> 20.241 + <div> 20.242 + <table> 20.243 + <tr><td>$(gettext 'Interface')</td> 20.244 + <td><select name="iface" value="$INTERFACE" style="width:100%"/> 20.245 + $(cd /sys/class/net; ls -1 | awk -viface="$INTERFACE" '{ 20.246 + sel = ($0 == iface) ? " selected":"" 20.247 + printf "<option value=\"%s\"%s>%s", $0, sel, $0 20.248 + }') 20.249 + </select></td> 20.250 + </tr> 20.251 + <tr><td> </td> 20.252 + <td><label><input type="checkbox" name="staticip" id="staticip"/> 20.253 + $(gettext 'Use static IP')</td> 20.254 + <tr><td>$(gettext 'IP address')</td> 20.255 + <td><input type="text" name="ip" id="st1" value="$IP" $PAR/></td> 20.256 + </tr> 20.257 + <tr><td>$(gettext 'Netmask')</td> 20.258 + <td><input type="text" name="netmask" id="st2" value="$NETMASK" $PAR/></td> 20.259 + </tr> 20.260 + <tr><td>$(gettext 'Gateway')</td> 20.261 + <td><input type="text" name="gateway" id="st3" value="$GATEWAY" $PAR/></td> 20.262 + </tr> 20.263 + <tr><td>$(gettext 'DNS server')</td> 20.264 + <td><input type="text" name="dns" id="st4" value="$DNS_SERVER" $PAR/></td> 20.265 + </tr> 20.266 + </table> 20.267 + </div> 20.268 + </form> 20.269 + <footer><!-- 20.270 + --><button form="conf" type="submit" name="static" data-icon="ok" >$(gettext 'Activate (static)')</button><!-- 20.271 + --><button form="conf" type="submit" name="dhcp" data-icon="ok" >$(gettext 'Activate (DHCP)' )</button><!-- 20.272 + --><button form="conf" name="disable" data-icon="cancel">$(gettext 'Disable' )</button><!-- 20.273 + --></footer> 20.274 +</section> 20.275 + 20.276 +<script type="text/javascript"> 20.277 + document.getElementById('staticip').onchange = static_change; 20.278 + 20.279 + function static_change() { 20.280 + staticip = document.getElementById('staticip'); 20.281 + alert(staticip.checked); 20.282 + } 20.283 +</script> 20.284 + 20.285 +<section> 20.286 + <header> 20.287 + $(gettext 'Configuration file') 20.288 + <form action="index.cgi"> 20.289 + <input type="hidden" name="file" value="/etc/network.conf"/> 20.290 + <button name="action" value="edit" data-icon="edit">$(gettext 'Edit')</button> 20.291 + </form> 20.292 + </header> 20.293 + <div>$(gettext "These values are the ethernet settings in the main /etc/network.conf configuration file")</div> 20.294 + <pre>$(awk '{if($1 !~ "WIFI" && $1 !~ "#" && $1 != ""){print $0}}' /etc/network.conf | syntax_highlighter conf)</pre> 20.295 +</section> 20.296 +EOT 20.297 + ;; 20.298 + 20.299 + 20.300 + 20.301 + *\ wifi_list\ *) 20.302 + # Catch ESSIDs and format output. 20.303 + # We get the list of networks by Cell and without spaces. 20.304 + 20.305 + HIDDEN="$(gettext '(hidden)')" 20.306 + 20.307 + cat <<EOT 20.308 +<table class="wide center zebra"> 20.309 <thead> 20.310 <tr> 20.311 <td>$(gettext 'Name')</td> 20.312 - <td>$(gettext 'Value')</td> 20.313 + <td>$(gettext 'Signal level')</td> 20.314 + <td>$(gettext 'Channel')</td> 20.315 + <td>$(gettext 'Encryption')</td> 20.316 + <td>$(gettext 'Status')</td> 20.317 </tr> 20.318 </thead> 20.319 <tbody> 20.320 - <tr> 20.321 - <td>$(gettext 'Interface')</td> 20.322 - <td><input type="text" name="iface" size="20" value="$INTERFACE" /></td> 20.323 - </tr> 20.324 - <tr> 20.325 - <td>$(gettext 'IP address')</td> 20.326 - <td><input type="text" name="ip" size="20" value="$IP" /></td> 20.327 - </tr> 20.328 - <tr> 20.329 - <td>$(gettext 'Netmask')</td> 20.330 - <td><input type="text" name="netmask" size="20" value="$NETMASK" /></td> 20.331 - </tr> 20.332 - <tr> 20.333 - <td>$(gettext 'Gateway')</td> 20.334 - <td><input type="text" name="gateway" size="20" value="$GATEWAY" /></td> 20.335 - </tr> 20.336 - <tr> 20.337 - <td>$(gettext 'DNS server')</td> 20.338 - <td><input type="text" name="dns" size="20" value="$DNS_SERVER" /></td> 20.339 - </tr> 20.340 +EOT 20.341 + if [ -d /sys/class/net/$WIFI_INTERFACE/wireless ]; then 20.342 + ifconfig $WIFI_INTERFACE up 20.343 + for i in $(iwlist $WIFI_INTERFACE scan | sed '/Cell /!d;s/.*Cell \([^ ]*\).*/Cell.\1/') 20.344 + do 20.345 + SCAN=$(iwlist $WIFI_INTERFACE scan last | sed "/$i/,/Cell/!d" | sed '$d') 20.346 + 20.347 + BSSID=$(echo "$SCAN" | sed -n 's|.*Address: \([^ ]*\).*|\1|p') 20.348 + 20.349 + CHANNEL=$(echo "$SCAN" | sed -n 's|.*Channel[:=]\([^ ]*\).*|\1|p') 20.350 + 20.351 + QUALITY=$(echo "$SCAN" | sed -n 's|.*Quality[:=]\([^ ]*\).*|\1|p') 20.352 + QUALITY_ICON="lvl$(( 5*${QUALITY:-0} ))" # lvl0 .. lvl4, lvl5 20.353 + LEVEL=$(echo "$SCAN" | sed -n 's|.*Signal level[:=]\([^ ]*\).*|\1|p; s|-|−|') 20.354 + 20.355 + ENCRYPTION=$(echo "$SCAN" | sed -n 's|.*Encryption key[:=]\([^ ]*\).*|\1|p') # on/off 20.356 + 20.357 + ESSID=$(echo "$SCAN" | sed -n 's|.*ESSID:"\([^"]*\).*|\1|p') 20.358 + 20.359 + # WPA Type - Group Cipher - Pairwise Ciphers - Authentication Suites 20.360 + # {WPA|WPA2}-{TKIP|CCMP}-{TKIP|CCMP|TKIP CCMP}-{PSK|802.1x} 20.361 + #CAPABILITIES="$(echo "$SCAN" | grep -e 'IE: .*WPA*' -A3 | cut -d: -f2 | sed -e 's|^ ||' -e '/WPA2/s|.*|=WPA2|' -e '/WPA /s|.*|=WPA|' -e '/--/d' | tr '\n' '-' | tr '=' '\n' | sed -e '/^$/d' -e 's|-$||')" 20.362 + 20.363 + # Authentication type 20.364 + AUTH="$(echo "$SCAN" | sed -n 's|.*Authentication Suites[^:]*: *\(.*\)|\1|p')" 20.365 + if [ -n "$(echo -n $AUTH | fgrep PSK)" ]; then 20.366 + # WPA-Personal. Authentication using password (PSK = pre-shared key) 20.367 + WIFI_KEY_TYPE='WPA' 20.368 + elif [ -n "$(echo -n $AUTH | fgrep 802.1x)" ]; then 20.369 + # WPA-Enterprise. Authentication using username, password, certificates... 20.370 + WIFI_KEY_TYPE='EAP' 20.371 + else 20.372 + WIFI_KEY_TYPE='NONE' 20.373 + fi 20.374 + 20.375 + # Check encryption type 20.376 + if [ "$ENCRYPTION" == 'on' ]; then 20.377 + # "WPA" or "WPA2" or "WPA/WPA2" (maybe also "WPA2/WPA") 20.378 + ENC_SIMPLE=$(echo "$SCAN" | sed -n '/.*WPA.*/ s|.*\(WPA[^ ]*\).*|\1|p') 20.379 + ENC_SIMPLE=$(echo $ENC_SIMPLE | sed 's| |/|') 20.380 + ENC_ICON='sechi' # high 20.381 + if [ -z "$ENC_SIMPLE" ]; then 20.382 + WIFI_KEY_TYPE='WEP' 20.383 + ENC_SIMPLE='WEP'; ENC_ICON='secmi' # middle 20.384 + fi 20.385 + else 20.386 + WIFI_KEY_TYPE='NONE' 20.387 + ENC_SIMPLE="$(gettext 'None')"; ENC_ICON='seclo' # low 20.388 + fi 20.389 + 20.390 + # 20.391 + #if echo $SCAN | grep -q 'Mode:Managed'; then 20.392 + # AP="&ap=$(echo $SCAN | sed 's/.*Address: \([^ ]*\).*/\1/')" 20.393 + #else 20.394 + # AP='' 20.395 + #fi 20.396 + 20.397 + # Connected or not connected... 20.398 + if ifconfig $WIFI_INTERFACE | fgrep -q inet && \ 20.399 + iwconfig $WIFI_INTERFACE | fgrep -q "ESSID:\"$ESSID\""; then 20.400 + status="$(gettext 'Connected')" 20.401 + else 20.402 + status='---' 20.403 + fi 20.404 + 20.405 + cat <<EOT 20.406 +<tr> 20.407 + <td><a data-icon="wifi" onclick="loadcfg('$ESSID', '$BSSID', '$WIFI_KEY_TYPE')">${ESSID:-$HIDDEN}</a></td> 20.408 + <td><span data-icon="$QUALITY_ICON" title="Quality: $QUALITY"> $LEVEL dBm</span></td> 20.409 + <td>$CHANNEL</td> 20.410 + <td><span data-icon="$ENC_ICON">$ENC_SIMPLE</span></td> 20.411 + <td>$status</td> 20.412 +</tr> 20.413 +EOT 20.414 + done 20.415 + fi 20.416 + cat <<EOT 20.417 </tbody> 20.418 - </table> 20.419 - <input type="submit" name="static" value="$(gettext 'Activate (static)')"> 20.420 - <input type="submit" name="dhcp" value="$(gettext 'Activate (DHCP)')"> 20.421 - <input type="submit" name="disable" value="$(gettext 'Disable')"> 20.422 +</table> 20.423 +EOT 20.424 + exit 0 20.425 + ;; 20.426 + 20.427 + 20.428 + *\ wifi\ *) 20.429 + # Wireless connections settings 20.430 + xhtml_header 20.431 + 20.432 + . /etc/network.conf 20.433 + cat <<EOT 20.434 +<h2>$(gettext 'Wireless connection')</h2> 20.435 + 20.436 +<form> 20.437 + <input type="hidden" name="wifi"/> 20.438 +EOT 20.439 + 20.440 + start_disabled=''; stop_disabled='' 20.441 + if iwconfig 2>/dev/null | grep -q 'Tx-Power=off'; then 20.442 + stop_disabled='disabled' 20.443 + else 20.444 + start_disabled='disabled' 20.445 + fi 20.446 + 20.447 + cat <<EOT 20.448 + <button name="start-wifi" data-icon="start" $start_disabled>$(gettext 'Start')</button><!-- 20.449 + --><button name="stop" data-icon="stop" $stop_disabled >$(gettext 'Stop' )</button><!-- 20.450 + --><button type="submit" data-icon="refresh" $stop_disabled >$(gettext 'Scan' )</button> 20.451 </form> 20.452 +EOT 20.453 + 20.454 + if [ -n "$start_disabled" ]; then 20.455 + cat <<EOT 20.456 +<section id="wifiList"> 20.457 + <div style="text-align: center;"><span id="ajaxStatus"></span>$(gettext 'Scanning wireless interface...')</div> 20.458 </section> 20.459 20.460 +<script type="text/javascript"> 20.461 + ajax('/network.cgi?wifi_list', '1', 'wifiList'); 20.462 + $(parse_wpa_conf) 20.463 +</script> 20.464 +EOT 20.465 + 20.466 + ESSID="$(GET essid)" 20.467 + #WIFI_KEY_TYPE="$(GET keyType)" 20.468 + #WIFI_KEY="$(GET key)" 20.469 + #WIFI_AP="$(GET ap)" 20.470 + 20.471 + if [ -n "$ESSID" ]; then 20.472 + /etc/init.d/network.sh stop | log 20.473 + sed -i \ 20.474 + -e "s/^WIFI_ESSID=.*/WIFI_ESSID=\"$essid\"/" \ 20.475 + -e "s/^WIFI_KEY_TYPE=.*/WIFI_KEY_TYPE=\"$WIFI_KEY_TYPE\"/" \ 20.476 + -e "s/^WIFI_KEY=.*/WIFI_KEY=\"$WIFI_KEY\"/" \ 20.477 + -e "s/^WIFI_AP=.*/WIFI_AP=\"$WIFI_AP\"/" \ 20.478 + /etc/network.conf 20.479 + . /etc/network.conf 20.480 + start_wifi 20.481 + fi 20.482 + 20.483 + # ESSID names are clickable 20.484 + #SELECT="$(GET select)" 20.485 + #if [ -n "$SELECT" ]; then 20.486 + # [ "$SELECT" != "$WIFI_ESSID" ] && WIFI_KEY='' 20.487 + # WIFI_ESSID="$SELECT" 20.488 + #fi 20.489 + 20.490 + cat <<EOT 20.491 <section> 20.492 -<h3>$(gettext 'Configuration file')</h3> 20.493 + <header>$(gettext 'Connection')</header> 20.494 + <div> 20.495 + <form id="connection"> 20.496 + <input type="hidden" name="connect-wifi"/> 20.497 + <table> 20.498 + <tr><td>$(gettext 'Network SSID')</td> 20.499 + <td><input type="text" name="essid" value="$WIFI_ESSID" id="essid"/></td> 20.500 + </tr> 20.501 20.502 -<p>$(gettext "These values are the ethernet settings in the main \ 20.503 -/etc/network.conf configuration file")</p> 20.504 -<pre> 20.505 -$(grep ^[A-V] /etc/network.conf | syntax_highlighter conf) 20.506 -</pre> 20.507 -<a class="button" href="index.cgi?file=/etc/network.conf&action=edit"> 20.508 - <img src="$IMAGES/edit.png" />$(gettext 'Manual Edit')</a> 20.509 + <tr><td>$(gettext 'Security')</td> 20.510 + <td><select name="keyType" id="keyType"> 20.511 + <option value="NONE">$(gettext 'None')</option> 20.512 + <option value="WEP" >WEP</option> 20.513 + <option value="WPA" >WPA/WPA2 PSK</option> 20.514 + <option value="EAP" >802.1x EAP</option> 20.515 + </select> 20.516 + </td> 20.517 + </tr> 20.518 + 20.519 + <tr class="eap"> 20.520 + <td><div>$(gettext 'EAP method')</div></td> 20.521 + <td><div><select name="eap" id="eap"> 20.522 + <option value="PEAP">PEAP</option> 20.523 + <option value="TLS" >TLS</option> 20.524 + <option value="TTLS">TTLS</option> 20.525 + <option value="PWD" >PWD</option> 20.526 + </select> 20.527 + </div></td> 20.528 + </tr> 20.529 + 20.530 + <tr class="eap1"> 20.531 + <td><div>$(gettext 'Phase 2 authentication')</div></td> 20.532 + <td><div><select name="phase2" id="phase2"> 20.533 + <option value="none" >$(gettext 'None')</option> 20.534 + <option value="pap" >PAP</option> 20.535 + <option value="mschap" >MSCHAP</option> 20.536 + <option value="mschapv2">MSCHAPV2</option> 20.537 + <option value="gtc" >GTC</option> 20.538 + </select> 20.539 + </div></td> 20.540 + </tr> 20.541 + 20.542 + <tr class="eap1"> 20.543 + <td><div>$(gettext 'CA certificate')</div></td> 20.544 + <td><div><input type="text" name="caCert" id="caCert"></div></td> 20.545 + </tr> 20.546 + 20.547 + <tr class="eap1"> 20.548 + <td><div>$(gettext 'User certificate')</div></td> 20.549 + <td><div><input type="text" name="clientCert" id="clientCert"></div></td> 20.550 + </tr> 20.551 + 20.552 + <tr class="eap"> 20.553 + <td><div>$(gettext 'Identity')</div></td> 20.554 + <td><div><input type="text" name="identity" id="identity"></div></td> 20.555 + </tr> 20.556 + 20.557 + <tr class="eap1"> 20.558 + <td><div>$(gettext 'Anonymous identity')</div></td> 20.559 + <td><div><input type="text" name="anonymousIdentity" id="anonymousIdentity"></div></td> 20.560 + </tr> 20.561 + 20.562 + <tr class="wep wpa eap"> 20.563 + <td><div>$(gettext 'Password')</div></td> 20.564 + <td><div> 20.565 + <input type="password" name="password" value="$WIFI_KEY" id="password"/> 20.566 + <span data-img="view" title="$(gettext 'Show password')" 20.567 + onmousedown="document.getElementById('password').type='text'; return false" 20.568 + onmouseup="document.getElementById('password').type='password'" 20.569 + onmouseout="document.getElementById('password').type='password'" 20.570 + ></span> 20.571 + </div></td> 20.572 + </tr> 20.573 + 20.574 + 20.575 +<!-- 20.576 + <tr><td>$(gettext 'Access point')</td> 20.577 + <td><input type="text" name="ap" value="$WIFI_AP"/></td> 20.578 + </tr> 20.579 +--> 20.580 + 20.581 + <script type="text/javascript"> 20.582 +function wifiSettingsChange() { 20.583 + document.getElementById('connection').className = 20.584 + document.getElementById('keyType').value.toLowerCase() + ' ' + 20.585 + document.getElementById('eap').value.toLowerCase(); 20.586 +} 20.587 +document.getElementById('keyType').onchange = wifiSettingsChange; 20.588 +document.getElementById('eap').onchange = wifiSettingsChange; 20.589 + 20.590 +document.getElementById('keyType').value = "$WIFI_KEY_TYPE"; wifiSettingsChange(); 20.591 + </script> 20.592 + 20.593 + <style type="text/css"> 20.594 +#connection input[type="text"], #connection input[type="password"] { width: 14rem; } 20.595 +#connection select { width: 14.4rem; } 20.596 + 20.597 +#connection td { padding: 0; margin: 0; } 20.598 +#connection [class] div { 20.599 + max-height: 0; overflow: hidden; padding: 0; margin: 0; 20.600 + -webkit-transition: all 0.5s ease-in-out; 20.601 + -moz-transition: all 0.5s ease-in-out; 20.602 + transition: all 0.5s ease-in-out; 20.603 +} 20.604 +.wep .wep div, .wpa .wpa div, .eap .eap div, 20.605 +.eap.peap .eap1 div, .eap.tls .eap1 div, .eap.ttls .eap1 div { 20.606 + max-height: 2em !important; 20.607 +} 20.608 + </style> 20.609 + 20.610 + </table> 20.611 + </form> 20.612 + </div> 20.613 + <footer> 20.614 + <button form="connection" type="submit" name="wifi" data-icon="ok">$(gettext 'Configure')</button> 20.615 + </footer> 20.616 +</section> 20.617 +EOT 20.618 + fi 20.619 + 20.620 + cat <<EOT 20.621 +<section> 20.622 + <header> 20.623 + $(gettext 'Configuration file') 20.624 + <form action="index.cgi"> 20.625 + <input type="hidden" name="file" value="/etc/network.conf"/> 20.626 + <button name="action" value="edit" data-icon="edit">$(gettext 'Edit')</button> 20.627 + </form> 20.628 + </header> 20.629 + <div>$(gettext "These values are the wifi settings in the main /etc/network.conf configuration file")</div> 20.630 + <pre>$(grep ^WIFI /etc/network.conf | sed '/WIFI_KEY=/s|".*"|"********"|' | syntax_highlighter conf)</pre> 20.631 +</section> 20.632 + 20.633 + 20.634 +<section> 20.635 + <header>$(gettext 'Output of iwconfig')</header> 20.636 + <pre>$(iwconfig)</pre> 20.637 </section> 20.638 EOT 20.639 ;; 20.640 - *\ wifi\ *) 20.641 - # Wireless connections settings 20.642 - xhtml_header 20.643 - LOADING_MSG=$(gettext 'Scanning wireless interface...') 20.644 - loading_msg 20.645 - . /etc/network.conf 20.646 - cat << EOT 20.647 -<h2>$(gettext 'Wireless connection')</h2> 20.648 -<div id="actions"> 20.649 - <a class="button" href="?wifi&start-wifi=start-wifi"> 20.650 - <img src="$IMAGES/start.png" />$(gettext 'Start')</a> 20.651 - <a class="button" href="?wifi&stop=stop"> 20.652 - <img src="$IMAGES/stop.png" />$(gettext 'Stop')</a> 20.653 - <a class="button" href="?wifi=scan"> 20.654 - <img src="$IMAGES/recharge.png" />$(gettext 'Scan')</a> 20.655 -</div> 20.656 -$(detect_wifi_networks) 20.657 -EOT 20.658 - WIFI_AP="$(GET ap)" 20.659 - WIFI_KEY="$(GET key)" 20.660 - case "$(GET keytype)" in 20.661 - ''|off) WIFI_KEY_TYPE=none ;; 20.662 - *) WIFI_KEY_TYPE=any ;; 20.663 - esac 20.664 - if [ "$(GET essid)" ]; then 20.665 - /etc/init.d/network.sh stop | log 20.666 - sed -i \ 20.667 - -e s"/^WIFI_ESSID=.*/WIFI_ESSID=\"$(GET essid)\""/ \ 20.668 - -e s"/^WIFI_KEY=.*/WIFI_KEY=\"$WIFI_KEY\"/" \ 20.669 - -e s"/^WIFI_KEY_TYPE=.*/WIFI_KEY_TYPE=\"$WIFI_KEY_TYPE\"/" \ 20.670 - -e s"/^WIFI_AP=.*/WIFI_AP=\"$WIFI_AP\"/" \ 20.671 - /etc/network.conf 20.672 - . /etc/network.conf 20.673 - start_wifi 20.674 - fi 20.675 - # ESSID names are clickable 20.676 - if [ "$(GET select)" ]; then 20.677 - if [ "$(GET select)" != "$WIFI_ESSID" ]; then 20.678 - WIFI_KEY="" 20.679 - fi 20.680 - WIFI_ESSID="$(GET select)" 20.681 - fi 20.682 - cat << EOT 20.683 -<section> 20.684 -<h3>$(gettext 'Connection')</h3> 20.685 -<form method="get" action=""> 20.686 - <input type="hidden" name="connect-wifi" /> 20.687 - $(table_start) 20.688 - <thead> 20.689 - <tr> 20.690 - <td>$(gettext 'Name')</td> 20.691 - <td>$(gettext 'Value')</td> 20.692 - </tr> 20.693 - </thead> 20.694 - <tr> 20.695 - <td>$(gettext 'Wifi name (ESSID)')</td> 20.696 - <td><input type="text" name="essid" size="30" value="$WIFI_ESSID" /></td> 20.697 - </tr> 20.698 - <tr> 20.699 - <td>$(gettext 'Password (Wifi key)')</td> 20.700 - <td><input type="password" name="key" size="30" value="$WIFI_KEY" /></td> 20.701 - </tr> 20.702 - <tr> 20.703 - <td>$(gettext 'Encryption type')</td> 20.704 - <td><input type="text" name="keytype" size="30" value="$WIFI_KEY_TYPE" /></td> 20.705 - </tr> 20.706 - <tr> 20.707 - <td>$(gettext 'Access point')</td> 20.708 - <td><input type="text" name="ap" size="30" value="$WIFI_AP" /></td> 20.709 - </tr> 20.710 - $(table_end) 20.711 - <input type="submit" name="wifi" value="$(gettext 'Configure')" /> 20.712 -</form> 20.713 -</section> 20.714 20.715 -<section> 20.716 -<h3>$(gettext 'Configuration file')</h3> 20.717 20.718 -<p>$(gettext "These values are the wifi settings in the main /etc/network.conf \ 20.719 -configuration file")</p> 20.720 - 20.721 -<pre>$(grep ^WIFI /etc/network.conf | sed '/WIFI_KEY=/s|".*"|"********"|' | \ 20.722 -syntax_highlighter conf)</pre> 20.723 - 20.724 -<a class="button" href="index.cgi?file=/etc/network.conf&action=edit"> 20.725 - <img src="$IMAGES/edit.png" />$(gettext 'Manual Edit')</a> 20.726 -</section> 20.727 - 20.728 -<section> 20.729 -<h3>$(gettext 'Output of iwconfig')</h3> 20.730 - 20.731 -<pre>$(iwconfig)</pre> 20.732 -</section> 20.733 -EOT 20.734 - ;; 20.735 *) 20.736 # Main Network page starting with a summary 20.737 xhtml_header 20.738 - hostname=$(cat /etc/hostname) 20.739 - cat << EOT 20.740 + 20.741 + stop_disabled=''; start_disabled='' 20.742 + if cat /sys/class/net/*/operstate | fgrep -q up; then 20.743 + start_disabled='disabled' 20.744 + else 20.745 + stop_disabled='disabled' 20.746 + fi 20.747 + 20.748 + cat <<EOT 20.749 <h2>$(gettext 'Networking')</h2> 20.750 20.751 <p>$(gettext 'Manage network connections and services')</p> 20.752 20.753 -<section> 20.754 -<div id="actions"> 20.755 - <div class="float-left"> 20.756 - <a class="button" href="?start"> 20.757 - <img src="$IMAGES/start.png" />$(gettext 'Start')</a> 20.758 - <a class="button" href="?stop"> 20.759 - <img src="$IMAGES/stop.png" />$(gettext 'Stop')</a> 20.760 - <a class="button" href="?restart"> 20.761 - <img src="$IMAGES/recharge.png" />$(gettext 'Restart')</a> 20.762 - </div> 20.763 - <div class="float-right"> 20.764 - $(gettext 'Configuration:') 20.765 - <a class="button" href="index.cgi?file=/etc/network.conf">network.conf</a> 20.766 - <a class="button" href="?eth">Ethernet</a> 20.767 - <a class="button" href="?wifi">Wireless</a> 20.768 - </div> 20.769 +<form action="index.cgi" id="indexform"></form> 20.770 + 20.771 +<form id="mainform"><!-- 20.772 + --><button name="start" data-icon="start" $start_disabled>$(gettext 'Start' )</button><!-- 20.773 + --><button name="stop" data-icon="stop" $stop_disabled >$(gettext 'Stop' )</button><!-- 20.774 + --><button name="restart" data-icon="restart" $stop_disabled >$(gettext 'Restart')</button> 20.775 +</form> 20.776 +<div class="float-right"><!-- 20.777 + -->$(gettext 'Configuration:')<!-- 20.778 + --><button form="indexform" name="file" value="/etc/network.conf" data-icon="conf">network.conf</button><!-- 20.779 + --><button form="mainform" name="eth" data-icon="eth">Ethernet</button><!-- 20.780 + --><button form="mainform" name="wifi" data-icon="wifi">Wireless</button> 20.781 </div> 20.782 20.783 -$(list_network_interfaces) 20.784 + 20.785 +<section> 20.786 + <header>$(gettext 'Network interfaces')</header> 20.787 + $(list_network_interfaces) 20.788 </section> 20.789 20.790 + 20.791 <section> 20.792 -<h3 id="hosts">$(gettext 'Hosts')</h3> 20.793 - 20.794 -<pre>$(cat /etc/hosts)</pre> 20.795 - 20.796 -<a class="button" href="index.cgi?file=/etc/hosts&action=edit"> 20.797 - <img src="$IMAGES/edit.png" />$(gettext 'Edit hosts')</a> 20.798 + <header id="hosts">$(gettext 'Hosts')</header> 20.799 + <pre>$(cat /etc/hosts)</pre> 20.800 + <footer> 20.801 + <form action="index.cgi"> 20.802 + <input type="hidden" name="file" value="/etc/hosts"/> 20.803 + <button name="action" value="edit" data-icon="edit">$(gettext 'Edit')</button> 20.804 + </form> 20.805 + </footer> 20.806 </section> 20.807 20.808 + 20.809 <section> 20.810 -<h3>$(gettext 'Hostname')</h3> 20.811 - 20.812 -<form method="get" name=""> 20.813 - <input type="text" name="hostname" value="$hostname" /> 20.814 - <input type="submit" value="$(gettext 'Change hostname')" /> 20.815 -</form> 20.816 + <header>$(gettext 'Hostname')</header> 20.817 + <footer> 20.818 + <form> 20.819 + <!-- was: name="hostname"; please don't use 'name' in name: unwanted webkit styling --> 20.820 + <input type="text" name="host" value="$(cat /etc/hostname)"/><!-- 20.821 + --><button type="submit" data-icon="ok">$(gettext 'Change')</button> 20.822 + </form> 20.823 + </footer> 20.824 </section> 20.825 20.826 + 20.827 <section> 20.828 -<h3 id="ifconfig">$(gettext 'Output of ifconfig')</h3> 20.829 - 20.830 -<pre>$(ifconfig)</pre> 20.831 + <header id="ifconfig">$(gettext 'Output of ifconfig')</header> 20.832 + <pre>$(ifconfig)</pre> 20.833 </section> 20.834 20.835 + 20.836 <section> 20.837 -<h3 id="routing">$(gettext 'Routing table')</h3> 20.838 - 20.839 -<pre>$(route -n)</pre> 20.840 + <header id="routing">$(gettext 'Routing table')</header> 20.841 + <pre>$(route -n)</pre> 20.842 </section> 20.843 20.844 + 20.845 <section> 20.846 -<h3 id="dns">$(gettext 'Domain name resolution')</h3> 20.847 - 20.848 -<pre>$(cat /etc/resolv.conf)</pre> 20.849 + <header id="dns">$(gettext 'Domain name resolution')</header> 20.850 + <pre>$(cat /etc/resolv.conf)</pre> 20.851 </section> 20.852 20.853 + 20.854 <section> 20.855 -<h3 id="arp">$(gettext 'ARP table')</h3> 20.856 - 20.857 -<pre>$(arp)</pre> 20.858 + <header id="arp">$(gettext 'ARP table')</header> 20.859 + <pre>$(arp)</pre> 20.860 </section> 20.861 20.862 + 20.863 <section> 20.864 -<h3 id="connections">$(gettext 'IP Connections')</h3> 20.865 - 20.866 -<pre> 20.867 -$(netstat -anp 2> /dev/null | sed -e '/UNIX domain sockets/,$d' \ 20.868 --e 's#\([0-9]*\)/#<a href="boot.cgi?daemons=pid=\1">\1</a>/#') 20.869 -</pre> 20.870 + <header id="connections">$(gettext 'IP Connections')</header> 20.871 + <pre>$(netstat -anp 2>/dev/null | sed -e '/UNIX domain sockets/,$d' \ 20.872 +-e 's#\([0-9]*\)/#<a href="boot.cgi?daemons=pid=\1">\1</a>/#')</pre> 20.873 </section> 20.874 EOT 20.875 ;;
21.1 --- a/settings.cgi Mon Mar 23 21:17:06 2015 +0100 21.2 +++ b/settings.cgi Tue Mar 24 03:39:08 2015 +0200 21.3 @@ -4,17 +4,21 @@ 21.4 # don't have multiple pages here there is only one case used to get command 21.5 # values and the full content is followed directly. 21.6 # 21.7 -# Copyright (C) 2011-2014 SliTaz GNU/Linux - BSD License 21.8 +# Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License 21.9 # 21.10 21.11 + 21.12 # Common functions from libtazpanel 21.13 + 21.14 . lib/libtazpanel 21.15 get_config 21.16 header 21.17 21.18 TITLE=$(gettext 'TazPanel - Settings') 21.19 21.20 + 21.21 # Get system database. LDAP compatible. 21.22 + 21.23 getdb() 21.24 { 21.25 getent $1 2>/dev/null || cat /etc/$1 21.26 @@ -27,63 +31,209 @@ 21.27 done 21.28 } 21.29 21.30 + 21.31 +############################# 21.32 +# Get info from locale file # 21.33 +############################# 21.34 + 21.35 +get_locale_info() 21.36 +{ 21.37 + # Commands like `LC_ALL=fr_FR locale -k LC_MEASUREMENT` will do the job 21.38 + # only when your locale is generated and exists in the /usr/lib/locale. 21.39 + # Here we manually parse locale definition files from /usr/share/i18n/locales/. 21.40 + # Strange, bloated and not script-friendly format :( 21.41 + 21.42 + [ ! -e /usr/share/i18n/locales/$1 ] && return 21.43 + 21.44 + # Prepare file 21.45 + if [ ! -e /tmp/tazpanel-$1 ]; then 21.46 + sed 's|^[ \t]*||;/^%/d;/^comment_char/d;/^escape_char/d' /usr/share/i18n/locales/$1 | tr '\n' '&' | sed 's|/&||g' | tr '&' '\n' | sed 's|<U\([0-9a-fA-F]*\)>|\&#x\1;|g' | sed 's|�|\&#x|g' > /tmp/tazpanel-$1 21.47 + fi 21.48 + 21.49 + local ANS=$(grep -e "^$2[ ]" /tmp/tazpanel-$1 | sed 's|^[^ \t][^ \t]* *||') 21.50 + if [ -z "$ANS" ]; then 21.51 + # Not found, then section is copied from other locale definition file... 21.52 + case $2 in 21.53 + measurement) 21.54 + section='LC_MEASUREMENT';; 21.55 + width|height) 21.56 + section='LC_PAPER';; 21.57 + currency_symbol|int_curr_symbol) 21.58 + section='LC_MONETARY';; 21.59 + day|abday|mon|abmon|d_t_fmt|d_fmt|t_fmt|am_pm|t_fmt_ampm|date_fmt) 21.60 + section='LC_TIME';; 21.61 + esac 21.62 + # Recursive call 21.63 + get_locale_info $(sed -n '/^'$section'/,/^END '$section'/p' /tmp/tazpanel-$1 | grep 'copy' | cut -d'"' -f2) $2 21.64 + else 21.65 + case $2 in 21.66 + day|abday|mon|abmon|am_pm) # semicolon-separated list in double quotes 21.67 + echo "$ANS";; 21.68 + *) # single value in double qoutes 21.69 + echo "$ANS" | cut -d'"' -f2;; 21.70 + esac 21.71 + fi 21.72 +} 21.73 + 21.74 + 21.75 +# Get info from locale file about measurement system 21.76 + 21.77 +get_locale_info_measurement() 21.78 +{ 21.79 + # faster to use pre-processed values 21.80 + case $1 in 21.81 + en_AG|en_US|es_PR|es_US|nl_AW|yi_US) gettext 'US' ;; 21.82 + POSIX) ;; 21.83 + *) gettext 'metric' ;; 21.84 + esac 21.85 +} 21.86 + 21.87 + 21.88 +# Get info from locale file about paper size 21.89 + 21.90 +get_locale_info_paper() 21.91 +{ 21.92 + # faster to use pre-processed values 21.93 + case $1 in 21.94 + en_AG|en_US|es_PR|es_US|nl_AW|yi_US) echo '8½×11 (US Letter)';; 21.95 + 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)';; 21.96 + POSIX) ;; 21.97 + *) echo '210×297 (A4)';; 21.98 + esac 21.99 +} 21.100 + 21.101 + 21.102 +# Get info from locale file about date and time format 21.103 + 21.104 +get_locale_info_date_time() 21.105 +{ 21.106 + case $2 in 21.107 + c) get_locale_info $1 d_t_fmt ;; 21.108 + x) get_locale_info $1 d_fmt ;; 21.109 + X) get_locale_info $1 t_fmt ;; 21.110 + r) get_locale_info $1 t_fmt_ampm ;; 21.111 + *) get_locale_info $1 date_fmt ;; 21.112 + 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;' 21.113 + 21.114 +} 21.115 + 21.116 + 21.117 +parse_date() 21.118 +{ 21.119 + local weekday month day abday mon abmon rtime d_fmt t_fmt am_pm 21.120 + weekday=$(( $(date +%w) + 1 )) # 1=Sunday ... 21.121 + month=$(date +%-m) # 1=January ... 21.122 + day=$(get_locale_info $1 day | cut -d'"' -f$(( 2 * $weekday )) | sed 's|&|\\\&|g') # translated day of week 21.123 + abday=$(get_locale_info $1 abday | cut -d'"' -f$(( 2 * $weekday )) | sed 's|&|\\\&|g') # same, abbreviated 21.124 + mon=$(get_locale_info $1 mon | cut -d'"' -f$(( 2 * $month )) | sed 's|&|\\\&|g') # translated month 21.125 + abmon=$(get_locale_info $1 abmon | cut -d'"' -f$(( 2 * $month )) | sed 's|&|\\\&|g') # same, abbreviated 21.126 + # next %-codes expanded into other %-codes 21.127 + rtime=$(get_locale_info_date_time $1 r | sed 's|&|\\\&|g') # %r: 12-hour time 21.128 + d_fmt=$(get_locale_info_date_time $1 x | sed 's|&|\\\&|g') # %x: date 21.129 + t_fmt=$(get_locale_info_date_time $1 X | sed 's|&|\\\&|g') # %X: time 21.130 + 21.131 + case $(LC_ALL=POSIX date +%P) in # translated am/pm 21.132 + am) am_pm=$(get_locale_info $1 am_pm | cut -d'"' -f2 | sed 's|&|\\\&|g');; 21.133 + pm) am_pm=$(get_locale_info $1 am_pm | cut -d'"' -f4 | sed 's|&|\\\&|g');; 21.134 + esac 21.135 + 21.136 + # 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 21.137 + # Note: %P=am/pm; %p=AM/PM. But here they the same because it is not a simple job to convert letters. 21.138 + echo "$2" | sed "s|%r|$rtime|; s|%x|$d_fmt|; s|%X|$t_fmt|; \ 21.139 + s|%OC|S(date +%OC)|; \ 21.140 + s|%Y|$(date +%Y)|; s|%y|$(date +%y )|; s|%Oy|$(date +%Oy)|; s|%Ey|$(date +%Ey)|; \ 21.141 + s|%m|$(date +%m)|; s|%-m|$(date +%-m)|; s|%Om|$(date +%Om)|; \ 21.142 + s|%d|$(date +%d)|; s|%-d|$(date +%-d)|; s|%Od|$(date +%Od)|; \ 21.143 + s|%e|$(date +%e)|; s|%-e|$(date +%-e)|; s|%Oe|$(date +%Oe)|; \ 21.144 + s|%F|$(date +%F)|; \ 21.145 + s|%H|$(date +%H)|; s|%OH|$(date +%OH)|; s|%k|$(date +%k)|; \ 21.146 + s|%I|$(date +%I)|; s|%OI|$(date +%OI)|; s|%l|$(date +%l)|; \ 21.147 + s|%M|$(date +%M)|; s|%OM|$(date +%OM)|; \ 21.148 + s|%S|$(date +%S)|; s|%OS|$(date +%OS)|; \ 21.149 + s|%R|$(date +%R)|; s|%T|$(date +%T )|; \ 21.150 + s|%Z|$(date +%Z)|; s|%z|$(date +%z )|; \ 21.151 + s|%t|\t|; \ 21.152 + s|%P|$am_pm|; s|%p|$am_pm|; s|%Op|$am_pm|; s|%A|$day|; s|%a|$abday|; s|%B|$mon|; s|%b|$abmon|;" 21.153 + 21.154 +} 21.155 + 21.156 +list_of() 21.157 +{ 21.158 + cd /usr/share/i18n/locales 21.159 + #mon=$(date +%-m); monn=$(( $mon * 2 )) 21.160 + #echo "mon=\"$mon\" monn=\"$monn\"" 21.161 + 21.162 + echo '<pre>' 21.163 +for LOC in be_BY ca_IT el_CY fr_CH ru_RU ru_UA; do 21.164 + case $LOC in 21.165 + iso*|translit*) ;; 21.166 + *) 21.167 + #echo -e "$LOC:\t$(parse_date $LOC $(get_locale_info_date_time $LOC c | sed 's|&|\\\&|g'))";; 21.168 + FMT="$(get_locale_info_date_time $LOC c)" 21.169 + echo -e "$LOC:\t$FMT" 21.170 + parse_date $LOC "$FMT" 21.171 + echo;; 21.172 + esac 21.173 +done 21.174 + echo '</pre>' 21.175 +} 21.176 + 21.177 + 21.178 + 21.179 + 21.180 + 21.181 # 21.182 # Commands executed before page loading. 21.183 # 21.184 21.185 case " $(GET) " in 21.186 *\ do\ *) 21.187 - # Assume no array support in httpd_helper.sh ;^) 21.188 - users="" 21.189 - groups="" 21.190 - IFS="&" 21.191 - for i in $QUERY_STRING ; do 21.192 - case "$i" in 21.193 - user=*) users="$users ${i#user=}" ;; 21.194 - group=*) groups="$groups ${i#group=}" ;; 21.195 - esac 21.196 - done 21.197 - unset IFS 21.198 - for cmd in "Delete group" ; do 21.199 - [ "$(GET do)" == "$(gettext "$cmd")" ] || continue 21.200 - for group in $groups ; do 21.201 - case "$cmd" in 21.202 - Delete*) delgroup $group ;; 21.203 - esac 21.204 - done 21.205 - done 21.206 - for cmd in "Delete user" "Lock user" "Unlock user" \ 21.207 - "Change password" ; do 21.208 - [ "$(GET do)" == "$(gettext "$cmd")" ] || continue # BUGGY 21.209 - for user in $users ; do 21.210 - case "$cmd" in 21.211 - Delete*) deluser $user ;; 21.212 - Lock*) passwd -l $user | log ;; 21.213 - Unlock*) passwd -u $user | log ;; 21.214 - Change*) echo "$user:$(GET password)" | chpasswd -m | log ;; 21.215 - esac 21.216 - done 21.217 - done ;; 21.218 - *\ addmember\ *) 21.219 - addgroup $(GET member) $(GET group) ;; 21.220 - *\ delmember\ *) 21.221 - delgroup $(GET member) $(GET group) ;; 21.222 - *\ addgroup\ *) 21.223 - addgroup $(GET addgroup) ;; 21.224 - *\ adduser\ *) 21.225 - # 21.226 - # Manage system user accounts 21.227 - # 21.228 - user=$(GET adduser) 21.229 - passwd=$(GET passwd) 21.230 - if [ -n "$user" ]; then 21.231 - adduser -D -s /bin/sh -g "SliTaz User" -G users -h /home/$user $user 21.232 - echo "$user:$passwd" | chpasswd -m | log 21.233 - for g in audio cdrom floppy video tty 21.234 - do 21.235 - addgroup $user $g 21.236 - done 21.237 - fi ;; 21.238 + users=$(echo $QUERY_STRING | awk 'BEGIN{RS="&";FS="="}{if($1=="user") print $2}') 21.239 + groups=$(echo $QUERY_STRING | awk 'BEGIN{RS="&";FS="="}{if($1=="group")print $2}') 21.240 + 21.241 + case $(GET do) in 21.242 + 21.243 + # Groups page 21.244 + delgroups) 21.245 + for i in $groups; do delgroup $i; done ;; 21.246 + addgroup) 21.247 + addgroup $groups ;; 21.248 + addmember) 21.249 + addgroup $(GET member) $groups ;; 21.250 + delmember) 21.251 + delgroup $(GET member) $groups ;; 21.252 + 21.253 + # Users page 21.254 + delusers) 21.255 + for i in $users; do deluser $i; done ;; 21.256 + lockusers) 21.257 + for i in $users; do passwd -l $i | log; done ;; 21.258 + unlockusers) 21.259 + for i in $users; do passwd -u $i | log; done ;; 21.260 + chpasswd) 21.261 + echo "$users:$(GET password)" | chpasswd -m | log ;; 21.262 + adduser) 21.263 + if [ -n "$users" ]; then 21.264 + name=$(GET name); name=${name:-SliTaz User} 21.265 + adduser -D -s /bin/sh -g "$name" -G users -h /home/$users $users 21.266 + echo "$user:$(GET passwd)" | chpasswd -m | log 21.267 + for i in audio cdrom floppy video tty; do addgroup $users $i; done 21.268 + fi ;; 21.269 + 21.270 + # System time 21.271 + settz) 21.272 + GET tz > /etc/TZ;; 21.273 + date) # normalize to two digits 21.274 + date $(printf '%02d%02d%02d%02d%d.%02d' "$(GET month)" "$(GET day)" "$(GET hour)" "$(GET min)" "$(GET year)" "$(GET sec)") >/dev/null;; 21.275 + rdate) 21.276 + rdate -s tick.greyware.com ;; 21.277 + hwclock) 21.278 + hwclock -w -u ;; 21.279 + 21.280 + esac 21.281 + ;; 21.282 + 21.283 + 21.284 *\ gen_locale\ *) 21.285 new_locale=$(GET gen_locale) ;; 21.286 *\ gen_keymap\ *) 21.287 @@ -91,24 +241,21 @@ 21.288 *\ apply_xorg_kbd\ *) 21.289 sed -i "s/XkbLayout.*/XkbLayout \" \"$(GET apply_xorg_kbd)\"/" \ 21.290 /etc/X11/xorg.conf.d/40-Keyboard.conf ;; 21.291 - *\ date\ *) 21.292 - date $(GET month)$(GET day)$(GET hour)$(GET min)$(GET year).$(GET sec) ;; 21.293 - *\ rdate\ *) 21.294 - rdate -s tick.greyware.com ;; 21.295 - *\ hwclock\ *) 21.296 - hwclock -w -u ;; 21.297 *\ panel_pass*) 21.298 sed -i s@/:root:.*@/:root:$(GET panel_pass)@ $HTTPD_CONF ;; 21.299 *\ style*) 21.300 sed -i s/'^STYLE.*'/"STYLE=\"$(GET style)\""/ $CONFIG 21.301 . $CONFIG ;; 21.302 - *\ settz\ *) 21.303 - GET tz > /etc/TZ ;; 21.304 esac 21.305 21.306 + 21.307 + 21.308 + 21.309 + 21.310 # 21.311 # Default xHTML content 21.312 # 21.313 + 21.314 xhtml_header 21.315 21.316 case " $(GET) " in 21.317 @@ -117,116 +264,123 @@ 21.318 # Groups management 21.319 # 21.320 cat <<EOT 21.321 -<h3 id="groups">$(gettext 'Manage groups')</h3> 21.322 +<h2 id="groups">$(gettext 'Manage groups')</h2> 21.323 21.324 -<form method="get" action=""> 21.325 - <input type="hidden" name="groups" /> 21.326 -<div id="actions"> 21.327 - <div class="float-left"> 21.328 - $(gettext 'Selection:') 21.329 - <input type="submit" name="do" value="$(gettext 'Delete group')" /> 21.330 - </div> 21.331 -</div> 21.332 21.333 -<table class="zebra outbox"> 21.334 -<thead> 21.335 -<tr class="thead"> 21.336 - <td>$(gettext 'Group')</td> 21.337 - <td>$(gettext 'Group ID')</td> 21.338 - <td>$(gettext 'Members')</td> 21.339 -</tr> 21.340 -</thead> 21.341 -</tbody> 21.342 +<section> 21.343 + <form class="wide"> 21.344 + <header> 21.345 + <input type="hidden" name="groups"/> 21.346 + <!-- $(gettext 'Selection:') --> 21.347 + <button name="do" value="delgroups" data-icon="delete">$(gettext 'Delete group')</button> 21.348 + </header> 21.349 + 21.350 + <div class="scroll"> 21.351 + <table class="wide zebra scroll"> 21.352 + <thead> 21.353 + <tr class="thead"> 21.354 + <td>$(gettext 'Group')</td> 21.355 + <td>$(gettext 'Group ID')</td> 21.356 + <td>$(gettext 'Members')</td> 21.357 + </tr> 21.358 + </thead> 21.359 + <tbody> 21.360 EOT 21.361 - for group in `getdb group | cut -d ":" -f 1` 21.362 - do 21.363 + for group in $(getdb group | cut -d ":" -f 1); do 21.364 IFS=':' 21.365 set -- $(getdb group | grep "^$group:") 21.366 unset IFS 21.367 gid=$3 21.368 members=$4 21.369 cat <<EOT 21.370 -<tr> 21.371 - <td><input type='checkbox' name='group' value='$group' /> 21.372 - <img src='$IMAGES/users.png' />$group</td> 21.373 - <td>$gid</td> 21.374 - <td>${members//,/, }</td> 21.375 -</tr> 21.376 + <tr> 21.377 + <td><input type="checkbox" name="group" value="$group" id="$group"/> 21.378 + <label for="$group" data-icon="group">$group</label></td> 21.379 + <td>$gid</td> 21.380 + <td>${members//,/, }</td> 21.381 + </tr> 21.382 EOT 21.383 done 21.384 - cat << EOT 21.385 -</tbody> 21.386 -</table> 21.387 -</form> 21.388 + cat <<EOT 21.389 + </tbody> 21.390 + </table> 21.391 + </div> 21.392 + </form> 21.393 +</section> 21.394 + 21.395 21.396 <section> 21.397 -<h4>$(gettext 'Add a new group')</h4> 21.398 - 21.399 -<form method="get" action=""> 21.400 - <input type="hidden" name="groups" /> 21.401 - <table> 21.402 - <tr><td>$(gettext 'Group name:')</td> 21.403 - <td><input type="text" name="addgroup" size="30" /></td> 21.404 - <td> 21.405 - <input type="submit" value="$(gettext 'Create group')" /></td></tr> 21.406 - </table> 21.407 -</form> 21.408 + <header>$(gettext 'Add a new group')</header> 21.409 + <form> 21.410 + <input type="hidden" name="groups"/> 21.411 + <table> 21.412 + <tr><td>$(gettext 'Group name:')</td> 21.413 + <td><input type="text" name="group"/></td> 21.414 + </tr> 21.415 + <tr><td colspan="2"> 21.416 + <button type="submit" name="do" value="addgroup" data-icon="add">$(gettext 'Create group')</button> 21.417 + </td></tr> 21.418 + </table> 21.419 + </form> 21.420 </section> 21.421 21.422 + 21.423 <section> 21.424 -<h4>$(gettext 'Manage group membership')</h4> 21.425 - 21.426 -<form method="get" action=""> 21.427 - <input type="hidden" name="groups" /> 21.428 - <table> 21.429 - <tr><td>$(gettext 'Group name:')</td> 21.430 - <td><select class="button" name="group"> 21.431 - $(listdb group) 21.432 - </select></td> 21.433 - <td>$(gettext 'User name:')</td> 21.434 - <td><select class="button" name="member"> 21.435 - $(listdb passwd) 21.436 - </select></td></tr> 21.437 - <tr><td colspan="4"><input type="submit" name="addmember" value="$(gettext 'Add user')" /> 21.438 - <input type="submit" name="delmember" value="$(gettext 'Remove user')" /></td></tr> 21.439 - </table> 21.440 -</form> 21.441 + <header>$(gettext 'Manage group membership')</header> 21.442 + <form> 21.443 + <input type="hidden" name="groups"/> 21.444 + <table> 21.445 + <tr> 21.446 + <td>$(gettext 'Group name:')</td> 21.447 + <td><select name="group">$(listdb group)</select></td> 21.448 + <td>$(gettext 'User name:')</td> 21.449 + <td><select name="member">$(listdb passwd)</select></td> 21.450 + </tr> 21.451 + <tr> 21.452 + <td colspan="2"> 21.453 + <button name="do" value="addmember" data-icon="add">$(gettext 'Add user')</button> 21.454 + </td> 21.455 + <td colspan="2"> 21.456 + <button name="do" value="delmember" data-icon="delete">$(gettext 'Remove user')</button> 21.457 + </td> 21.458 + </tr> 21.459 + </table> 21.460 + </form> 21.461 </section> 21.462 21.463 EOT 21.464 ;; 21.465 21.466 + 21.467 *\ user*) 21.468 # 21.469 # Users management 21.470 # 21.471 cat <<EOT 21.472 -<h3 id="users">$(gettext 'Manage users')</h3> 21.473 +<h2 id="users">$(gettext 'Manage users')</h2> 21.474 21.475 -<form method="get" action=""> 21.476 -<div id="actions"> 21.477 - <div class="float-left"> 21.478 - $(gettext 'Selection:') 21.479 - <input type="submit" name="do" value="$(gettext 'Delete user')" /> 21.480 - <input type="submit" name="do" value="$(gettext 'Lock user')" /> 21.481 - <input type="submit" name="do" value="$(gettext 'Unlock user')" /> 21.482 - </div> 21.483 -</div> 21.484 +<section> 21.485 + <form class="wide"> 21.486 + <header> 21.487 + <!--$(gettext 'Selection:')--> 21.488 + <button name="do" value="delusers" data-icon="delete">$(gettext 'Delete user')</button> 21.489 + <button name="do" value="lockusers" data-icon="lock" >$(gettext 'Lock user' )</button> 21.490 + <button name="do" value="unlockusers" data-icon="unlock">$(gettext 'Unlock user')</button> 21.491 + </header> 21.492 21.493 -<table class="zebra outbox"> 21.494 -<thead> 21.495 -<tr class="thead"> 21.496 - <td>$(gettext 'Login')</td> 21.497 - <td>$(gettext 'User ID')</td> 21.498 - <td>$(gettext 'Name')</td> 21.499 - <td>$(gettext 'Home')</td> 21.500 - <td>$(gettext 'Shell')</td> 21.501 -</tr> 21.502 -</thead> 21.503 -</tbody> 21.504 + <table class="wide zebra center"> 21.505 + <thead> 21.506 + <tr> 21.507 + <td>$(gettext 'Login')</td> 21.508 + <td>$(gettext 'User ID')</td> 21.509 + <td>$(gettext 'Name')</td> 21.510 + <td>$(gettext 'Home')</td> 21.511 + <td>$(gettext 'Shell')</td> 21.512 + </tr> 21.513 + </thead> 21.514 + </tbody> 21.515 EOT 21.516 - for login in `getdb passwd | cut -d ":" -f 1` 21.517 - do 21.518 + for login in $(getdb passwd | cut -d ":" -f 1); do 21.519 if [ -d /home/$login ]; then 21.520 colorlogin=$login 21.521 grep -qs "^$login:!" /etc/shadow && 21.522 @@ -234,61 +388,65 @@ 21.523 IFS=':' 21.524 set -- $(getdb passwd | grep "^$login:") 21.525 unset IFS 21.526 - uid=$3 21.527 - gid=$4 21.528 - name="$(echo $5 | sed s/,.*//)" 21.529 - home="$6" 21.530 - shell=$7 21.531 cat <<EOT 21.532 <tr> 21.533 - <td><input type='checkbox' name='user' value='$login' /> 21.534 - <img src='$IMAGES/user.png' />$colorlogin</td> 21.535 - <td>$uid:$gid</td> 21.536 - <td>$name</td> 21.537 - <td>$home</td> 21.538 - <td>$shell</td> 21.539 + <td style="white-space: nowrap"> 21.540 + <input type="checkbox" name="user" value="$login" id="$login"/> 21.541 + <label for="$login" data-icon="user">$colorlogin</label></td> 21.542 + <td>$3:$4</td> 21.543 + <td>$(echo $5 | sed s/,.*//)</td> 21.544 + <td>$6</td> 21.545 + <td>$7</td> 21.546 </tr> 21.547 EOT 21.548 fi 21.549 done 21.550 - cat << EOT 21.551 -</tbody> 21.552 -</table> 21.553 + cat <<EOT 21.554 + </tbody> 21.555 + </table> 21.556 EOT 21.557 - cat << EOT 21.558 -<p> 21.559 - $(gettext 'Password:') 21.560 - <input type="password" name="password" /> 21.561 - <input type="submit" name="do" value="$(gettext 'Change password')" /> 21.562 -</p> 21.563 -</form> 21.564 + cat <<EOT 21.565 + <footer> 21.566 + <div> 21.567 + $(gettext 'Password:') 21.568 + <input type="password" name="password"/> 21.569 + <button type="submit" name="do" value="chpasswd" data-icon="ok">$(gettext 'Change password')</button> 21.570 + </div> 21.571 + </footer> 21.572 + </form> 21.573 +</section> 21.574 + 21.575 21.576 <section> 21.577 -<h4>$(gettext 'Add a new user')</h4> 21.578 + <header>$(gettext 'Add a new user')</header> 21.579 21.580 -<form method="get" action=""> 21.581 - <input type="hidden" name="user" /> 21.582 - <table> 21.583 - <tr><td>$(gettext 'User login:')</td> 21.584 - <td><input type="text" name="adduser" size="30" /></td></tr> 21.585 - <tr><td>$(gettext 'User password:')</td> 21.586 - <td><input type="password" name="passwd" size="30" /></td></tr> 21.587 - <tr><td colspan="2"> 21.588 - <input type="submit" value="$(gettext 'Create user')" /></td></tr> 21.589 - </table> 21.590 -</form> 21.591 + <form> 21.592 + <input type="hidden" name="users"/> 21.593 + <table class="summary"> 21.594 + <tr><td>$(gettext 'User login:')</td> 21.595 + <td><input type="text" name="user" size="30" pattern="[a-z]*"/></td></tr> 21.596 + <tr><td>$(gettext 'User name:')</td> 21.597 + <td><input type="text" name="name" size="30"/></td></tr> 21.598 + <tr><td>$(gettext 'User password:')</td> 21.599 + <td><input type="password" name="passwd" size="30"/></td></tr> 21.600 + </table> 21.601 + 21.602 + <footer> 21.603 + <button type="submit" name="do" value="adduser" data-icon="add">$(gettext 'Create user')</button> 21.604 + </footer> 21.605 + </form> 21.606 </section> 21.607 21.608 + 21.609 <section> 21.610 -<h4>$(gettext 'Current user sessions')</h4> 21.611 - 21.612 -<pre>$(who)</pre> 21.613 + <header>$(gettext 'Current user sessions')</header> 21.614 + <pre>$(who)</pre> 21.615 </section> 21.616 21.617 + 21.618 <section> 21.619 -<h4>$(gettext 'Last user sessions')</h4> 21.620 - 21.621 -<pre>$(last)</pre> 21.622 + <header>$(gettext 'Last user sessions')</header> 21.623 + <div class="scroll"><pre>$(last)</pre></div> 21.624 </section> 21.625 EOT 21.626 ;; 21.627 @@ -298,19 +456,25 @@ 21.628 # 21.629 # Choose locale 21.630 # 21.631 - LOADING_MSG="$(gettext 'Please wait...')" 21.632 - loading_msg 21.633 + LOADING_MSG="$(gettext 'Please wait...')"; loading_msg 21.634 + 21.635 cur_loc=$(locale | grep LANG | cut -d= -f2) 21.636 - cat << EOT 21.637 -<h3 id="locale">$(gettext 'Choose locale')</h3> 21.638 + cat <<EOT 21.639 +<h2 id="locale">$(gettext 'Choose locale')</h2> 21.640 21.641 -<p>$(gettext 'Current locale settings:')</p> 21.642 -<pre>$(locale)</pre> 21.643 +<section> 21.644 + <header>$(gettext 'Current locale settings:')</header> 21.645 + <div> 21.646 + <pre>$(locale)</pre> 21.647 + </div> 21.648 +</section> 21.649 21.650 -<p>$(gettext 'Locales that are currently installed on the machine:')</p> 21.651 -<pre>$(locale -a)</pre> 21.652 - 21.653 -<p>$(gettext 'Available locales:')</p> 21.654 +<section> 21.655 + <header>$(gettext 'Locales that are currently installed on the machine:')</header> 21.656 + <div> 21.657 + <pre>$(locale -a)</pre> 21.658 + </div> 21.659 +</section> 21.660 EOT 21.661 21.662 is_installed "glibc-locale" 21.663 @@ -320,49 +484,48 @@ 21.664 <a href='/pkgs.cgi?do=Install&glibc-locale'>install glibc-locale</a> \ 21.665 to see a larger list of available locales.") 21.666 21.667 - cat << EOT 21.668 -<form method="get" action=""> 21.669 - <div class="outbox"> 21.670 - <table class="zebra fixed"> 21.671 - <thead> 21.672 - <tr><td style="width:9em">$(gettext 'Code')</td> 21.673 - <td style="width:10em">$(gettext 'Language')</td> 21.674 - <td style="width:10em">$(gettext 'Territory')</td> 21.675 - <td>$(gettext 'Description')</td> 21.676 - </tr> 21.677 - </thead> 21.678 - </table> 21.679 21.680 - <div style="max-height: 16em; overflow:auto"> 21.681 - <table class="zebra fixed"> 21.682 - <col style="width:9em"> 21.683 - <col style="width:10em"> 21.684 - <col style="width:10em"> 21.685 - <col> 21.686 - <tbody style="max-height:10em; overflow:auto"> 21.687 + cat <<EOT 21.688 +<section> 21.689 + <header>$(gettext 'Available locales:')</header> 21.690 + <form class="wide"> 21.691 + <table class="wide zebra"> 21.692 + <thead> 21.693 + <tr><td>$(gettext 'Code')</td> 21.694 + <td>$(gettext 'Language')</td> 21.695 + <td>$(gettext 'Territory')</td> 21.696 + <td>$(gettext 'Description')</td> 21.697 + </tr> 21.698 + </thead> 21.699 + <tbody> 21.700 EOT 21.701 - for locale in $(find /usr/share/i18n/locales -type f | sort) 21.702 - do 21.703 + for locale in $(find /usr/share/i18n/locales -type f | sort); do 21.704 locale_name=$(basename $locale) 21.705 locale_title=$(grep -m 1 -e '^ *title' $locale | cut -d'"' -f2) 21.706 if [ -n "$locale_title" ]; then 21.707 - sel=""; [ "$locale_name" == "$cur_loc" ] && sel="checked" 21.708 - cat << EOT 21.709 - <tr><td><input type="radio" name="gen_locale" value="$locale_name" $sel />$locale_name</td> 21.710 - <td>$(gettext -d iso_639 "$(grep -m 1 -e '^ *language' $locale | cut -d '"' -f2)")</td> 21.711 - <td>$(gettext -d iso_3166 "$(grep -m 1 -e '^ *territory' $locale | cut -d '"' -f2)")</td> 21.712 - <td>$locale_title</td> 21.713 - </tr> 21.714 + sel=''; [ "$locale_name" == "$cur_loc" ] && sel='checked="checked"' 21.715 + cat <<EOT 21.716 + <tr> 21.717 + <td> 21.718 + <input type="radio" name="gen_locale" value="$locale_name" $sel id="$locale_name"/> 21.719 + <label for="$locale_name">$locale_name</label> 21.720 + </td> 21.721 + <td>$(gettext -d iso_639 "$(grep -m 1 -e '^ *language' $locale | cut -d '"' -f2)")</td> 21.722 + <td>$(gettext -d iso_3166 "$(grep -m 1 -e '^ *territory' $locale | cut -d '"' -f2)")</td> 21.723 + <td>$locale_title</td> 21.724 + </tr> 21.725 EOT 21.726 fi 21.727 done 21.728 - cat << EOT 21.729 - </tbody> 21.730 - </table> 21.731 - </div> 21.732 - </div> 21.733 - <p><input type="submit" value="$(gettext 'Activate')" /></p> 21.734 -</form> 21.735 + cat <<EOT 21.736 + </tbody> 21.737 + </table> 21.738 + 21.739 + <footer> 21.740 + <button type="submit" data-icon="ok">$(gettext 'Activate')</button> 21.741 + </footer> 21.742 + </form> 21.743 +</section> 21.744 EOT 21.745 ;; 21.746 21.747 @@ -371,64 +534,72 @@ 21.748 # 21.749 # Default system settings page 21.750 # 21.751 - cat << EOT 21.752 -<div id="wrapper"> 21.753 - <h2>$(gettext 'System settings')</h2> 21.754 - <p>$(gettext 'Manage system time, users or language settings')<p> 21.755 -</div> 21.756 -<div id="actions"> 21.757 - <a class="button" href="?users"> 21.758 - <img src="$IMAGES/user.png" />$(gettext 'Manage users')</a> 21.759 - <a class="button" href="?groups"> 21.760 - <img src="$IMAGES/users.png" />$(gettext 'Manage groups')</a> 21.761 -</div> 21.762 + list_of 21.763 + cat <<EOT 21.764 +<h2>$(gettext 'System settings')</h2> 21.765 + 21.766 +<p>$(gettext 'Manage system time, users or language settings')<p> 21.767 + 21.768 +<form><!-- 21.769 + --><button name="users" data-icon="user" >$(gettext 'Manage users' )</button><!-- 21.770 + --><button name="groups" data-icon="group">$(gettext 'Manage groups')</button> 21.771 +</form> 21.772 21.773 <section> 21.774 -<h3>$(gettext 'System time')</h3> 21.775 + <header>$(gettext 'System time')</header> 21.776 + <div> 21.777 + <form class="wide"> 21.778 + <fieldset><legend>$(gettext 'Time zone:')</legend> 21.779 + <select name="tz"> 21.780 + $(cd /usr/share/zoneinfo; find * -type f ! -name '*.tab' | sort | \ 21.781 + awk -vtz="$(cat /etc/TZ)" \ 21.782 + '{printf("<option%s>%s</option>", ($1 == tz)?" selected":"", $1)}') 21.783 + </select> 21.784 + <button name="do" value="settz" data-icon="ok">$(gettext 'Change')</button> 21.785 + </fieldset> 21.786 + <fieldset><legend>$(gettext 'System time:')</legend> 21.787 + $(date | sed 's|[0-9][0-9]:[0-9:]*|<span id="time">&</span>|') 21.788 + <button name="do" value="rdate" data-icon="sync">$(gettext 'Sync online')</button> 21.789 + </fieldset> 21.790 + <fieldset><legend>$(gettext 'Hardware clock:')</legend> 21.791 + $(hwclock -ur | sed 's|0.000000 seconds||') 21.792 + <button name="do" value="hwclock" data-icon="clock">$(gettext 'Set hardware clock')</button> 21.793 + </fieldset> 21.794 + <fieldset><legend>$(gettext 'Set date')</legend> 21.795 + <input type="number" name="day" value="$(date +%d)" min="1" max="31" size="4" required/> 21.796 + <select name="month" value="$(date +%m)"> 21.797 + $(for i in $(seq 12); do 21.798 + printf '<option value="%s">%s</option>' $(date -d $i.01-01:01 '+%m %B') 21.799 + done) 21.800 + </select> 21.801 + <input type="number" name="year" value="$(date +%Y)" min="2015" max="2030" size="6" required/> 21.802 + - <input type="number" name="hour" value="$(date +%H)" min="0" max="23" size="4" required/><!-- 21.803 + -->:<input type="number" name="min" value="$(date +%M)" min="0" max="59" size="4" required/><!-- 21.804 + -->:<input type="number" name="sec" value="00" min="0" max="59" size="4" required/> 21.805 + <button name="do" value="date" data-icon="ok">$(gettext 'Set date')</button> 21.806 + </fieldset> 21.807 + </form> 21.808 + </div> 21.809 21.810 -<form method="get" action=""> 21.811 -<table> 21.812 - <tr><td>$(gettext 'Time zone:')</td><td> 21.813 - <select class="button" name="tz"> 21.814 - $(cd /usr/share/zoneinfo ; find * -type f | while read tz; do 21.815 - if [ "$(cat /etc/TZ)" == "$tz" ]; then 21.816 - echo "<option selected>$tz</option>" 21.817 - else 21.818 - echo "<option>$tz</option>" 21.819 - fi 21.820 - done) 21.821 - </select> 21.822 - <input type="submit" name="settz" value="$(gettext 'Change')" /></td></tr> 21.823 - <tr><td>$(gettext 'System time:')</td><td>$(date)</td></tr> 21.824 - <tr><td>$(gettext 'Hardware clock:')</td><td>$(hwclock -r)</tr> 21.825 -</table> 21.826 -</form> 21.827 - 21.828 -<form method="get" action=""> 21.829 - <input type="submit" name="date" value="$(gettext 'Set date')" /> 21.830 - <select class="button" name="day">$(printf '<option>%d</option>' $(seq 31))</select> 21.831 - <select class="button" name="month"> 21.832 - $(for i in $(seq 12); do 21.833 - printf '<option value="%s">%s</option>' $(date -d $i.01-01:01 '+%m %B') 21.834 - done) 21.835 - </select> 21.836 - <select class="button" name="year">$(printf '<option>%d</option>' $(seq 2010 2030))</select> 21.837 -- <select class="button" name="hour">$(printf '<option>%02d</option>' $(seq 0 23))</select> 21.838 -: <select class="button" name="min">$(printf '<option>%02d</option>' $(seq 0 59))</select> 21.839 -: <select class="button" name="sec">$(printf '<option>%02d</option>' $(seq 0 59))</select> 21.840 -</form> 21.841 - 21.842 -<a class="button" href="?rdate">$(gettext 'Sync online')</a> 21.843 -<a class="button" href="?hwclock">$(gettext 'Set hardware clock')</a> 21.844 +<script type="text/javascript"> 21.845 +// Live time on page 21.846 +Date.prototype.timeNow = function() { 21.847 + return ((this.getHours() < 10)?"0":"") + this.getHours() + ":" + ((this.getMinutes() < 10)?"0":"") + this.getMinutes() + ":" + ((this.getSeconds() < 10)?"0":"") + this.getSeconds(); 21.848 +} 21.849 +setInterval(function(){document.getElementById('time').innerText = new Date().timeNow()}, 1000); 21.850 +</script> 21.851 </section> 21.852 EOT 21.853 + 21.854 + 21.855 # 21.856 # Locale settings 21.857 # 21.858 - cat << EOT 21.859 + cat <<EOT 21.860 <section> 21.861 -<h3 id="locale">$(gettext 'System language')</h3> 21.862 -<p> 21.863 + <header id="locale">$(gettext 'System language')</header> 21.864 + <div> 21.865 + <form> 21.866 EOT 21.867 # Check if a new locale was requested 21.868 if [ -n "$new_locale" ]; then 21.869 @@ -441,16 +612,21 @@ 21.870 msg warn "$(eval_gettext \ 21.871 'You must logout and login again to your current session to use $new_locale locale.')" 21.872 else 21.873 - gettext 'Current system locale:'; echo -n " <strong>" 21.874 - locale | grep LANG | cut -d= -f2 21.875 + cat <<EOT 21.876 + $(gettext 'Current system locale:') 21.877 + <strong>$(locale | grep LANG | cut -d= -f2)</strong> 21.878 + <button name="locale" data-icon="locale">$(gettext 'Change')</button> 21.879 +EOT 21.880 fi 21.881 - cat << EOT 21.882 -</strong> <a class="button" href="?locale">$(gettext 'Change')</a></p> 21.883 + cat <<EOT 21.884 + </div> 21.885 + </form> 21.886 </section> 21.887 21.888 + 21.889 <section> 21.890 -<h3 id="keymap">$(gettext 'Console keymap')</h3> 21.891 -<p> 21.892 + <header id="keymap">$(gettext 'Keyboard layout')</header> 21.893 + <div> 21.894 EOT 21.895 # Check if a new keymap was requested 21.896 if [ -n "$new_keymap" ]; then 21.897 @@ -461,15 +637,15 @@ 21.898 loadkmap < /usr/share/kmap/$new_keymap.kmap 21.899 fi 21.900 fi 21.901 + 21.902 keymap=$(cat /etc/keymap.conf) 21.903 eval_gettext 'Current console keymap: $keymap' 21.904 - echo "</p>" 21.905 if [ -n "$keymap" ]; then 21.906 case "$keymap" in 21.907 fr_CH*) 21.908 keymap="ch" ;; 21.909 ru) 21.910 - keymap="us,ru(winkeys)" ;; 21.911 + keymap="us,ru" ;; 21.912 slovene) 21.913 keymap=si ;; 21.914 *) 21.915 @@ -477,55 +653,52 @@ 21.916 keymap=${keymap%-abnt2} ;; 21.917 esac 21.918 keyboard_config=/etc/X11/xorg.conf.d/40-Keyboard.conf 21.919 - cat << EOT 21.920 -<form method="get" action=""> 21.921 - $(gettext 'Suggested keymap for Xorg:') 21.922 - <input type="submit" name "apply_xorg_kbd" value="$keymap" /> 21.923 - <a class="button" href="index.cgi?file=$keyboard_config"> 21.924 - <img src="$IMAGES/edit.png" />$(gettext 'Edit')</a> 21.925 -</form> 21.926 + cat <<EOT 21.927 + <form id="settings"></form> 21.928 + <form id="index" action="index.cgi"></form> 21.929 + <br/> 21.930 + $(gettext 'Suggested keymap for Xorg:') $keymap 21.931 + <button form="settings" name="apply_xorg_kbd" value="$keymap" data-icon="ok">$(gettext 'Activate')</button> 21.932 + <button form="index" name="file" value="$keyboard_config" data-icon="edit">$(gettext 'Edit')</button> 21.933 + <br/> 21.934 EOT 21.935 fi 21.936 - cat << EOT 21.937 -<form method="get" action=""> 21.938 - $(gettext 'Available keymaps:') 21.939 - <select class="button" name="gen_keymap"> 21.940 - $(list_keymaps) 21.941 - </select> 21.942 - <input type="submit" value="$(gettext 'Activate')" /> 21.943 -</form> 21.944 + cat <<EOT 21.945 + <form> 21.946 + $(gettext 'Available keymaps:') 21.947 + <select name="gen_keymap"> 21.948 + $(list_keymaps) 21.949 + </select> 21.950 + <button type="submit" data-icon="ok">$(gettext 'Activate')</button> 21.951 + </form> 21.952 + </div> 21.953 </section> 21.954 21.955 + 21.956 <section> 21.957 -<h2>$(gettext 'Panel configuration')</h2> 21.958 + <header>$(gettext 'Panel configuration')</header> 21.959 + <div> 21.960 + <form class="wide"> 21.961 + <fieldset><legend>$(gettext 'Style:')</legend> 21.962 + <select name="style">$(list_styles)</select> 21.963 + <button data-icon="ok">$(gettext 'Activate')</button> 21.964 + </fieldset> 21.965 21.966 -<form method="get" action=""> 21.967 - <p> 21.968 - $(gettext 'Style:') 21.969 - <select class="button" name="style"> 21.970 - $(list_styles) 21.971 - </select> 21.972 - <input type="submit" value="$(gettext 'Activate')" /> 21.973 + <fieldset><legend>$(gettext 'Panel password:')</legend> 21.974 + <input type="password" name="panel_pass"/> 21.975 + <button data-icon="ok">$(gettext 'Change')</button> 21.976 + </fieldset> 21.977 + </form> 21.978 + 21.979 + <fieldset><legend>$(gettext 'Configuration files:')</legend> 21.980 + <button form="index" name="file" value="$CONFIG" data-icon="edit">$(gettext 'Panel')</button> 21.981 + <button form="index" name="file" value="$HTTPD_CONF" data-icon="edit">$(gettext 'Server')</button> 21.982 + </fieldset> 21.983 + 21.984 + <p>$(gettext 'TazPanel provides a debugging mode and page:') 21.985 + <a href="/index.cgi?debug">debug</a> 21.986 </p> 21.987 -</form> 21.988 -<form method="get" action=""> 21.989 - <p> 21.990 - $(gettext 'Panel password:') 21.991 - <input type="password" name="panel_pass"/> 21.992 - <input type="submit" value="$(gettext 'Change')" /> 21.993 - </p> 21.994 -</form> 21.995 -<p> 21.996 - $(gettext 'Configuration files:') 21.997 - <a class="button" href="index.cgi?file=$CONFIG"> 21.998 - <img src="$IMAGES/edit.png" />$(gettext 'Panel')</a> 21.999 - <a class="button" href="index.cgi?file=$HTTPD_CONF"> 21.1000 - <img src="$IMAGES/edit.png" />$(gettext 'Server')</a> 21.1001 -</p> 21.1002 -<p> 21.1003 - $(gettext 'TazPanel provides a debugging mode and page:') 21.1004 - <a href="/index.cgi?debug">debug</a> 21.1005 -</p> 21.1006 + </div> 21.1007 </section> 21.1008 EOT 21.1009 ;;
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 22.2 +++ b/styles/default/base.css Tue Mar 24 03:39:08 2015 +0200 22.3 @@ -0,0 +1,731 @@ 22.4 +/** 22.5 + * CSS style for TazPanel - (C) 2011-2015 SliTaz GNU/Linux 22.6 + */ 22.7 + 22.8 + 22.9 +/* To always have a scroll bar */ 22.10 +/*html { min-height: 102%; } */ 22.11 + 22.12 +body { color: CaptionText; font: caption; margin: 72px 0 0 0; } 22.13 + 22.14 + 22.15 + 22.16 +/** 22.17 + * Header and main title 22.18 + */ 22.19 + 22.20 +body > header { 22.21 + position: fixed; top: 0; left: 0; 22.22 + /*height: 40px;*/ width: 100%; 22.23 + /*background: #222 url(images/logo.png) no-repeat left; padding-left: 40px;*/ 22.24 + background-color: #222; 22.25 +} 22.26 + 22.27 +body > header h1 { 22.28 + margin: 0; 22.29 + color: #fff; 22.30 + font-size: 20px; line-height: 40px; /* center vertical */ 22.31 + font-style: italic; 22.32 + white-space: nowrap; overflow: hidden; 22.33 + vertical-align: middle; 22.34 +} 22.35 + 22.36 + 22.37 + 22.38 +/** 22.39 + * Toolbar with menu 22.40 + */ 22.41 + 22.42 +nav { 22.43 + position: fixed; top: 40px; left: 0; 22.44 + width: 100%; 22.45 + display: table; 22.46 + border: 1px solid; border-right: none; border-left: none; 22.47 +} 22.48 + 22.49 + 22.50 + 22.51 +/* menu panel */ 22.52 +#toolbarMenu { margin: 0; padding: 0; height: 100%; font: menu; } 22.53 + 22.54 +/* menu items */ 22.55 +#toolbarMenu li { 22.56 + list-style: none; 22.57 + float: left; 22.58 + display: block; 22.59 + padding: 0; 22.60 + color: inherit; background: inherit; 22.61 + cursor: pointer; 22.62 + outline: none; 22.63 +} 22.64 +#toolbarMenu > li > span { 22.65 + display: inline-block; 22.66 + padding: 0.2rem; 22.67 +} 22.68 + 22.69 +#toolbarMenu menu li { 22.70 + padding: 0.2rem; 22.71 +} 22.72 + 22.73 +/* Selected menu item */ 22.74 +#toolbarMenu li:focus span, 22.75 +#toolbarMenu li:hover span, 22.76 +#toolbarMenu menu li:focus, 22.77 +#toolbarMenu menu li:hover { 22.78 + background-color: hsla(30, 100%, 50%, 0.5); 22.79 +} 22.80 + 22.81 + 22.82 + 22.83 + 22.84 +#toolbarMenu menu { 22.85 + position: absolute; 22.86 + margin: 0; padding: 0; 22.87 + white-space: nowrap; 22.88 + border: 1px solid; 22.89 + display: none; 22.90 +} 22.91 + 22.92 +/* Submenus */ 22.93 +#toolbarMenu menu menu { 22.94 + left: 100%; top: 0; 22.95 + min-width: 100%; 22.96 +} 22.97 + 22.98 +/* Show menu list */ 22.99 +#toolbarMenu menu.opened { 22.100 + display: block; z-index: 10; 22.101 +} 22.102 + 22.103 +/* By default hide submenus */ 22.104 +#toolbarMenu menu.opened menu { 22.105 + display: none; 22.106 +} 22.107 +/* Show submenu on mouse over */ 22.108 +.opened li:hover menu { display: block !important; } 22.109 + 22.110 +/* Menu items one below the other */ 22.111 +#toolbarMenu menu li { 22.112 + position: relative; 22.113 + float: none; 22.114 +} 22.115 +/* Show arrow for submenu */ 22.116 +#toolbarMenu a:after { content: "‣"; float: right; } 22.117 +#toolbarMenu a:only-child:after { content: " "; } 22.118 + 22.119 +#toolbarMenu a { display: block; color: inherit; text-decoration: none; } 22.120 + 22.121 +#noMenu { 22.122 + position: fixed; 22.123 + background-color: transparent; /*hsla(40, 100%, 60%, 0.5);*/ 22.124 + display: none; 22.125 + height: 100%; width: 100%; 22.126 +} 22.127 + 22.128 + 22.129 +/** 22.130 + * Panes, sections 22.131 + */ 22.132 + 22.133 +section { 22.134 + display: block; 22.135 + border: 1pt solid; border-radius: 0.3rem; 22.136 + padding: 0; margin: 0.5rem 0 0 0; 22.137 +} 22.138 + 22.139 +section header { 22.140 + padding: 0.2rem 0.3rem; margin: 0; 22.141 + display: table; width: 100%; 22.142 + border-radius: 0.3rem 0.3rem 0 0; 22.143 + font-weight: bold; font-size: 1.1rem;/* line-height: 0;*/ 22.144 + text-shadow: 0 1px 1px hsla(0, 0%, 0%, 0.5); 22.145 + overflow: auto; /* provide break after floated objects */ 22.146 + vertical-align: baseline; 22.147 +} 22.148 +section header form, section footer form { 22.149 + display: table-cell; vertical-align: baseline; line-height: 0; width: 1px; white-space: nowrap; 22.150 +} 22.151 +section header button, section footer button { margin: 0; } 22.152 + 22.153 +section footer { 22.154 + padding: 0 0.3rem 0.2rem; margin: 0; 22.155 + display: block; 22.156 + overflow: auto; /* provide break after floated objects */ 22.157 + vertical-align: baseline; 22.158 +} 22.159 + 22.160 +section > pre, 22.161 +section div { padding: 0.3rem 0.3rem 0.2rem 0.3rem; margin: 0; } 22.162 +section td:nth-child(1) { padding-left: 0.3rem; } 22.163 +section table { margin-bottom: 0.3rem; } 22.164 +.nogap { word-spacing: 0; } /* remove gap between buttons in line */ 22.165 + 22.166 + 22.167 + 22.168 + 22.169 + 22.170 + 22.171 + 22.172 + 22.173 + 22.174 + 22.175 +#actions { 22.176 + display: block; 22.177 + margin: 0; padding: 0.2rem 0.3rem; 22.178 + overflow: auto; /* provide break after floated objects */ 22.179 +} 22.180 +.float-left, .float-right { display: table-cell; padding: 0; margin: 0; } 22.181 +.float-left { float: left; } 22.182 +.float-right { float: right; } 22.183 + 22.184 + 22.185 + 22.186 + fieldset { border: 1pt solid; border-radius: 0.3rem; margin-bottom: 0.2rem; } 22.187 + 22.188 + 22.189 + 22.190 + 22.191 + 22.192 + 22.193 +/* Icons on the right of the toolbar */ 22.194 +#icons { 22.195 + display: table-cell; vertical-align: middle; /* center vertical */ 22.196 + padding: 0.1rem 0.3rem; 22.197 + white-space: nowrap; width: 1rem; /* minimal width */ 22.198 +} 22.199 +#icons img { vertical-align: middle; } 22.200 + 22.201 + 22.202 + 22.203 +/* Loading notification bar */ 22.204 +#loading { 22.205 + position: fixed; top: 76px; right: 140px; width: 248px; 22.206 + padding: 4px 4px 2px; 22.207 + background-color: #f8f8f8; color: #666; 22.208 + border: 1px solid #ddd; 22.209 + cursor: progress; 22.210 +} 22.211 + 22.212 + 22.213 + 22.214 +/* Page content container */ 22.215 +#content { margin: 1ex; } 22.216 + 22.217 + 22.218 +/* Page first header */ 22.219 +h2 { font-size: 1.5rem; padding: 0.5rem 0 0 0; margin: 0; } 22.220 + 22.221 + 22.222 +/* Additional headers (obsolete) */ 22.223 +h3 { font-size: 1.3rem; margin: 0; } 22.224 +h4 { font-size: 1.1rem; margin: 0; } 22.225 + 22.226 + 22.227 +/* Plain paragraph */ 22.228 +p { margin: 1ex 0; } 22.229 + 22.230 + 22.231 +#actions p { margin: 6px 0; } 22.232 + 22.233 + 22.234 + 22.235 + 22.236 + 22.237 +button img { padding: 0 3px 0 0; margin: 0; } 22.238 +button, input, select { 22.239 + /*color: ButtonText;*/ 22.240 + vertical-align: middle; } 22.241 +button:before, input:before, select:before { 22.242 + padding: 3px; } 22.243 + 22.244 +ul { list-style-type: square; } 22.245 +li { padding: 4px 0; } 22.246 + 22.247 + 22.248 +/* Blocks */ 22.249 + 22.250 +#block { float: left; } 22.251 + 22.252 +#wrapper, .wrapper { margin: 20px 0; } 22.253 + 22.254 +.box { 22.255 + margin: 10px 0; 22.256 + padding: 12px; 22.257 + background: #f8f8f8; 22.258 + border: 1px solid #ddd; 22.259 +} 22.260 + 22.261 +.box ul { list-style-type: none; padding: 0; } 22.262 + 22.263 +.debug { 22.264 + position: fixed; 22.265 + bottom: 0px; 22.266 + right: 10px; 22.267 + left: 10px; 22.268 + margin: 5px; 22.269 + padding: 4px 10px; 22.270 + background-color: #111; 22.271 + color: #fff; 22.272 + border: 0; 22.273 + /*font-size: 12px;*/ 22.274 + opacity: 0.9; 22.275 +} 22.276 + 22.277 + 22.278 + 22.279 + 22.280 +/********** 22.281 + * Tables * 22.282 + **********/ 22.283 + 22.284 +/* Base style */ 22.285 +table { margin: 0; padding: 0; border: 0 none; border-collapse: collapse; } 22.286 + 22.287 +/* Bold header */ 22.288 +thead { font-weight: bold; } 22.289 + 22.290 +/* Wide table */ 22.291 +.wide { width: 100%; } 22.292 + 22.293 +/* Center content excluding first column */ 22.294 +.center tr td { text-align: center; } 22.295 +.center tr td:nth-child(1) { text-align: left; padding-left: 0.3rem; } 22.296 + 22.297 +/* Table Zebra */ 22.298 +.zebra thead td { line-height: 1.5em; text-align: center; vertical-align: middle; border: 1pt solid; } 22.299 + 22.300 + 22.301 + 22.302 +.borders.zebra td + td { border-left: 1px solid; } 22.303 + 22.304 + 22.305 + 22.306 +.outbox { box-shadow: 0 0 2px 4px #ddd; } 22.307 +.fixed { table-layout: fixed; } 22.308 + 22.309 + 22.310 +.borders tr { border-bottom: 1pt solid; } 22.311 + 22.312 +.hborders thead tr { border-top: 1.5pt solid; border-bottom: 1.5pt solid; } 22.313 + 22.314 +td.small { min-width: 60px; } 22.315 +td.pct { min-width: 200px; background: #eee; } 22.316 +div.pct { background: #ccc; } 22.317 +td.pct, div.pct { border-radius: 2px; } 22.318 +td img {vertical-align: middle; } 22.319 + 22.320 +table.daemons td:nth-child(4), table.daemons td:nth-child(5) { text-align: center; } 22.321 + 22.322 + 22.323 + 22.324 + 22.325 + 22.326 +/* Misc */ 22.327 + 22.328 +a { text-decoration: none; color: #268bd2; cursor: pointer; } 22.329 +a:not([data-img]):hover { text-decoration: underline; } 22.330 + 22.331 + 22.332 +form { display: inline-block; padding: 0; margin: 0; } 22.333 + 22.334 +pre { margin: 0; padding: 0; color: CaptionText; } 22.335 + 22.336 +.pre-main { margin: 16px 0; } 22.337 + 22.338 +.scroll { height: 12rem; overflow: auto; border: 1px solid; } 22.339 +.scroll table { border: 0px solid #fff; } 22.340 + 22.341 + 22.342 +/* Round corner */ 22.343 + 22.344 +#loading, .debug, .box, div.scroll, .outbox, section { 22.345 + -moz-border-radius: 4px; 22.346 + -webkit-border-radius: 4px; 22.347 + border-radius: 4px; 22.348 +} 22.349 + 22.350 +/* Help page */ 22.351 + 22.352 +#help { text-align: justify; } 22.353 +#help a { text-decoration: underline; } 22.354 +#help a:hover { text-decoration: none; } 22.355 + 22.356 + 22.357 + 22.358 +/* 22.359 + * Page footer 22.360 + */ 22.361 + 22.362 +body > footer { 22.363 + border-top: 1px solid; 22.364 + text-align: center; 22.365 + padding: 0.5em; 22.366 + font-size: smaller; 22.367 +} 22.368 + 22.369 + 22.370 +/*************** 22.371 + * HTML5 Meter * 22.372 + ***************/ 22.373 + 22.374 +.meter { 22.375 + height: 1.2rem; 22.376 + min-width: 150px; 22.377 + color: #222; 22.378 + /*cursor: default;*/ 22.379 +} 22.380 +.meter meter { 22.381 + height: inherit; 22.382 + width: 100%; 22.383 + display: block; 22.384 + border: 1px solid #ddd; 22.385 + border-radius: 4px; 22.386 +} 22.387 +.meter span { 22.388 + display: block; 22.389 + white-space: nowrap; 22.390 + position: absolute; 22.391 + margin: -1.1rem auto 0 0.3rem; 22.392 +} 22.393 + 22.394 + 22.395 + 22.396 +/************** 22.397 + * Animations * 22.398 + **************/ 22.399 + 22.400 +a.button { 22.401 + -webkit-transition: all 0.3s ease-in-out; 22.402 + -moz-transition: all 0.3s ease-in-out; 22.403 + -o-transition: all 0.3s ease-in-out; 22.404 + -ms-transition: all 0.3s ease-in-out; 22.405 + transition: all 0.3s ease-in-out; 22.406 +} 22.407 + 22.408 +/*section { 22.409 + margin: 20pt -0.7em; 22.410 + padding: 0.8em 0.7em 1.2em; 22.411 + background-color: #fdfdfd; 22.412 + border: 1px solid #ddd; 22.413 + border-radius: 1em; 22.414 + box-shadow: 0 0 3pt 2pt #eee; 22.415 +} 22.416 +section h4 { 22.417 + margin: 0 0 0.5em 0; 22.418 +} 22.419 +section h3 { 22.420 + margin: 0 0 0.5em 0; } 22.421 +*/ 22.422 + 22.423 +#tabs { 22.424 + font-weight: bold; 22.425 + /*font-size: 14px;*/ 22.426 + list-style-type: none; 22.427 + padding-bottom: 25px; 22.428 + border-bottom: 1px solid #aaa; 22.429 +} 22.430 + 22.431 +#tabs li { 22.432 + float: left; 22.433 + height: 16px; 22.434 + background-color: #eee; 22.435 + margin: 0 40px 0 -40px; 22.436 + border: 1px solid #aaa; 22.437 + text-align: center; 22.438 + min-width: 100px; 22.439 + -webkit-border-radius: 4px 4px 0 0; 22.440 + -moz-border-radius: 4px 4px 0 0; 22.441 + border-radius: 4px 4px 0 0; 22.442 + -webkit-appearance: tab; 22.443 + appearance: tab; 22.444 +} 22.445 + 22.446 +#tabs li.active { 22.447 + border-bottom: 1px solid #fff; 22.448 + background-color: #fff; 22.449 +} 22.450 + 22.451 +#tabs a { 22.452 + padding: 8px; 22.453 +} 22.454 + 22.455 + 22.456 + 22.457 +/**************** 22.458 + * Search block * 22.459 + ****************/ 22.460 +.search { 22.461 + display: block; white-space: nowrap; 22.462 + position: fixed; right: 7px; top: 7px; 22.463 + margin: 0; padding: 0; border: none; 22.464 +} 22.465 +.search input { 22.466 + display: inline-block; 22.467 + width: 200px; height: 24px; 22.468 +} 22.469 +.search button { 22.470 + -webkit-appearance: button; 22.471 + height: 100%; margin: 0; 22.472 +} 22.473 + 22.474 + 22.475 + 22.476 +/********************** 22.477 + * Buttons with icons * 22.478 + **********************/ 22.479 +@font-face { 22.480 + font-family: TazPanelWeb; 22.481 + src: url('/styles/default/tazpanel.ttf'); 22.482 +} 22.483 + 22.484 +[data-icon]:before, [data-img] { 22.485 + vertical-align: baseline; 22.486 + padding: 0; 22.487 + margin: 0 /*0 0 -0.5em*/; 22.488 + font-size: 1.2em; 22.489 + font-family: TazPanel, TazPanelWeb; 22.490 + 22.491 + font-style: normal; 22.492 + font-weight: normal; 22.493 + font-variant: normal; 22.494 + text-transform: none; 22.495 + line-height: 1.2em; 22.496 + display: inline-block; 22.497 + text-decoration: none; 22.498 + width: 1.2em; text-align: center; 22.499 + 22.500 + -webkit-font-feature-settings: "liga", "dlig"; 22.501 + -moz-font-feature-settings: "liga=1, dlig=1"; 22.502 + -o-font-feature-settings: "liga", "dlig"; 22.503 + font-feature-settings: "liga", "dlig"; 22.504 + 22.505 + -webkit-text-rendering: optimizeLegibility; 22.506 + -moz-text-rendering: optimizeLegibility; 22.507 + -o-text-rendering: optimizeLegibility; 22.508 + text-rendering: optimizeLegibility; 22.509 + 22.510 + -webkit-font-smoothing: antialiased; 22.511 + -moz-font-smoothing: antialiased; 22.512 + -o-font-smoothing: antialiased; 22.513 + font-smoothing: antialiased; 22.514 +} 22.515 +button[data-icon]::before { font-size: 16px; line-height: 16px; width: 16px; } 22.516 + 22.517 +[data-icon]::before { content: attr(data-icon); } 22.518 +[data-img]::before { content: attr(data-img); } 22.519 + 22.520 +[data-icon], [data-img] { display: inline-block; } 22.521 + 22.522 + 22.523 +/* Solarized: 22.524 + red #dc322f 22.525 + orange #cb4b16 22.526 + yellow #b58900 22.527 + green #859900 22.528 + cyan #2aa198 22.529 + blue #268bd2 22.530 + magenta #d33682 22.531 +*/ 22.532 + 22.533 + 22.534 +[data-icon="tazpanel"]::before { 22.535 + display: inline-block; 22.536 + content: '\f13d'; 22.537 + color: #EBEBEB; 22.538 + border: 1pt solid hsl(5, 85%, 35%); border-radius: 0.2rem; 22.539 + font-size: 32px; line-height: 32px; 22.540 + 22.541 + height: 32px; width: 32px; 22.542 + margin: 0.2rem; 22.543 + padding: 0; 22.544 + vertical-align: top; 22.545 + background-image: -webkit-linear-gradient(top, hsl(10, 100%, 40%), hsl(0, 70%, 30%)); 22.546 +} 22.547 +.light [data-icon="tazpanel"]::before { 22.548 + text-shadow: 0 1pt 2pt hsla(0, 0%, 0%, 0.9), 0 0 2pt hsla(0, 0%, 0%, 0.6); 22.549 +} 22.550 + 22.551 + 22.552 + 22.553 +/******************* 22.554 + * Terminal colors * 22.555 + *******************/ 22.556 + 22.557 +/* Using color palettes from Sakura terminal source */ 22.558 + 22.559 +.term { 22.560 + padding: 0.3rem; 22.561 + height: 24rem; max-height: 24rem; 22.562 + white-space: pre-wrap; 22.563 + overflow: auto; 22.564 + z-index: 4; 22.565 + background: transparent; 22.566 +} 22.567 + 22.568 +/* SliTaz Spider on background */ 22.569 +/*.term_ { display: block; position: relative; z-index: 2; } 22.570 +.term_::after { 22.571 + display: block; border: 1pt solid; 22.572 + font-family: TazPanel; 22.573 + font-size: 16rem; 22.574 + position: absolute; right: 0; bottom: 0; 22.575 + content: '\f13f'; 22.576 + opacity: 1; 22.577 + color: orange; 22.578 + z-index: 1; 22.579 +}*/ 22.580 + 22.581 +.term.log { white-space: pre; } 22.582 +/*.term input[type="text"] { 22.583 + width: 100%!important; padding: 0; margin: 0; vertical-align: middle; 22.584 + -webkit-appearance: none!important; -moz-appearance: none; appearance: none; 22.585 + display: inline; 22.586 + background-color: transparent; color: inherit; border: none; outline: none; 22.587 + font: inherit; line-height: 1rem; 22.588 +}*/ 22.589 +.term .cmdline { 22.590 + /*position: relative; float: left; display: inline-block; white-space: pre-wrap; 22.591 + width: 100%; overflow: hidden; left: 0; 22.592 + vertical-align: middle;*/ 22.593 + padding: 0; 22.594 +} 22.595 +#typeField { 22.596 + outline-style: none !important; 22.597 + -webkit-user-modify: read-write; 22.598 + word-wrap: break-word; 22.599 + -webkit-nbsp-mode: space; 22.600 + -webkit-line-break: after-white-space; 22.601 +} 22.602 +#num_hist { 22.603 + display: inline-block; 22.604 + position: absolute; right: 0.5rem; float: right; 22.605 + height: 0; 22.606 + color: #FFF; background: #FFF; 22.607 +} 22.608 + 22.609 +/* Tango palette (default) */ 22.610 +.color30{color:#2E3436} .color1.color30{color:#555753} .color40{background:#2E3436} 22.611 +.color31{color:#CC0000} .color1.color31{color:#EF2929} .color41{background:#CC0000} 22.612 +.color32{color:#4E9A06} .color1.color32{color:#8AE234} .color42{background:#4E9A06} 22.613 +.color33{color:#C4A000} .color1.color33{color:#FCE94F} .color43{background:#C4A000} 22.614 +.color34{color:#3465A4} .color1.color34{color:#729FCF} .color44{background:#3465A4} 22.615 +.color35{color:#75507B} .color1.color35{color:#AD7FA8} .color45{background:#75507B} 22.616 +.color36{color:#06989A} .color1.color36{color:#34E2E2} .color46{background:#06989A} 22.617 +.color37{color:#D3D7CF} .color1.color37{color:#EEEEEC} .color47{background:#D3D7CF} 22.618 +.term {color:#D3D7CF; background:#2E3436} 22.619 + 22.620 +/* Linux palette */ 22.621 +.linux .color30{color:#000} .linux .color1.color30{color:#555} .linux .color40{background:#000} 22.622 +.linux .color31{color:#A00} .linux .color1.color31{color:#F55} .linux .color41{background:#A00} 22.623 +.linux .color32{color:#0A0} .linux .color1.color32{color:#5F5} .linux .color42{background:#0A0} 22.624 +.linux .color33{color:#A50} .linux .color1.color33{color:#FF5} .linux .color43{background:#A50} 22.625 +.linux .color34{color:#00A} .linux .color1.color34{color:#55F} .linux .color44{background:#00A} 22.626 +.linux .color35{color:#A0A} .linux .color1.color35{color:#F5F} .linux .color45{background:#A0A} 22.627 +.linux .color36{color:#0AA} .linux .color1.color36{color:#5FF} .linux .color46{background:#0AA} 22.628 +.linux .color37{color:#AAA} .linux .color1.color37{color:#FFF} .linux .color47{background:#AAA} 22.629 +.linux.term {color:#AAA; background:#000} 22.630 + 22.631 +/* Xterm palette */ 22.632 +.xterm .color30{color:#000000} .xterm .color1.color30{color:#4C4C4C} .xterm .color40{background:#000000} 22.633 +.xterm .color31{color:#CD0000} .xterm .color1.color31{color:#FF0000} .xterm .color41{background:#CD0000} 22.634 +.xterm .color32{color:#00CD00} .xterm .color1.color32{color:#00FFFF} .xterm .color42{background:#00CD00} 22.635 +.xterm .color33{color:#CDCD00} .xterm .color1.color33{color:#FFFF00} .xterm .color43{background:#CDCD00} 22.636 +.xterm .color34{color:#1E90FF} .xterm .color1.color34{color:#4682B4} .xterm .color44{background:#1E90FF} 22.637 +.xterm .color35{color:#CD00CD} .xterm .color1.color35{color:#FF00FF} .xterm .color45{background:#CD00CD} 22.638 +.xterm .color36{color:#00CDCD} .xterm .color1.color36{color:#00FFFF} .xterm .color46{background:#00CDCD} 22.639 +.xterm .color37{color:#E5E5E5} .xterm .color1.color37{color:#FFFFFF} .xterm .color47{background:#E5E5E5} 22.640 +.xterm.term {color:#E5E5E5; background:#000000} 22.641 + 22.642 +/* Rxvt palette */ 22.643 +.rxvt .color30{color:#000000} .rxvt .color1.color30{color:#404040} .rxvt .color40{background:#000000} 22.644 +.rxvt .color31{color:#CD0000} .rxvt .color1.color31{color:#FF0000} .rxvt .color41{background:#CD0000} 22.645 +.rxvt .color32{color:#00CD00} .rxvt .color1.color32{color:#00FFFF} .rxvt .color42{background:#00CD00} 22.646 +.rxvt .color33{color:#CDCD00} .rxvt .color1.color33{color:#FFFF00} .rxvt .color43{background:#CDCD00} 22.647 +.rxvt .color34{color:#0000CD} .rxvt .color1.color34{color:#0000FF} .rxvt .color44{background:#0000CD} 22.648 +.rxvt .color35{color:#CD00CD} .rxvt .color1.color35{color:#FF00FF} .rxvt .color45{background:#CD00CD} 22.649 +.rxvt .color36{color:#00CDCD} .rxvt .color1.color36{color:#00FFFF} .rxvt .color46{background:#00CDCD} 22.650 +.rxvt .color37{color:#FAEBD7} .rxvt .color1.color37{color:#FFFFFF} .rxvt .color47{background:#FAEBD7} 22.651 +.rxvt.term {color:#FAEBD7; background:#000000} 22.652 + 22.653 +/* Echo palette (http://mso-chronicles.blogspot.com/2013/02/xfce-terminal-and-xchat-colour-scheme.html) */ 22.654 +.echo .color30{color:#000000} .echo .color1.color30{color:#5E5E5E} .echo .color40{background:#000000} 22.655 +.echo .color31{color:#B40000} .echo .color1.color31{color:#FF5200} .echo .color41{background:#B40000} 22.656 +.echo .color32{color:#00AA00} .echo .color1.color32{color:#93DA00} .echo .color42{background:#00AA00} 22.657 +.echo .color33{color:#CB7C00} .echo .color1.color33{color:#FFE139} .echo .color43{background:#CB7C00} 22.658 +.echo .color34{color:#003F68} .echo .color1.color34{color:#0073A2} .echo .color44{background:#003F68} 22.659 +.echo .color35{color:#BF00EF} .echo .color1.color35{color:#DB81FF} .echo .color45{background:#BF00EF} 22.660 +.echo .color36{color:#00A6D0} .echo .color1.color36{color:#81E3FF} .echo .color46{background:#00A6D0} 22.661 +.echo .color37{color:#C6C6C6} .echo .color1.color37{color:#FFFFFF} .echo .color47{background:#C6C6C6} 22.662 +.echo.term {color:#C6C6C6; background:#000000} 22.663 + 22.664 +.color1 { font-weight: bold; } 22.665 + 22.666 +/* History table for terminal */ 22.667 +.history { width: 100%; } 22.668 +.history td:nth-child(1), .history td:nth-child(2), .history td:nth-child(3) { 22.669 + white-space: nowrap; 22.670 + width: 1px; 22.671 +} 22.672 + 22.673 + 22.674 + 22.675 +/********** 22.676 + * Inputs * 22.677 + **********/ 22.678 + 22.679 +:default { outline: 1px dotted hsla(240, 100%, 50%, 0.5); outline-offset: -4px; } 22.680 +:required { outline: 1px solid hsla( 30, 100%, 50%, 0.7); outline-offset: -3px; } 22.681 +:invalid { outline: 2px solid hsla( 0, 100%, 50%, 0.7); outline-offset: -3px; } 22.682 + 22.683 + 22.684 +/* HACK for Tazweb (as clean Webkit browser): remove 1px white border around textfield */ 22.685 +input[type="text"], input[type="password"], input[type="number"], textarea { -webkit-appearance: searchfield; } 22.686 + 22.687 +textarea { display: block; color: CaptionText; font-family: monospace; box-sizing: border-box; } 22.688 + 22.689 + 22.690 + 22.691 + 22.692 + 22.693 +/*********************** 22.694 + * System memory gauge * 22.695 + ***********************/ 22.696 + 22.697 +.sysmem { 22.698 + margin: 0.2rem; padding: 0; 22.699 + border: 1pt solid; 22.700 + border-radius: 0.2rem; 22.701 + box-shadow: inset 0 0 0 1pt hsla(0, 0%, 100%, 0.05); 22.702 + width: 100%; margin: 0; padding: 0; 22.703 +} 22.704 + 22.705 +.sysmem_used, .sysmem_buff, .sysmem_free { 22.706 + display: inline-block; 22.707 + padding: 0.2rem 0; margin: 0; 22.708 + height: 120%; 22.709 + text-align: center; vertical-align: middle; 22.710 + text-shadow: 0 1px 1px hsla(0, 0%, 0%, 0.5); 22.711 + text-align: center; 22.712 +} 22.713 + 22.714 +.sysmem_used { 22.715 + background-color: #f28f68; 22.716 + background-image: -webkit-linear-gradient(top, hsla(0, 0%, 100%, 0.25), hsla(0, 0%, 0%, 0.2)); 22.717 + border-radius: 0.2rem 0 0 0.2rem; 22.718 +} 22.719 +.sysmem_buff { 22.720 + background-color: #f28f68; 22.721 + background-image: 22.722 + -webkit-linear-gradient(top, hsla(0, 0%, 100%, 0.25), hsla(0, 0%, 0%, 0.2)), 22.723 + -webkit-linear-gradient(135deg, 22.724 + transparent, transparent 25%, 22.725 + #719fd1 25%, #719fd1 50%, 22.726 + transparent 50%, transparent 75%, 22.727 + #719fd1 75%); 22.728 + background-size: 100% 100%; 22.729 +} 22.730 +.sysmem_free { 22.731 + background-color: #719fd1; 22.732 + background-image: -webkit-linear-gradient(top, hsla(0, 0%, 100%, 0.25), hsla(0, 0%, 0%, 0.2)); 22.733 + border-radius: 0 0.2rem 0.2rem 0; 22.734 +}
23.1 --- a/styles/default/footer.html Mon Mar 23 21:17:06 2015 +0100 23.2 +++ b/styles/default/footer.html Tue Mar 24 03:39:08 2015 +0200 23.3 @@ -4,13 +4,14 @@ 23.4 </div> 23.5 23.6 <footer> 23.7 - $(gettext 'Copyright') © $(date +%Y) 23.8 - <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a> 23.9 - - <a href="/index.cgi?file=/usr/share/licenses/bsd.txt">$(gettext 'BSD License')</a> 23.10 + $(gettext 'Copyright') © 2015 23.11 + <a href="http://www.slitaz.org/" target="_blank">SliTaz GNU/Linux</a> 23.12 + - <a href="index.cgi?file=/usr/share/licenses/bsd.txt">$(gettext 'BSD License')</a> 23.13 </footer> 23.14 23.15 <script type="text/javascript"> 23.16 window.onbeforeunload = null; 23.17 + dupTableHead(); 23.18 </script> 23.19 </body> 23.20 </html>
24.1 --- a/styles/default/header.html Mon Mar 23 21:17:06 2015 +0100 24.2 +++ b/styles/default/header.html Tue Mar 24 03:39:08 2015 +0200 24.3 @@ -3,91 +3,85 @@ 24.4 <html lang="${LANG%%_*}"> 24.5 <head> 24.6 <title>$TITLE</title> 24.7 - <link rel="shortcut icon" href="/styles/$STYLE/favicon.ico" /> 24.8 -$(printf '\t<link rel="stylesheet" type="text/css" href="/%s" />\n' \ 24.9 - $(cd /var/www/tazpanel; ls styles/$STYLE/*.css)) 24.10 - 24.11 - <script type="text/javascript"> 24.12 - function hideLoading(){document.getElementById("loading").style.display='none';} 24.13 - window.onbeforeunload = confirmExit; 24.14 - function confirmExit(){return "$(_ 'Confirm break')";} 24.15 - </script> 24.16 + <link rel="shortcut icon" href="/styles/$STYLE/favicon.ico"/> 24.17 +$(printf '\t<link rel="stylesheet" type="text/css" href="/%s"/>\n' $(cd /var/www/tazpanel; ls styles/$STYLE/*.css)) 24.18 +$(printf '\t<script type="text/javascript" src="/%s"></script>\n' $(cd /var/www/tazpanel; ls lib/*.js)) 24.19 </head> 24.20 -<body onload="hideLoading()"> 24.21 +<body> 24.22 +<script type="text/javascript">setColorTheme(); setBaseFont();</script> 24.23 24.24 <header> 24.25 - <h1>$TITLE</h1> 24.26 + <h1 data-icon="tazpanel">$TITLE</h1> 24.27 </header> 24.28 24.29 -<div id="toolbar"> 24.30 - <div id="icons"> 24.31 - <a href="/help.cgi"> 24.32 - <img src="/styles/$STYLE/images/help.png" alt="Help" /></a> 24.33 - </div> 24.34 - <ul id="menu"> 24.35 - <li><a href="/">$(gettext 'Panel')</a> 24.36 - <ul> 24.37 - <li><a href="/index.cgi?terminal"><img 24.38 - src="/styles/$STYLE/images/terminal.png" />$(gettext 'Terminal')</a></li> 24.39 - <li><a href="/index.cgi?top"><img 24.40 - src="/styles/$STYLE/images/monitor.png" />$(gettext 'Processes')</a></li> 24.41 - <li><a href="/index.cgi?report"><img 24.42 - src="/styles/$STYLE/images/text.png" />$(gettext 'Create Report')</a></li> 24.43 - $(for i in menu.d/panel/* ; do [ -f $i ] && sh $i menu $i ; done) 24.44 - </ul> 24.45 - </li> 24.46 - <li><a href="/network.cgi">$(gettext 'Network')</a> 24.47 - <ul> 24.48 - <li><a href="/index.cgi?file=/etc/network.conf"><img 24.49 - src="/styles/$STYLE/images/edit.png" />$(gettext 'Config file')</a></li> 24.50 - <li><a href="/network.cgi?eth"><img 24.51 - src="/styles/$STYLE/images/ethernet.png" />$(gettext 'Ethernet')</a></li> 24.52 - <li><a href="/network.cgi?wifi"><img 24.53 - src="/styles/$STYLE/images/wireless.png" />$(gettext 'Wireless')</a></li> 24.54 - $(for i in menu.d/network/* ; do [ -f $i ] && sh $i menu $i ; done) 24.55 - </ul> 24.56 - </li> 24.57 - <li><a href="/settings.cgi">$(gettext 'Settings')</a> 24.58 - <ul> 24.59 - <li><a href="/settings.cgi?users"><img 24.60 - src="/styles/$STYLE/images/user.png" />$(gettext 'Users')</a></li> 24.61 - <li><a href="/settings.cgi?groups"><img 24.62 - src="/styles/$STYLE/images/users.png" />$(gettext 'Groups')</a></li> 24.63 - $(for i in menu.d/settings/* ; do [ -f $i ] && sh $i menu $i ; done) 24.64 - </ul> 24.65 - </li> 24.66 - <li><a href="/boot.cgi">$(gettext 'Boot')</a> 24.67 - <ul> 24.68 - <li><a href="/boot.cgi?grub"><img 24.69 - src="/styles/$STYLE/images/tux.png" />$(gettext 'Boot loader')</a></li> 24.70 - <li><a href="/boot.cgi?log"><img 24.71 - src="/styles/$STYLE/images/text.png" />$(gettext 'Boot logs')</a> 24.72 - <ul> 24.73 - <li><a href="/boot.cgi?log=kernel">$(gettext 'Kernel messages')</a> 24.74 - <li><a href="/boot.cgi?log=boot">$(gettext 'Boot scripts')</a> 24.75 - <li><a href="/boot.cgi?log=xlog">$(gettext 'X server')</a> 24.76 - <li><a href="/boot.cgi?log=slim">$(gettext 'X session')</a> 24.77 - </ul> 24.78 - </li> 24.79 - <li><a href="/boot.cgi?daemons"><img 24.80 - src="/styles/$STYLE/images/recharge.png" />$(gettext 'Manage daemons')</a></li> 24.81 - $(for i in menu.d/boot/* ; do [ -f $i ] && sh $i menu $i ; done) 24.82 - </ul> 24.83 - </li> 24.84 - <li><a href="/hardware.cgi">$(gettext 'Hardware')</a> 24.85 - <ul> 24.86 - <li><a href="/hardware.cgi?modules"><img 24.87 - src="/styles/$STYLE/images/tux.png" />$(gettext 'Kernel modules')</a></li> 24.88 - <li><a href="/hardware.cgi?detect"><img 24.89 - src="/styles/$STYLE/images/monitor.png" />$(gettext 'Detect PCI/USB')</a></li> 24.90 - <li><a href="/hardware.cgi#disk"><img 24.91 - src="/styles/$STYLE/images/harddisk.png" />$(gettext 'Disks')</a></li> 24.92 - $(for i in menu.d/hardware/* ; do [ -f $i ] && sh $i menu $i ; done) 24.93 - </ul> 24.94 - </li> 24.95 - $(for i in menu.d/* ; do [ -f $i ] && sh $i menu $i ; done) 24.96 - </ul> 24.97 -</div> 24.98 +<nav id="toolbar"> 24.99 + <menu type="toolbar" id="toolbarMenu"> 24.100 + <li tabindex="1"> 24.101 + <span>$(gettext 'Panel')</span> 24.102 + <menu> 24.103 + <li><a data-icon="info" href="/">$(gettext 'Summary')</a></li> 24.104 + <li><a data-icon="terminal" href="/index.cgi?cmd=help">$(gettext 'Terminal')</a></li> 24.105 + <li><a data-icon="proc" href="/index.cgi?top">$(gettext 'Processes')</a></li> 24.106 + <li><a data-icon="report" href="/index.cgi?report">$(gettext 'Create Report')</a></li> 24.107 + $(for i in menu.d/panel/* ; do [ -f $i ] && sh $i menu $i ; done) 24.108 + </menu> 24.109 + </li> 24.110 + <li tabindex="2"> 24.111 + <span>$(gettext 'Network')</span> 24.112 + <menu> 24.113 + <li><a data-icon="info" href="/network.cgi">$(gettext 'Summary')</a></li> 24.114 + <li><a data-icon="conf" href="/index.cgi?file=/etc/network.conf">$(gettext 'Config file')</a></li> 24.115 + <li><a data-icon="eth" href="/network.cgi?eth">$(gettext 'Ethernet')</a></li> 24.116 + <li><a data-icon="wifi" href="/network.cgi?wifi">$(gettext 'Wireless')</a></li> 24.117 + $(for i in menu.d/network/* ; do [ -f $i ] && sh $i menu $i ; done) 24.118 + </menu> 24.119 + </li> 24.120 + <li tabindex="3"> 24.121 + <span>$(gettext 'Settings')</span> 24.122 + <menu> 24.123 + <li><a data-icon="info" href="/settings.cgi">$(gettext 'Summary')</a></li> 24.124 + <li><a data-icon="user" href="/settings.cgi?users">$(gettext 'Users')</a></li> 24.125 + <li><a data-icon="group" href="/settings.cgi?groups">$(gettext 'Groups')</a></li> 24.126 + $(for i in menu.d/settings/* ; do [ -f $i ] && sh $i menu $i ; done) 24.127 + </menu> 24.128 + </li> 24.129 + <li tabindex="4"> 24.130 + <span>$(gettext 'Boot')</span> 24.131 + <menu> 24.132 + <li><a data-icon="info" href="/boot.cgi">$(gettext 'Summary')</a></li> 24.133 + <li><a data-icon="grub" href="/boot.cgi?grub">$(gettext 'Boot loader')</a></li> 24.134 + <li><a data-icon="logs" href="/boot.cgi?log">$(gettext 'Boot logs')</a> 24.135 + <menu> 24.136 + <li><a data-icon="" href="/boot.cgi?log=kernel">$(gettext 'Kernel messages')</a></li> 24.137 + <li><a data-icon="" href="/boot.cgi?log=boot">$(gettext 'Boot scripts')</a></li> 24.138 + <li><a data-icon="" href="/boot.cgi?log=xlog">$(gettext 'X server')</a></li> 24.139 + <li><a data-icon="" href="/boot.cgi?log=slim">$(gettext 'X session')</a></li> 24.140 + </menu> 24.141 + </li> 24.142 + <li><a data-icon="daemons" href="/boot.cgi?daemons">$(gettext 'Manage daemons')</a></li> 24.143 + $(for i in menu.d/boot/* ; do [ -f $i ] && sh $i menu $i ; done) 24.144 + </menu> 24.145 + </li> 24.146 + <li tabindex="5"> 24.147 + <span>$(gettext 'Hardware')</span> 24.148 + <menu> 24.149 + <li><a data-icon="info" href="/hardware.cgi">$(gettext 'Summary')</a></li> 24.150 + <li><a data-icon="modules" href="/hardware.cgi?modules">$(gettext 'Kernel modules')</a></li> 24.151 + <li><a data-icon="detect" href="/hardware.cgi?detect">$(gettext 'Detect PCI/USB')</a></li> 24.152 + <li><a data-icon="hdd" href="/hardware.cgi#disk">$(gettext 'Disks')</a></li> 24.153 + $(for i in menu.d/hardware/* ; do [ -f $i ] && sh $i menu $i ; done) 24.154 + </menu> 24.155 + </li> 24.156 + $(for i in menu.d/* ; do [ -f $i ] && sh $i menu $i ; done) 24.157 + </menu> 24.158 + <span id="icons"> 24.159 + <span id="miscinfo2"></span> 24.160 + <span id="miscinfo1"></span> 24.161 + <a data-img="help" href="/help.cgi"></a> 24.162 + </span> 24.163 +</nav> 24.164 +<div id="noMenu"></div> 24.165 +<script type="text/javascript">addMenuHandlers();</script> 24.166 24.167 <!-- Page content --> 24.168 <div id="content">
25.1 Binary file styles/default/images/harddisk.png has changed
26.1 Binary file styles/default/images/removable.png has changed
27.1 Binary file styles/default/images/tux.png has changed
28.1 --- a/styles/default/style.css Mon Mar 23 21:17:06 2015 +0100 28.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 28.3 @@ -1,513 +0,0 @@ 28.4 -/* 28.5 - * CSS style for TazPanel - (C) 2011-2015 SliTaz GNU/Linux 28.6 -*/ 28.7 - 28.8 -/* To always have a scroll bar */ 28.9 -html { 28.10 - min-height: 102%; 28.11 -} 28.12 - 28.13 -body { 28.14 - background: #fff; 28.15 - color: black; 28.16 - font: 13px "DejaVu Sans", Ubuntu, "Droid Sans", "Liberation Sans", FreeSans, sans-serif; 28.17 - margin: 80px 0 0; 28.18 -} 28.19 - 28.20 -h2 { color: #333; font-size: 180%; margin: 10px 0 10px; } 28.21 -h3 { color: #444; font-size: 160%; } 28.22 -h4 { color: #666; font-size: 140%; } 28.23 -img { border: 0pt none; vertical-align: middle; padding: 0px 6px 2px 0;} 28.24 -p { margin: 10px 0; } 28.25 -ul { list-style-type: square; } 28.26 -li { padding: 4px 0; } 28.27 -a { text-decoration: none; color: #666; } 28.28 -a:hover { color: #000; } 28.29 - 28.30 - 28.31 - 28.32 -/* 28.33 - * Header and main title 28.34 - */ 28.35 - 28.36 -header { 28.37 - height: 40px; 28.38 - /*border-bottom: 4px solid #afafaf;*/ 28.39 - background: #222 url(images/logo.png) no-repeat left; 28.40 - position: fixed; 28.41 - top: 0; 28.42 - width: 100%; 28.43 -} 28.44 - 28.45 -header h1 { 28.46 - margin: 0; 28.47 - padding: 8px 0 0 42px; 28.48 - color: #fff; 28.49 - font-size: 20px; 28.50 - font-style: italic; 28.51 -} 28.52 - 28.53 - 28.54 - 28.55 -/* 28.56 - * Desktop GUI style bar 28.57 - */ 28.58 - 28.59 -#toolbar { 28.60 - position: fixed; 28.61 - top: 40px; 28.62 - left: 0; 28.63 - height: 23px; 28.64 - width: 100%; 28.65 - padding: 0; 28.66 - background-color: #f1efeb; 28.67 - border-bottom: 1px solid #c1baad; 28.68 - z-index: 200; 28.69 - cursor: default; 28.70 -} 28.71 - 28.72 -#menu { 28.73 - margin: 0; 28.74 - padding: 0; 28.75 -} 28.76 -#menu li { 28.77 - list-style: none; 28.78 - float: left; 28.79 - padding: 0; 28.80 -} 28.81 -#menu li a { 28.82 - display: block; 28.83 - padding: 4px 6px; 28.84 - background-color: inherit; 28.85 - text-decoration: none; 28.86 - cursor: default; 28.87 - color: #000; 28.88 -} 28.89 -#menu li a:hover { 28.90 - color: #ffffff; 28.91 - background-color: #d66018; 28.92 -} 28.93 -#menu li ul { 28.94 - display: none; 28.95 - min-width: 180px; 28.96 - background-color: #f1efeb; 28.97 - border: 1px solid #c1baad; 28.98 -} 28.99 -#menu li ul a { 28.100 - padding: 4px 6px 2px; 28.101 -} 28.102 -#menu li:hover ul { 28.103 - display: block; 28.104 - position: absolute; 28.105 - margin: 0; 28.106 - padding: 0; 28.107 -} 28.108 -#menu li:hover li { 28.109 - float: none; 28.110 - position: relative; 28.111 -} 28.112 -#menu li:hover li a { 28.113 - background-color: #f1efeb; 28.114 - color: #000; 28.115 -} 28.116 -#menu li li a { border: 1px solid #f1efeb; } 28.117 -#menu li li a:hover { 28.118 - background-color: #d66018; 28.119 - color: #ffffff; 28.120 - border-radius: 2px; 28.121 - /* border: 1px solid #c1baad; */ 28.122 -} 28.123 - 28.124 -/* submenus */ 28.125 -#menu li:hover li ul { 28.126 - display: none; 28.127 - position: absolute; 28.128 - left: 180px; 28.129 - top: 0px; 28.130 - z-index:1; 28.131 -} 28.132 -#menu li:hover li:hover ul { 28.133 - display: block; 28.134 -} 28.135 - 28.136 -#icons { margin: 3px 8px; float: right; } 28.137 -#icons img { padding: 0; } 28.138 - 28.139 -#loading { 28.140 - /* font-weight: bold; */ 28.141 - background-color: #f8f8f8; 28.142 - border: 1px solid #ddd; 28.143 - color: #666; 28.144 - cursor: progress; 28.145 - position: fixed; 28.146 - top: 76px; 28.147 - right: 140px; 28.148 - width: 248px; 28.149 - padding: 4px 4px 2px; 28.150 -} 28.151 - 28.152 -/* Blocks */ 28.153 - 28.154 -#block { float: left; } 28.155 - 28.156 -/* Sidebar menus */ 28.157 - 28.158 -#sidebar { 28.159 - position: fixed; 28.160 - top: 124px; 28.161 - right: 5px; 28.162 - width: 116px; 28.163 -} 28.164 - 28.165 -#sidebar a { 28.166 - display: block; 28.167 - padding: 0px 0 0px 12px; 28.168 - margin: 0; 28.169 -} 28.170 - 28.171 -#sidebar a.active { 28.172 - color: #000; 28.173 - font-weight: bold; 28.174 -} 28.175 - 28.176 -#sidebar h4 { margin: 0 0 2px 12px; font-size: 16px; color: #222; } 28.177 -#sidebar ul { list-style-type: none; padding: 0; } 28.178 - 28.179 - 28.180 -/* Content */ 28.181 - 28.182 -#content { margin: 20px; } 28.183 -#content-sidebar { margin: 20px 120px 20px 20px; } 28.184 -#wrapper, .wrapper { margin: 20px 0; } 28.185 - 28.186 -#actions { 28.187 - min-height: 20px; 28.188 - padding: 0; 28.189 -} 28.190 - 28.191 -#actions p { margin: 6px 0; } 28.192 - 28.193 -.search { 28.194 - position: fixed; 28.195 - right: 10px; 28.196 - top: -8px; 28.197 -} 28.198 - 28.199 -.search input[type=submit] { 28.200 - padding: 5px; 28.201 - margin-left: -4px; 28.202 - background-color: #f1f1f1; 28.203 - border: 1px solid #ddd; 28.204 - cursor: pointer; 28.205 - color: #000; 28.206 - font-weight: bold; 28.207 - border-radius: 0px; 28.208 -} 28.209 - 28.210 -.search input[type=submit].radius { 28.211 - border-top-right-radius: 4px; 28.212 - border-bottom-right-radius: 4px; 28.213 - border-top-left-radius: 0px; 28.214 - border-bottom-left-radius: 0px; 28.215 -} 28.216 - 28.217 -.search input[type=text] { 28.218 - border: 1px solid #ddd; 28.219 - padding: 4px; 28.220 - height: 18px; 28.221 - margin: 0; 28.222 - width: 200px; 28.223 - border-top-left-radius: 4px; 28.224 - border-bottom-left-radius: 4px; 28.225 -} 28.226 - 28.227 -.box { 28.228 - margin: 10px 0; 28.229 - padding: 12px; 28.230 - background: #f8f8f8; 28.231 - border: 1px solid #ddd; 28.232 -} 28.233 - 28.234 -.box ul { list-style-type: none; padding: 0; } 28.235 - 28.236 -.debug { 28.237 - position: fixed; 28.238 - bottom: 0px; 28.239 - right: 10px; 28.240 - left: 10px; 28.241 - margin: 5px; 28.242 - padding: 4px 10px; 28.243 - background-color: #111; 28.244 - color: #fff; 28.245 - border: 0; 28.246 - font-size: 12px; 28.247 - opacity: 0.9; 28.248 -} 28.249 - 28.250 -.float-left { 28.251 - float: left; 28.252 -} 28.253 -.float-right { 28.254 - float: right; 28.255 -} 28.256 - 28.257 - 28.258 - 28.259 -/* 28.260 - * Table 28.261 - */ 28.262 - 28.263 -table { 28.264 - background-color: #f8f8f8; 28.265 - border: 4px solid #ddd; 28.266 - padding: 10px; 28.267 - width: 100%; 28.268 - margin: 0 0 6px 0; 28.269 -} 28.270 - 28.271 -table a { color: #000; } 28.272 -table a:hover { color: #666; } 28.273 -td.small { min-width: 60px; } 28.274 -td.pct { min-width: 200px; background: #eee; } 28.275 -div.pct { background: #ccc; } 28.276 -td.pct, div.pct { border-radius: 2px; } 28.277 - 28.278 -#thead, .thead, thead { 28.279 - height: 10px; 28.280 - font-weight: bold; 28.281 -} 28.282 - 28.283 -/* Table Zebra */ 28.284 - 28.285 -table.zebra { 28.286 - border: none; 28.287 - border-collapse: collapse; 28.288 - margin: 20px 0; 28.289 -} 28.290 -table.zebra tr:nth-child(even) { 28.291 - background-color: rgba(0,0,0,0.05); 28.292 -} 28.293 -table.zebra thead tr td { 28.294 - height: 22px; 28.295 - background-color: #eee; 28.296 - text-align: center; 28.297 - vertical-align: middle; 28.298 -} 28.299 -table.zebra td + td { 28.300 - border-left: 1px solid #ddd; 28.301 - height: 22px; 28.302 -} 28.303 -table.zebra td:first-child { padding-left: 6px; } 28.304 -.outbox { 28.305 - box-shadow: 0 0 2px 4px #ddd; 28.306 -} 28.307 -.fixed { 28.308 - table-layout: fixed; 28.309 -} 28.310 - 28.311 - 28.312 - 28.313 -/* 28.314 - * syntax_highlighter 28.315 - */ 28.316 - 28.317 -.conf-comment { color: #666; } 28.318 -.conf-var { color: #392600; } 28.319 -.conf-val, .sh-val { color: #f35a00; } 28.320 -.sh-comment { color: #b20000; } 28.321 -.activity-log { color: #888; } 28.322 -.diff-rm { color: red; } 28.323 -.diff-add { color: green; } 28.324 -.diff-at { color: blue; } 28.325 -.top { color: #00c800; font-weight: normal; } 28.326 -.kernel-hex { color: #18A423; } 28.327 -.kernel-id { color: #287FC7; } 28.328 -.kernel-id2 { color: #843523; } 28.329 -.lsusb-h, .lspci-h { color: #800; font-weight: bold; } 28.330 -.lsusb-t, .lspci-t { color: #448; font-weight: bold; } 28.331 - 28.332 - 28.333 - 28.334 -/* Misc */ 28.335 - 28.336 -pre, .pre-main { 28.337 - font: 13px "DejaVu Sans Mono", "Droid Sans Mono", "Liberation Mono", FreeMono, monospace; 28.338 - background-color: #f8f8f8; 28.339 - border: 4px solid #ddd; 28.340 - padding: 10px; 28.341 - margin: 10px 0; 28.342 - overflow: auto; 28.343 -} 28.344 - 28.345 -.pre-main { margin: 16px 0; } 28.346 - 28.347 -input[type=submit], .button { 28.348 - color: #444444; 28.349 - border: 1px solid #afafaf; 28.350 - padding: 4px; 28.351 - /*margin: 4px 0px;*/ 28.352 - font-size: 14px; 28.353 - /*line-height: 1.2em;*/ 28.354 - background-image: -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); 28.355 - background-image: -moz-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); 28.356 - /*-webkit-appearance: none; 28.357 - -webkit-padding-end: 12px; 28.358 - -webkit-padding-start: 6px;*/ 28.359 -} 28.360 -input[type="submit"] { 28.361 - -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); 28.362 - -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); 28.363 - box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); 28.364 -} 28.365 -/*select { 28.366 - background-image: url(images/down.png), 28.367 - -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); 28.368 - background-position: center right; 28.369 - background-repeat: no-repeat; 28.370 -}*/ 28.371 -a.button { 28.372 - white-space: nowrap; 28.373 - height: 16px; 28.374 - margin: 2px 0; 28.375 - display: inline-block; 28.376 - -webkit-appearance: button; -moz-appearance: button; 28.377 -} 28.378 - 28.379 -input[type=submit]:hover, .button:hover { 28.380 - background-color: #ddd; 28.381 - border: 1px solid #999; 28.382 -} 28.383 - 28.384 -input[type=text], input[type=password] { height: 18px; } 28.385 - 28.386 -div.scroll { height: 200px; overflow: auto; 28.387 - border: 1px solid #ddd; } 28.388 -div.scroll table { border: 0px solid #fff; } 28.389 - 28.390 -#terminal { 28.391 - background: #000; 28.392 - color: #fff; 28.393 - border: 1px solid #444; 28.394 - min-height: 240px; 28.395 -} 28.396 - 28.397 -/* Round corner */ 28.398 - 28.399 -#loading, table, pre, input[type=submit], .debug, .box, 28.400 -.button, div.scroll, .outbox, section { 28.401 - -moz-border-radius: 4px; 28.402 - -webkit-border-radius: 4px; 28.403 - border-radius: 4px; 28.404 -} 28.405 - 28.406 -/* Help page */ 28.407 - 28.408 -#help { text-align: justify; } 28.409 -#help a { color: #215090; text-decoration: underline; } 28.410 -#help a:hover { text-decoration: none; color: blue; } 28.411 - 28.412 - 28.413 - 28.414 -/* 28.415 - * Footer 28.416 - */ 28.417 - 28.418 -footer { 28.419 - /* border-bottom: 1px solid #c1baad; */ 28.420 - height: 25px; 28.421 - text-align: center; 28.422 - padding: 40px 10px; 28.423 - font-size: 11px; 28.424 - color: #bbb; 28.425 -} 28.426 - 28.427 -footer a { color: #bbb; } 28.428 -footer a:hover { color: #555; } 28.429 - 28.430 - 28.431 - 28.432 -/* 28.433 - * HTML5 Meter 28.434 - */ 28.435 - 28.436 -.meter { 28.437 - height: 22px; 28.438 - min-width: 200px; 28.439 - cursor: default; 28.440 -} 28.441 -.meter meter { 28.442 - height: inherit; 28.443 - width: 100%; 28.444 - display: block; 28.445 - border: 1px solid #ddd; 28.446 - border-radius: 4px; 28.447 -} 28.448 -.meter span { 28.449 - height: 22px; 28.450 - display: block; 28.451 - white-space: nowrap; 28.452 - position: absolute; 28.453 - margin: -18px auto 0 2px; 28.454 -} 28.455 - 28.456 - 28.457 - 28.458 -/* 28.459 - * Animations 28.460 - */ 28.461 - 28.462 -a.button, input { 28.463 - -webkit-transition: all 0.3s ease-in-out; 28.464 - -moz-transition: all 0.3s ease-in-out; 28.465 - -o-transition: all 0.3s ease-in-out; 28.466 - -ms-transition: all 0.3s ease-in-out; 28.467 - transition: all 0.3s ease-in-out; 28.468 -} 28.469 - 28.470 -/*section { 28.471 - margin: 20pt -0.7em; 28.472 - padding: 0.8em 0.7em 1.2em; 28.473 - background-color: #fdfdfd; 28.474 - border: 1px solid #ddd; 28.475 - border-radius: 1em; 28.476 - box-shadow: 0 0 3pt 2pt #eee; 28.477 -} 28.478 -section h4 { 28.479 - margin: 0 0 0.5em 0; 28.480 -} 28.481 -section h3 { 28.482 - margin: 0 0 0.5em 0; } 28.483 -*/ 28.484 - 28.485 -#tabs { 28.486 - font-weight: bold; 28.487 - font-size: 14px; 28.488 - list-style-type: none; 28.489 - padding-bottom: 25px; 28.490 - border-bottom: 1px solid #aaa; 28.491 -} 28.492 - 28.493 -#tabs li { 28.494 - float: left; 28.495 - height: 16px; 28.496 - background-color: #eee; 28.497 - margin: 0 40px 0 -40px; 28.498 - border: 1px solid #aaa; 28.499 - text-align: center; 28.500 - min-width: 100px; 28.501 - -moz-border-top-right-radius: 4px; 28.502 - -moz-border-top-left-radius: 4px; 28.503 - -webkit-border-top-right-radius: 4px; 28.504 - -webkit-border-top-left-radius: 4px; 28.505 - border-top-right-radius: 4px; 28.506 - border-top-left-radius: 4px; 28.507 -} 28.508 - 28.509 -#tabs li.active { 28.510 - border-bottom: 1px solid #fff; 28.511 - background-color: #fff; 28.512 -} 28.513 - 28.514 -#tabs a { 28.515 - padding: 8px; 28.516 -}
29.1 Binary file styles/default/tazpanel.ttf has changed
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 30.2 +++ b/styles/default/tweaks.css Tue Mar 24 03:39:08 2015 +0200 30.3 @@ -0,0 +1,244 @@ 30.4 +/** 30.5 + * CSS style for TazPanel - (C) 2011-2015 SliTaz GNU/Linux 30.6 + */ 30.7 + 30.8 + 30.9 +body.light { background: #EBEBEB; } 30.10 +body.dark { background: #3C3C3C; } 30.11 + 30.12 + 30.13 + 30.14 +/********************* 30.15 + * Toolbar with menu * 30.16 + *********************/ 30.17 + 30.18 +.dark nav { 30.19 + background-image: -webkit-linear-gradient(#3B3B3B, #393939); 30.20 + border-top-color: #454545; border-bottom-color: #313131; } /*ok*/ 30.21 +.light nav { 30.22 + background-image: -webkit-linear-gradient(#EAEAEA, #E0E0E0); 30.23 + border-top-color: #F5F5F5; border-bottom-color: #C1C1C1; } /*ok*/ 30.24 + 30.25 + 30.26 + 30.27 +.light #toolbarMenu menu { background-color: #F7F7F7; border-color: #A4A4A4;} /*ok*/ 30.28 +.dark #toolbarMenu menu { background-color: #333333; border-color: #222222;} /*ok*/ 30.29 + 30.30 + 30.31 + 30.32 +/******************* 30.33 + * Panes, sections * 30.34 + *******************/ 30.35 + 30.36 +.dark #sidebar, .dark section { 30.37 + border-color: #2E2E2E; /*ok*/ 30.38 + background-color: #454545; /*ok*/ 30.39 + box-shadow: inset 0 0 0 1pt hsla(0, 0%, 100%, 0.05); 30.40 +} 30.41 +.light #sidebar, .light section { 30.42 + border-color: #A3A3A3; /*ok*/ 30.43 + background-color: #F5F5F5; /*ok*/ 30.44 + box-shadow: inset 1pt 1pt 0 0 #FFF, inset -1pt -1pt 0 0 #EBEBEB; /*ok*/ 30.45 +} 30.46 + 30.47 +.dark #sidebar, .dark section header { 30.48 + background-image: -webkit-linear-gradient(hsla(0, 0%, 100%, 0.04), transparent); /*ok*/ 30.49 +} 30.50 +.light #sidebar, .light section header { 30.51 + background-image: -webkit-linear-gradient(hsla(0, 0%, 100%, 1), hsla(0, 0%, 100%, 0)); /*ok*/ 30.52 +} 30.53 + 30.54 +.dark section footer { 30.55 + background-image: -webkit-linear-gradient(transparent, hsla(0, 0%, 0%, 0.1)); /*ok*/ 30.56 +} 30.57 +.light section footer { 30.58 + background-image: -webkit-linear-gradient(transparent, hsla(0, 0%, 0%, 0.1)); /*ok*/ 30.59 +} 30.60 + 30.61 + 30.62 + 30.63 +.dark fieldset { 30.64 + border-color: #313131; 30.65 + box-shadow: inset 1pt 1pt 0 0 #3E3E3E, 1pt 1pt 0 0 #3E3E3E; /*ok*/ 30.66 +} 30.67 +.light fieldset { 30.68 + border-color: #C1C1C1; } 30.69 +.dark legend { background-color: #454545; } 30.70 + 30.71 + 30.72 + 30.73 +/* Page first header */ 30.74 + 30.75 +.light h2 { color: #333; } 30.76 +.dark h2 { color: #CCC; } 30.77 + 30.78 + 30.79 + 30.80 +/* Additional headers (obsolete) */ 30.81 + 30.82 +.light h3 { color: hsla(0, 0%, 0%, 0.7); } /*#444*/ 30.83 +.dark h3 { color: hsla(0, 0%, 100%, 0.7); } 30.84 +.light h4 { color: hsla(0, 0%, 0%, 0.6); } /*#666*/ 30.85 +.dark h4 { color: hsla(0, 0%, 100%, 0.6); } 30.86 + 30.87 + 30.88 + 30.89 +/********** 30.90 + * Tables * 30.91 + **********/ 30.92 + 30.93 +/* Table Zebra */ 30.94 +.light .zebra tr:nth-child(odd) { background-color: #FFFFFF; } /*ok*/ 30.95 +.light .zebra tr:nth-child(even) { background-color: #ECECEC; } /*ok*/ 30.96 +.dark .zebra tr:nth-child(odd) { background-color: #4C4C4C; } /*ok*/ 30.97 +.dark .zebra tr:nth-child(even) { background-color: #484848; } /*ok*/ 30.98 +.light .zebra thead td { 30.99 + background-image: -webkit-linear-gradient(#FFFFFF, #FFFFFF 49%, #F4F4F4 50%, #D9D9D9); /*ok*/ 30.100 + border-color: #9C9C9C hsla(0, 0%, 0%, 0.1) #B1B1B1 transparent; /*ok*/ 30.101 + box-shadow: inset 1px 0 0 hsla(0, 0%, 100%, 0.5); 30.102 +} 30.103 +.dark .zebra thead td { 30.104 + background-image: -webkit-linear-gradient(#565656, #515151 49%, #484848 50%, #414141); /*ok*/ 30.105 + border-color: #282828 hsla(0, 0%, 0%, 0.1) #2F2F2F transparent; /*ok*/ 30.106 + box-shadow: inset 1px 0 0 hsla(0, 0%, 100%, 0.1); 30.107 +} 30.108 +.dark .zebra thead td:nth-child(1) { box-shadow: none; } /*fix*/ 30.109 + 30.110 + 30.111 + 30.112 +.light .borders.zebra td + td { border-color: #ddd; } 30.113 +.dark .borders.zebra td + td { border-color: #383838; } 30.114 + 30.115 +.light .borders tr { border-color: rgba(92, 92, 92, 0.1); } 30.116 +.dark .borders tr { border-color: #111; } 30.117 + 30.118 +.light .hborders thead tr { border-color: rgba(92, 92, 92, 0.1); } 30.119 +.dark .hborders thead tr { border-color: #333; } 30.120 + 30.121 + 30.122 + 30.123 +/********************** 30.124 + * Syntax highlighter * 30.125 + **********************/ 30.126 + 30.127 +.sh-comment, .conf-comment {font-style:italic} 30.128 + 30.129 +.light .conf-var {color:hsl(40, 100%, 30%)} .dark .conf-var {color:hsl(40, 100%, 50%)} /*brown*/ 30.130 +.light .conf-val {color:hsl(22, 100%, 50%)} .dark .conf-val {color:hsl(22, 100%, 60%)} /*orange*/ 30.131 +.light .conf-comment {color:hsl( 0, 0%, 40%)} .dark .conf-comment {color:hsl( 0, 0%, 50%)} /*gray*/ 30.132 + 30.133 +.light .sh-var {color:hsl(40, 100%, 30%)} .dark .sh-var {color:hsl(40, 100%, 50%)} /*brown*/ 30.134 +.light .sh-val {color:hsl(22, 100%, 50%)} .dark .sh-val {color:hsl(22, 100%, 60%)} /*orange*/ 30.135 +.light .sh-comment {color:hsl( 0, 100%, 35%)} .dark .sh-comment {color:hsl( 0, 100%, 60%)} /*tomato*/ 30.136 + 30.137 + 30.138 + 30.139 +.activity-log { color: #888; } 30.140 + 30.141 +.light .diff-rm {color:hsl( 0, 100%, 50%)} .dark .diff-rm {color:hsl( 0, 100%, 70%)} /*red*/ 30.142 +.light .diff-add{color:hsl(120, 100%, 40%)} .dark .diff-add{color:hsl(120, 100%, 40%)} /*green*/ 30.143 +.light .diff-at {color:hsl(240, 100%, 50%)} .dark .diff-at {color:hsl(240, 100%, 70%)} /*blue*/ 30.144 + 30.145 +.top { color: #00C800; font-weight: normal; } 30.146 +.kernel-hex { color: #18A423; } 30.147 +.kernel-id { color: #287FC7; } 30.148 +.kernel-id2 { color: #843523; } 30.149 +.kernel-trace { background-color: red; } 30.150 + 30.151 +.lsusb-h, .lspci-h, .lsusb-t, .lspci-t { font-weight: bold; } 30.152 +.light .lsusb-h, .light .lspci-h { color: #800; } 30.153 +.dark .lsusb-h, .dark .lspci-h { color: #C66; } 30.154 +.light .lsusb-t, .light .lspci-t { color: #448; } 30.155 +.dark .lsusb-t, .dark .lspci-t { color: #66C; } 30.156 + 30.157 +.xlog-timestamp { color: #287FC7; } 30.158 +.xlog-probed, .xlog-config, .xlog-default, .xlog-cmdline, .xlog-info { color: #5A0; } 30.159 +.xlog-notice, .xlog-warn { color: #A50; } 30.160 +.xlog-error, .xlog-ni, .xlog-unknown { color: #F00; } 30.161 +.xlog { cursor: help; } 30.162 + 30.163 + 30.164 + 30.165 +/* Misc */ 30.166 + 30.167 +.dark .scroll { border-color: #2E2E2E; } 30.168 + 30.169 + 30.170 + 30.171 +/*************** 30.172 + * Page footer * 30.173 + ***************/ 30.174 + 30.175 +.light > footer { border-color: #C1C1C1; background-color: #EBEBEB; color: #888; } 30.176 +.dark > footer { border-color: #313131; background-color: #3C3C3C; color: #666; } 30.177 + 30.178 +.light > footer a { color: #666; } 30.179 +.light > footer a:hover { color: #888; } 30.180 + 30.181 +.dark > footer a { color: #bbb; } 30.182 +.dark > footer a:hover { color: #555; } 30.183 + 30.184 + 30.185 + 30.186 +/********************** 30.187 + * Buttons with icons * 30.188 + **********************/ 30.189 + 30.190 +.light .icon:before, 30.191 +.light .icon2:before, 30.192 +.light [class|="icon"]:before { 30.193 + text-shadow: 0 1px 0 hsla(0, 0%, 100%, 0.3), 0 0 3px hsla(0, 0%, 100%, 0.7); } 30.194 +.dark .icon:before, 30.195 +.dark .icon2:before { 30.196 + text-shadow: 0 0 3px hsla(0, 0%, 0%, 0.7), 0 1px 0 hsla(0, 0%, 0%, 0.3); } 30.197 + 30.198 +.dark.nowebkit [data-icon]::before { 30.199 + text-shadow: 30.200 + 0 1px 0 hsla(0, 0%, 0%, 0.7), 0 -1px 0 hsla(0, 0%, 0%, 0.4), 30.201 + 1px 0 0 hsla(0, 0%, 0%, 0.4), -1px 0 0 hsla(0, 0%, 0%, 0.4); } 30.202 +.light button[data-icon]::before, button { 30.203 + text-shadow: 30.204 + 0 1px 0 hsla(0, 0%, 100%, 0.9) /*, 0 -1px 0 hsla(0, 0%, 100%, 0.6), 30.205 + 1px 0 0 hsla(0, 0%, 100%, 0.6), -1px 0 0 hsla(0, 0%, 100%, 0.6)*/; } 30.206 + 30.207 +.dark [data-icon]:before, .dark [data-img] { 30.208 + /* Experimental webkit-only styles */ 30.209 + background-image: -webkit-radial-gradient(25% 25%, #fff, #777); 30.210 + -webkit-background-clip: text; 30.211 + -webkit-text-fill-color: transparent; 30.212 +} 30.213 +/*.light a[data-icon]:before { color: #333; }*/ 30.214 +a[data-icon] { white-space: pre-line; } 30.215 + 30.216 +[data-icon="cancel"]::before, [data-icon="delete"]::before, 30.217 +[data-icon="remove"]::before, [data-icon="stop"]::before, 30.218 +[data-img="help"]::before, [data-img="man"]::before, 30.219 +[data-img="off"]::before, [data-img="remove"]::before, 30.220 +[data-img="stop"]::before {color:#dc322f} /*red*/ 30.221 + 30.222 +[data-icon="restart"]::before, [data-img="conf"]::before {color:#cb4b16} /*orange*/ 30.223 + 30.224 +[data-icon="ok"]::before, [data-icon="run"]::before, 30.225 +[data-icon="start"]::before, [data-img="on"]::before, 30.226 +[data-img="opt"]::before, [data-img="run"]::before {color:#859900} /*green*/ 30.227 + 30.228 +[data-img="web"]::before {color:#268bd2} /*blue*/ 30.229 + 30.230 + 30.231 + 30.232 +/********** 30.233 + * Inputs * 30.234 + **********/ 30.235 + 30.236 +.dark textarea { border-color: #2E2E2E; } 30.237 +.light textarea { border-color: #A3A3A3; } 30.238 + 30.239 + 30.240 + 30.241 +/*********************** 30.242 + * System memory gauge * 30.243 + ***********************/ 30.244 + 30.245 +.dark .sysmem { border-color: #2E2E2E; } 30.246 +.light .sysmem { border-color: #A3A3A3; } 30.247 +
31.1 --- a/tazpanel Mon Mar 23 21:17:06 2015 +0100 31.2 +++ b/tazpanel Tue Mar 24 03:39:08 2015 +0200 31.3 @@ -2,11 +2,13 @@ 31.4 # 31.5 # Tiny Tazpanel cmdline interface 31.6 # 31.7 -# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License 31.8 +# Copyright (C) 2012-2015 SliTaz GNU/Linux - BSD License 31.9 # 31.10 VERSION=1.8.2 31.11 31.12 + 31.13 # Get the configuration file and functions 31.14 + 31.15 CONFIG="/etc/slitaz/tazpanel.conf" 31.16 [ -f "$CONFIG" ] && . $CONFIG 31.17 [ -f "data/tazpanel.conf" ] && . data/tazpanel.conf 31.18 @@ -14,10 +16,13 @@ 31.19 31.20 . /lib/libtaz.sh 31.21 31.22 + 31.23 # I18n 31.24 + 31.25 TEXTDOMAIN='tazpanel' 31.26 export TEXTDOMAIN 31.27 31.28 + 31.29 # 31.30 # Commands 31.31 # 31.32 @@ -29,12 +34,12 @@ 31.33 31.34 case "$1" in 31.35 -h|*help|*usage) 31.36 - echo "" 31.37 + echo 31.38 gettext 'Usage: tazpanel [start|stop|passwd|app]'; echo 31.39 - echo "" ;; 31.40 - start) 31.41 + echo ;; 31.42 + start) 31.43 if [ -f $PIDFILE ]; then 31.44 - gettext 'TazPanel is already running.'; echo 31.45 + gettext 'TazPanel is already running.'; echo 31.46 exit 1 31.47 fi 31.48 eval_gettext 'Starting TazPanel web server on port $HTTPD_PORT...' 31.49 @@ -43,27 +48,27 @@ 31.50 ps | grep "httpd -p $HTTPD_PORT " | grep -v grep | \ 31.51 awk '{ print $1 }' > $PIDFILE 31.52 status ;; 31.53 - stop) 31.54 - if [ ! -f $PIDFILE ]; then 31.55 - gettext 'TazPanel is not running.'; echo 31.56 - exit 1 31.57 - fi 31.58 + stop) 31.59 + if [ ! -f $PIDFILE ]; then 31.60 + gettext 'TazPanel is not running.'; echo 31.61 + exit 1 31.62 + fi 31.63 gettext 'Stopping TazPanel web server...' 31.64 - kill $(pgrep -f TazPanel) 31.65 + kill $(pgrep -f TazPanel) 31.66 rm -f $PIDFILE 31.67 status ;; 31.68 passwd|-p) 31.69 - echo "" 31.70 + echo 31.71 gettext 'Changing password for TazPanel'; echo 31.72 gettext 'New password: ' && read pass 31.73 - sed -i s"/\/:root:.*/\/:root:$pass/" $HTTPD_CONF 31.74 + sed -i "s/\/:root:.*/\/:root:$pass/" $HTTPD_CONF 31.75 gettext 'Password changed successfully'; echo 31.76 - echo "" ;; 31.77 + echo ;; 31.78 *) 31.79 . /etc/slitaz/applications.conf 31.80 USER_CONFIG="$HOME/.config/slitaz/applications.conf" 31.81 - [ -f "$USER_CONFIG" ] && . $USER_CONFIG 31.82 - [ "$1" ] && app="/${1}.cgi" 31.83 + [ -f "$USER_CONFIG" ] && . $USER_CONFIG 31.84 + [ -n "$1" ] && app="/${1}.cgi" 31.85 echo http://localhost:82${app} 31.86 case "$BROWSER" in 31.87 tazweb) tazweb --notoolbar http://localhost:82${app} & ;;
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 32.2 +++ b/test.cgi Tue Mar 24 03:39:08 2015 +0200 32.3 @@ -0,0 +1,153 @@ 32.4 +#!/bin/sh 32.5 +# 32.6 +# test.cgi - Test TazPanel styles. 32.7 +# 32.8 +# Copyright (C) 2015 SliTaz GNU/Linux - BSD License 32.9 +# 32.10 + 32.11 +# Common functions from libtazpanel 32.12 +. lib/libtazpanel 32.13 +get_config 32.14 +header 32.15 + 32.16 +TITLE='TazPanel - Test' 32.17 + 32.18 +xhtml_header 32.19 + 32.20 +cat <<EOT 32.21 + 32.22 +<section> 32.23 + <header data-icon="info">Buttons with font icons</header> 32.24 +<!-- 32.25 +--><button data-icon="add" >Add </button><button data-icon="admin" >Admin </button><!-- 32.26 +--><button data-icon="back" >Back </button><button data-icon="battery" >Battery </button><!-- 32.27 +--><button data-icon="brightness" >Brightness </button><button data-icon="cancel" >Cancel </button><!-- 32.28 +--><button data-icon="cd" >CD </button><button data-icon="check" >Check </button><!-- 32.29 +--><button data-icon="clock" >Clock </button><button data-icon="conf" >Conf </button><!-- 32.30 +--><button data-icon="daemons" >Daemons </button><button data-icon="delete" >Delete </button><!-- 32.31 +--><button data-icon="detect" >Detect </button><button data-icon="diff" >Diff </button><!-- 32.32 +--><button data-icon="download" >Download </button><button data-icon="edit" >Edit </button><!-- 32.33 +--><button data-icon="eth" >Eth </button><button data-icon="group" >Group </button><!-- 32.34 +--><button data-icon="grub" >GRUB </button><button data-icon="hdd" >HDD </button><!-- 32.35 +--><button data-icon="help" >Help </button><button data-icon="history" >History </button><!-- 32.36 +--><button data-icon="info" >Info </button><button data-icon="install" >Install </button><!-- 32.37 +--><button data-icon="link" >Link </button><button data-icon="list" >List </button><!-- 32.38 +--><button data-icon="locale" >Locale </button><button data-icon="lock" >Lock </button><!-- 32.39 +--><button data-icon="logs" >Logs </button><button data-icon="loopback">Loopback</button><!-- 32.40 +--><button data-icon="man" >Man </button><button data-icon="modules" >Modules </button><!-- 32.41 +--><button data-icon="off" >Off </button><button data-icon="ok" >OK </button><!-- 32.42 +--><button data-icon="on" >On </button><button data-icon="opt" >Opt </button><!-- 32.43 +--><button data-icon="proc" >Proc </button><button data-icon="refresh" >Refresh </button><!-- 32.44 +--><button data-icon="removable" >Removable </button><button data-icon="remove" >Remove </button><!-- 32.45 +--><button data-icon="repack" >Repack </button><button data-icon="report" >Report </button><!-- 32.46 +--><button data-icon="restart" >Restart </button><button data-icon="run" >Run </button><!-- 32.47 +--><button data-icon="save" >Save </button><button data-icon="scan" >Scan </button><!-- 32.48 +--><button data-icon="settings" >Settings </button><button data-icon="slitaz" >SliTaz </button><!-- 32.49 +--><button data-icon="start" >Start </button><button data-icon="stop" >Stop </button><!-- 32.50 +--><button data-icon="sync" >Sync </button><button data-icon="tags" >Tags </button><!-- 32.51 +--><button data-icon="tag" >Tag </button><button data-icon="tazx" >TazX </button><!-- 32.52 +--><button data-icon="temperature">Temperature</button><button data-icon="terminal">Terminal</button><!-- 32.53 +--><button data-icon="text" >Text </button><button data-icon="unlink" >Unlink </button><!-- 32.54 +--><button data-icon="unlock" >Unlock </button><button data-icon="upgrade" >Upgrade </button><!-- 32.55 +--><button data-icon="user" >User </button><button data-icon="view" >View </button><!-- 32.56 +--><button data-icon="web" >Web </button><button data-icon="wifi" >Wi-Fi </button><!-- 32.57 +--> 32.58 +</section> 32.59 + 32.60 + 32.61 +<section> 32.62 + <header data-icon="link">Links with font icons</header> 32.63 + <div> 32.64 +<p> 32.65 +<a data-icon="add" >Add </a> <a data-icon="admin" >Admin </a> <a data-icon="back" >Back </a> 32.66 +<a data-icon="battery" >Battery </a> <a data-icon="brightness">Brightness</a> <a data-icon="cancel" >Cancel </a> 32.67 +<a data-icon="cd" >CD </a> <a data-icon="check" >Check </a> <a data-icon="clock" >Clock </a> 32.68 +<a data-icon="conf" >Conf </a> <a data-icon="daemons" >Daemons </a> <a data-icon="delete" >Delete </a> 32.69 +<a data-icon="detect" >Detect </a> <a data-icon="diff" >Diff </a> <a data-icon="download" >Download </a> 32.70 +<a data-icon="edit" >Edit </a> <a data-icon="eth" >Eth </a> <a data-icon="group" >Group </a> 32.71 +<a data-icon="grub" >GRUB </a> <a data-icon="hdd" >HDD </a> <a data-icon="help" >Help </a> 32.72 +<a data-icon="history" >History </a> <a data-icon="info" >Info </a> <a data-icon="install" >Install </a> 32.73 +<a data-icon="link" >Link </a> <a data-icon="list" >List </a> <a data-icon="locale" >Locale </a> 32.74 +<a data-icon="lock" >Lock </a> <a data-icon="logs" >Logs </a> <a data-icon="loopback" >Loopback </a> 32.75 +<a data-icon="man" >Man </a> <a data-icon="modules" >Modules </a> <a data-icon="off" >Off </a> 32.76 +<a data-icon="ok" >OK </a> <a data-icon="on" >On </a> <a data-icon="opt" >Opt </a> 32.77 +<a data-icon="proc" >Proc </a> <a data-icon="refresh" >Refresh </a> <a data-icon="removable">Removable</a> 32.78 +<a data-icon="remove" >Remove </a> <a data-icon="repack" >Repack </a> <a data-icon="report" >Report </a> 32.79 +<a data-icon="restart" >Restart </a> <a data-icon="run" >Run </a> <a data-icon="save" >Save </a> 32.80 +<a data-icon="scan" >Scan </a> <a data-icon="settings" >Settings </a> <a data-icon="slitaz" >SliTaz </a> 32.81 +<a data-icon="start" >Start </a> <a data-icon="stop" >Stop </a> <a data-icon="sync" >Sync </a> 32.82 +<a data-icon="tags" >Tags </a> <a data-icon="tag" >Tag </a> <a data-icon="tazx" >TazX </a> 32.83 +<a data-icon="temperature">Temperature</a> <a data-icon="terminal" >Terminal </a> <a data-icon="text" >Text </a> 32.84 +<a data-icon="unlink" >Unlink </a> <a data-icon="unlock" >Unlock </a> <a data-icon="upgrade" >Upgrade </a> 32.85 +<a data-icon="user" >User </a> <a data-icon="view" >View </a> <a data-icon="web" >Web </a> 32.86 +<a data-icon="wifi" >Wi-Fi </a> 32.87 +</p> 32.88 + </div> 32.89 +</section> 32.90 + 32.91 + 32.92 +<section> 32.93 + <header data-icon="view">Links with font icons only (small buttons)</header> 32.94 + <p> 32.95 +<a data-img="conf" href="#"></a>Conf <a data-img="help" href="#"></a>Help <a data-img="man" href="#"></a>Man 32.96 +<a data-img="off" href="#"></a>Off <a data-img="on" href="#"></a>On <a data-img="opt" href="#"></a>Opt 32.97 +<a data-img="remove" href="#"></a>Remove <a data-img="run" href="#"></a>Run <a data-img="stop" href="#"></a>Stop 32.98 +<a data-img="web" href="#"></a>Web 32.99 +</p> 32.100 +</section> 32.101 + 32.102 +<section> 32.103 + <header data-icon="check">User input elements</header> 32.104 + <div><form> 32.105 + <table> 32.106 + <tr><td>Text:</td> 32.107 + <td><input type="text" placeholder="Text"/></td> 32.108 + </tr> 32.109 + <tr><td>Password:</td> 32.110 + <td><input type="password" placeholder="Password"/></td> 32.111 + </tr> 32.112 + <tr><td>Button:</td> 32.113 + <td><input type="button" value="Button" data-icon="ok"/></td> 32.114 + </tr> 32.115 + <tr><td>Checkbox:</td> 32.116 + <td><input type="checkbox" id="chk"/><label for="chk">Check it</label></td> 32.117 + </tr> 32.118 + <tr><td>Radio:</td> 32.119 + <td> 32.120 + <label><input type="radio" name="rad" id="radio1"/>Option 1</label> 32.121 + <label><input type="radio" name="rad" id="radio2" checked/>Option 2</label> 32.122 + <label><input type="radio" name="rad" id="radio3"/>Option 3</label> 32.123 + </td> 32.124 + </tr> 32.125 + <tr><td>File:</td> 32.126 + <td><input type="file" accept=".txt,.png"/></td> 32.127 + </tr> 32.128 + <tr><td>Image:</td> 32.129 + <td><input type="image" src="/styles/default/images/msg-warn.png"/></td> 32.130 + </tr> 32.131 + <tr><td>Reset:</td><td><input type="reset"/></td></tr> 32.132 + <tr><td>Submit:</td><td><input type="submit"/></td></tr> 32.133 + <tr><td>Select:</td> 32.134 + <td><select><option data-icon="user">Option 1<option>Option 2<option>Option 3</select></td> 32.135 + </tr> 32.136 + <tr><td colspan="2"><b>HTML 5 inputs:</b></td></tr> 32.137 + <tr><td>Search:</td><td><input type="search" results="5" autosave="pkgsearch" autocomplete="on"/></td></tr> 32.138 + <tr><td>Number:</td><td><input type="number" name="n" value="3" min="0" max="10"/></td></tr> 32.139 + <tr><td>Range:</td><td><input type="range" name="r" value="3" min="0" max="10"/></td></tr> 32.140 + <tr><td>Color:</td><td><input type="color" name="c"/></td></tr> 32.141 + <tr><td>Tel:</td><td><input type="tel" name="t"/></td></tr> 32.142 + <tr><td>URL:</td><td><input type="url" name="u"/></td></tr> 32.143 + <tr><td>E-mail:</td><td><input type="email" name="e" data-x="A part number is a digit followed by three uppercase letters." required/></td></tr> 32.144 + <tr><td>Date:</td><td><input type="date" name="d" value="$(date +'%F')"/></td></tr> 32.145 + <tr><td>Month:</td><td><input type="month" name="m" value="$(date +'%Y-%m')"/></td></tr> 32.146 + <tr><td>Week:</td><td><input type="week" name="w" value="$(date +'%Y-W%V')"/></td></tr> 32.147 + <tr><td>Time:</td><td><input type="time" name="ti" value="$(date +'%R')"/></td></tr> 32.148 + <tr><td>Date & Time:</td><td><input type="datetime" name="dt" value="$(date +'%FT%RZ')"/></td></tr> 32.149 + <tr><td>Date & Time Local:</td><td><input type="datetime-local" name="dtl" value="$(date +'%FT%R')"/></td></tr> 32.150 + </table> 32.151 + </form></div> 32.152 +</section> 32.153 + 32.154 +EOT 32.155 +xhtml_footer 32.156 +exit 0