display disk/bw quota usage in nav menu
This commit is contained in:
parent
40028613fd
commit
f07c407deb
|
@ -37,7 +37,7 @@ include("head.php");
|
||||||
<div id="alternc-logo"><a href="http://alternc.org"><!-- img src="alternc.png" width="120" height="82" border="0" alt="AlternC" / -->AlternC</a>
|
<div id="alternc-logo"><a href="http://alternc.org"><!-- img src="alternc.png" width="120" height="82" border="0" alt="AlternC" / -->AlternC</a>
|
||||||
<span><?php echo "$L_VERSION"; ?></span>
|
<span><?php echo "$L_VERSION"; ?></span>
|
||||||
</div>
|
</div>
|
||||||
<h3>Menu <?php echo $mem->user["login"]; ?></h3>
|
<h3><?php echo _("Menu") . ' ' . $mem->user["login"]; ?></h3>
|
||||||
<dl id="menu-list">
|
<dl id="menu-list">
|
||||||
<?php
|
<?php
|
||||||
$MENUPATH="/var/alternc/bureau/admin/";
|
$MENUPATH="/var/alternc/bureau/admin/";
|
||||||
|
@ -50,6 +50,7 @@ while (!feof ($tt)) {
|
||||||
}
|
}
|
||||||
fclose($tt);
|
fclose($tt);
|
||||||
?>
|
?>
|
||||||
|
<dt id="session"><?php __("Session"); ?></dt>
|
||||||
<dd><a href="mem_logout.php" target="_parent"><?php __("Logout"); ?></a></dd>
|
<dd><a href="mem_logout.php" target="_parent"><?php __("Logout"); ?></a></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
|
|
@ -27,5 +27,40 @@
|
||||||
Purpose of file:
|
Purpose of file:
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
?>
|
|
||||||
<dd><a href="quota_show.php"><?php __("Show my quotas"); ?></a></dd>
|
$q=$quota->getquota();
|
||||||
|
|
||||||
|
$qlist=$quota->qlist();
|
||||||
|
reset($qlist);
|
||||||
|
|
||||||
|
echo '<dt id="#quotas">' . _("Quotas") . '</dt>';
|
||||||
|
echo '<dd><a href="quota_show.php">' . _("Show my quotas") . '</a></dd>';
|
||||||
|
|
||||||
|
if (!is_array($q)) {
|
||||||
|
// "No quotas for this account, or quotas currently unavailable
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (list($key,$val)=each($qlist)) {
|
||||||
|
$col=3-$col;
|
||||||
|
|
||||||
|
if (($key == 'bw_web' || $key == 'web') && ($q[$key]["t"] > 0)) {
|
||||||
|
if ($key == 'web') {
|
||||||
|
$q[$key]["u"] = $q[$key]["u"] * 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
$usage_percent = (int) ($q[$key]["u"] / $q[$key]["t"] * 100);
|
||||||
|
$usage_color = ($q[$key]["u"] > $q[$key]["t"] ? '#f00' : '#0f0');
|
||||||
|
$usage_color = ((85 < $usage_percent && $usage_percent < 100) ? '#ff0' : $usage_color); // yellow if 85 < x < 100
|
||||||
|
|
||||||
|
echo "<dd>";
|
||||||
|
echo '<div><a href="quota_show.php">' . /* _($val) */ $key . ' ' . $usage_percent . '%' . ' (' . format_size($q[$key]["u"]) . ' / ' . format_size($q[$key]["t"]) . ')</a></div>';
|
||||||
|
echo "</dd>";
|
||||||
|
echo "<dd>";
|
||||||
|
echo '<div style="width: 100%; background: #fff;">';
|
||||||
|
echo '<div style="width: ' . ($usage_percent > 100 ? 100 : $usage_percent) . '%; background: ' . $usage_color . ';"> </div>';
|
||||||
|
echo '</div>';
|
||||||
|
echo "</dd>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,5 +8,5 @@ menu_sql.php
|
||||||
menu_adm.php
|
menu_adm.php
|
||||||
menu_lang.php
|
menu_lang.php
|
||||||
menu_mem.php
|
menu_mem.php
|
||||||
menu_quota.php
|
|
||||||
menu_aide.php
|
menu_aide.php
|
||||||
|
menu_quota.php
|
||||||
|
|
Loading…
Reference in New Issue