tazpanel view index.cgi @ rev 42

Add settings.cgi and split user config from index.cgi, add need CSS stuff and up POT
author Christophe Lincoln <pankso@slitaz.org>
date Thu Apr 07 01:22:07 2011 +0200 (2011-04-07)
parents 1a80f769f6e1
children af4b1f0b3110
line source
1 #!/bin/sh
2 #
3 # Main CGI interface for TazPanel. In on word: KISS. Use the main cas form
4 # command so we are faster and dont load unneeded function. If nececarry
5 # you can use the lib/ dir to handle external resources.
6 #
7 # Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
8 #
9 echo "Content-Type: text/html"
10 echo ""
12 # Common functions from libtazpanel
13 . lib/libtazpanel
14 get_config
16 # Include gettext helper script.
17 . /usr/bin/gettext.sh
19 # Export package name for gettext.
20 TEXTDOMAIN='tazpanel'
21 export TEXTDOMAIN
23 #
24 # Commands
25 #
27 case "$QUERY_STRING" in
28 boot)
29 #
30 # Everything until user login
31 #
32 TITLE="- Boot"
33 xhtml_header
34 cat << EOT
35 <div id="wrapper">
36 <h2>`gettext "Boot &amp; startup"`</h2>
37 <p>
38 `gettext "Everything that appends before user login."`
39 </p>
40 </div>
42 <h3>`gettext "Kernel cmdline"`</h3>
43 <pre>
44 `cat /proc/cmdline`
45 </pre>
46 EOT
47 ;;
48 hardware)
49 #
50 # Hardware drivers, devices, filesystem, screen
51 #
52 TITLE="- Hardware"
53 xhtml_header
54 cat << EOT
55 <div id="wrapper">
56 <h2>`gettext "Drivers &amp; Devices"`</h2>
57 <p>`gettext "Manage your computer hardware`</p>
58 </div>
59 EOT
60 echo '<pre>'
61 fdisk -l | fgrep Disk
62 echo '</pre>'
63 echo '<pre>'
64 df -h | grep ^/dev
65 echo '</pre>'
66 echo '<pre>'
67 lspci
68 echo '</pre>'
69 ;;
70 *)
71 #
72 # Default xHTML content
73 #
74 xhtml_header
75 case "$QUERY_STRING" in
76 gen-locale=*)
77 new_locale=${QUERY_STRING#gen-locale=} ;;
78 rdate)
79 echo "" ;;
80 esac
81 cat << EOT
82 <div id="wrapper">
83 <h2>`gettext "Host:"` `hostname`</h2>
84 <p>`gettext "SliTaz administration et configuration Panel"`<p>
85 </div>
87 <h3>`gettext "Summary"`</h3>
88 <div id="summary">
89 <p>
90 `gettext "Uptime:"` `uptime`
91 </p>
92 <p>
93 `gettext "Memory in Mb"`
94 `free -m | grep Mem: | awk \
95 '{print "| Total:", $2, "| Used:", $3, "| Free:", $4}'`
96 </p>
97 <!-- Close summary -->
98 </div>
100 <h4>`gettext "Network status"`</h4>
101 `list_network_interfaces`
103 <h4>`gettext "Filesystem usage statistics"`</h4>
104 <pre>
105 `df -h | grep ^/dev`
106 </pre>
107 EOT
108 ;;
109 esac
111 xhtml_footer
112 exit 0