Add navbar refresh to all pages that use it
This commit is contained in:
parent
cb70a3627f
commit
0a995aea78
|
@ -2933,6 +2933,16 @@ our @options = (
|
||||||
type => $types{integer},
|
type => $types{integer},
|
||||||
category => 'highband',
|
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',
|
name => 'ZM_WEB_H_REFRESH_CYCLE',
|
||||||
default => '10',
|
default => '10',
|
||||||
|
@ -3196,6 +3206,16 @@ our @options = (
|
||||||
`,
|
`,
|
||||||
category => 'medband',
|
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',
|
name => 'ZM_WEB_M_REFRESH_CYCLE',
|
||||||
default => '20',
|
default => '20',
|
||||||
|
@ -3459,6 +3479,16 @@ our @options = (
|
||||||
type => $types{integer},
|
type => $types{integer},
|
||||||
category => 'lowband',
|
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',
|
name => 'ZM_WEB_L_REFRESH_CYCLE',
|
||||||
default => '30',
|
default => '30',
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
if ($_REQUEST['entity'] == "navBar") {
|
||||||
|
ajaxResponse(getNavBarHtml('reload'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$statusData = array(
|
$statusData = array(
|
||||||
'system' => array(
|
'system' => array(
|
||||||
|
|
|
@ -56,6 +56,7 @@ $bandwidth_options = array(
|
||||||
switch ( $_COOKIE['zmBandwidth'] ) {
|
switch ( $_COOKIE['zmBandwidth'] ) {
|
||||||
case 'high' : {
|
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_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_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_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
|
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;
|
break;
|
||||||
} case 'medium' : {
|
} 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_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_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_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
|
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;
|
break;
|
||||||
} case 'low' : {
|
} 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_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_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_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
|
define( 'ZM_WEB_REFRESH_STATUS', ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
|
||||||
|
|
|
@ -159,7 +159,7 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) {
|
||||||
<?php
|
<?php
|
||||||
} // end function xhtmlHeaders( $file, $title )
|
} // end function xhtmlHeaders( $file, $title )
|
||||||
|
|
||||||
function getNavBarHTML() {
|
function getNavBarHTML($reload = null) {
|
||||||
|
|
||||||
$versionClass = (ZM_DYN_DB_VERSION&&(ZM_DYN_DB_VERSION!=ZM_VERSION))?'errorText':'';
|
$versionClass = (ZM_DYN_DB_VERSION&&(ZM_DYN_DB_VERSION!=ZM_VERSION))?'errorText':'';
|
||||||
|
|
||||||
|
@ -172,13 +172,16 @@ function getNavBarHTML() {
|
||||||
global $user;
|
global $user;
|
||||||
global $bandwidth_options;
|
global $bandwidth_options;
|
||||||
global $view;
|
global $view;
|
||||||
|
if ($reload === null) {
|
||||||
?>
|
?>
|
||||||
<noscript>
|
<noscript>
|
||||||
<div style="background-color:red;color:white;font-size:x-large;">
|
<div style="background-color:red;color:white;font-size:x-large;">
|
||||||
ZoneMinder requires Javascript. Please enable Javascript in your browser for this site.
|
ZoneMinder requires Javascript. Please enable Javascript in your browser for this site.
|
||||||
</div>
|
</div>
|
||||||
</noscript>
|
</noscript>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
<div class="navbar navbar-inverse navbar-static-top">
|
<div class="navbar navbar-inverse navbar-static-top">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
|
@ -279,7 +282,7 @@ if ( ZM_OPT_X10 && canView( 'Devices' ) ) { ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div> <!-- End .footer -->
|
</div> <!-- End .footer -->
|
||||||
|
|
||||||
</div> <!-- End .navbar .navbar-default -->
|
<!-- End .navbar .navbar-default --></div>
|
||||||
<?php
|
<?php
|
||||||
return( ob_get_clean() );
|
return( ob_get_clean() );
|
||||||
} // end function getNavBarHTML()
|
} // end function getNavBarHTML()
|
||||||
|
|
|
@ -182,6 +182,20 @@ function refreshParentWindow() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$j.ajaxSetup ({timeout: AJAX_TIMEOUT }); //sets timeout for all getJSON.
|
||||||
|
|
||||||
|
$j(document).ready(function() {
|
||||||
|
if ($j('.navbar').length) setInterval(getNavBar, navBarRefresh)
|
||||||
|
});
|
||||||
|
|
||||||
|
function getNavBar () {
|
||||||
|
$j.getJSON(thisUrl + '?view=request&request=status&entity=navBar', setNavBar);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNavBar (data) {
|
||||||
|
$j('.navbar').replaceWith(data.message);
|
||||||
|
}
|
||||||
|
|
||||||
//Shows a message if there is an error in the streamObj or the stream doesn't exist. Returns true if error, false otherwise.
|
//Shows a message if there is an error in the streamObj or the stream doesn't exist. Returns true if error, false otherwise.
|
||||||
function checkStreamForErrors( funcName, streamObj ) {
|
function checkStreamForErrors( funcName, streamObj ) {
|
||||||
if ( !streamObj ) {
|
if ( !streamObj ) {
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
?>
|
?>
|
||||||
var AJAX_TIMEOUT = <?php echo ZM_WEB_AJAX_TIMEOUT ?>;
|
var AJAX_TIMEOUT = <?php echo ZM_WEB_AJAX_TIMEOUT ?>;
|
||||||
|
|
||||||
|
var navBarRefresh = <?php echo 1000*ZM_WEB_REFRESH_NAVBAR ?>;
|
||||||
|
|
||||||
var currentView = '<?php echo $view ?>';
|
var currentView = '<?php echo $view ?>';
|
||||||
var thisUrl = "<?php echo ZM_BASE_URL.$_SERVER['PHP_SELF'] ?>";
|
var thisUrl = "<?php echo ZM_BASE_URL.$_SERVER['PHP_SELF'] ?>";
|
||||||
var skinPath = "<?php echo ZM_SKIN_PATH ?>";
|
var skinPath = "<?php echo ZM_SKIN_PATH ?>";
|
||||||
|
|
|
@ -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
|
var cueFrames = null; //make cueFrames availaible even if we don't send another ajax query
|
||||||
|
|
||||||
function initialAlarmCues (eventId) {
|
function initialAlarmCues (eventId) {
|
||||||
|
|
Loading…
Reference in New Issue