show real data in account information

This commit is contained in:
Robin Appelman 2011-04-17 13:47:45 +02:00
parent e984a3b47a
commit 542a0a2518
2 changed files with 10 additions and 3 deletions

View File

@ -8,7 +8,14 @@ if( !OC_USER::isLoggedIn()){
}
$tmpl = new OC_TEMPLATE( "settings", "index", "admin" );
$tmpl = new OC_TEMPLATE( "settings", "index", "admin");
$used=OC_FILESYSTEM::filesize('/');
$free=disk_free_space(OC_CONFIG::getValue('datadirectory'));
$total=$free+$used;
$relative=round(($used/$total)*100);
$tmpl->assign('usage',OC_HELPER::humanFileSize($used));
$tmpl->assign('total_space',OC_HELPER::humanFileSize($total));
$tmpl->assign('usage_relative',$relative);
$tmpl->printPage();
?>

View File

@ -1,8 +1,8 @@
<form id="quota">
<fieldset>
<legend>Account information</legend>
<div id="quota_indicator"><div style="width:72%;">&nbsp;</div></div>
<p>You're currently using 72% (7.2GB) of your 10GB space.</p>
<div id="quota_indicator"><div style="width:<?php echo $_['usage_relative'] ?>%;">&nbsp;</div></div>
<p>You're currently using <?php echo $_['usage_relative'] ?>% (<?php echo $_['usage'] ?>) of your <?php echo $_['total_space'] ?> space.</p>
</fieldset>
</form>