tazpanel diff index.cgi @ rev 40
Move network shared function (used by summary) to libtazpanel and include libtazpanel in POT file
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Apr 06 06:17:23 2011 +0200 (2011-04-06) |
parents | 5f2f88618292 |
children | a7b1d69663c3 |
line diff
1.1 --- a/index.cgi Wed Apr 06 06:09:34 2011 +0200 1.2 +++ b/index.cgi Wed Apr 06 06:17:23 2011 +0200 1.3 @@ -18,48 +18,6 @@ 1.4 TEXTDOMAIN='tazpanel' 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><td>----</td>" 1.15 - fi 1.16 -} 1.17 - 1.18 -# Catch network interface (network is splited this function and above 1.19 -# must go in lib/libtazpanel 1.20 -list_network_interfaces() { 1.21 - table_start 1.22 - cat << EOT 1.23 -<tr id="thead"> 1.24 - <td>`gettext "Interface"`</td> 1.25 - <td>`gettext "Name"`</td> 1.26 - <td>`gettext "Status"`</td> 1.27 - <td>`gettext "IP Address"`</td> 1.28 -</tr> 1.29 -EOT 1.30 - for i in `ls /sys/class/net` 1.31 - do 1.32 - case $i in 1.33 - eth*) 1.34 - echo "<tr><td><img src='$IMAGES/ethernet.png' />$i</td> 1.35 - <td>Ethernet</td> `interface_status`</tr>" ;; 1.36 - wlan*|ath*|ra*) 1.37 - echo "<tr><td><img src='$IMAGES/wireless.png' />$i</td> 1.38 - <td>Wireless</td> `interface_status`</tr>" ;; 1.39 - lo) 1.40 - echo "<tr><td><img src='$IMAGES/loopback.png' />$i</td> 1.41 - <td>Loopback</td> `interface_status`</tr>" ;; 1.42 - *) 1.43 - continue ;; 1.44 - esac 1.45 - done 1.46 - table_end 1.47 -} 1.48 - 1.49 # 1.50 # Commands 1.51 # 1.52 @@ -174,26 +132,6 @@ 1.53 </form> 1.54 EOT 1.55 ;; 1.56 - network) 1.57 - # 1.58 - # Network configuration 1.59 - # 1.60 - TITLE="- Network" 1.61 - xhtml_header 1.62 - cat << EOT 1.63 -<div id="wrapper"> 1.64 - <h2>`gettext "Networking`</h2> 1.65 - <p>`gettext "Manage network connection and services`</p> 1.66 -</div> 1.67 - 1.68 -`list_network_interfaces` 1.69 - 1.70 -<h3>Output of: ifconfig -a</h3> 1.71 -<pre> 1.72 -`ifconfig -a` 1.73 -</pre> 1.74 -EOT 1.75 - ;; 1.76 hardware) 1.77 # 1.78 # Hardware drivers, devices, filesystem, screen