tazpanel diff network.cgi @ rev 523

lib/libtazpanel: add edit_button()
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Aug 08 16:06:55 2015 +0200 (2015-08-08)
parents 8b67a70440c2
children 5323427d34b9
line diff
     1.1 --- a/network.cgi	Fri Aug 07 02:33:24 2015 +0300
     1.2 +++ b/network.cgi	Sat Aug 08 16:06:55 2015 +0200
     1.3 @@ -321,12 +321,7 @@
     1.4  	<header>
     1.5  		$(_ 'Configuration file')
     1.6  EOT
     1.7 -		[ -w /etc/network.conf ] && cat <<EOT
     1.8 -		<form action="index.cgi">
     1.9 -			<input type="hidden" name="file" value="/etc/network.conf"/>
    1.10 -			<button name="action" value="edit" data-icon="edit">$(_ 'Edit')</button>
    1.11 -		</form>
    1.12 -EOT
    1.13 +		edit_button /etc/network.conf
    1.14  		cat <<EOT
    1.15  	</header>
    1.16  	<div>$(_ "These values are the ethernet settings in the main /etc/network.conf configuration file")</div>
    1.17 @@ -661,12 +656,7 @@
    1.18  	<header>
    1.19  		$(_ 'Configuration file')
    1.20  EOT
    1.21 -		[ -w /etc/network.conf ] && cat <<EOT
    1.22 -		<form action="index.cgi">
    1.23 -			<input type="hidden" name="file" value="/etc/network.conf"/>
    1.24 -			<button name="action" value="edit" data-icon="edit">$(_ 'Edit')</button>
    1.25 -		</form>
    1.26 -EOT
    1.27 +		edit_button /etc/network.conf
    1.28  		cat <<EOT
    1.29  	</header>
    1.30  	<div>$(_ "These values are the wifi settings in the main /etc/network.conf configuration file")</div>
    1.31 @@ -735,12 +725,7 @@
    1.32  	<header id="hosts">
    1.33  		$(_ 'Hosts')
    1.34  EOT
    1.35 -		[ -w '/etc/hosts' ] && cat <<EOT
    1.36 -		<form action="index.cgi">
    1.37 -			<input type="hidden" name="file" value="/etc/hosts"/>
    1.38 -			<button name="action" value="edit" data-icon="edit">$(_ 'Edit')</button>
    1.39 -		</form>
    1.40 -EOT
    1.41 +		edit_button /etc/hosts
    1.42  		cat <<EOT
    1.43  	</header>
    1.44  	<footer>
    1.45 @@ -785,12 +770,7 @@
    1.46  	<header id="dns">
    1.47  		$(_ 'Domain name resolution')
    1.48  EOT
    1.49 -		[ -w /etc/resolv.conf ] && cat <<EOT
    1.50 -		<form action="index.cgi">
    1.51 -			<input type="hidden" name="file" value="/etc/resolv.conf"/>
    1.52 -			<button name="action" value="edit" data-icon="edit">$(_ 'Edit')</button>
    1.53 -		</form>
    1.54 -EOT
    1.55 +		edit_button /etc/resolv.conf
    1.56  		cat <<EOT
    1.57  	</header>
    1.58  	<footer><pre>$(cat /etc/resolv.conf)</pre></footer>
    1.59 @@ -842,7 +822,9 @@
    1.60  EOT
    1.61  		[ "$REMOTE_USER" == "root" -a "$(which iptables-save)" ] && cat <<EOT
    1.62  <section>
    1.63 -	<header id="iptables">$(_ 'Firewall')</header>
    1.64 +	<header id="iptables">$(_ 'Firewall')
    1.65 +		$(edit_button /etc/knockd.conf "$(_ 'Port knocker')")
    1.66 +	</header>
    1.67  	<footer>
    1.68  	<pre>$(iptables-save)</pre>
    1.69  	</footer>