]> source.dussan.org Git - nextcloud-server.git/commitdiff
show real data in account information
authorRobin Appelman <icewind1991@gmail.com>
Sun, 17 Apr 2011 11:47:45 +0000 (13:47 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Sun, 17 Apr 2011 11:47:45 +0000 (13:47 +0200)
settings/index.php
settings/templates/index.php

index 31db326f6bc7cabfca607dbb7d1b0d9cc2bf429d..521f2ade9da8b0d4ec4680f2ae71faac47a2f3e2 100644 (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();
 
 ?>
index 910437fefc9c1a553eaebfb931bd4663271cda9a..f3f0b533a624b965f7a2a1b8e4b03daa4be0f530 100644 (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>