# HG changeset patch # User Pascal Bellard # Date 1439042815 -7200 # Node ID c0997cc494ed1d15c7b6c35aa9bc82c9668fc839 # Parent 8b67a70440c2eb87bd496c080ecb3b55125b5ca5 lib/libtazpanel: add edit_button() diff -r 8b67a70440c2 -r c0997cc494ed boot.cgi --- a/boot.cgi Fri Aug 07 02:33:24 2015 +0300 +++ b/boot.cgi Sat Aug 08 16:06:55 2015 +0200 @@ -45,12 +45,7 @@ $(_ 'System logs') EOT - [ -w /etc/syslog.conf ] && cat < - - - -EOT + edit_button /etc/syslog.conf syslog.conf cat < @@ -518,14 +513,7 @@
$(_ 'Local startup commands') -
- -EOT - [ -w /etc/init.d/local.sh ] && cat <$(_ 'Edit') -EOT - cat < + $(edit_button /etc/init.d/local.sh)
$(htmlize < /etc/init.d/local.sh)
diff -r 8b67a70440c2 -r c0997cc494ed hardware.cgi --- a/hardware.cgi Fri Aug 07 02:33:24 2015 +0300 +++ b/hardware.cgi Sat Aug 08 16:06:55 2015 +0200 @@ -485,14 +485,7 @@
$(_ 'Filesystems table') -EOT - [ -w /etc/fstab ] && cat < - - - -EOT - cat < diff -r 8b67a70440c2 -r c0997cc494ed index.cgi --- a/index.cgi Fri Aug 07 02:33:24 2015 +0300 +++ b/index.cgi Sat Aug 08 16:06:55 2015 +0200 @@ -618,9 +618,9 @@ print "
"
 	for (i in pkg) for (j = split(pkg[i], p, " "); j > 2; j--) {
 		if (pkg[p[j]] || alias[p[j]]) kill[p[j]]=1
-		else print "Missing dep " p[j] " for " name(p[1])
+		else { miss=1 ; print "Missing dep " p[j] " for " name(p[1]) }
 	}
-	print ""
+	if (miss) print ""
 	n=0
 	for (i=0; i < c; i++) {
 		if (kill[idx[i]]) continue
diff -r 8b67a70440c2 -r c0997cc494ed lib/libtazpanel
--- a/lib/libtazpanel	Fri Aug 07 02:33:24 2015 +0300
+++ b/lib/libtazpanel	Sat Aug 08 16:06:55 2015 +0200
@@ -369,6 +369,17 @@
 }
 
 
+# Show "Edit" button
+
+edit_button() {
+	[ -w "$1" ] && cat <
+			
+			
+		
+EOT
+}
+
 # Mark select option as checked
 
 selected() {
diff -r 8b67a70440c2 -r c0997cc494ed network.cgi
--- a/network.cgi	Fri Aug 07 02:33:24 2015 +0300
+++ b/network.cgi	Sat Aug 08 16:06:55 2015 +0200
@@ -321,12 +321,7 @@
 	
$(_ 'Configuration file') EOT - [ -w /etc/network.conf ] && cat < - - - -EOT + edit_button /etc/network.conf cat <
$(_ "These values are the ethernet settings in the main /etc/network.conf configuration file")
@@ -661,12 +656,7 @@
$(_ 'Configuration file') EOT - [ -w /etc/network.conf ] && cat < - - - -EOT + edit_button /etc/network.conf cat <
$(_ "These values are the wifi settings in the main /etc/network.conf configuration file")
@@ -735,12 +725,7 @@
$(_ 'Hosts') EOT - [ -w '/etc/hosts' ] && cat < - - - -EOT + edit_button /etc/hosts cat <
@@ -785,12 +770,7 @@
$(_ 'Domain name resolution') EOT - [ -w /etc/resolv.conf ] && cat < - - - -EOT + edit_button /etc/resolv.conf cat <
$(cat /etc/resolv.conf)
@@ -842,7 +822,9 @@ EOT [ "$REMOTE_USER" == "root" -a "$(which iptables-save)" ] && cat < -
$(_ 'Firewall')
+
$(_ 'Firewall') + $(edit_button /etc/knockd.conf "$(_ 'Port knocker')") +
$(iptables-save)