From 49b1b12991f863dab95f4160723b30f8c1ddf648 Mon Sep 17 00:00:00 2001 From: mrtg Date: Sun, 18 Feb 2024 13:18:58 +0100 Subject: [PATCH] update rrdGraphCtrl timeRanges --- tmpl/details.tmpl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tmpl/details.tmpl b/tmpl/details.tmpl index c04fe81..35662c8 100644 --- a/tmpl/details.tmpl +++ b/tmpl/details.tmpl @@ -19,8 +19,18 @@ // crate a control panel and attach it to the charts q('#ctrl').rrdGraphCtrl(graph,{ - initialTimeRange: 'Last 7 Days', - resetTimeOnDateChange: true + initialTimeRange: 'Last 2 Days', + resetTimeOnDateChange: true, + timeRanges: { + "Last 60 Minutes": { order: 0, len: 60, end: 'minute' }, + "Last 6 Hours": { order: 1, len: 6, end: 'hour' }, + "Last 24 Hours": { order: 2, len: 24, end: 'hour' }, + "Last 2 Days": { order: 3, len: 2, end: 'day' }, + "Last 7 Days": { order: 4, len: 7, end: 'day' }, + "Last 31 Days": { order: 5, len: 31, end: 'day' }, + "Last 3 Months": { order: 5, len: 3, end: 'month' }, + "Last 12 Months": { order: 6, len: 12, end: 'month' } + } }); // you can also remove all the magic again