# HG changeset patch # User Christophe Lincoln # Date 1302109327 -7200 # Node ID 167a97495e1c9ab16116a25409f12fac4e33cda1 # Parent 1a80f769f6e127268dbc39c14fa0ddde249003e0 Better CSS for pkgs.cgi and handle packages category as fast as we can diff -r 1a80f769f6e1 -r 167a97495e1c lib/libtazpanel --- a/lib/libtazpanel Wed Apr 06 06:17:23 2011 +0200 +++ b/lib/libtazpanel Wed Apr 06 19:02:07 2011 +0200 @@ -46,10 +46,12 @@ do case $i in eth*) - echo "$i + echo " + $i Ethernet `interface_status`" ;; wlan*|ath*|ra*) - echo "$i + echo " + $i Wireless `interface_status`" ;; lo) echo "$i diff -r 1a80f769f6e1 -r 167a97495e1c network.cgi --- a/network.cgi Wed Apr 06 06:17:23 2011 +0200 +++ b/network.cgi Wed Apr 06 19:02:07 2011 +0200 @@ -16,28 +16,65 @@ TEXTDOMAIN='tazpanel' export TEXTDOMAIN +# Actions commands before page is displayed +case "$QUERY_STRING" in + start) + # Here we sleep a bit to let udhcp get the lease before reloading + # page with status + /etc/init.d/network.sh start >/dev/null + sleep 2 ;; + stop) + /etc/init.d/network.sh stop >/dev/null ;; + *) + continue ;; +esac + # -# Commands +# Main Commands for pages # case "$QUERY_STRING" in - *) - # - # Network configuration - # - TITLE="- Network" + eth) + # Wired connections settings xhtml_header cat << EOT -
-

`gettext "Networking`

-

`gettext "Manage network connection and services`

+

`gettext "Ethernet connection`

+
+`grep ^[A-V] /etc/network.conf`
+
+EOT + ;; + wifi) + # Wireless connections settings + xhtml_header + cat << EOT +

`gettext "Wireless connection`

+
+`grep ^WIFI_ /etc/network.conf`
+
+EOT + ;; + *) + # Main Network page starting with a summary + xhtml_header + cat << EOT +

`gettext "Networking`

+

+ `gettext "Manage network connection and services` +

+
+

+ `gettext "Connection:"` + `gettext "Start"` + `gettext "Stop"` +

`list_network_interfaces` -

Output of: ifconfig -a

+

`gettext "Output of ifconfig"`

-`ifconfig -a`
+`ifconfig`
 
EOT ;; diff -r 1a80f769f6e1 -r 167a97495e1c pkgs.cgi --- a/pkgs.cgi Wed Apr 06 06:17:23 2011 +0200 +++ b/pkgs.cgi Wed Apr 06 19:02:07 2011 +0200 @@ -23,7 +23,7 @@ # xHTML 5 header TITLE="- Packages" -xhtml_header +xhtml_header | sed 's/id="content"/id="content-sidebar"/' # DEBUG mode if [ $DEBUG == "1" ]; then @@ -41,7 +41,8 @@ web=$(echo $line | cut -d "|" -f 5) if [ -d $INSTALLED/$pkg ]; then echo -e "\n - $pkg" + + $pkg" else echo -e "\n $pkg" @@ -122,14 +123,24 @@ EOT } -sub_block() { +sidebar() { cat << EOT -
- `gettext "My packages"` | - `gettext "All packages"` | - `gettext "Recharge list"` | - `gettext "Upgrade"` | - `gettext "Configuration"` + EOT } @@ -137,33 +148,70 @@ # For my packages list list_actions() { cat << EOT -

+

`gettext "Selection:"` - -

+ +
+
+ `gettext "List:"` + + +
EOT } -# For list-all -list_all_actions() { +# For list-cat +list_cat_action() { cat << EOT -

+

`gettext "Selection:"` - - -

+ + +
+
+ `gettext "List:"` + + + + `gettext "My packages"` +
EOT } -# For search and upgrade with JS function to toogle all pkgs +# For search with JS function to toogle all pkgs list_full_actions() { cat << EOT -

+

`gettext "Selection:"` - - + + `gettext "Toogle all"` -

+
+
+ `gettext "List:"` + + + + `gettext "My packages"` +
+EOT +} + +# For upgrade with JS function to toogle all pkgs and no 'Upgrade' button +list_up_actions() { + cat << EOT +
+ `gettext "Selection:"` + + + `gettext "Toogle all"` +
+
+ `gettext "List:"` + + + `gettext "My packages"` +
EOT } @@ -172,12 +220,12 @@ # case "$QUERY_STRING" in - list) + list*) # List installed packages. This is the default because parsing # the full packages.desc can be long and take some resources cd $INSTALLED search_form - sub_block + sidebar cat << EOT

`gettext "My packages"`

@@ -186,6 +234,7 @@ list_actions echo '
' table_start + table_head for pkg in * do . $pkg/receipt @@ -195,7 +244,7 @@ echo " $pkg" + src='$IMAGES/tazpkg-installed.png'/>$pkg" echo "$VERSION" echo "$SHORT_DESC" echo "web" @@ -204,30 +253,33 @@ table_end list_actions echo '' ;; - list-all) - # List all available packages on mirror + cat*) + # List all available packages by category on mirror. Listing all + # packages is to resource intensive and not usefull. cd $LOCALSTATE + category=${QUERY_STRING#cat=} + [ "${QUERY_STRING}" == "cat" ] && category="base-system" search_form - sub_block + sidebar | sed s/"active_${category}"/"active"/ cat << EOT -

`gettext "All packages"`

+

`gettext "Category:"` $category

EOT - list_all_actions + list_cat_action echo '
' table_start table_head - cat packages.desc | parse_packages_desc + grep "| $category |" packages.desc | parse_packages_desc table_end - list_all_actions + list_cat_action echo '
' ;; search=*) # Search for packages pkg=${QUERY_STRING#*=} cd $LOCALSTATE search_form - sub_block + sidebar cat << EOT

`gettext "Search packages"`

@@ -240,19 +292,27 @@ grep $pkg packages.desc | parse_packages_desc table_end echo '
' ;; - recharge) + recharge*) # Let recharge the packages list search_form - sub_block + sidebar cat << EOT

`gettext "Recharge"`

-

- `gettext "Recharge will check for new or updated packages... - please wait"` -

-
+
+

+ `gettext "Recharge will check for new or updated packages... +please wait"` +

+
+ +
 EOT
 		tazpkg recharge | filter_tazpkg_msgs
@@ -260,16 +320,16 @@
 		echo '

' gettext "Packages lists are up-to-date" echo '

' ;; - upgradeable) + upgradeable*) cd $LOCALSTATE search_form - sub_block + sidebar cat << EOT

`gettext "Upgradeable packages"`

EOT - list_full_actions + list_up_actions tazpkg upgradeable echo '
' table_start @@ -279,24 +339,39 @@ grep "^$pkg |" $LOCALSTATE/packages.desc | parse_packages_desc done table_end + list_up_actions echo '' ;; do=*) # Do an action on one or some packages cmdline=`echo ${QUERY_STRING#do=} | sed s'/&/ /g'` cmd=`echo ${cmdline} | awk '{print $1}'` pkgs=`echo $cmdline | sed -e s'/+/ /g' -e s'/pkg=//g' -e s/$cmd//` - [ $cmd == install ] && cmd=get-install opt=--forced + case $cmd in + install|Install) + cmd=get-install opt=--forced ;; + remove|Remove) + cmd=remove ;; + esac search_form - sub_block + sidebar cat << EOT

Tazpkg: $cmd

-

+

+

+ `gettext "Performing task on packages... please wait"` +

+
+ +
EOT - gettext "Performing task on packages" - echo '

' - echo '
'
+		echo '
'
 		gettext "Executing $cmd for:$pkgs"
 		echo '
' for pkg in $pkgs @@ -308,26 +383,37 @@ info=*) pkg=${QUERY_STRING#*=} search_form - sub_block + sidebar . $INSTALLED/$pkg/receipt + files=`cat $INSTALLED/$pkg/files.list | wc -l` cat << EOT -

`gettext "Package info"`

+

`gettext "Package"` $PACKAGE

-

`gettext "Detailled information on:"` $PACKAGE

+ +
 Name        : $PACKAGE
 Version     : $VERSION
 Description : $SHORT_DESC
+Category    : $CATEGORY
 Maintainer  : $MAINTAINER
 Depends     : `for i in $DEPENDS; do echo -n \
 	"$i "; done`
 Website     : $WEB_SITE
 Sizes       : $PACKED_SIZE/$UNPACKED_SIZE
-Files       : `cat $INSTALLED/$pkg/files.list | wc -l`
 
-

`gettext "Installed files"`

+

`gettext "Installed files:"` `cat $INSTALLED/$pkg/files.list | wc -l`

 `cat $INSTALLED/$pkg/files.list`
 
@@ -349,7 +435,7 @@ esac cache_files=`find /var/cache/tazpkg -name *.tazpkg | wc -l` cache_size=`du -sh /var/cache/tazpkg` - sub_block + sidebar cat << EOT

`gettext "Configuration"`

@@ -385,15 +471,24 @@ # Default to summary # search_form - sub_block + sidebar cat << EOT

`gettext "Summary"`

-

`gettext "Overview of all installed and mirrored packages"`

+ `gettext "Overview of all installed and mirrored packages"`
-
+
 `packages_summary`
 
+ + `gettext "My packages"` + + `gettext "Recharge list"` + + `gettext "Check upgrade"` + + `gettext "Configuration"` +

`gettext "Latest log entries"`

 `tail -n 6 /var/log/tazpkg.log | fgrep "-" | \
diff -r 1a80f769f6e1 -r 167a97495e1c po/fr.po
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/po/fr.po	Wed Apr 06 19:02:07 2011 +0200
@@ -0,0 +1,339 @@
+# French translations for TazPanel package.
+# Copyright (C) 2011 THE TazPanel'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the TazPanel package.
+# Linux User , 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: TazPanel 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-04-06 06:09+0200\n"
+"PO-Revision-Date: 2011-04-06 06:11+0200\n"
+"Last-Translator: Linux User \n"
+"Language-Team: French\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: tazpanel:33
+msgid "TazPanel Authentication"
+msgstr ""
+
+#: tazpanel:36
+msgid "Stopping TazPanel web server..."
+msgstr ""
+
+#: tazpanel:40
+msgid "Changing password for TazPanel"
+msgstr ""
+
+#: tazpanel:41
+msgid "New password: "
+msgstr ""
+
+#: tazpanel:43
+msgid "Password changed succeffuly"
+msgstr ""
+
+#: tazpanel:47
+msgid "Usage:"
+msgstr ""
+
+#: index.cgi:38
+msgid "Interface"
+msgstr ""
+
+#: index.cgi:39 index.cgi:133 pkgs.cgi:117
+msgid "Name"
+msgstr ""
+
+#: index.cgi:40
+msgid "Status"
+msgstr ""
+
+#: index.cgi:41
+msgid "IP Address"
+msgstr ""
+
+#: index.cgi:76
+msgid "Boot & startup"
+msgstr ""
+
+#: index.cgi:78
+msgid "Everything that appends before user login."
+msgstr ""
+
+#: index.cgi:82
+msgid "Kernel cmdline"
+msgstr ""
+
+#: index.cgi:123
+msgid "Manage users"
+msgstr ""
+
+#: index.cgi:124
+msgid "Manage human users on your SliTaz system"
+msgstr ""
+
+#: index.cgi:131
+msgid "Login"
+msgstr ""
+
+#: index.cgi:132
+msgid "User ID"
+msgstr ""
+
+#: index.cgi:134
+msgid "Home"
+msgstr ""
+
+#: index.cgi:135
+msgid "SHell"
+msgstr ""
+
+#: index.cgi:162
+msgid "Delete selected user"
+msgstr ""
+
+#: index.cgi:166
+msgid "Add a new user"
+msgstr ""
+
+#: index.cgi:169
+msgid "User login:"
+msgstr ""
+
+#: index.cgi:171
+msgid "User password:"
+msgstr ""
+
+#: index.cgi:173
+msgid "Create user"
+msgstr ""
+
+#: index.cgi:185 network.cgi:32
+msgid "Networking"
+msgstr ""
+
+#: index.cgi:186 network.cgi:33
+msgid "Manage network connection and services"
+msgstr ""
+
+#: index.cgi:205
+msgid "Drivers & Devices"
+msgstr ""
+
+#: index.cgi:206
+msgid "Manage your computer hardware"
+msgstr ""
+
+#: index.cgi:226
+msgid "Host:"
+msgstr ""
+
+#: index.cgi:227
+msgid "SliTaz administration et configuration Panel"
+msgstr ""
+
+#: index.cgi:230 pkgs.cgi:390
+msgid "Summary"
+msgstr ""
+
+#: index.cgi:233
+msgid "Uptime:"
+msgstr ""
+
+#: index.cgi:236
+msgid "Memory in Mb"
+msgstr ""
+
+#: index.cgi:243
+msgid "Network status"
+msgstr ""
+
+#: index.cgi:246
+msgid "Filesystem usage statistics"
+msgstr ""
+
+#: pkgs.cgi:63
+msgid "Last recharge        : "
+msgstr ""
+
+#: pkgs.cgi:73
+msgid "Installed packages   : "
+msgstr ""
+
+#: pkgs.cgi:75
+msgid "Mirrored packages    : "
+msgstr ""
+
+#: pkgs.cgi:77
+msgid "Upgradeable packages : "
+msgstr ""
+
+#: pkgs.cgi:79
+msgid "Installed files      : "
+msgstr ""
+
+#: pkgs.cgi:81
+msgid "Blocked packages     : "
+msgstr ""
+
+#: pkgs.cgi:107
+msgid "Search"
+msgstr ""
+
+#: pkgs.cgi:118
+msgid "Version"
+msgstr ""
+
+#: pkgs.cgi:119
+msgid "Description"
+msgstr ""
+
+#: pkgs.cgi:120
+msgid "Web"
+msgstr ""
+
+#: pkgs.cgi:128 pkgs.cgi:182
+msgid "My packages"
+msgstr ""
+
+#: pkgs.cgi:129 pkgs.cgi:213
+msgid "All packages"
+msgstr ""
+
+#: pkgs.cgi:130
+msgid "Recharge list"
+msgstr ""
+
+#: pkgs.cgi:131
+msgid "Upgrade"
+msgstr ""
+
+#: pkgs.cgi:132 pkgs.cgi:354
+msgid "Configuration"
+msgstr ""
+
+#: pkgs.cgi:141 pkgs.cgi:151 pkgs.cgi:162
+msgid "Selection:"
+msgstr ""
+
+#: pkgs.cgi:165
+msgid "Toogle all"
+msgstr ""
+
+#: pkgs.cgi:232
+msgid "Search packages"
+msgstr ""
+
+#: pkgs.cgi:248
+msgid "Recharge"
+msgstr ""
+
+#: pkgs.cgi:252
+msgid ""
+"Recharge will check for new or updated packages...\n"
+"\t\tplease wait"
+msgstr ""
+
+#: pkgs.cgi:261
+msgid "Packages lists are up-to-date"
+msgstr ""
+
+#: pkgs.cgi:268
+msgid "Upgradeable packages"
+msgstr ""
+
+#: pkgs.cgi:297
+msgid "Performing task on packages"
+msgstr ""
+
+#: pkgs.cgi:314
+msgid "Package info"
+msgstr ""
+
+#: pkgs.cgi:316
+msgid "Detailled information on:"
+msgstr ""
+
+#: pkgs.cgi:330
+msgid "Installed files"
+msgstr ""
+
+#: pkgs.cgi:356
+msgid "Tazpkg configuration and settings"
+msgstr ""
+
+#: pkgs.cgi:361
+msgid "Packages in the cache:"
+msgstr ""
+
+#: pkgs.cgi:368
+msgid "Current mirror list"
+msgstr ""
+
+#: pkgs.cgi:392
+msgid "Overview of all installed and mirrored packages"
+msgstr ""
+
+#: pkgs.cgi:397
+msgid "Latest log entries"
+msgstr ""
+
+#: live.cgi:50
+msgid "TODO"
+msgstr ""
+
+#: live.cgi:58
+msgid "SliTaz Live Systems"
+msgstr ""
+
+#: live.cgi:59
+msgid "Create and manage Live CD or USB SliTaz systems"
+msgstr ""
+
+#: live.cgi:62
+msgid "Write a Live CD"
+msgstr ""
+
+#: live.cgi:64
+msgid ""
+"The command writeiso will generate an ISO image of the\n"
+"\tcurrent filesystem as is, including all files in the /home directory.\n"
+"\tIt is an easy way to remaster a SliTaz Live system, you just have\n"
+"\tto: boot, modify, writeiso."
+msgstr ""
+
+#: live.cgi:70
+msgid "Compression type:"
+msgstr ""
+
+#: live.cgi:76
+msgid "write ISO"
+msgstr ""
+
+#: live.cgi:79
+msgid "Live USB"
+msgstr ""
+
+#: live.cgi:81
+msgid ""
+"Generate SliTaz LiveUSB media and boot in RAM! Insert a\n"
+"\tLiveCD into the cdrom drive, select the correct device and press\n"
+"\tGenerate."
+msgstr ""
+
+#: live.cgi:86
+msgid "USB Media to use:"
+msgstr ""
+
+#: live.cgi:95
+msgid "Not found"
+msgstr ""
+
+#: live.cgi:99
+msgid "generate"
+msgstr ""
diff -r 1a80f769f6e1 -r 167a97495e1c styles/default/footer.html
--- a/styles/default/footer.html	Wed Apr 06 06:17:23 2011 +0200
+++ b/styles/default/footer.html	Wed Apr 06 19:02:07 2011 +0200
@@ -2,7 +2,9 @@
 
 
- + diff -r 1a80f769f6e1 -r 167a97495e1c styles/default/images/edit.png Binary file styles/default/images/edit.png has changed diff -r 1a80f769f6e1 -r 167a97495e1c styles/default/images/recharge.png Binary file styles/default/images/recharge.png has changed diff -r 1a80f769f6e1 -r 167a97495e1c styles/default/images/update.png Binary file styles/default/images/update.png has changed diff -r 1a80f769f6e1 -r 167a97495e1c styles/default/style.css --- a/styles/default/style.css Wed Apr 06 06:17:23 2011 +0200 +++ b/styles/default/style.css Wed Apr 06 19:02:07 2011 +0200 @@ -14,11 +14,11 @@ margin: 25px 0 0; } -h1 { color: #d66018; padding: 18px 0 0 40px;} +h1 { color: #d66018; padding: 10px 0 0 40px;} h2 { color: #444; margin: 10px 0 10px; } h3 { color: #666; font-size: 140%; } h4 { color: #888; font-size: 120%; } -img { border: 0pt none; vertical-align: middle; padding: 0 6px 0 0;} +img { border: 0pt none; vertical-align: middle; padding: 0px 6px 2px 0;} p { margin: 6px 0; } ul { list-style-type: none; padding: 0; } li { padding: 4px 0; } @@ -28,69 +28,10 @@ /* Header and main title */ #header { - height: 68px; + height: 52px; border-bottom: 1px dotted #ddd; } -/* Blocks */ - -#block { float: left; } - -#sub_block { margin: 20px 0; } - -/* Content */ - -#content { margin: 20px 80px; } -#wrapper { margin: 20px 0 20px; } - -.search { - position: absolute; - right: 80px; - top: 39px; -} - -#actions { - -} - -#actions p { padding: 0; } - -.box { - margin: 10px 0; - padding: 12px; - background: #f8f8f8; - border: 1px solid #ddd; -} - -.debug { - position: fixed; - top: 20px; - left: 5px; - padding: 6px 20px; - background-color: #f8f8f8; - border: 1px solid #ddd; -} - -.float_left { float: right; } -.float_right { float: right; } - -/* Table */ - -table { - background-color: #f8f8f8; - border: 1px solid #ddd; - padding: 10px; - width: 100%; -} - -td.pkg { max-width: 160px; } -td.desc { max-width: 300px; } - -#thead, thead { - height: 10px; - font-weight: bold; -} - /* Desktop gui style bar */ #toolbar { @@ -113,9 +54,120 @@ .progress { cursor: progress; } +/* Blocks */ + +#block { float: left; } + +/* Sidebar menus */ + +#sidebar { + position: fixed; + top: 187px; + right: 5px; + width: 116px; +} + +#sidebar a { + display: block; + padding: 1px 0 1px 12px; + margin:0; +} + +#sidebar a.active { + color: #000; + font-weight: bold; + /* Vertical tab alike menu + background-color: #f8f8f8; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + border-right: 1px solid #ddd; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; */ +} +#sidebar h4 { margin: 0 0 2px 12px; } + +/* Content */ + +#content { margin: 20px 40px 20px 40px; } +#content-sidebar { margin: 20px 120px 20px 40px; } +#wrapper { margin: 10px 0 20px; } + +.search { + position: absolute; + right: 40px; + top: 32px; +} + +.search input[type=submit] { + padding: 4px; + margin-left: -5px; + background-color: #f1f1f1; + border: 1px solid #ddd; + cursor: pointer; + color: #000; + font-weight: bold; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; +} + +.search input[type=text] { + border: 1px solid #ddd; + padding: 4px; + height: 17px; + margin: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} + +#actions { + height: 20px; + margin: 16px 0; +} + +.box { + margin: 10px 0; + padding: 12px; + background: #f8f8f8; + border: 1px solid #ddd; +} + +.debug { + position: fixed; + top: 20px; + left: 5px; + padding: 6px 20px; + background-color: #f8f8f8; + border: 1px solid #ddd; +} + +.float-left { float: left; } +.float-right { float: right; } + +/* Table */ + +table { + background-color: #f8f8f8; + border: 1px solid #ddd; + padding: 10px; + width: 100%; + margin: 0 0 6px 0; +} + +table a { color: #000; } +table a:hover { color: #666; } +td.pkg { max-width: 160px; } +td.desc { max-width: 300px; } + +#thead, thead { + height: 10px; + font-weight: bold; +} + /* Misc */ -pre { +pre, .pre-main { background-color: #f8f8f8; border: 1px solid #ddd; padding: 10px; @@ -123,25 +175,38 @@ overflow: auto; } -input[type=submit], select { - padding: 2px 4px; - margin: 4px 0 0; +.pre-main { margin: 16px 0; } + +input[type=submit], select, .button { + padding: 4px; + margin: 0; background-color: #f1f1f1; border: 1px solid #ddd; cursor: pointer; + color: #000; } -input[type=submit]:hover, select:hover { +input[type=submit]:hover, select:hover, .button:hover { background-color: #ddd; border: 1px solid #999; } -input[type=text] { height: 15px; } +input[type=text] { height: 18px; } /* Round corner */ -table, pre, input[type=submit], .debug, .box { - -moz-border-radius: 4px; - -webkit-border-radius: 4px; +table, pre, input[type=submit], .debug, .box, .button { + /*-moz-border-radius: 4px; + -webkit-border-radius: 4px; */ border-radius: 4px; } + +/* Footer */ + +#footer { + /* border-bottom: 1px solid #c1baad; */ + height: 25px; + text-align: center; + padding: 40px 10px; + font-size: 11px; +}