tazbug diff web/plugins/dashboard/dashboard.cgi @ rev 123

Use new admin config and up users plugins from TinyCM
author Christophe Lincoln <pankso@slitaz.org>
date Tue Feb 21 00:51:31 2017 +0100 (2017-02-21)
parents b19dbd851223
children f07cd117feed
line diff
     1.1 --- a/web/plugins/dashboard/dashboard.cgi	Sat Feb 11 22:27:47 2017 +0100
     1.2 +++ b/web/plugins/dashboard/dashboard.cgi	Tue Feb 21 00:51:31 2017 +0100
     1.3 @@ -26,55 +26,42 @@
     1.4  	fi
     1.5  	if check_auth; then
     1.6  		cat << EOT
     1.7 -<h2>Dashboard</h2>
     1.8 -
     1.9  <div id="tools">
    1.10  	$DASHBOARD_TOOLS $ADMIN_TOOLS
    1.11  </div>
    1.12 -
    1.13 +<h2>Dashboard</h2>
    1.14  <pre>
    1.15  Bugs count       : $bugs
    1.16  Database size    : $bugsize
    1.17  Server uptime    :$(uptime | cut -d "," -f 1-2)
    1.18  </pre>
    1.19 -
    1.20 -<h3>Admin users</h3>
    1.21  EOT
    1.22 -		
    1.23 -		# Get the list of administrators
    1.24 -		fgrep -l "ADMIN_USER=" $PEOPLE/*/account.conf | while read file;
    1.25 -		do
    1.26 -			. ${file}
    1.27 -			echo "<a href='?user=$USER'>$USER</a>"
    1.28 -			unset NAME USER
    1.29 -		done
    1.30 -		
    1.31 +	
    1.32  		# Only for admins
    1.33  		if check_auth && admin_user; then
    1.34  			# List all plugins
    1.35  			cat << EOT
    1.36 -<h3>$(gettext "Plugins")</h3>
    1.37 -<pre>
    1.38 -	<table>
    1.39 -		<thead>
    1.40 -			<td>$(gettext "Name")</td>
    1.41 -			<td>$(gettext "Description")</td>
    1.42 -			<td>$(gettext "Action")</td>
    1.43 -		</thead>
    1.44 +<h3>$(gettext "Plugins:") $(ls $plugins | wc -l)</h3>
    1.45 +<div id="plugins">
    1.46 +<table>
    1.47 +	<thead>
    1.48 +		<td>$(gettext "Name")</td>
    1.49 +		<td>$(gettext "Description")</td>
    1.50 +		<td>$(gettext "Action")</td>
    1.51 +	</thead>
    1.52  EOT
    1.53  			for p in $(ls -1 $plugins)
    1.54  			do
    1.55  				. $plugins/$p/$p.conf
    1.56  				cat << EOT
    1.57 -		<tr>
    1.58 -			<td><a href='?$p'>$PLUGIN</a></td>
    1.59 -			<td>$SHORT_DESC</td>
    1.60 -			<td>TODO</td>
    1.61 -		</tr>
    1.62 +	<tr>
    1.63 +		<td><a href='?$p'>$PLUGIN</a></td>
    1.64 +		<td>$SHORT_DESC</td>
    1.65 +		<td>TODO</td>
    1.66 +	</tr>
    1.67  EOT
    1.68  			done
    1.69 -			echo "	</table>"
    1.70 -			echo "</pre>"
    1.71 +			echo "</table></div>"
    1.72  		fi
    1.73  	else
    1.74  		gettext "You must be logged in to view the dashboard"