public function lastBackup()
{
$file = JsonFile::instance($this->grav['locator']->findResource("log://backup.log"));
$content = $file->content();
if (empty($content)) {
return ['days' => '∞', 'chart_fill' => 100, 'chart_empty' => 0];
}
$backup = new \DateTime();
$backup->setTimestamp($content['time']);
$diff = $backup->diff(new \DateTime());
$days = $diff->days;
$chart_fill = $days > 30 ? 100 : round($days / 30 * 100);
return ['days' => $days, 'chart_fill' => $chart_fill, 'chart_empty' => 100 - $chart_fill];
}