tazpanel view index.cgi @ rev 472

boot.cgi: change look of "System logs" page; index.cgi: return "Diff" button back.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Apr 30 02:25:59 2015 +0300 (2015-04-30)
parents 7ca14d55e705
children de34ca9d1417
line source
1 #!/bin/sh
2 #
3 # Main CGI interface for TazPanel. In on word: KISS. Use the main CSS form
4 # command so we are faster and do not load unneeded functions. If necessary
5 # you can use the lib/ dir to handle external resources.
6 #
7 # Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License
8 #
11 # Common functions from libtazpanel
13 . lib/libtazpanel
14 get_config
16 TITLE="TazPanel"
20 # Check whether a configuration file has been modified after installation
22 file_is_modified() {
23 grep -l " $1$" $INSTALLED/*/md5sum | while read file; do
25 # Found, but can we do diff?
26 [ "$(grep -h " $1$" $file)" != "$(md5sum $1)" ] || break
27 orig=$(dirname $file)/volatile.cpio.gz
28 zcat $orig 2>/dev/null | cpio -t 2>/dev/null | grep -q "^${1#/}$" || break
30 case "$2" in
31 diff)
32 tmp=$(mktemp -d)
33 ( cd $tmp; zcat $orig | cpio -id ${1#/} )
34 diff -abu $tmp$1 $1 | sed "s|$tmp||"
35 rm -rf $tmp;;
36 button)
37 echo -n '<button name="action" value="diff" data-icon="diff">'$(_ 'Differences')'</button>';;
38 esac
39 break
40 done
41 }
45 # OK status in table
47 ok_status_t() {
48 echo '<td><span class="diff-add" data-img="ok"></span></td></tr>'
49 }
53 # Terminal prompt
55 term_prompt() {
56 if [ "$user" == 'root' ]; then
57 local color1='color31' sign='#'
58 else
59 local color1='color32' sign='$'
60 fi
61 echo -n "<span class='$color1'>$user@$(hostname)</span>:<span class='color33'>"
62 pwd | sed "s|^$HOME|~|" | tr -d '\n'; echo -n "</span>$sign "
63 }
67 #
68 # Things to do before displaying the page
69 #
71 [ -n "$(GET panel_pass)" ] &&
72 sed -i s@/:root:.*@/:root:$(GET panel_pass)@ $HTTPD_CONF
78 #
79 # Commands
80 #
82 case " $(GET) " in
85 *\ exec\ *)
86 # Execute command and display its result in a terminal-like window
88 header; TITLE=$(_ 'TazPanel - exec'); xhtml_header
90 exec="$(GET exec)"
91 font="${TERM_FONT:-monospace}"
92 palette=$(echo $TERM_PALETTE | tr A-Z a-z)
94 cat <<EOT
95 <section>
96 <header>
97 $exec
98 $(back_button "$(GET back)" "$(GET back_caption)" "$(GET back_icon)")
99 </header>
100 <div class="term_">
101 <pre class="term $palette" style="font-family: '$font'">$($exec 2>&1 | htmlize | filter_taztools_msgs)</pre>
102 </div>
103 </section>
104 EOT
105 ;;
108 *\ file\ *)
109 #
110 # Handle files
111 #
112 header
113 file="$(GET file)"
114 action="$(POST action)"; [ -z "$action" ] && action="$(GET action)" # receive 'action' both on POST or GET
115 title="$(POST title)"; [ -z "$title" ] && title="$(GET title)" # (optional)
117 case $file in
118 *.html)
119 cat $file; exit 0 ;;
120 *)
121 TITLE=$(_ 'TazPanel - File'); xhtml_header ;;
122 esac
124 case "$action" in
125 edit)
126 cat <<EOT
127 <section>
128 <header>
129 <span data-icon="edit">${title:-$file}</span>
130 <form id="editform" method="post" action="?file=$file">
131 <button data-icon="save">$(_ 'Save')</button>
132 <button name="action" value="diff" data-icon="diff">$(_ 'Differences')</button>
133 </form>
134 </header>
135 <textarea form="editform" name="content" class="wide" rows="30" autofocus>$(cat $file | htmlize)</textarea>
136 </section>
137 EOT
138 #The space before textarea gets muddled when the form is submitted.
139 #It prevents anything else from getting messed up
140 ;;
142 setvar)
143 data="$(. $(GET file) ;eval echo \$$(GET var))"
144 cat <<EOT
145 <section>
146 <header>$(GET var)</header>
147 <form method="post" action="?file=$file" class="nogap">
148 <input type="hidden" name="var" value="$(GET var)">
149 <input type="text" name="content" value="${data:-$(GET default)}">
150 <button type="submit" data-icon="save">$(_ 'Save')</button>
151 </form>
152 </section>
153 EOT
154 ;;
156 diff)
157 cat <<EOT
158 <section>
159 <pre id="diff">$(file_is_modified $file diff | syntax_highlighter diff)</pre>
160 </section>
161 EOT
162 ;;
164 *)
165 R=$(echo -en '\r')
166 if [ -n "$(POST content)" ]; then
167 if [ -n "$(POST var)" ]; then
168 sed -i "s|^\\($(POST var)=\\).*|\1\"$(POST content)\"|" $file
169 else
170 sed "s/$R /\n/g;s/$R%0//g" > $file <<EOT
171 $(POST content)
172 EOT
173 fi
174 fi
176 cat <<EOT
177 <section class="bigNoScrollable">
178 <header>
179 <span data-icon="text">${title:-$file}</span>
180 EOT
181 if [ -w "$file" ]; then
182 cat <<EOT
183 <form>
184 <input type="hidden" name="file" value="$file"/>
185 <button onclick='editFile(); return false' id="edit_button"
186 data-icon="edit">$(_ 'Edit')</button><!--
187 --><button onclick='saveFile("$file", "$title"); return false' id="save_button"
188 data-icon="save" style="display:none">$(_ 'Save')</button><!--
189 -->$(file_is_modified $file button)
190 </form>
191 EOT
192 elif [ -r "$file" ]; then
193 cat <<EOT
194 <form>
195 <input type="hidden" name="file" value="$file"/>
196 $(file_is_modified $file button)
197 </form>
198 EOT
199 fi
200 cat <<EOT
201 </header>
203 <div>
204 <pre id="fileContent" class="bigScrollable">
205 EOT
206 end_code=''
207 # Handle file type by extension as a Web Server does it.
208 case "$file" in
209 *.sh|*.cgi|*/receipt|*.conf)
210 echo '<code class="language-bash">'; end_code='</code>'
211 cat | htmlize ;;
212 *.ini)
213 echo '<code class="language-ini">'; end_code='</code>'
214 cat | htmlize ;;
215 *.conf|*.lst)
216 syntax_highlighter conf ;;
217 *Xorg.0.log)
218 syntax_highlighter xlog ;;
219 *dmesg.log)
220 syntax_highlighter kernel ;;
221 *)
222 cat | htmlize ;;
223 esac < $file
224 cat <<EOT
225 $end_code</pre>
226 </div>
227 </section>
228 EOT
229 esac
230 ;;
234 *\ terminal\ *|*\ cmd\ *)
235 # Cmdline terminal
237 header; TITLE=$(_ 'TazPanel - Terminal'); xhtml_header
239 user="$REMOTE_USER"
240 HOME="$(awk -F: -vu=$user '$1==u{print $6}' /etc/passwd)"
241 historyfile="$HOME/.ash_history"
243 cmd=$(GET cmd)
244 path="$(GET path)"; path="${path:-/tmp}"; cd "$path"
246 font="${TERM_FONT:-monospace}"
247 palette=$(echo $TERM_PALETTE | tr A-Z a-z)
249 [ -n "$cmd" -a "$cmd" != "$(tail -n1 $historyfile)" ] && echo "$cmd" >> $historyfile
252 # Terminal history
254 if [ "$cmd" == 'history' ]; then
255 cat <<EOT
256 <section>
257 <header>
258 $(_ 'History')
259 <form><button name="terminal" data-icon="terminal">$(_ 'Back')</button></form>
260 </header>
261 <form>
262 <input type="hidden" name="path" value="$path"/>
263 <pre class="term $palette" style="font-family: '$font'">
264 EOT
265 htmlize < $historyfile | awk -vrun="$(_ 'run')" -vpath="$path" '
266 BEGIN { num=1 }
267 {
268 printf("%3d ", num);
269 cmd = $0
270 gsub("%", "%25", cmd); gsub("+", "%2B", cmd); gsub(" ", "+", cmd);
271 gsub("\"", "%22", cmd); gsub("!", "%21", cmd); gsub("'\''", "%27", cmd);
272 printf("<a data-icon=\"run\" href=\"?cmd=%s&path=%s\">%s</a> ", cmd, path, run);
273 printf("<input type=\"checkbox\" name=\"rm\" value=\"%d\" id=\"hist%d\">", num, num);
274 printf("<label for=\"hist%d\">%s</label>\n", num, $0);
275 num++
276 }'
277 cat <<EOT
278 </pre>
279 <footer>
280 <button name="rmhistory" data-icon="remove">$(_ 'Clear')</button>
281 </footer>
282 </form>
283 </section>
284 EOT
285 xhtml_footer
286 exit 0
287 fi
290 # Terminal window
292 cat <<EOT
293 <span id="num_hist"></span>
294 <section>
295 <pre class="term $palette" style="font-family: '$font'" onclick="document.getElementById('typeField').focus()">
296 EOT
297 if [ -n "$cmd" ]; then
298 term_prompt
299 echo "$cmd" | htmlize
300 fi
302 case "$cmd" in
303 usage|help)
304 _ 'Small non-interactive terminal emulator.'; echo
305 _ 'Run any command at your own risk, avoid interactive commands (%s)' 'nano, mc, ...'; echo
306 ;;
307 wget*)
308 dl=/var/cache/downloads
309 [ ! -d "$dl" ] && mkdir -p $dl
310 _ 'Downloading to: %s' $dl; echo
311 cd $dl; $cmd 2>&1 ;;
312 cd|cd\ *)
313 path="${cmd#cd}"; path="${path:-$HOME}";
314 path="$(realpath $path)"; cd "$path" ;;
315 ls|ls\ *)
316 $cmd -w80 --color=always 2>&1 | filter_taztools_msgs ;;
317 cat)
318 # Cmd must be used with an arg.
319 _ '%s needs an argument' "$cmd" ;;
320 mc|nano|su)
321 # List of restricted (interactive) commands
322 _ "Please, don't run interactive command \"%s\"" "$cmd"; echo; echo ;;
323 *)
324 unset HTTP_REFERER # for fooling /lib/libtaz.sh formatting utils (<hr> in the terminal is so-so)
325 export DISPLAY=:0.0 # for run X applications
326 /bin/sh -c "$cmd" 2>&1 | htmlize | filter_taztools_msgs
327 ;;
328 esac
330 cat <<EOT
331 <form id="term">
332 <div class="cmdline" id="cmdline"><span id="prompt">$(term_prompt)</span><span id="typeField"> </span></div>
333 <input type="hidden" name="path" value="$(pwd)"/>
334 <input type="hidden" name="cmd" id="cmd"/>
335 </form>
336 </pre>
337 </section>
339 <form>
340 <button name="termsettings" data-icon="settings">$(_ 'Settings')</button>
341 <button name="cmd" value="history" data-icon="history">$(_ 'History')</button>
342 </form>
344 <script type="text/javascript">
345 with (document.getElementById('typeField')) {
346 contentEditable=true;
347 focus();
348 }
349 document.onkeydown=keydownHandler;
350 EOT
352 # Export history as array.
353 # Escape "all \"quotes\" in quotes", and all '\'
354 # (because \u, \x, \c has special meaning and can produce syntax error and stop js)
355 sed 's|\\|\\\\|g; s|"|\\"|g' $historyfile | awk '
356 BEGIN{ i=1; printf("ash_history=[") }
357 { printf("\"%s\",", $0); i++ }
358 END{
359 printf("\"\"];")
360 i--; printf("cur_hist=\"%d\";max_hist=\"%d\";", i, i)
361 }'
362 cat <<EOT
363 </script>
364 EOT
365 ;;
368 *\ rmhistory\ *)
369 # Manage shell commandline history
370 user="$REMOTE_USER"
371 [ -z "$HOME" ] && HOME="$(awk -F: -vu=$user '$1==u{print $6}' /etc/passwd)"
372 historyfile="$HOME/.ash_history"
374 # Return sed command for removing history lines ('8d12d' to remove 8 and 12 lines)
375 rms=$(echo $QUERY_STRING | awk 'BEGIN{RS="&";FS="="}{if($1=="rm")printf "%dd", $2}')
377 if [ -n "$rms" ]; then
378 # Actually remove lines
379 sed -i $rms $historyfile
380 # Redirects back to the history table
381 header "HTTP/1.1 301 Moved Permanently" "Location: ?terminal&cmd=history&path=$(GET path)"
382 exit 0
383 fi
384 ;;
387 *\ termsettings\ *)
388 # Terminal settings
389 TITLE=$(_ 'TazPanel - Terminal'); header; xhtml_header;
390 user="$REMOTE_USER"
391 font="$(GET font)"; font="${font:-$TERM_FONT}"
392 palette="$(GET palette)"; palette="${palette:-$TERM_PALETTE}"
393 pal=$(echo $palette | tr A-Z a-z)
395 # Add or change settings in TazPanel config
396 if [ -z "$TERM_FONT" ]; then
397 echo -e "\n# Terminal font family\nTERM_FONT=\"$font\"" >> $CONFIG
398 else
399 sed -i "s|TERM_FONT=.*|TERM_FONT=\"$font\"|" $CONFIG
400 fi
401 if [ -z "$TERM_PALETTE" ]; then
402 echo -e "\n# Terminal color palette\nTERM_PALETTE=\"$palette\"" >> $CONFIG
403 else
404 sed -i "s|TERM_PALETTE=.*|TERM_PALETTE=\"$palette\"|" $CONFIG
405 fi
407 cat <<EOT
408 <section style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: 0.5rem;">
409 <header>
410 $(_ 'Terminal settings')
411 <form>
412 <button name="terminal" data-icon="terminal">$(_ 'Terminal')</button>
413 </form>
414 </header>
415 <pre class="term $pal" style="height: auto; font-family: '$font'">
416 <span class='color31'>$user@$(hostname)</span>:<span class='color33'>~</span># palette
418 $(
419 for i in $(seq 30 37); do
420 for b in 0 1; do
421 for j in $(seq 40 47); do
422 echo -n "<span class=\"color$b color$i color$j\">$i:$j</span>"
423 done
424 done
425 echo
426 done
427 )
428 </pre>
429 <footer>
430 <form class="wide">
431 $(_ 'Font:')
432 <select name="font">
433 <option value="">$(_ 'Default')</option>
434 $(fc-list :spacing=mono:lang=en family | sed '/\.pcf/d;/,/d;s|\\-|-|g' | sort -u | \
435 awk -vfont="$font" '{
436 printf("<option value=\"%s\"%s>%s</option>\n", $0, ($0 == font)?" selected":"", $0)
437 }')
438 </select>
439 $(_ 'Palette:')
440 <select name="palette">
441 $(echo -e 'Tango\nLinux\nXterm\nRxvt\nEcho' | awk -vpal="$palette" '{
442 printf("<option value=\"%s\"%s>%s</option>\n", $0, ($0 == pal)?" selected":"", $0)
443 }')
444 </select>
445 <button name="termsettings" data-icon="ok">$(_ 'Apply')</button>
446 </form>
447 </footer>
448 </section>
449 EOT
451 ;;
454 *\ top\ *)
455 header; TITLE=$(_ 'TazPanel - Process activity'); xhtml_header
457 r=$(GET refresh)
458 cat <<EOT
459 <form>
460 <p>$(_ 'Refresh:')
461 <input type="hidden" name="top"/>
462 <input type="radio" name="refresh" value="1" id="r1" $([ "$r" == 1 ] && echo checked) onchange="this.form.submit()"/>
463 <label for="r1">$(_ '1s' )</label>
464 <input type="radio" name="refresh" value="5" id="r2" $([ "$r" == 5 ] && echo checked) onchange="this.form.submit()"/>
465 <label for="r2">$(_ '5s' )</label>
466 <input type="radio" name="refresh" value="10" id="r3" $([ "$r" == 10 ] && echo checked) onchange="this.form.submit()"/>
467 <label for="r3">$(_ '10s' )</label>
468 <input type="radio" name="refresh" value="" id="r4" $([ -z "$r" ] && echo checked) onchange="this.form.submit()"/>
469 <label for="r4">$(_ 'none')</label>
470 </p>
471 </form>
472 EOT
473 [ -n "$r" ] && echo "<meta http-equiv=\"refresh\" content=\"$r\">"
475 echo '<section><div><pre class="term log">'
476 top -n1 -b | htmlize | sed \
477 -e 's|^[A-Z].*:|<span class="color1 color31">\0</span>|g' \
478 -e 's|^\ *PID|<span class="color1 color32">\0</span>|g'
479 echo '</pre></div></section>' ;;
482 *\ debug\ *)
483 header; TITLE=$(_ 'TazPanel - Debug'); xhtml_header
485 cat <<EOT
486 <h2>$(_ 'HTTP Environment')</h2>
488 <section>
489 <div>
490 <pre>$(httpinfo | syntax_highlighter conf)</pre>
491 </div>
492 </section>
493 EOT
494 ;;
497 *\ report\ *)
498 header; TITLE=$(_ 'TazPanel - System report'); xhtml_header
500 [ -d /var/cache/slitaz ] || mkdir -p /var/cache/slitaz
501 output=/var/cache/slitaz/sys-report.html
503 cat <<EOT
505 <section>
506 <header>$(_ 'Reporting to: %s' "$output")</header>
507 <table class="wide zebra">
508 <tbody>
509 <tr><td>$(_ 'Creating report header...')</td>
510 EOT
511 cat > $output <<EOT
512 <!DOCTYPE html>
513 <html xmlns="http://www.w3.org/1999/xhtml">
514 <head>
515 <meta charset="utf-8"/>
516 <title>$(_ 'SliTaz system report')</title>
517 <style type="text/css">
518 body { padding: 20px 60px; font-size: 13px; }
519 h1, h2 { color: #444; }
520 pre { background: #f1f1f1; border: 1px solid #ddd;
521 padding: 10px; border-radius: 4px; }
522 span.diff-rm { color: red; }
523 span.diff-add { color: green; }
524 </style>
525 </head>
526 <body>
527 EOT
528 cat <<EOT
529 $(ok_status_t)
530 <tr><td>$(_ 'Creating system summary...')</td>
531 EOT
532 cat >> $output <<EOT
533 <h1>$(_ 'SliTaz system report')</h1>
534 $(_ 'Date:') $(date)
535 <pre>
536 uptime : $(uptime)
537 cmdline : $(cat /proc/cmdline)
538 version : $(cat /etc/slitaz-release)
539 packages : $(ls /var/lib/tazpkg/installed | wc -l) installed
540 kernel : $(uname -r)
541 </pre>
542 EOT
543 cat <<EOT
544 $(ok_status_t)
545 <tr><td>$(_ 'Getting hardware info...')</td>
546 EOT
547 cat >> $output <<EOT
548 <h2>free</h2>
549 <pre>$(free)</pre>
551 <h2>lspci -k</h2>
552 <pre>$(lspci -k)</pre>
554 <h2>lsusb</h2>
555 <pre>$(lsusb)</pre>
557 <h2>lsmod</h2>
558 <pre>$(lsmod)</pre>
560 EOT
561 cat <<EOT
562 $(ok_status_t)
563 <tr><td>$(_ 'Getting networking info...')</td>
564 EOT
565 cat >> $output <<EOT
566 <h2>ifconfig -a</h2>
567 <pre>$(ifconfig -a)</pre>
569 <h2>route -n</h2>
570 <pre>$(route -n)</pre>
572 <h2>/etc/resolv.conf</h2>
573 <pre>$(cat /etc/resolv.conf)</pre>
574 EOT
575 cat <<EOT
576 $(ok_status_t)
577 <tr><td>$(_ 'Getting filesystems info...')</td>
578 EOT
579 cat >> $output <<EOT
580 <h2>blkid</h2>
581 <pre>$(blkid)</pre>
583 <h2>fdisk -l</h2>
584 <pre>$(fdisk -l)</pre>
586 <h2>mount</h2>
587 <pre>$(mount)</pre>
589 <h2>df -h</h2>
590 <pre>$(df -h)</pre>
592 <h2>df -i</h2>
593 <pre>$(df -i)</pre>
594 EOT
595 cat <<EOT
596 $(ok_status_t)
597 <tr><td>$(_ 'Getting boot logs...')</td>
598 EOT
599 cat >> $output <<EOT
600 <h2>$(_ 'Kernel messages')</h2>
601 <pre>$(cat /var/log/dmesg.log)</pre>
603 <h2>$(_ 'Boot scripts')</h2>
604 <pre>$(cat /var/log/boot.log | filter_taztools_msgs)</pre>
605 EOT
606 cat <<EOT
607 $(ok_status_t)
608 <tr><td>$(_ 'Creating report footer...')</td>
609 EOT
610 cat cat >> $output <<EOT
611 </body>
612 </html>
613 EOT
614 cat <<EOT
615 $(ok_status_t)
616 </tbody>
617 </table>
618 <footer>
619 <form><button name="file" value="$output" data-icon="view">$(_ 'View')</button></form>
620 </footer>
621 </section>
624 $(msg tip "$(_ 'This report can be attached with a bug report on:')
625 <a href="http://bugs.slitaz.org/" target="_blank">bugs.slitaz.org</a></p>")
626 EOT
627 ;;
630 *)
631 #
632 # Default xHTML content
633 #
634 header; xhtml_header
635 [ -n "$(GET gen_locale)" ] && new_locale=$(GET gen_locale)
636 [ -n "$(GET rdate)" ] && echo ""
637 hostname=$(hostname)
639 cat <<EOT
640 <h2>$(_ 'Host: %s' $hostname)</h2>
641 <p>$(_ 'SliTaz administration and configuration Panel')<p>
643 <form class="nogap"><!--
644 --><button name="terminal" data-icon="terminal">$(_ 'Terminal')</button><!--
645 --><button name="top" data-icon="proc" >$(_ 'Process activity')</button><!--
646 --><button name="report" data-icon="report" data-root>$(_ 'Create a report')</button><!--
647 --></form>
649 <section>
650 <header>$(_ 'Summary')</header>
651 <table>
652 <tr><td>$(_ 'Uptime:')</td>
653 <td id="uptime">$(uptime | sed 's|\([0-9.:][0-9.:]*\)|<b>\1</b>|g')</td>
654 </tr>
655 <tr><td>$(_ 'Memory in Mb:')</td>
656 <td>$(free -m | grep Mem: | \
657 awk -vline="$(gettext 'Total: %d, Used: %d, Free: %d')" \
658 '{ printf(line, $2, $3, $4) }' | \
659 sed 's|\([0-9][0-9]*\)|<b>\1</b>|g')</td>
660 </tr>
661 <tr><td>$(_ 'Linux kernel:')</td>
662 <td>$(uname -r)</td>
663 </tr>
664 </table>
665 </section>
668 <section>
669 <header>
670 $(_ 'Network status')
671 <form action="network.cgi">
672 <button data-icon="wifi">$(_ 'Network')</button>
673 </form>
674 </header>
675 $(list_network_interfaces)
676 </section>
679 <section>
680 <header>
681 $(_ 'Filesystem usage statistics')
682 <form action="hardware.cgi">
683 <button data-icon="hdd">$(_ 'Disks')</button>
684 </form>
685 </header>
686 <table class="wide zebra center">
687 EOT
688 # Disk stats (management is done as hardware.cgi)
689 df_thead
690 echo '<tbody>'
691 df -h | grep ^/dev | while read fs size used av pct mp; do
692 cat <<EOT
693 <tr>
694 <td><span data-icon="hdd">${fs#/dev/}</span></td>
695 <td>$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td>
696 <td>$(blkid $fs | sed '/TYPE=/!d;s/.*TYPE="\([^"]*\).*/\1/')</td>
697 <td>$size</td>
698 <td>$av</td>
699 <td class="meter"><meter min="0" max="100" value="$(echo $pct | cut -d% -f1)"
700 low="$DU_WARN" high="$DU_CRIT" optimum="10"></meter>
701 <span>$used - $pct</span>
702 </td>
703 <td>$mp</td>
704 <td>$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td>
705 </tr>
706 EOT
707 done
708 cat <<EOT
709 </tbody>
710 </table>
711 </section>
713 <section>
714 <header>
715 $(_ 'Panel Activity')
716 <form>
717 <button name="file" value="$LOG_FILE" data-icon="view">$(_ 'View')</button>
718 </form>
719 </header>
720 <div>
721 <pre id="panel-activity">
722 $(cat $LOG_FILE | tail -n 8 | sort -r | syntax_highlighter activity)</pre>
723 </div>
724 </section>
725 EOT
726 ;;
727 esac
729 xhtml_footer
730 exit 0