Korrekturen

URLs angepasst
Statistik Einheit automatisch ändern (MB -> GB)
This commit is contained in:
Gregor Schulte
2022-04-16 20:56:12 +02:00
parent 1e60371abe
commit 57608f3b2f
10 changed files with 230 additions and 245 deletions

View File

@@ -282,6 +282,17 @@ class StatisticBuilder
$this->suffix = isset($suffix) ? $suffix : NULL;
$this->label = _t($statistic['label']);
$this->unit = $statistic['unit'];
if ($statistic['unit'] == 'MB') {
$log = new LogStatistic();
$log->setFile(LOG_PATH . $this->raw . '.csv');
$lastValue = $log->getLast();
$log->close();
if ($lastValue && $lastValue[1] > 999999999) {
$this->unit = 'GB';
$this->label = 'GB';
}
}
$this->cycle = $statistic['cycle'];
$this->limits = $statistic['limits'];