From 8bdf465a0f04724387f54bf04f564170a14550ed Mon Sep 17 00:00:00 2001 From: M Alfiyan Syamsuddin Date: Thu, 2 Sep 2021 12:55:02 +0700 Subject: [PATCH] add month button --- src/psm/Util/Server/HistoryGraph.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/psm/Util/Server/HistoryGraph.php b/src/psm/Util/Server/HistoryGraph.php index 11425e8b..110a58e9 100644 --- a/src/psm/Util/Server/HistoryGraph.php +++ b/src/psm/Util/Server/HistoryGraph.php @@ -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; }