2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web console file, $Date$, $Revision$
|
2008-07-25 17:48:16 +08:00
|
|
|
// Copyright (C) 2001-2008 Philip Coombes
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
// 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
|
2016-12-26 23:23:16 +08:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
|
2015-09-17 02:51:23 +08:00
|
|
|
require_once('includes/Server.php');
|
2016-01-05 03:51:24 +08:00
|
|
|
$servers = Server::find_all();
|
2015-09-17 02:51:23 +08:00
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
$eventCounts = array(
|
|
|
|
array(
|
2015-05-10 21:10:30 +08:00
|
|
|
"title" => translate('Events'),
|
2008-07-14 21:54:50 +08:00
|
|
|
"filter" => array(
|
|
|
|
"terms" => array(
|
|
|
|
)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2015-05-10 21:10:30 +08:00
|
|
|
"title" => translate('Hour'),
|
2008-07-14 21:54:50 +08:00
|
|
|
"filter" => array(
|
|
|
|
"terms" => array(
|
2009-10-21 05:36:17 +08:00
|
|
|
array( "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ),
|
2008-07-14 21:54:50 +08:00
|
|
|
)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2015-05-10 21:10:30 +08:00
|
|
|
"title" => translate('Day'),
|
2008-07-14 21:54:50 +08:00
|
|
|
"filter" => array(
|
|
|
|
"terms" => array(
|
2009-10-21 05:36:17 +08:00
|
|
|
array( "attr" => "DateTime", "op" => ">=", "val" => "-1 day" ),
|
2008-07-14 21:54:50 +08:00
|
|
|
)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2015-05-10 21:10:30 +08:00
|
|
|
"title" => translate('Week'),
|
2008-07-14 21:54:50 +08:00
|
|
|
"filter" => array(
|
|
|
|
"terms" => array(
|
2009-10-21 05:36:17 +08:00
|
|
|
array( "attr" => "DateTime", "op" => ">=", "val" => "-7 day" ),
|
2008-07-14 21:54:50 +08:00
|
|
|
)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2015-05-10 21:10:30 +08:00
|
|
|
"title" => translate('Month'),
|
2008-07-14 21:54:50 +08:00
|
|
|
"filter" => array(
|
|
|
|
"terms" => array(
|
2009-10-21 05:36:17 +08:00
|
|
|
array( "attr" => "DateTime", "op" => ">=", "val" => "-1 month" ),
|
2008-07-14 21:54:50 +08:00
|
|
|
)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2015-05-10 21:10:30 +08:00
|
|
|
"title" => translate('Archived'),
|
2008-07-14 21:54:50 +08:00
|
|
|
"filter" => array(
|
|
|
|
"terms" => array(
|
|
|
|
array( "attr" => "Archived", "op" => "=", "val" => "1" ),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
$running = daemonCheck();
|
2015-05-10 21:10:30 +08:00
|
|
|
$status = $running?translate('Running'):translate('Stopped');
|
2015-08-04 23:37:11 +08:00
|
|
|
$run_state = dbFetchOne('select Name from States where IsActive = 1', 'Name' );
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-03-22 11:10:13 +08:00
|
|
|
$group = NULL;
|
|
|
|
if ( ! empty($_COOKIE['zmGroup']) ) {
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( $group = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_COOKIE['zmGroup'])) )
|
|
|
|
$groupIds = array_flip(explode( ',', $group['MonitorIds'] ));
|
2014-03-22 11:10:13 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
noCacheHeaders();
|
|
|
|
|
|
|
|
$maxWidth = 0;
|
|
|
|
$maxHeight = 0;
|
|
|
|
$cycleCount = 0;
|
|
|
|
$minSequence = 0;
|
|
|
|
$maxSequence = 1;
|
|
|
|
$seqIdList = array();
|
|
|
|
$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" );
|
2008-10-06 03:16:45 +08:00
|
|
|
$displayMonitors = array();
|
2017-05-26 02:26:49 +08:00
|
|
|
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 );
|
|
|
|
$seqIdList[] = $monitors[$i]['Id'];
|
|
|
|
$displayMonitors[] = $monitors[$i];
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
$lastId = 0;
|
|
|
|
$seqIdUpList = array();
|
2017-05-26 02:26:49 +08:00
|
|
|
foreach ( $seqIdList as $seqId ) {
|
|
|
|
if ( !empty($lastId) )
|
|
|
|
$seqIdUpList[$seqId] = $lastId;
|
|
|
|
else
|
|
|
|
$seqIdUpList[$seqId] = $seqId;
|
|
|
|
$lastId = $seqId;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
$lastId = 0;
|
|
|
|
$seqIdDownList = array();
|
2017-05-26 02:26:49 +08:00
|
|
|
foreach ( array_reverse($seqIdList) as $seqId ) {
|
|
|
|
if ( !empty($lastId) )
|
|
|
|
$seqIdDownList[$seqId] = $lastId;
|
|
|
|
else
|
|
|
|
$seqIdDownList[$seqId] = $seqId;
|
|
|
|
$lastId = $seqId;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2008-07-15 17:04:09 +08:00
|
|
|
$cycleWidth = $maxWidth;
|
|
|
|
$cycleHeight = $maxHeight;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
$eventsView = ZM_WEB_EVENTS_VIEW;
|
|
|
|
$eventsWindow = 'zm'.ucfirst(ZM_WEB_EVENTS_VIEW);
|
|
|
|
|
|
|
|
$eventCount = 0;
|
2017-05-26 02:26:49 +08:00
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
|
|
|
$eventCounts[$i]['total'] = 0;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
$zoneCount = 0;
|
2017-05-26 02:26:49 +08:00
|
|
|
foreach( $displayMonitors as $monitor ) {
|
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
|
|
|
$eventCounts[$i]['total'] += $monitor['EventCount'.$i];
|
|
|
|
}
|
|
|
|
$zoneCount += $monitor['ZoneCount'];
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2017-05-19 01:54:06 +08:00
|
|
|
$seqUpFile = getSkinFile( 'graphics/seq-u.png' );
|
|
|
|
$seqDownFile = getSkinFile( 'graphics/seq-d.png' );
|
2008-07-23 00:24:36 +08:00
|
|
|
|
2011-05-25 17:15:14 +08:00
|
|
|
$versionClass = (ZM_DYN_DB_VERSION&&(ZM_DYN_DB_VERSION!=ZM_VERSION))?'errorText':'';
|
|
|
|
|
2016-05-26 23:15:13 +08:00
|
|
|
$left_columns = 3;
|
|
|
|
if ( count($servers) ) $left_columns += 1;
|
2016-05-27 00:18:58 +08:00
|
|
|
if ( ZM_WEB_ID_ON_CONSOLE ) $left_columns += 1;
|
2016-04-15 01:53:10 +08:00
|
|
|
|
2015-05-10 21:10:30 +08:00
|
|
|
xhtmlHeaders( __FILE__, translate('Console') );
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<body>
|
|
|
|
<div id="page">
|
2014-12-05 07:44:23 +08:00
|
|
|
<form name="monitorForm" method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<input type="hidden" name="action" value=""/>
|
|
|
|
<div id="header">
|
2014-12-05 07:44:23 +08:00
|
|
|
<h3 id="systemTime"><?php echo preg_match( '/%/', DATE_FMT_CONSOLE_LONG )?strftime( DATE_FMT_CONSOLE_LONG ):date( DATE_FMT_CONSOLE_LONG ) ?></h3>
|
2016-11-11 21:47:08 +08:00
|
|
|
<h3 id="systemStats"><?php echo translate('Load') ?>: <?php echo getLoad() ?> - <?php echo translate('Disk') ?>: <?php echo getDiskPercent() ?>% - <?php echo ZM_PATH_MAP ?>: <?php echo getDiskPercent(ZM_PATH_MAP) ?>%</h3>
|
2015-06-21 21:31:21 +08:00
|
|
|
<h2 id="title"><a href="http://www.zoneminder.com" target="ZoneMinder">ZoneMinder</a> <?php echo translate('Console') ?> - <?php echo makePopupLink( '?view=state', 'zmState', 'state', $status, canEdit( 'System' ) ) ?> - <?php echo $run_state ?> <?php echo makePopupLink( '?view=version', 'zmVersion', 'version', '<span class="'.$versionClass.'">v'.ZM_VERSION.'</span>', canEdit( 'System' ) ) ?></h2>
|
2008-07-14 21:54:50 +08:00
|
|
|
<div class="clear"></div>
|
2017-06-01 10:08:05 +08:00
|
|
|
<?php if ( ZM_WEB_CONSOLE_BANNER ) { ?><h3 id="development"><?php echo ZM_WEB_CONSOLE_BANNER ?></h3><?php } ?>
|
2015-08-17 01:29:03 +08:00
|
|
|
<div id="monitorSummary"><?php echo makePopupLink( '?view=groups', 'zmGroups', 'groups', sprintf( $CLANG['MonitorCount'], count($displayMonitors), zmVlang( $VLANG['Monitor'], count($displayMonitors) ) ).($group?' ('.$group['Name'].')':''), canView( 'Groups' ) ); ?></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( ZM_OPT_X10 && canView( 'Devices' ) ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<div id="devices"><?php echo makePopupLink( '?view=devices', 'zmDevices', 'devices', translate('Devices') ) ?></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( canView( 'System' ) ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<div id="options"><?php echo makePopupLink( '?view=options', 'zmOptions', 'options', translate('Options') ) ?><?php if ( logToDatabase() > Logger::NOLOG ) { ?> / <?php echo makePopupLink( '?view=log', 'zmLog', 'log', '<span class="'.logState().'">'.translate('Log').'</span>' ) ?><?php } ?></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2008-09-01 21:58:27 +08:00
|
|
|
}
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( canView( 'Stream' ) && $cycleCount > 1 ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
$cycleGroup = isset($_COOKIE['zmGroup'])?$_COOKIE['zmGroup']:0;
|
|
|
|
?>
|
2015-07-23 01:51:31 +08:00
|
|
|
<div id="cycleMontage">
|
2017-05-26 02:26:49 +08:00
|
|
|
<?php echo makePopupLink( '?view=cycle&group='.$cycleGroup, 'zmCycle'.$cycleGroup, array( 'cycle', $cycleWidth, $cycleHeight ), translate('Cycle'), $running ) ?> /
|
|
|
|
<?php echo makePopupLink( '?view=montage&group='.$cycleGroup, 'zmMontage'.$cycleGroup, 'montage', translate('Montage'), $running ) ?> /
|
|
|
|
<?php echo makePopupLink( '?view=montagereview&group='.$cycleGroup, 'zmMontage'.$cycleGroup, 'montagereview', translate('Montage Review'), $running ) ?>
|
2015-07-23 01:51:31 +08:00
|
|
|
</div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
} else {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-07-16 22:03:18 +08:00
|
|
|
<h3 id="loginBandwidth"><?php
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( ZM_OPT_USE_AUTH ) {
|
2015-05-10 21:10:30 +08:00
|
|
|
?><?php echo translate('LoggedInAs') ?> <?php echo makePopupLink( '?view=logout', 'zmLogout', 'logout', $user['Username'], (ZM_AUTH_TYPE == "builtin") ) ?>, <?php echo strtolower( translate('ConfiguredFor') ) ?><?php
|
2017-05-26 02:26:49 +08:00
|
|
|
} else {
|
2015-05-10 21:10:30 +08:00
|
|
|
?><?php echo translate('ConfiguredFor') ?><?php
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
2015-05-10 21:10:30 +08:00
|
|
|
?> <?php echo makePopupLink( '?view=bandwidth', 'zmBandwidth', 'bandwidth', $bwArray[$_COOKIE['zmBandwidth']], ($user && $user['MaxBandwidth'] != 'low' ) ) ?> <?php echo translate('BandwidthHead') ?></h3>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<table id="consoleTable" cellspacing="0">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2016-05-26 23:15:13 +08:00
|
|
|
<?php if ( ZM_WEB_ID_ON_CONSOLE ) { ?>
|
|
|
|
<th class="colId"><?php echo translate('Id') ?></th>
|
|
|
|
<?php } ?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colName"><?php echo translate('Name') ?></th>
|
|
|
|
<th class="colFunction"><?php echo translate('Function') ?></th>
|
2016-01-05 03:59:04 +08:00
|
|
|
<?php if ( count($servers) ) { ?>
|
2016-04-15 01:53:10 +08:00
|
|
|
<th class="colServer"><?php echo translate('Server') ?></th>
|
2016-01-05 03:51:24 +08:00
|
|
|
<?php } ?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colSource"><?php echo translate('Source') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<th class="colEvents"><?php echo $eventCounts[$i]['title'] ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colZones"><?php echo translate('Zones') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( canEdit('Monitors') ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colOrder"><?php echo translate('Order') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colMark"><?php echo translate('Mark') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
2016-05-26 23:15:13 +08:00
|
|
|
<td class="colLeftButtons" colspan="<?php echo $left_columns ?>">
|
2015-05-10 21:10:30 +08:00
|
|
|
<input type="button" value="<?php echo translate('Refresh') ?>" onclick="location.reload(true);"/>
|
2017-05-26 02:26:49 +08:00
|
|
|
<input type="button" name="addBtn" value="<?php echo translate('AddNewMonitor') ?>" onclick="addMonitor( this )"/>
|
2016-04-15 01:53:10 +08:00
|
|
|
<!-- <?php echo makePopupButton( '?view=monitor', 'zmMonitor0', 'monitor', translate('AddNewMonitor'), (canEdit( 'Monitors' ) && !$user['MonitorIds']) ) ?> -->
|
2015-05-10 21:10:30 +08:00
|
|
|
<?php echo makePopupButton( '?view=filter&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3c&filter[terms][0][val]=now', 'zmFilter', 'filter', translate('Filters'), canView( 'Events' ) ) ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
</td>
|
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
|
|
|
parseFilter( $eventCounts[$i]['filter'] );
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colEvents"><?php echo makePopupLink( '?view='.$eventsView.'&page=1'.$eventCounts[$i]['filter']['query'], $eventsWindow, $eventsView, $eventCounts[$i]['total'], canView( 'Events' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colZones"><?php echo $zoneCount ?></td>
|
2015-05-10 21:10:30 +08:00
|
|
|
<td class="colRightButtons" colspan="<?php echo canEdit('Monitors')?2:1 ?>"><input type="button" name="editBtn" value="<?php echo translate('Edit') ?>" onclick="editMonitor( this )" disabled="disabled"/><input type="button" name="deleteBtn" value="<?php echo translate('Delete') ?>" onclick="deleteMonitor( this )" disabled="disabled"/></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
foreach( $displayMonitors as $monitor ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( !$monitor['zmc'] ) {
|
|
|
|
$dclass = "errorText";
|
|
|
|
} else {
|
2016-04-15 01:53:10 +08:00
|
|
|
// https://github.com/ZoneMinder/ZoneMinder/issues/1082
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( !$monitor['zma'] && $monitor['Function']!='Monitor' )
|
|
|
|
$dclass = "warnText";
|
|
|
|
else
|
|
|
|
$dclass = "infoText";
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
if ( $monitor['Function'] == 'None' )
|
2017-05-26 02:26:49 +08:00
|
|
|
$fclass = "errorText";
|
2015-10-01 23:35:38 +08:00
|
|
|
//elseif ( $monitor['Function'] == 'Monitor' )
|
|
|
|
// $fclass = "warnText";
|
2008-07-14 21:54:50 +08:00
|
|
|
else
|
2017-05-26 02:26:49 +08:00
|
|
|
$fclass = "infoText";
|
2008-07-14 21:54:50 +08:00
|
|
|
if ( !$monitor['Enabled'] )
|
2017-05-26 02:26:49 +08:00
|
|
|
$fclass .= " disabledText";
|
2008-07-14 21:54:50 +08:00
|
|
|
$scale = max( reScale( SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
|
|
|
|
?>
|
2016-05-26 23:15:13 +08:00
|
|
|
<?php if ( ZM_WEB_ID_ON_CONSOLE ) { ?>
|
|
|
|
<td class="colId"><?php echo makePopupLink( '?view=watch&mid='.$monitor['Id'], 'zmWatch'.$monitor['Id'], array( 'watch', reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ) ), $monitor['Id'], $running && ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
|
|
|
|
<?php } ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colName"><?php echo makePopupLink( '?view=watch&mid='.$monitor['Id'], 'zmWatch'.$monitor['Id'], array( 'watch', reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ) ), $monitor['Name'], $running && ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
|
2015-05-22 01:23:31 +08:00
|
|
|
<td class="colFunction"><?php echo makePopupLink( '?view=function&mid='.$monitor['Id'], 'zmFunction', 'function', '<span class="'.$fclass.'">'.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', disabled' : '' ) .'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2016-01-05 03:59:04 +08:00
|
|
|
<?php if ( count($servers) ) { ?>
|
2016-04-15 01:53:10 +08:00
|
|
|
<td class="colServer"><?php
|
2015-09-18 03:34:48 +08:00
|
|
|
$Server = new Server( $monitor['ServerId'] );
|
|
|
|
echo $Server->Name();
|
|
|
|
?></td>
|
2016-01-05 03:51:24 +08:00
|
|
|
<?php } ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php if ( $monitor['Type'] == "Local" ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.$monitor['Device'].' ('.$monitor['Channel'].')</span>', canEdit( 'Monitors' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } elseif ( $monitor['Type'] == "Remote" ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.preg_replace( '/^.*@/', '', $monitor['Host'] ).'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } elseif ( $monitor['Type'] == "File" ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.preg_replace( '/^.*\//', '', $monitor['Path'] ).'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2015-07-17 19:59:40 +08:00
|
|
|
<?php } elseif ( $monitor['Type'] == "Ffmpeg" || $monitor['Type'] == "Libvlc" ) {
|
2013-12-22 09:29:40 +08:00
|
|
|
$domain = parse_url( $monitor['Path'], PHP_URL_HOST );
|
|
|
|
$shortpath = $domain ? $domain : preg_replace( '/^.*\//', '', $monitor['Path'] );
|
2016-04-15 01:53:10 +08:00
|
|
|
if ( $shortpath == '' ) {
|
2017-05-26 02:26:49 +08:00
|
|
|
$shortpath = 'Monitor ' . $monitor['Id'];
|
2016-04-15 01:53:10 +08:00
|
|
|
}
|
2013-12-22 09:29:40 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.$shortpath.'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2013-11-04 23:28:15 +08:00
|
|
|
<?php } elseif ( $monitor['Type'] == "cURL" ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.preg_replace( '/^.*\//', '', $monitor['Path'] ).'</span>', canEdit( 'Monitors' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } else { ?>
|
|
|
|
<td class="colSource"> </td>
|
|
|
|
<?php } ?>
|
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colEvents"><?php echo makePopupLink( '?view='.$eventsView.'&page=1'.$monitor['eventCounts'][$i]['filter']['query'], $eventsWindow, $eventsView, $monitor['EventCount'.$i], canView( 'Events' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2016-05-26 22:35:36 +08:00
|
|
|
<td class="colZones"><?php echo makePopupLink( '?view=zones&mid='.$monitor['Id'], 'zmZones', array( 'zones', $monitor['Width'], $monitor['Height'] ), $monitor['ZoneCount'], $running && canView( 'Monitors' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-05-26 02:26:49 +08:00
|
|
|
if ( canEdit('Monitors') ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colOrder"><?php echo makeLink( '?view='.$view.'&action=sequence&mid='.$monitor['Id'].'&smid='.$seqIdUpList[$monitor['Id']], '<img src="'.$seqUpFile.'" alt="Up"/>', $monitor['Sequence']>$minSequence ) ?><?php echo makeLink( '?view='.$view.'&action=sequence&mid='.$monitor['Id'].'&smid='.$seqIdDownList[$monitor['Id']], '<img src="'.$seqDownFile.'" alt="Down"/>', $monitor['Sequence']<$maxSequence ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colMark"><input type="checkbox" name="markMids[]" value="<?php echo $monitor['Id'] ?>" onclick="setButtonStates( this )"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|