tazpanel diff network.cgi @ rev 501

*.cgi: Implement TazPanel title and sub-title; hardware.cgi: fix and improve modules search; index.cgi: complex code using awk was prevented 'make pot' to collect all messages, fix terminal history removing; tazpanel.js: disable buttons when no packages selected (pkgs.cgi: up / search / category lists); network.cgi: complex comment was prevented 'make pot' to collect all messages; powersaving.cgi: starting development; *.po: rebuild; tazpanel.ttf: add messages icons, so remove all the style/png images and change libtazpanel; *.css: title and sub-title, messages icons; test.cgi: add new icons.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Jun 08 04:32:19 2015 +0300 (2015-06-08)
parents 470ab4241de5
children 0e464ccf165e
line diff
     1.1 --- a/network.cgi	Mon May 18 17:13:57 2015 +0300
     1.2 +++ b/network.cgi	Mon Jun 08 04:32:19 2015 +0300
     1.3 @@ -12,7 +12,7 @@
     1.4  get_config
     1.5  header
     1.6  
     1.7 -TITLE=$(_ 'TazPanel - Network')
     1.8 +TITLE=$(_ 'Network')
     1.9  
    1.10  ip_forward=/proc/sys/net/ipv4/ip_forward
    1.11  
    1.12 @@ -222,7 +222,7 @@
    1.13  
    1.14  	*\ eth\ *)
    1.15  		# Wired connections settings
    1.16 -		xhtml_header
    1.17 +		xhtml_header "$(_ 'Ethernet connection')"
    1.18  
    1.19  		PAR1="size=\"20\" required"; PAR="$PAR1 pattern=\"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\""
    1.20  
    1.21 @@ -239,9 +239,6 @@
    1.22  		fi
    1.23  
    1.24  		[ -s /etc/ethers ] || echo "#01:02:03:04:05:06 mystation" > /etc/ethers
    1.25 -		cat <<EOT
    1.26 -<h2>$(_ 'Ethernet connection')</h2>
    1.27 -EOT
    1.28  		[ -w /etc/network.conf ] && cat <<EOT
    1.29  <p>$(_ "Here you can configure a wired connection using DHCP to \
    1.30  automatically get a random IP or configure a static/fixed IP")</p>
    1.31 @@ -436,12 +433,9 @@
    1.32  
    1.33  	*\ wifi\ *)
    1.34  		# Wireless connections settings
    1.35 -		xhtml_header
    1.36 +		xhtml_header "$(_ 'Wireless connection')"
    1.37  
    1.38  		. /etc/network.conf
    1.39 -		cat <<EOT
    1.40 -<h2>$(_ 'Wireless connection')</h2>
    1.41 -EOT
    1.42  
    1.43  		start_disabled=''; stop_disabled=''
    1.44  		if iwconfig 2>/dev/null | grep -q 'Tx-Power=off'; then
    1.45 @@ -619,7 +613,7 @@
    1.46  
    1.47  	*)
    1.48  		# Main Network page starting with a summary
    1.49 -		xhtml_header
    1.50 +		xhtml_header "$(_ 'Manage network connections and services')"
    1.51  
    1.52  		stop_disabled=''; start_disabled=''
    1.53  		if cat /sys/class/net/*/operstate | fgrep -q up; then
    1.54 @@ -628,15 +622,11 @@
    1.55  			stop_disabled='disabled'
    1.56  		fi
    1.57  
    1.58 -		if [ ! -w /etc/network.conf ]; then
    1.59 +		if [ ! -w '/etc/network.conf' ]; then
    1.60  			start_disabled='disabled'; stop_disabled='disabled'
    1.61  		fi
    1.62  
    1.63  		cat <<EOT
    1.64 -<h2>$(_ 'Networking')</h2>
    1.65 -
    1.66 -<p>$(_ 'Manage network connections and services')</p>
    1.67 -
    1.68  <form action="index.cgi" id="indexform"></form>
    1.69  
    1.70  <form id="mainform"><!--
    1.71 @@ -658,11 +648,11 @@
    1.72  	$(list_network_interfaces)
    1.73  	<footer>
    1.74  		<input form="mainform" type="checkbox" name="opt" value="ipforward" $(
    1.75 -		[ "$REMOTE_USER" == "root" ] || echo " disabled" ;
    1.76 -		[ $(cat $ip_forward) -eq 1 ] && echo checked)/>
    1.77 +		[ "$REMOTE_USER" != 'root' ] && echo ' disabled' ;
    1.78 +		[ $(cat $ip_forward) -eq 1 ] && echo ' checked')/>
    1.79  EOT
    1.80  		_ 'forward packets between interfaces'
    1.81 -		[ "$REMOTE_USER" == "root" ] && cat <<EOT
    1.82 +		[ "$REMOTE_USER" == 'root' ] && cat <<EOT
    1.83  		<button form="mainform" name="toggleipforward" data-icon="ok">$(_ 'Change')</button>
    1.84  EOT
    1.85  		cat <<EOT
    1.86 @@ -674,7 +664,7 @@
    1.87  	<header id="hosts">
    1.88  		$(_ 'Hosts')
    1.89  EOT
    1.90 -		[ -w /etc/hosts ] && cat <<EOT
    1.91 +		[ -w '/etc/hosts' ] && cat <<EOT
    1.92  		<form action="index.cgi">
    1.93  			<input type="hidden" name="file" value="/etc/hosts"/>
    1.94  			<button name="action" value="edit" data-icon="edit">$(_ 'Edit')</button>
    1.95 @@ -683,7 +673,7 @@
    1.96  		cat <<EOT
    1.97  	</header>
    1.98  	<footer>
    1.99 -		<pre>$(cat /etc/hosts)</pre>
   1.100 +		<pre>$(cat '/etc/hosts')</pre>
   1.101  	</footer>
   1.102  </section>
   1.103  
   1.104 @@ -692,10 +682,10 @@
   1.105  	<header>$(_ 'Hostname')</header>
   1.106  	<footer>
   1.107  EOT
   1.108 -		if [ -w /etc/hostname ]; then
   1.109 +		if [ -w '/etc/hostname' ]; then
   1.110 +			# was: name="hostname"; please don't use 'name' in name: unwanted webkit styling
   1.111  			cat <<EOT
   1.112  		<form>
   1.113 -			<!-- was: name="hostname"; please don't use 'name' in name: unwanted webkit styling -->
   1.114  			<input type="text" name="host" value="$(cat /etc/hostname)"/><!--
   1.115  			--><button type="submit" data-icon="ok">$(_ 'Change')</button>
   1.116  		</form>