From 0a995aea78a2fcc65c172d27ef5a9cb791dc4f4c Mon Sep 17 00:00:00 2001 From: digital-gnome <31593470+digital-gnome@users.noreply.github.com> Date: Wed, 29 Nov 2017 23:04:38 -0500 Subject: [PATCH] Add navbar refresh to all pages that use it --- .../lib/ZoneMinder/ConfigData.pm.in | 30 +++++++++++++++++++ web/ajax/status.php | 4 +++ web/skins/classic/includes/config.php | 3 ++ web/skins/classic/includes/functions.php | 9 ++++-- web/skins/classic/js/skin.js | 14 +++++++++ web/skins/classic/js/skin.js.php | 2 ++ web/skins/classic/views/js/event.js | 2 -- 7 files changed, 59 insertions(+), 5 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 820a5d980..238eae2e7 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -2933,6 +2933,16 @@ our @options = ( type => $types{integer}, category => 'highband', }, + { + name => 'ZM_WEB_H_REFRESH_NAVBAR', + default => '5', + description => 'How often (in seconds) the navigation header should refresh itself', + help => q` + The navigation header contains the general status information about server load and storage space. + `, + type => $types{integer}, + category => 'highband', + }, { name => 'ZM_WEB_H_REFRESH_CYCLE', default => '10', @@ -3196,6 +3206,16 @@ our @options = ( `, category => 'medband', }, + { + name => 'ZM_WEB_M_REFRESH_NAVBAR', + default => '15', + description => 'How often (in seconds) the navigation header should refresh itself', + help => q` + The navigation header contains the general status information about server load and storage space. + `, + type => $types{integer}, + category => 'medband', + }, { name => 'ZM_WEB_M_REFRESH_CYCLE', default => '20', @@ -3459,6 +3479,16 @@ our @options = ( type => $types{integer}, category => 'lowband', }, + { + name => 'ZM_WEB_L_REFRESH_NAVBAR', + default => '35', + description => 'How often (in seconds) the navigation header should refresh itself', + help => q` + The navigation header contains the general status information about server load and storage space. + `, + type => $types{integer}, + category => 'lowband', + }, { name => 'ZM_WEB_L_REFRESH_CYCLE', default => '30', diff --git a/web/ajax/status.php b/web/ajax/status.php index 3941a5645..a51669d15 100644 --- a/web/ajax/status.php +++ b/web/ajax/status.php @@ -1,4 +1,8 @@ array( diff --git a/web/skins/classic/includes/config.php b/web/skins/classic/includes/config.php index 763a2b8cc..6128d534f 100644 --- a/web/skins/classic/includes/config.php +++ b/web/skins/classic/includes/config.php @@ -56,6 +56,7 @@ $bandwidth_options = array( switch ( $_COOKIE['zmBandwidth'] ) { case 'high' : { define( 'ZM_WEB_REFRESH_MAIN', ZM_WEB_H_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes + define( 'ZM_WEB_REFRESH_NAVBAR', ZM_WEB_H_REFRESH_NAVBAR ); // How often (in seconds) the nav header refreshes define( 'ZM_WEB_REFRESH_CYCLE', ZM_WEB_H_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor define( 'ZM_WEB_REFRESH_IMAGE', ZM_WEB_H_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) define( 'ZM_WEB_REFRESH_STATUS', ZM_WEB_H_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window @@ -73,6 +74,7 @@ switch ( $_COOKIE['zmBandwidth'] ) { break; } case 'medium' : { define( 'ZM_WEB_REFRESH_MAIN', ZM_WEB_M_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes + define( 'ZM_WEB_REFRESH_NAVBAR', ZM_WEB_M_REFRESH_NAVBAR ); // How often (in seconds) the nav header refreshes define( 'ZM_WEB_REFRESH_CYCLE', ZM_WEB_M_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor define( 'ZM_WEB_REFRESH_IMAGE', ZM_WEB_M_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) define( 'ZM_WEB_REFRESH_STATUS', ZM_WEB_M_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window @@ -90,6 +92,7 @@ switch ( $_COOKIE['zmBandwidth'] ) { break; } case 'low' : { define( 'ZM_WEB_REFRESH_MAIN', ZM_WEB_L_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes + define( 'ZM_WEB_REFRESH_NAVBAR', ZM_WEB_L_REFRESH_NAVBAR ); // How often (in seconds) the nav header refreshes define( 'ZM_WEB_REFRESH_CYCLE', ZM_WEB_L_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor define( 'ZM_WEB_REFRESH_IMAGE', ZM_WEB_L_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) define( 'ZM_WEB_REFRESH_STATUS', ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 450cf63b3..e3d9f8110 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -159,7 +159,7 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) { - + var AJAX_TIMEOUT = ; +var navBarRefresh = ; + var currentView = ''; var thisUrl = ""; var skinPath = ""; diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index 95460a8f1..f3f4752a7 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -40,8 +40,6 @@ function vjsReplay() { } } -$j.ajaxSetup ({timeout: AJAX_TIMEOUT }); //sets timeout for all getJSON. - var cueFrames = null; //make cueFrames availaible even if we don't send another ajax query function initialAlarmCues (eventId) {