tazpanel diff network.cgi @ rev 525

Add "noheader" flag to get page without header/footer/panel "wrappers" (for pop-ups); strip, minify and gzip scripts and styles.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Aug 20 17:00:19 2015 +0300 (2015-08-20)
parents c0997cc494ed
children 4f619f973b88
line diff
     1.1 --- a/network.cgi	Sat Aug 08 16:06:55 2015 +0200
     1.2 +++ b/network.cgi	Thu Aug 20 17:00:19 2015 +0300
     1.3 @@ -431,59 +431,6 @@
     1.4  		# Wireless connections settings
     1.5  		xhtml_header "$(_ 'Wireless connection')"
     1.6  
     1.7 -		cat <<EOT
     1.8 -<style type="text/css">
     1.9 -#connection input[type="text"], #connection input[type="password"] { width: 14rem; }
    1.10 -#connection select { width: 14.4rem; }
    1.11 -
    1.12 -#connection td { padding: 0; margin: 0; }
    1.13 -#connection [class] div {
    1.14 -	max-height: 0; overflow: hidden; padding: 0; margin: 0;
    1.15 -	-webkit-transition: all 0.5s ease-in-out;
    1.16 -	   -moz-transition: all 0.5s ease-in-out;
    1.17 -	        transition: all 0.5s ease-in-out;
    1.18 -}
    1.19 -.wep .wep div, .wpa .wpa div, .eap .eap div,
    1.20 -.eap.peap .eap1 div, .eap.tls .eap1 div, .eap.ttls .eap1 div {
    1.21 -	max-height: 2em !important;
    1.22 -}
    1.23 -
    1.24 -#shader {
    1.25 -	z-index: 100;
    1.26 -	position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    1.27 -	background-color: #000;
    1.28 -	opacity: 0.6;
    1.29 -}
    1.30 -#shader.hidden {
    1.31 -	display: none;
    1.32 -	opacity: 0;
    1.33 -}
    1.34 -
    1.35 -#popup_qr {
    1.36 -	z-index: 101;
    1.37 -	position: fixed;
    1.38 -	width: 100%;
    1.39 -	bottom: 2em;
    1.40 -	transition: all 0.5s;
    1.41 -	-webkit-transition: all 0.5s;
    1.42 -	-webkit-transition-delay: 0.3s;
    1.43 -}
    1.44 -#popup_qr_inner {
    1.45 -	display: inline-block;
    1.46 -	text-align: center;
    1.47 -	margin: 0.5em;
    1.48 -	background: #fff; color: #222;
    1.49 -	border: 0.16em solid ; border-radius: 0.5em;
    1.50 -
    1.51 -	padding: 0.5em;
    1.52 -}
    1.53 -#popup_qr.hidden {bottom: -100em; }
    1.54 -
    1.55 -#qrimg { margin: 3em 1.5em 2em 3em; }
    1.56 -</style>
    1.57 -EOT
    1.58 -
    1.59 -
    1.60  		. /etc/network.conf
    1.61  
    1.62  		start_disabled=''; stop_disabled=''
    1.63 @@ -615,8 +562,6 @@
    1.64  
    1.65  document.getElementById('keyType').value = "$WIFI_KEY_TYPE"; wifiSettingsChange();
    1.66  
    1.67 -$(cat $PANEL/lib/qr.js.include)
    1.68 -
    1.69  function shareWiFi() {
    1.70  	// S=<SSID>; T={WPA|WEP|nopass}; P=<password>; H=<hidden?>
    1.71  	// Escape ":" and ";" -> "\:" and "\;"
    1.72 @@ -642,7 +587,7 @@
    1.73  	<tr>
    1.74  		<td style="text-align: center;">
    1.75  			<div id="popup_qr_inner">
    1.76 -				<img id="qrimg" src="#" /><br/>
    1.77 +				<img id="qrimg"/><br/>
    1.78  				$(_ 'Share Wi-Fi network with your friends')
    1.79  			</div>
    1.80  		</td>
    1.81 @@ -722,15 +667,8 @@
    1.82  
    1.83  
    1.84  <section>
    1.85 -	<header id="hosts">
    1.86 -		$(_ 'Hosts')
    1.87 -EOT
    1.88 -		edit_button /etc/hosts
    1.89 -		cat <<EOT
    1.90 -	</header>
    1.91 -	<footer>
    1.92 -		<pre>$(getdb hosts)</pre>
    1.93 -	</footer>
    1.94 +	<header id="hosts">$(_ 'Hosts'; edit_button /etc/hosts)</header>
    1.95 +	<pre class="scroll">$(getdb hosts)</pre>
    1.96  </section>
    1.97  
    1.98  
    1.99 @@ -756,30 +694,24 @@
   1.100  
   1.101  <section>
   1.102  	<header id="ifconfig">$(_ 'Output of ifconfig')</header>
   1.103 -	<footer><pre>$(ifconfig)</pre></footer>
   1.104 +	<pre>$(ifconfig)</pre>
   1.105  </section>
   1.106  
   1.107  
   1.108  <section>
   1.109  	<header id="routing">$(_ 'Routing table')</header>
   1.110 -	<footer><pre>$(route -n)</pre></footer>
   1.111 +	<pre>$(route -n)</pre>
   1.112  </section>
   1.113  
   1.114  
   1.115  <section>
   1.116 -	<header id="dns">
   1.117 -		$(_ 'Domain name resolution')
   1.118 -EOT
   1.119 -		edit_button /etc/resolv.conf
   1.120 -		cat <<EOT
   1.121 -	</header>
   1.122 -	<footer><pre>$(cat /etc/resolv.conf)</pre></footer>
   1.123 +	<header id="dns">$(_ 'Domain name resolution'; edit_button /etc/resolv.conf)</header>
   1.124 +	<pre>$(cat /etc/resolv.conf)</pre>
   1.125  </section>
   1.126  
   1.127  
   1.128  <section>
   1.129  	<header id="arp">$(_ 'ARP table')</header>
   1.130 -	<footer>
   1.131  EOT
   1.132  		if [ "$REMOTE_USER" == "root" ]; then
   1.133  			echo "<table>"
   1.134 @@ -795,7 +727,8 @@
   1.135  EOT
   1.136  			done
   1.137  			cat <<EOT
   1.138 -			</table>
   1.139 +	</table>
   1.140 +	<footer>
   1.141  		<form>
   1.142  			IP <input type="text" name="ip" value="10.20.30.40" size="12" /> on $(select_if)<!--
   1.143  			--><button type="submit" data-icon="upgrade" name="proxyarp">$(_ 'Proxy')</button>
   1.144 @@ -813,10 +746,8 @@
   1.145  
   1.146  <section>
   1.147  	<header id="connections">$(_ 'IP Connections')</header>
   1.148 -	<footer>
   1.149  	<pre>$(netstat -anp 2>/dev/null | sed -e '/UNIX domain sockets/,$d' \
   1.150  -e 's#\([0-9]*\)/#<a href="boot.cgi?daemons=pid=\1">\1</a>/#')</pre>
   1.151 -	</footer>
   1.152  </section>
   1.153  
   1.154  EOT
   1.155 @@ -825,9 +756,7 @@
   1.156  	<header id="iptables">$(_ 'Firewall')
   1.157  		$(edit_button /etc/knockd.conf "$(_ 'Port knocker')")
   1.158  	</header>
   1.159 -	<footer>
   1.160  	<pre>$(iptables-save)</pre>
   1.161 -	</footer>
   1.162  </section>
   1.163  EOT
   1.164