Merge branch 'iconnor-updated-console' into storageareas
This commit is contained in:
commit
02b5cd6b6c
|
@ -180,7 +180,11 @@ function getNavBarHTML() {
|
||||||
ob_start();
|
ob_start();
|
||||||
global $CLANG;
|
global $CLANG;
|
||||||
global $VLANG;
|
global $VLANG;
|
||||||
|
global $CLANG;
|
||||||
|
global $VLANG;
|
||||||
|
global $status;
|
||||||
|
global $running;
|
||||||
|
global $user;
|
||||||
?>
|
?>
|
||||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
|
@ -117,7 +117,7 @@ xhtmlHeaders( __FILE__, translate('Console') );
|
||||||
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
||||||
<input type="hidden" name="action" value=""/>
|
<input type="hidden" name="action" value=""/>
|
||||||
|
|
||||||
<?php include("skins/$skin/views/header.php") ?>
|
<?php echo $navbar ?>
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<table class="table table-striped table-hover table-condensed">
|
<table class="table table-striped table-hover table-condensed">
|
||||||
|
|
|
@ -1,158 +0,0 @@
|
||||||
<?php
|
|
||||||
//
|
|
||||||
// ZoneMinder web console file, $Date$, $Revision$
|
|
||||||
// Copyright (C) 2001-2008 Philip Coombes
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License
|
|
||||||
// as published by the Free Software Foundation; either version 2
|
|
||||||
// of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
//
|
|
||||||
|
|
||||||
$states = dbFetchAll( "select * from States" );
|
|
||||||
$status = $running?translate('Running'):translate('Stopped');
|
|
||||||
$run_state = dbFetchOne('select Name from States where IsActive = 1', 'Name' );
|
|
||||||
|
|
||||||
$group = NULL;
|
|
||||||
if ( ! empty($_COOKIE['zmGroup']) ) {
|
|
||||||
if ( $group = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_COOKIE['zmGroup'])) )
|
|
||||||
$groupIds = array_flip(explode( ',', $group['MonitorIds'] ));
|
|
||||||
}
|
|
||||||
|
|
||||||
$maxWidth = 0;
|
|
||||||
$maxHeight = 0;
|
|
||||||
$cycleCount = 0;
|
|
||||||
# minSequence and MaxSequence are used to determine whether the up and down arrows are greyed out or not.
|
|
||||||
# Seems to me, we shouldn't need it, we could just test for
|
|
||||||
$minSequence = 0;
|
|
||||||
$maxSequence = 1;
|
|
||||||
$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" );
|
|
||||||
$displayMonitors = array();
|
|
||||||
for ( $i = 0; $i < count($monitors); $i++ )
|
|
||||||
{
|
|
||||||
if ( !visibleMonitor( $monitors[$i]['Id'] ) )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ( $group && !empty($groupIds) && !array_key_exists( $monitors[$i]['Id'], $groupIds ) )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$monitors[$i]['Show'] = true;
|
|
||||||
if ( empty($minSequence) || ($monitors[$i]['Sequence'] < $minSequence) )
|
|
||||||
{
|
|
||||||
$minSequence = $monitors[$i]['Sequence'];
|
|
||||||
}
|
|
||||||
if ( $monitors[$i]['Sequence'] > $maxSequence )
|
|
||||||
{
|
|
||||||
$maxSequence = $monitors[$i]['Sequence'];
|
|
||||||
}
|
|
||||||
$monitors[$i]['zmc'] = zmcStatus( $monitors[$i] );
|
|
||||||
$monitors[$i]['zma'] = zmaStatus( $monitors[$i] );
|
|
||||||
$monitors[$i]['ZoneCount'] = dbFetchOne( 'select count(Id) as ZoneCount from Zones where MonitorId = ?', 'ZoneCount', array($monitors[$i]['Id']) );
|
|
||||||
$counts = array();
|
|
||||||
for ( $j = 0; $j < count($eventCounts); $j++ )
|
|
||||||
{
|
|
||||||
$filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['terms']), array( "cnj" => "and", "attr" => "MonitorId", "op" => "=", "val" => $monitors[$i]['Id'] ) );
|
|
||||||
parseFilter( $filter );
|
|
||||||
$counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j";
|
|
||||||
$monitors[$i]['eventCounts'][$j]['filter'] = $filter;
|
|
||||||
}
|
|
||||||
$sql = "select ".join($counts,", ")." from Events as E where MonitorId = ?";
|
|
||||||
$counts = dbFetchOne( $sql, NULL, array($monitors[$i]['Id']) );
|
|
||||||
if ( $monitors[$i]['Function'] != 'None' )
|
|
||||||
{
|
|
||||||
$cycleCount++;
|
|
||||||
$scaleWidth = reScale( $monitors[$i]['Width'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
|
||||||
$scaleHeight = reScale( $monitors[$i]['Height'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
|
||||||
if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth;
|
|
||||||
if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight;
|
|
||||||
}
|
|
||||||
if ( $counts ) $monitors[$i] = array_merge( $monitors[$i], $counts );
|
|
||||||
$displayMonitors[] = $monitors[$i];
|
|
||||||
}
|
|
||||||
|
|
||||||
$cycleWidth = $maxWidth;
|
|
||||||
$cycleHeight = $maxHeight;
|
|
||||||
|
|
||||||
$eventsView = ZM_WEB_EVENTS_VIEW;
|
|
||||||
$eventsWindow = 'zm'.ucfirst(ZM_WEB_EVENTS_VIEW);
|
|
||||||
|
|
||||||
$eventCount = 0;
|
|
||||||
for ( $i = 0; $i < count($eventCounts); $i++ )
|
|
||||||
{
|
|
||||||
$eventCounts[$i]['total'] = 0;
|
|
||||||
}
|
|
||||||
$zoneCount = 0;
|
|
||||||
foreach( $displayMonitors as $monitor )
|
|
||||||
{
|
|
||||||
for ( $i = 0; $i < count($eventCounts); $i++ )
|
|
||||||
{
|
|
||||||
$eventCounts[$i]['total'] += $monitor['EventCount'.$i];
|
|
||||||
}
|
|
||||||
$zoneCount += $monitor['ZoneCount'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$versionClass = (ZM_DYN_DB_VERSION&&(ZM_DYN_DB_VERSION!=ZM_VERSION))?'errorText':'';
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="navbar-header">
|
|
||||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-header-nav" aria-expanded="false">
|
|
||||||
<span class="sr-only">Toggle navigation</span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
</button>
|
|
||||||
<a class="navbar-brand" href="http://www.zoneminder.com" target="ZoneMinder">ZoneMinder</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="main-header-nav">
|
|
||||||
<ul class="nav navbar-nav">
|
|
||||||
<li><a href="?view=console"><?php echo translate('Console') ?></a></li>
|
|
||||||
<?php if ( canView( 'System' ) ) { ?>
|
|
||||||
<li><a href="?view=options"><?php echo translate('Options') ?></a></li>
|
|
||||||
<li><?php if ( logToDatabase() > Logger::NOLOG ) { ?> <?php echo makePopupLink( '?view=log', 'zmLog', 'log', '<span class="'.logState().'">'.translate('Log').'</span>' ) ?><?php } ?></li>
|
|
||||||
<?php } ?>
|
|
||||||
<?php if ( ZM_OPT_X10 && canView( 'Devices' ) ) { ?>
|
|
||||||
<li><a href="/?view=devices">Devices</a></li>
|
|
||||||
<?php } ?>
|
|
||||||
<li><?php echo makePopupLink( '?view=groups', 'zmGroups', 'groups', sprintf( $CLANG['MonitorCount'], count($displayMonitors), zmVlang( $VLANG['Monitor'], count($displayMonitors) ) ).($group?' ('.$group['Name'].')':''), canView( 'Groups' ) ); ?></li>
|
|
||||||
<li><?php echo makePopupLink( '?view=filter&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3c&filter[terms][0][val]=now', 'zmFilter', 'filter', translate('Filters'), canView( 'Events' ) ) ?></li>
|
|
||||||
|
|
||||||
<?php if ( canView( 'Stream' ) && $cycleCount > 1 ) {
|
|
||||||
$cycleGroup = isset($_COOKIE['zmGroup'])?$_COOKIE['zmGroup']:0;
|
|
||||||
?>
|
|
||||||
<li><?php echo makePopupLink( '?view=cycle&group='.$cycleGroup, 'zmCycle'.$cycleGroup, array( 'cycle', $cycleWidth, $cycleHeight ), translate('Cycle'), $running ) ?></li>
|
|
||||||
<li><?php echo makePopupLink( '?view=montage&group='.$cycleGroup, 'zmMontage'.$cycleGroup, 'montage', translate('Montage'), $running ) ?></li>
|
|
||||||
<li><?php echo makePopupLink( '?view=montagereview&group='.$cycleGroup, 'zmMontage'.$cycleGroup, 'montagereview', translate('Montage Review'), $running ) ?></li>
|
|
||||||
<?php } ?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="navbar-right">
|
|
||||||
<?php if ( ZM_OPT_USE_AUTH ) { ?>
|
|
||||||
<p class="navbar-text"><?php echo translate('LoggedInAs') ?> <?php echo makePopupLink( '?view=logout', 'zmLogout', 'logout', $user['Username'], (ZM_AUTH_TYPE == "builtin") ) ?> </p>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php if ( canEdit( 'System' ) ) { ?>
|
|
||||||
<button type="button" class="btn btn-default navbar-btn" data-toggle="modal" data-target="#modalState"><?php echo $status ?></button>
|
|
||||||
|
|
||||||
<?php } else if ( canView( 'System' ) ) { ?>
|
|
||||||
<p class="navbar-text"> <?php echo $status ?> </p>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div><!-- End .navbar-collapse -->
|
|
||||||
</div> <!-- End .container-fluid -->
|
|
||||||
</div> <!-- End .navbar .navbar-default -->
|
|
|
@ -78,9 +78,7 @@ Error("setting css $current_css to " . $_GET['css-choice']);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
|
<?php echo getNavBarHTML(); ?>
|
||||||
<?php include("skins/$skin/views/header.php") ?>
|
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-2 sidebar">
|
<div class="col-sm-2 sidebar">
|
||||||
|
|
Loading…
Reference in New Issue