added quota level percentage display

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1168 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Valkum 13 years ago
parent ce747878a2
commit dbf7d1aa74

@ -352,3 +352,29 @@ span.active {
div.nav_bar { div.nav_bar {
text-align: left; text-align: left;
} }
.quota {
z-index:99;
height:14px;
position: absolute;
}
.quota_text {
z-index:100;
text-align: center;
font-size: 10px;
color: #666;
cursor: default;
position: absolute;
width:120px;
height:14px;
margin-top:-14px;
}
.quota_bg { background-color: white; z-index:98; width:120px; height:14px;margin-top:-1px;margin-left:-1px; border: 1px solid #999;}
.quota_high { background: url(images/quota-colors.png) repeat-x 0 -28px #f90509; }
.quota_mid { background: url(images/quota-colors.png) repeat-x 0 -14px #e3e909; }
.quota_low { background: url(images/quota-colors.png) repeat-x 0 0px #05f905; }
.quota_text_high { color: white; }
.quota_text_mid { color: #666; }
.quota_text_low { color: #666; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

@ -307,6 +307,11 @@ if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0))
if(isset($tMailbox[$i]['quota'])) { if(isset($tMailbox[$i]['quota'])) {
$divide_quota ['quota'][$i] = divide_quota ($tMailbox[$i]['quota']); $divide_quota ['quota'][$i] = divide_quota ($tMailbox[$i]['quota']);
} }
if(isset($tMailbox[$i]['quota']) && isset($tMailbox[$i]['current']))
{
$divide_quota ['percent'][$i] = min(100, round(($divide_quota ['current'][$i]/max(1,$divide_quota ['quota'][$i]))*100));
$divide_quota ['quota_width'][$i] = ($divide_quota ['percent'][$i] / 100 * 120);
}
} }
class cNav_bar class cNav_bar

@ -49,7 +49,18 @@
{$PALANG.pOverview_disabled} {$PALANG.pOverview_disabled}
{else} {else}
{if $boolconf_used_quotas} {if $boolconf_used_quotas}
{$divide_quota.current[$i]} / {$divide_quota.quota[$i]}
{if $divide_quota.quota_width[$i]>90}
{assign var="quota_level" value="high"}
{elseif $divide_quota.quota_width[$i]>55}
{assign var="quota_level" value="mid"}
{else}
{assign var="quota_level" value="low"}
{/if}
<div class="quota quota_{$quota_level}" style="width:{$divide_quota.quota_width[$i]}px;"></div>
<div class="quota_bg"></div></div>
<div class="quota_text quota_text_{$quota_level}">{$divide_quota.current[$i]} / {$divide_quota.quota[$i]}</div>
{/if} {/if}
{/if} {/if}
</td> </td>

Loading…
Cancel
Save