# HG changeset patch # User Christophe Lincoln # Date 1486819997 -3600 # Node ID b07b36203b8d00d0cdcf6080b794abce24c79106 # Parent 2778498112c0c743e60424b2f8c7145ef9387fd1 Improve dashboard plugin (more to come) diff -r 2778498112c0 -r b07b36203b8d plugins/dashboard/dashboard.cgi --- a/plugins/dashboard/dashboard.cgi Sat Feb 11 10:18:48 2017 +0000 +++ b/plugins/dashboard/dashboard.cgi Sat Feb 11 14:33:17 2017 +0100 @@ -2,7 +2,6 @@ # # TinyCM Plugin - Users and admin Dashboard. # -. /usr/lib/slitaz/httphelper if [ "$(GET dashboard)" ]; then d="Dashboard" @@ -37,37 +36,47 @@

$d

-Users     : $users
-Wiki      : $docs ($wikisize)
-Cache     : $cachesize
-Mercurial : $hg
+Wiki docs        : $docs ($wikisize)
+Cache size       : $cachesize
+Mercurial        : $hg
+User accounts    : $users
+Server uptime    : $(uptime | cut -d " " -f 4 | sed s"/:/h /" | sed s"/,/min/")
 

Admin users

EOT # Get the list of administrators - for u in $(ls $PEOPLE) + fgrep -l "ADMIN_USER=" $PEOPLE/*/account.conf | while read file; do - user=${u} - if admin_user; then - echo "$u" - fi + . ${file} + echo "$USER" + unset NAME USER done - echo '

' # Only for admins if check_auth && admin_user; then # List all plugins cat << EOT

$(gettext "Plugins")

-
+
+	
+		
+		
+		
+	
 EOT
 			for p in $(ls -1 $plugins)
 			do
 				. $plugins/$p/$p.conf
-				echo "$PLUGIN - $SHORT_DESC"
+				cat << EOT
+	
+		
+		
+		
+	
+EOT
 			done
-			echo ''
+			echo "
$(gettext "Name")$(gettext "Description")$(gettext "Action")
$PLUGIN$SHORT_DESCremove
" fi else gettext "You must be logged in to view the dashboard."