tazbug view web/plugins/dashboard/dashboard.cgi @ rev 99

Small change to dashboard plugin
author Christophe Lincoln <pankso@slitaz.org>
date Fri Feb 10 15:27:11 2017 +0100 (2017-02-10)
parents 2808fc73ac9f
children bcaad2bc76c8
line source
1 #!/bin/sh
2 #
3 # TazBug Plugin - Dashboard
4 #
6 if [ "$(GET dashboard)" ]; then
7 d="Dashboard"
8 users=$(ls -1 $PEOPLE | wc -l)
9 bugs=$(ls -1 $bugdir | wc -l)
10 bugsize=$(du -sh $bugdir | awk '{print $1}')
11 header
12 html_header
13 user_box
14 if ! check_auth; then
15 gettext "You must be logged in to view the dashboard"
16 exit 0
17 fi
18 # Source all plugins.conf to get DASHBOARD_TOOLS and ADMIN_TOOLS
19 ADMIN_TOOLS=""
20 DASHBOARD_TOOLS=""
21 for p in $(ls $plugins)
22 do
23 . $plugins/$p/$p.conf
24 done
25 if check_auth && ! admin_user; then
26 ADMIN_TOOLS=""
27 fi
28 cat << EOT
29 <h2>Dashboard</h2>
31 <div id="tools">
32 $DASHBOARD_TOOLS $ADMIN_TOOLS
33 </div>
35 <pre>
36 Users : $users
37 Bugs : $bugs
38 Bugsize : $bugsize
39 </pre>
40 EOT
41 # List all plugins
42 cat << EOT
43 <h3>$(gettext "Plugins")</h3>
44 <pre>
45 EOT
46 for p in $(ls -1 $plugins)
47 do
48 . $plugins/$p/$p.conf
49 echo "<a href='?$p'>$PLUGIN</a> - $SHORT_DESC"
50 done
51 echo '</pre>'
53 # Get the list of administrators
54 echo "<h3>Admin users</h3>"
55 for u in $(ls $PEOPLE)
56 do
57 user=${u}
58 if admin_user; then
59 echo "<a href='?user=$u'>$u</a>"
60 fi
61 done
62 html_footer && exit 0
63 fi