fix traffic display in dashboards

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-11-04 12:39:10 +01:00
parent 5abe663cbe
commit dbec714af8
4 changed files with 4 additions and 4 deletions

View File

@@ -101,7 +101,7 @@ if ($page == 'overview') {
$userinfo['traffic_bytes'] = ($userinfo['traffic'] > -1) ? $userinfo['traffic'] * 1024 : -1;
$overview['traffic_bytes'] = $overview['traffic_assigned'] * 1024;
$overview['traffic_bytes_used'] = $overview['traffic_used'] * 1024;
$overview['traffic_bytes_used'] = $overview['traffic_used'];
$number_domains_stmt = Database::prepare("
SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "`

View File

@@ -109,7 +109,7 @@ if ($page == 'overview') {
// get everything in bytes for the percentage calculation on the dashboard
$userinfo['diskspace_bytes'] = ($userinfo['diskspace'] > -1) ? $userinfo['diskspace'] * 1024 : -1;
$userinfo['traffic_bytes'] = ($userinfo['traffic'] > -1) ? $userinfo['traffic'] * 1024 : -1;
$userinfo['traffic_bytes_used'] = $userinfo['traffic_used'] * 1024;
$userinfo['traffic_bytes_used'] = $userinfo['traffic_used'];
if ($usages) {
$userinfo['diskspace_bytes_used'] = $usages['webspace'] * 1024;

View File

@@ -89,6 +89,6 @@ class ProgressBar
*/
public static function traffic(array $attributes): array
{
return self::pbData('traffic', $attributes['fields'], 1024, (int)Settings::Get('system.report_trafficmax'));
return self::pbData('traffic', $attributes['fields'], 1, (int)Settings::Get('system.report_trafficmax'));
}
}

View File

@@ -51,7 +51,7 @@ return [
'label' => lng('admin.stdsubdomain_add') . '?',
'type' => 'checkbox',
'value' => '1',
'checked' => $result['standardsubdomain']
'checked' => (bool)$result['standardsubdomain']
],
'deactivated' => [
'label' => lng('admin.deactivated_user'),