From e7264a8167059bee96f2e700403e0aa95ff57fcb Mon Sep 17 00:00:00 2001 From: Linwood-F Date: Mon, 3 Aug 2015 15:31:13 -0400 Subject: [PATCH] Minox fixes, make live mode default, 1 hour default --- web/skins/classic/views/montagereview.php | 45 +++++++++++++++++++---- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/web/skins/classic/views/montagereview.php b/web/skins/classic/views/montagereview.php index eb9760c02..2ee386428 100644 --- a/web/skins/classic/views/montagereview.php +++ b/web/skins/classic/views/montagereview.php @@ -26,6 +26,25 @@ // It also will do a pseudo play function from history, as well as a live display of images. // +// Valid query string: +// +// &maxTime, minTime = string formats (locale) of starting and ending time for history (pass both or none), default = last hour +// +// ¤t = string format of time, where the slider is positioned first in history mode (normally only used in reloads, default = half scale) +// +// &speed = one of the valid speeds below (see $speeds in php section, default = 1.0) +// +// &scale = image sie scale (.1 to 1.0, or 1.1 = fit, default = fit) +// +// &live=1 whether to start in live mode, 1 = yes, 0 = no +// +// &archive = if "1" then include archive frames, if "0" do not, default "1" +// +// &z1, &z2, etc. = initial monitor specific zoom, numeral is a monitor id, default = 1.0, used in page reloads normally +// +// &group = group number of monitors to display, comes from console if set, default is none (i.e. not limited by group) +// + // It takes very high bandwidth to the server, and a pretty fast client to keep up with the image rate. To reduce the rate // change the playback slider to 0 and then it does not try to play at the same time it is scrubbing. // @@ -56,6 +75,8 @@ // - Add max fit, make it default // - Remove timeline in live mode, and restore when switched back (live button becomes toggle) // - Add +/- zooms to individual monitors so you can adjust size, persist across reload buttons (only) +// - Change default to 1 hour and live mode (reduce workload on initial load, let people ask for huge history amounts) +// - Since this may be run as a standalone window for shortcuts, etc., add a "console" link to get back to the console // if ( !canView( 'Events' ) ) { @@ -107,12 +128,21 @@ if ( !empty($user['MonitorIds']) ) // Parse input parameters -- note for future, validate/clean up better in case we don't get called from self. // Live overrides all the min/max stuff but it is still processed +// The default (nothing at all specified) is for 1 hour so we do not read the whole database + + +if ( !isset($_REQUEST['minTime']) && !isset($_REQUEST['maxTime']) ) +{ + $maxTime=strftime("%c",time()); + $minTime=strftime("%c",time() - 3600); +} if ( isset($_REQUEST['minTime']) ) $minTime = validHtmlStr($_REQUEST['minTime']); if ( isset($_REQUEST['maxTime']) ) $maxTime = validHtmlStr($_REQUEST['maxTime']); + if ( isset($_REQUEST['scale']) ) $defaultScale=validHtmlStr($_REQUEST['scale']); else @@ -137,9 +167,9 @@ if (isset($_REQUEST['current']) ) $defaultCurrentTime=validHtmlStr($_REQUEST['current']); -$initialModeIsLive=0; -if(isset($_REQUEST['live']) ) - $initialModeIsLive=1; +$initialModeIsLive=1; +if(isset($_REQUEST['live']) && $_REQUEST['live']=='0' ) + $initialModeIsLive=0; $initialDisplayInterval=1000; if(isset($_REQUEST['displayinterval'])) @@ -192,6 +222,7 @@ input[type=range]::-ms-tooltip {