add month button

This commit is contained in:
M Alfiyan Syamsuddin 2021-09-02 12:55:02 +07:00
parent 76d0c276c0
commit 8bdf465a0f
1 changed files with 6 additions and 0 deletions

View File

@ -120,6 +120,7 @@ class HistoryGraph
$hour = new DateTime('-1 hour');
$day = new DateTime('-1 day');
$week = new DateTime('-1 week');
$month = new DateTime('-1 month');
$records = $this->getRecords('uptime', $server_id, $start_time, $end_time);
@ -146,6 +147,11 @@ class HistoryGraph
'time' => $week->getTimestamp() * 1000,
'label' => psm_get_lang('servers', 'week')
);
$data['buttons'][] = array(
'unit' => 'day',
'time' => $month->getTimestamp() * 1000,
'label' => psm_get_lang('servers', 'month')
);
return $data;
}