tazbug diff web/plugins/dashboard/dashboard.cgi @ rev 116
Rename pkgs plugin and improve dashboard
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Feb 11 15:19:38 2017 +0100 (2017-02-11) |
parents | bcaad2bc76c8 |
children | b19dbd851223 |
line diff
1.1 --- a/web/plugins/dashboard/dashboard.cgi Fri Feb 10 16:51:39 2017 +0100 1.2 +++ b/web/plugins/dashboard/dashboard.cgi Sat Feb 11 15:19:38 2017 +0100 1.3 @@ -25,7 +25,8 @@ 1.4 if check_auth && ! admin_user; then 1.5 ADMIN_TOOLS="" 1.6 fi 1.7 - cat << EOT 1.8 + if check_auth; then 1.9 + cat << EOT 1.10 <h2>Dashboard</h2> 1.11 1.12 <div id="tools"> 1.13 @@ -33,31 +34,52 @@ 1.14 </div> 1.15 1.16 <pre> 1.17 -Users : $users 1.18 -Bugs : $bugs 1.19 -Bugsize : $bugsize 1.20 +Bugs count : $bugs 1.21 +Database size : $bugsize 1.22 +User accounts : $users 1.23 +Server uptime :$(uptime | cut -d "," -f 1-2) 1.24 </pre> 1.25 + 1.26 +<h3>Admin users</h3> 1.27 EOT 1.28 - # List all plugins 1.29 - cat << EOT 1.30 + 1.31 + # Get the list of administrators 1.32 + fgrep -l "ADMIN_USER=" $PEOPLE/*/account.conf | while read file; 1.33 + do 1.34 + . ${file} 1.35 + echo "<a href='?user=$USER'>$USER</a>" 1.36 + unset NAME USER 1.37 + done 1.38 + 1.39 + # Only for admins 1.40 + if check_auth && admin_user; then 1.41 + # List all plugins 1.42 + cat << EOT 1.43 <h3>$(gettext "Plugins")</h3> 1.44 <pre> 1.45 + <table> 1.46 + <thead> 1.47 + <td>$(gettext "Name")</td> 1.48 + <td>$(gettext "Description")</td> 1.49 + <td>$(gettext "Action")</td> 1.50 + </thead> 1.51 EOT 1.52 - for p in $(ls -1 $plugins) 1.53 - do 1.54 - . $plugins/$p/$p.conf 1.55 - echo "<a href='?$p'>$PLUGIN</a> - $SHORT_DESC" 1.56 - done 1.57 - echo '</pre>' 1.58 - 1.59 - # Get the list of administrators 1.60 - echo "<h3>Admin users</h3>" 1.61 - for u in $(ls $PEOPLE) 1.62 - do 1.63 - user=${u} 1.64 - if admin_user; then 1.65 - echo "<a href='?user=$u'>$u</a>" 1.66 + for p in $(ls -1 $plugins) 1.67 + do 1.68 + . $plugins/$p/$p.conf 1.69 + cat << EOT 1.70 + <tr> 1.71 + <td><a href='?$p'>$PLUGIN</a></td> 1.72 + <td>$SHORT_DESC</td> 1.73 + <td>TODO</td> 1.74 + </tr> 1.75 +EOT 1.76 + done 1.77 + echo " </table>" 1.78 + echo "</pre>" 1.79 fi 1.80 - done 1.81 + else 1.82 + gettext "You must be logged in to view the dashboard" 1.83 + fi 1.84 html_footer && exit 0 1.85 fi