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:
parent
8b453ab803
commit
1e6a032d1e
@ -44,4 +44,14 @@ tbody {
|
||||
.container-indicator {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
}
|
||||
.disk_space {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.progress-bar-committed {
|
||||
background-color: #B6E1F2;
|
||||
}
|
||||
.usage-info {
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -44,12 +44,12 @@ function domain_admin($_action, $_data = null) {
|
||||
WHERE `username` = :username");
|
||||
$stmt->execute(array(':username' => $username));
|
||||
$num_results[] = count($stmt->fetchAll(PDO::FETCH_ASSOC));
|
||||
|
||||
|
||||
$stmt = $pdo->prepare("SELECT `username` FROM `admin`
|
||||
WHERE `username` = :username");
|
||||
$stmt->execute(array(':username' => $username));
|
||||
$num_results[] = count($stmt->fetchAll(PDO::FETCH_ASSOC));
|
||||
|
||||
|
||||
$stmt = $pdo->prepare("SELECT `username` FROM `domain_admins`
|
||||
WHERE `username` = :username");
|
||||
$stmt->execute(array(':username' => $username));
|
||||
@ -373,7 +373,7 @@ function domain_admin($_action, $_data = null) {
|
||||
}
|
||||
$stmt = $pdo->query("SELECT DISTINCT
|
||||
`username`
|
||||
FROM `domain_admins`
|
||||
FROM `domain_admins`
|
||||
WHERE `username` IN (
|
||||
SELECT `username` FROM `admin`
|
||||
WHERE `superadmin`!='1'
|
||||
@ -409,7 +409,7 @@ function domain_admin($_action, $_data = null) {
|
||||
':domain_admin' => $_data
|
||||
));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (empty($row)) {
|
||||
if (empty($row)) {
|
||||
return false;
|
||||
}
|
||||
$domainadmindata['username'] = $row['username'];
|
||||
@ -444,5 +444,18 @@ function domain_admin($_action, $_data = null) {
|
||||
|
||||
return $domainadmindata;
|
||||
break;
|
||||
case 'total_quota':
|
||||
if ($_SESSION['mailcow_cc_role'] != "admin") {
|
||||
$_SESSION['return'][] = array(
|
||||
'type' => 'danger',
|
||||
'log' => array(__FUNCTION__, $_action, $_data_log),
|
||||
'msg' => 'access_denied'
|
||||
);
|
||||
return false;
|
||||
}
|
||||
$stmt = $pdo->query("SELECT SUM(`quota`) AS `quota` FROM `domain`");
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
return $row['quota'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ $lang['success']['resource_removed'] = 'Ressource %s wurde entfernt';
|
||||
$lang['warning']['cannot_delete_self'] = 'Kann derzeit eingeloggten Benutzer nicht entfernen';
|
||||
$lang['warning']['no_active_admin'] = 'Kann letzten aktiven Administrator nicht deaktivieren';
|
||||
$lang['danger']['max_quota_in_use'] = 'Mailbox Speicherplatzlimit muss größer oder gleich %d MiB sein';
|
||||
$lang['danger']['domain_quota_m_in_use'] = 'Domain Speicherplatzlimit muss größer oder gleich %d MiB sein';
|
||||
$lang['danger']['domain_quota_m_in_use'] = 'Domain-Speicherplatzlimit muss größer oder gleich %d MiB sein';
|
||||
$lang['danger']['mailboxes_in_use'] = 'Maximale Anzahl an Mailboxen muss größer oder gleich %d sein';
|
||||
$lang['danger']['aliases_in_use'] = 'Maximale Anzahl an Aliassen muss größer oder gleich %d sein';
|
||||
$lang['danger']['sender_acl_invalid'] = 'Sender ACL %s ist ungültig';
|
||||
@ -375,7 +375,7 @@ $lang['edit']['mailbox'] = 'Mailbox bearbeiten';
|
||||
$lang['edit']['description'] = 'Beschreibung';
|
||||
$lang['edit']['max_aliases'] = 'Max. Aliasse';
|
||||
$lang['edit']['max_quota'] = 'Max. Größe per Mailbox (MiB)';
|
||||
$lang['edit']['domain_quota'] = 'Domain Speicherplatz gesamt (MiB)';
|
||||
$lang['edit']['domain_quota'] = 'Domain-Speicherplatz gesamt (MiB)';
|
||||
$lang['edit']['backup_mx_options'] = 'Backup MX Optionen';
|
||||
$lang['edit']['relay_domain'] = 'Diese Domain relayen';
|
||||
$lang['edit']['relay_all'] = 'Alle Empfänger-Adressen relayen';
|
||||
@ -474,7 +474,7 @@ $lang['add']['description'] = 'Beschreibung';
|
||||
$lang['add']['max_aliases'] = 'Max. mögliche Aliasse';
|
||||
$lang['add']['max_mailboxes'] = 'Max. mögliche Mailboxen';
|
||||
$lang['add']['mailbox_quota_m'] = 'Max. Speicherplatz pro Mailbox (MiB)';
|
||||
$lang['add']['domain_quota_m'] = 'Domain Speicherplatz gesamt (MiB)';
|
||||
$lang['add']['domain_quota_m'] = 'Domain-Speicherplatz gesamt (MiB)';
|
||||
$lang['add']['backup_mx_options'] = 'Backup MX Optionen';
|
||||
$lang['add']['relay_all'] = 'Alle Empfänger-Adressen relayen';
|
||||
$lang['add']['relay_domain'] = 'Relay Domain';
|
||||
@ -545,7 +545,7 @@ $lang['tfa']['confirm_totp_token'] = "Bitte bestätigen Sie die Änderung durch
|
||||
|
||||
$lang['admin']['rspamd-com_settings'] = '<a href="https://rspamd.com/doc/configuration/settings.html#settings-structure" target="_blank">Rspamd docs</a>
|
||||
- Ein Name wird automatisch generiert. Beispielinhalte zur Einsicht stehen nachstehend bereit.';
|
||||
|
||||
|
||||
$lang['admin']['no_new_rows'] = 'Keine weiteren Zeilen vorhanden';
|
||||
$lang['admin']['additional_rows'] = ' zusätzliche Zeilen geladen'; // parses to 'n additional rows were added'
|
||||
$lang['admin']['private_key'] = 'Private Key';
|
||||
@ -791,6 +791,13 @@ $lang['debug']['solr_last_modified'] = 'Zuletzt geändert';
|
||||
$lang['debug']['solr_size'] = 'Größe';
|
||||
$lang['debug']['solr_docs'] = 'Dokumente';
|
||||
|
||||
$lang['debug']['disk_usage'] = 'Festplattenauslastung';
|
||||
$lang['debug']['containers_info'] = "Container-Informationen";
|
||||
|
||||
$lang['debug']['disk_space'] = "Verfügbarer Speicherplatz:";
|
||||
$lang['debug']['disk_used'] = "Von Mailboxen belegter Speicherplatz:";
|
||||
$lang['debug']['total_quota'] = "Zugewiesener Domain-Speicherplatz:";
|
||||
|
||||
$lang['quarantine']['release_body'] = "Die ursprüngliche Nachricht wurde als EML-Datei im Anhang hinterlegt.";
|
||||
$lang['danger']['release_send_failed'] = "Die Nachricht konnte nicht versendet werden: %s";
|
||||
$lang['quarantine']['release_subject'] = "Potentiell schädliche Nachricht aus Quarantäne: %s";
|
||||
|
@ -820,6 +820,10 @@ $lang['debug']['disk_usage'] = 'Disk usage';
|
||||
$lang['debug']['containers_info'] = "Container information";
|
||||
$lang['debug']['restart_container'] = 'Restart';
|
||||
|
||||
$lang['debug']['disk_space'] = "Available disk space:";
|
||||
$lang['debug']['disk_used'] = "Disk space occupied by mailboxes:";
|
||||
$lang['debug']['total_quota'] = "Total amount of assigned domain quota:";
|
||||
|
||||
$lang['quarantine']['release_body'] = "We have attached your message as eml file to this message.";
|
||||
$lang['danger']['release_send_failed'] = "Message could not be released: %s";
|
||||
$lang['quarantine']['release_subject'] = "Potentially damaging quarantine item %s";
|
||||
@ -915,4 +919,3 @@ $lang['mailbox']['alias_domain_backupmx'] = 'Alias domain inactive for relay dom
|
||||
|
||||
$lang['danger']['extra_acl_invalid'] = 'External sender address "%s" is invalid';
|
||||
$lang['danger']['extra_acl_invalid_domain'] = 'External sender "%s" uses an invalid domain';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user