diff --git a/customer_index.php b/customer_index.php index c4a1ea80..02b65683 100644 --- a/customer_index.php +++ b/customer_index.php @@ -115,10 +115,14 @@ if ($page == 'overview') { if ($usages) { $userinfo['diskspace_bytes_used'] = $usages['webspace'] * 1024; + $userinfo['mailspace_used'] = $usages['mail'] * 1024; + $userinfo['dbspace_used'] = $usages['mysql'] * 1024; $userinfo['total_bytes_used'] = ($usages['webspace'] + $usages['mail'] + $usages['mysql']) * 1024; } else { $userinfo['diskspace_bytes_used'] = 0; $userinfo['total_bytes_used'] = 0; + $userinfo['mailspace_used'] = 0; + $userinfo['dbspace_used'] = 0; } UI::twig()->addGlobal('userinfo', $userinfo); diff --git a/templates/Froxlor/user/dashboard-item.html.twig b/templates/Froxlor/user/dashboard-item.html.twig index 522b3566..61272077 100644 --- a/templates/Froxlor/user/dashboard-item.html.twig +++ b/templates/Froxlor/user/dashboard-item.html.twig @@ -1,7 +1,7 @@ -{% macro ditem(lngstr, available, used, assigned = null, formatbytes = false) %} +{% macro ditem(lngstr, available, used, assigned = null, formatbytes = false, byte_usage = null) %}
-
{{ lng(lngstr) }}
+
{{ lng(lngstr) }}{% if byte_usage %} ({{ byte_usage|formatBytes }}){% endif %}
{% if formatbytes %}{{ used|formatBytes }}{% else %}{{ used }}{% endif %}/{% if available < 0 %}{{ lng('panel.unlimited') }}{% else %}{% if formatbytes %}{{ available|formatBytes }}{% else %}{{ available }}{% endif %}{% endif %}
diff --git a/templates/Froxlor/user/index.html.twig b/templates/Froxlor/user/index.html.twig index 7a26c595..26acc05d 100644 --- a/templates/Froxlor/user/index.html.twig +++ b/templates/Froxlor/user/index.html.twig @@ -33,12 +33,13 @@ {% else %} {# customer-resources #}
+ {{ dashboard.ditem('customer.total_diskspace', userinfo.diskspace_bytes, userinfo.total_bytes_used, null, true) }} {{ dashboard.ditem('customer.diskspace', userinfo.diskspace_bytes, userinfo.diskspace_bytes_used, null, true) }} {{ dashboard.ditem('customer.traffic', userinfo.traffic_bytes, userinfo.traffic_bytes_used, null, true) }} {{ dashboard.ditem('customer.subdomains', userinfo.subdomains, userinfo.subdomains_used) }} - {{ dashboard.ditem('customer.mysqls', userinfo.mysqls, userinfo.mysqls_used) }} + {{ dashboard.ditem('customer.mysqls', userinfo.mysqls, userinfo.mysqls_used, null, false, userinfo.dbspace_used) }} {{ dashboard.ditem('customer.emails', userinfo.emails, userinfo.emails_used) }} - {{ dashboard.ditem('customer.accounts', userinfo.email_accounts, userinfo.email_accounts_used) }} + {{ dashboard.ditem('customer.accounts', userinfo.email_accounts, userinfo.email_accounts_used, null, false, userinfo.mailspace_used) }} {{ dashboard.ditem('customer.forwarders', userinfo.email_forwarders, userinfo.email_forwarders_used) }} {{ dashboard.ditem('customer.ftps', userinfo.ftps, userinfo.ftps_used) }}