tazpanel diff index.cgi @ rev 312

add visual sections to pages
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu May 17 14:52:15 2012 +0300 (2012-05-17)
parents 3e9acc16f728
children 01e1839f6450
line diff
     1.1 --- a/index.cgi	Thu May 17 14:02:41 2012 +0300
     1.2 +++ b/index.cgi	Thu May 17 14:52:15 2012 +0300
     1.3 @@ -41,13 +41,14 @@
     1.4  		break
     1.5  	done
     1.6  }
     1.7 +
     1.8 +
     1.9  # OK status in table
    1.10  ok_status_t() {
    1.11  	echo "	<td>[<span class='diff-add'> OK </span>]</td></tr>"
    1.12  }
    1.13  
    1.14  
    1.15 -
    1.16  #
    1.17  # Things to do before displaying the page
    1.18  #
    1.19 @@ -119,6 +120,7 @@
    1.20  			echo '</pre>'
    1.21  		fi ;;
    1.22  
    1.23 +
    1.24  	*\ terminal\ *|*\ cmd\ *)
    1.25  		# Cmdline terminal.
    1.26  		commands='cat du help ls ping pwd who wget'
    1.27 @@ -126,6 +128,7 @@
    1.28  		TITLE=$(gettext 'TazPanel - Terminal')
    1.29  		xhtml_header
    1.30  		cat << EOT
    1.31 +<section>
    1.32  <form method="get" action="$SCRIPT_NAME">
    1.33  	<div class="box">
    1.34  		root@$(hostname):~# <input autofocus type="text" name="cmd" style="width: 80%;" />
    1.35 @@ -157,7 +160,10 @@
    1.36  				eval_gettext 'Unknown command: $cmd' && echo
    1.37  			eval_gettext 'Commands: $commands' ;;
    1.38  	esac
    1.39 -	echo '</pre>' ;;
    1.40 +	echo '</pre></section>'
    1.41 +	;;
    1.42 +
    1.43 +
    1.44  	*\ top\ *)
    1.45  		TITLE=$(gettext 'TazPanel - Process activity')
    1.46  		xhtml_header
    1.47 @@ -184,6 +190,7 @@
    1.48  			-e s"#PID.*\([^']\)#<span class='top'>\0</span>#"g
    1.49  		echo '</pre>' ;;
    1.50  
    1.51 +
    1.52  	*\ debug\ *)
    1.53  		TITLE=$(gettext 'TazPanel - Debug')
    1.54  		xhtml_header
    1.55 @@ -194,6 +201,7 @@
    1.56  EOT
    1.57  		;;
    1.58  
    1.59 +
    1.60  	*\ report\ *)
    1.61  		TITLE=$(gettext 'TazPanel - System report')
    1.62  		[ -d /var/cache/slitaz ] || mkdir -p /var/cache/slitaz
    1.63 @@ -319,6 +327,8 @@
    1.64  	<a href="http://bugs.slitaz.org/">bugs.slitaz.org</a></p>
    1.65  EOT
    1.66  		;;
    1.67 +
    1.68 +
    1.69  	*)
    1.70  		#
    1.71  		# Default xHTML content
    1.72 @@ -341,6 +351,7 @@
    1.73  		<img src="$IMAGES/text.png" />$(gettext 'Create a report')</a>
    1.74  </div>
    1.75  
    1.76 +<section>
    1.77  <h3>$(gettext 'Summary')</h3>
    1.78  <div id="summary">
    1.79  <table>
    1.80 @@ -363,10 +374,14 @@
    1.81  </table>
    1.82  <!-- Close summary -->
    1.83  </div>
    1.84 +</section>
    1.85  
    1.86 +<section>
    1.87  <h4>$(gettext 'Network status')</h4>
    1.88  $(list_network_interfaces)
    1.89 +</section>
    1.90  
    1.91 +<section>
    1.92  <h4>$(gettext 'Filesystem usage statistics')</h4>
    1.93  EOT
    1.94  		# Disk stats (management is done as hardware.cgi)
    1.95 @@ -396,15 +411,14 @@
    1.96  		cat << EOT
    1.97  </tbody>
    1.98  </table>
    1.99 -EOT
   1.100 +</section>
   1.101  
   1.102 -
   1.103 -		cat << EOT
   1.104 +<section>
   1.105  <h3>$(gettext 'Panel Activity')</h3>
   1.106  <pre id="panel-activity">
   1.107  $(cat $LOG_FILE | tail -n 8 | sort -r | syntax_highlighter activity)
   1.108  </pre>
   1.109 -
   1.110 +</section>
   1.111  EOT
   1.112  		;;
   1.113  esac