tazpanel rev 31
index.cgi: Add support for network connection detection and listing + up po/*
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Apr 05 05:10:57 2011 +0200 (2011-04-05) |
parents | 55ce67f05cf9 |
children | b4e001e85045 |
files | index.cgi po/tazpanel-cgi/tazpanel-cgi.pot po/tazpanel-live/tazpanel-live.pot po/tazpanel-pkgs/tazpanel-pkgs.pot po/tazpanel/tazpanel.pot styles/default/header.html styles/default/images/ethernet.png styles/default/images/loopback.png styles/default/images/wireless.png styles/default/style.css |
line diff
1.1 --- a/index.cgi Tue Apr 05 05:09:53 2011 +0200 1.2 +++ b/index.cgi Tue Apr 05 05:10:57 2011 +0200 1.3 @@ -18,6 +18,47 @@ 1.4 TEXTDOMAIN='tazpanel-cgi' 1.5 export TEXTDOMAIN 1.6 1.7 +# Network interface status 1.8 +interface_status() { 1.9 + if ifconfig | grep -A 1 $i | grep -q inet; then 1.10 + ip=`ifconfig | grep -A 1 $i | grep inet | \ 1.11 + awk '{ print $2 }' | cut -d ":" -f 2` 1.12 + echo "<td>connected</td> <td>$ip</td>" 1.13 + else 1.14 + echo "<td>-</td>" 1.15 + fi 1.16 +} 1.17 + 1.18 +# Catch network interface 1.19 +list_network_interfaces() { 1.20 + table_start 1.21 + cat << EOT 1.22 +<tr id="thead"> 1.23 + <td>`gettext "Interface"`</td> 1.24 + <td>`gettext "Name"`</td> 1.25 + <td>`gettext "Statut"`</td> 1.26 + <td>`gettext "IP Address"`</td> 1.27 +</tr> 1.28 +EOT 1.29 + for i in `ls /sys/class/net` 1.30 + do 1.31 + case $i in 1.32 + eth*) 1.33 + echo "<tr><td><img src='$IMAGES/ethernet.png' />$i</td> 1.34 + <td>Ethernet</td> `interface_status`</tr>" ;; 1.35 + wlan*|ath*|ra*) 1.36 + echo "<tr><td><img src='$IMAGES/wireless.png' />$i</td> 1.37 + <td>Wireless</td> `interface_status`</tr>" ;; 1.38 + lo) 1.39 + echo "<tr><td><img src='$IMAGES/loopback.png' />$i</td> 1.40 + <td>Loopback</td> `interface_status`</tr>" ;; 1.41 + *) 1.42 + continue ;; 1.43 + esac 1.44 + done 1.45 + table_end 1.46 +} 1.47 + 1.48 # 1.49 # Commands 1.50 # 1.51 @@ -144,6 +185,8 @@ 1.52 <p>`gettext "Manage network connection and services`</p> 1.53 </div> 1.54 1.55 +`list_network_interfaces` 1.56 + 1.57 <h3>Output of: ifconfig -a</h3> 1.58 <pre> 1.59 `ifconfig -a` 1.60 @@ -201,6 +244,8 @@ 1.61 `df -h | grep ^/dev` 1.62 </pre> 1.63 1.64 +`list_network_interfaces` 1.65 + 1.66 <!-- Close summary --> 1.67 </div> 1.68 EOT
2.1 --- a/po/tazpanel-cgi/tazpanel-cgi.pot Tue Apr 05 05:09:53 2011 +0200 2.2 +++ b/po/tazpanel-cgi/tazpanel-cgi.pot Tue Apr 05 05:10:57 2011 +0200 2.3 @@ -8,7 +8,7 @@ 2.4 msgstr "" 2.5 "Project-Id-Version: TazPanel CGI 1.0\n" 2.6 "Report-Msgid-Bugs-To: \n" 2.7 -"POT-Creation-Date: 2011-04-05 01:58+0200\n" 2.8 +"POT-Creation-Date: 2011-04-05 04:23+0200\n" 2.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 2.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 2.11 "Language-Team: LANGUAGE <LL@li.org>\n" 2.12 @@ -69,50 +69,50 @@ 2.13 msgid "User login:" 2.14 msgstr "" 2.15 2.16 -#: index.cgi:131 2.17 +#: index.cgi:129 2.18 msgid "User password:" 2.19 msgstr "" 2.20 2.21 -#: index.cgi:135 2.22 +#: index.cgi:131 2.23 msgid "Create user" 2.24 msgstr "" 2.25 2.26 -#: index.cgi:147 2.27 +#: index.cgi:143 2.28 msgid "Networking" 2.29 msgstr "" 2.30 2.31 -#: index.cgi:148 2.32 +#: index.cgi:144 2.33 msgid "Manage network connection and services" 2.34 msgstr "" 2.35 2.36 -#: index.cgi:165 2.37 +#: index.cgi:161 2.38 msgid "Drivers & Devices" 2.39 msgstr "" 2.40 2.41 -#: index.cgi:166 2.42 +#: index.cgi:162 2.43 msgid "Manage your computer hardware" 2.44 msgstr "" 2.45 2.46 -#: index.cgi:186 2.47 +#: index.cgi:182 2.48 msgid "Host:" 2.49 msgstr "" 2.50 2.51 -#: index.cgi:187 2.52 +#: index.cgi:183 2.53 msgid "SliTaz administration et configuration Panel" 2.54 msgstr "" 2.55 2.56 -#: index.cgi:190 2.57 +#: index.cgi:186 2.58 msgid "Summary" 2.59 msgstr "" 2.60 2.61 -#: index.cgi:194 2.62 +#: index.cgi:190 2.63 msgid "Uptime:" 2.64 msgstr "" 2.65 2.66 -#: index.cgi:197 2.67 +#: index.cgi:193 2.68 msgid "Memory in Mb" 2.69 msgstr "" 2.70 2.71 -#: index.cgi:202 2.72 +#: index.cgi:198 2.73 msgid "Filesystem usage statistics:" 2.74 msgstr ""
3.1 --- a/po/tazpanel-live/tazpanel-live.pot Tue Apr 05 05:09:53 2011 +0200 3.2 +++ b/po/tazpanel-live/tazpanel-live.pot Tue Apr 05 05:10:57 2011 +0200 3.3 @@ -8,7 +8,7 @@ 3.4 msgstr "" 3.5 "Project-Id-Version: Tazpanel live CGI 1.0\n" 3.6 "Report-Msgid-Bugs-To: \n" 3.7 -"POT-Creation-Date: 2011-04-05 01:58+0200\n" 3.8 +"POT-Creation-Date: 2011-04-05 04:23+0200\n" 3.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 3.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 3.11 "Language-Team: LANGUAGE <LL@li.org>\n" 3.12 @@ -17,10 +17,50 @@ 3.13 "Content-Type: text/plain; charset=CHARSET\n" 3.14 "Content-Transfer-Encoding: 8bit\n" 3.15 3.16 -#: live.cgi:35 3.17 +#: live.cgi:49 3.18 +msgid "TODO" 3.19 +msgstr "" 3.20 + 3.21 +#: live.cgi:57 3.22 msgid "SliTaz Live Systems" 3.23 msgstr "" 3.24 3.25 -#: live.cgi:36 3.26 +#: live.cgi:58 3.27 msgid "Create and manage Live CD or USB SliTaz systems" 3.28 msgstr "" 3.29 + 3.30 +#: live.cgi:61 3.31 +msgid "Write a Live CD" 3.32 +msgstr "" 3.33 + 3.34 +#: live.cgi:63 3.35 +msgid "" 3.36 +"The command writeiso will generate an ISO image of the\n" 3.37 +"\tcurrent filesystem as is, including all files in the /home directory.\n" 3.38 +"\tIt is an easy way to remaster a SliTaz Live system, you just have\n" 3.39 +"\tto: boot, modify, writeiso." 3.40 +msgstr "" 3.41 + 3.42 +#: live.cgi:69 3.43 +msgid "Compression type:" 3.44 +msgstr "" 3.45 + 3.46 +#: live.cgi:75 3.47 +msgid "write ISO" 3.48 +msgstr "" 3.49 + 3.50 +#: live.cgi:78 3.51 +msgid "Live USB" 3.52 +msgstr "" 3.53 + 3.54 +#: live.cgi:81 3.55 +msgid "USB Media to use:" 3.56 +msgstr "" 3.57 + 3.58 +#: live.cgi:90 3.59 +msgid "Not found" 3.60 +msgstr "" 3.61 + 3.62 +#: live.cgi:94 3.63 +msgid "generate" 3.64 +msgstr ""
4.1 --- a/po/tazpanel-pkgs/tazpanel-pkgs.pot Tue Apr 05 05:09:53 2011 +0200 4.2 +++ b/po/tazpanel-pkgs/tazpanel-pkgs.pot Tue Apr 05 05:10:57 2011 +0200 4.3 @@ -8,7 +8,7 @@ 4.4 msgstr "" 4.5 "Project-Id-Version: Tazpanel pkgs CGI 1.0\n" 4.6 "Report-Msgid-Bugs-To: \n" 4.7 -"POT-Creation-Date: 2011-04-05 01:58+0200\n" 4.8 +"POT-Creation-Date: 2011-04-05 04:23+0200\n" 4.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 4.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 4.11 "Language-Team: LANGUAGE <LL@li.org>\n"
5.1 --- a/po/tazpanel/tazpanel.pot Tue Apr 05 05:09:53 2011 +0200 5.2 +++ b/po/tazpanel/tazpanel.pot Tue Apr 05 05:10:57 2011 +0200 5.3 @@ -8,7 +8,7 @@ 5.4 msgstr "" 5.5 "Project-Id-Version: TazPanel cmdline 1.0\n" 5.6 "Report-Msgid-Bugs-To: \n" 5.7 -"POT-Creation-Date: 2011-04-05 01:58+0200\n" 5.8 +"POT-Creation-Date: 2011-04-05 04:23+0200\n" 5.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 5.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 5.11 "Language-Team: LANGUAGE <LL@li.org>\n"
6.1 --- a/styles/default/header.html Tue Apr 05 05:09:53 2011 +0200 6.2 +++ b/styles/default/header.html Tue Apr 05 05:10:57 2011 +0200 6.3 @@ -8,7 +8,7 @@ 6.4 </head> 6.5 <body> 6.6 6.7 -<div id="tazbar"> 6.8 +<div id="toolbar"> 6.9 <div id="icons"> 6.10 <a href="./"><img src="styles/default/images/help.png" /></a> 6.11 </div>
7.1 Binary file styles/default/images/ethernet.png has changed
8.1 Binary file styles/default/images/loopback.png has changed
9.1 Binary file styles/default/images/wireless.png has changed
10.1 --- a/styles/default/style.css Tue Apr 05 05:09:53 2011 +0200 10.2 +++ b/styles/default/style.css Tue Apr 05 05:10:57 2011 +0200 10.3 @@ -93,7 +93,7 @@ 10.4 10.5 /* Desktop gui style bar */ 10.6 10.7 -#tazbar { 10.8 +#toolbar { 10.9 position: fixed; 10.10 top: 0; 10.11 left: 0; 10.12 @@ -123,8 +123,6 @@ 10.13 overflow: auto; 10.14 } 10.15 10.16 -.pre_main { margin: 20px 0 10px; } 10.17 - 10.18 input[type=submit], select { 10.19 padding: 2px 4px; 10.20 margin: 4px 0 0;