displaying assigned domain quota
adding the amount of assigned domain quota to the disk usage display as potentially used disk space
This commit is contained in:
@@ -43,6 +43,10 @@ else {
|
||||
<?php
|
||||
$exec_fields = array('cmd' => 'system', 'task' => 'df', 'dir' => '/var/vmail');
|
||||
$vmail_df = explode(',', json_decode(docker('post', 'dovecot-mailcow', 'exec', $exec_fields), true));
|
||||
$domainQuota = round(domain_admin('total_quota')/1024);
|
||||
$quotaPercent1 = round(($domainQuota/substr($vmail_df[3], 0, -1))*100);
|
||||
$quotaPercent2 = round((($domainQuota-substr($vmail_df[2], 0, -1))/substr($vmail_df[3], 0, -1))*100);
|
||||
$quotaPercent2 = ($quotaPercent2+substr($vmail_df[4], 0, -1)>100) ? 100-substr($vmail_df[4], 0, -1) : $quotaPercent2; //handling overcommitment
|
||||
?>
|
||||
<div role="tabpanel" class="tab-pane active" id="tab-containers">
|
||||
<div class="panel panel-default">
|
||||
@@ -53,12 +57,15 @@ else {
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p>/var/vmail on <?=$vmail_df[0];?></p>
|
||||
<p><?=$vmail_df[2];?> / <?=$vmail_df[1];?> (<?=$vmail_df[4];?>)</p>
|
||||
<p class="disk_space"><?=$lang['debug']['disk_space'];?> <?=$vmail_df[3];?>B</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-info" role="progressbar" style="width:<?=$vmail_df[4];?>"></div>
|
||||
<div class="progress-bar progress-bar-committed" role="progressbar" style="width:<?=$quotaPercent2;?>%"></div>
|
||||
</div>
|
||||
<p><span class="container-indicator label usage-info progress-bar-info"> </span> <?=$lang['debug']['disk_used'];?> <?=$vmail_df[2];?>B (<?=$vmail_df[4];?>)</p>
|
||||
<p><span class="container-indicator label usage-info progress-bar-committed"> </span> <?=$lang['debug']['total_quota'];?> <?=$domainQuota;?>GB (<?=$quotaPercent1;?>%)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -344,7 +351,6 @@ $lang_admin = json_encode($lang['admin']);
|
||||
echo "var lang = ". $lang_admin . ";\n";
|
||||
echo "var csrf_token = '". $_SESSION['CSRF']['TOKEN'] . "';\n";
|
||||
echo "var log_pagination_size = '". $LOG_PAGINATION_SIZE . "';\n";
|
||||
|
||||
?>
|
||||
</script>
|
||||
<?php
|
||||
|
Reference in New Issue
Block a user