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
|
|
|
//
|
|
|
|
|
2016-01-05 03:51:24 +08:00
|
|
|
$servers = Server::find_all();
|
2017-10-11 03:11:59 +08:00
|
|
|
$ServersById = array();
|
|
|
|
foreach ( $servers as $S ) {
|
|
|
|
$ServersById[$S->Id()] = $S;
|
|
|
|
}
|
2017-10-19 01:24:41 +08:00
|
|
|
session_start();
|
|
|
|
foreach ( array('ServerFilter','StorageFilter') as $var ) {
|
|
|
|
if ( isset( $_REQUEST[$var] ) ) {
|
2017-10-19 21:50:07 +08:00
|
|
|
if ( $_REQUEST[$var] != '' ) {
|
|
|
|
$_SESSION[$var] = $_REQUEST[$var];
|
|
|
|
} else {
|
|
|
|
unset( $_SESSION[$var] );
|
|
|
|
}
|
|
|
|
} else if ( isset( $_COOKIE[$var] ) ) {
|
|
|
|
if ( $_COOKIE[$var] != '' ) {
|
|
|
|
$_SESSION[$var] = $_COOKIE[$var];
|
|
|
|
} else {
|
|
|
|
unset($_SESSION[$var]);
|
|
|
|
}
|
2017-10-19 01:24:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
session_write_close();
|
2017-10-11 03:11:59 +08:00
|
|
|
|
2016-02-03 22:42:50 +08:00
|
|
|
$storage_areas = Storage::find_all();
|
2017-10-06 04:11:43 +08:00
|
|
|
$StorageById = array();
|
|
|
|
foreach ( $storage_areas as $S ) {
|
|
|
|
$StorageById[$S->Id()] = $S;
|
|
|
|
}
|
|
|
|
|
2016-02-03 22:42:50 +08:00
|
|
|
$show_storage_areas = count($storage_areas) > 1 and canEdit( 'System' ) ? 1 : 0;
|
2016-10-21 01:38:12 +08:00
|
|
|
if ( $running == null )
|
|
|
|
$running = daemonCheck();
|
2015-09-17 02:51:23 +08:00
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
$eventCounts = array(
|
2017-10-01 02:19:32 +08:00
|
|
|
array(
|
|
|
|
'title' => translate('Events'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array (
|
|
|
|
'terms' => array()
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-10-01 02:19:32 +08:00
|
|
|
'total' => 0,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => translate('Hour'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
|
|
|
array( 'attr' => 'DateTime', 'op' => '>=', 'val' => '-1 hour' ),
|
|
|
|
)
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-10-01 02:19:32 +08:00
|
|
|
'total' => 0,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => translate('Day'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
|
|
|
array( 'attr' => 'DateTime', 'op' => '>=', 'val' => '-1 day' ),
|
|
|
|
)
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-10-01 02:19:32 +08:00
|
|
|
'total' => 0,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => translate('Week'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
|
|
|
array( 'attr' => 'DateTime', 'op' => '>=', 'val' => '-7 day' ),
|
|
|
|
)
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-10-01 02:19:32 +08:00
|
|
|
'total' => 0,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => translate('Month'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
|
|
|
array( 'attr' => 'DateTime', 'op' => '>=', 'val' => '-1 month' ),
|
|
|
|
)
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-10-01 02:19:32 +08:00
|
|
|
'total' => 0,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => translate('Archived'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
|
|
|
array( 'attr' => 'Archived', 'op' => '=', 'val' => '1' ),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
'total' => 0,
|
|
|
|
),
|
2008-07-14 21:54:50 +08:00
|
|
|
);
|
|
|
|
|
2016-05-07 02:30:32 +08:00
|
|
|
|
|
|
|
$navbar = getNavBarHTML();
|
2017-10-01 02:19:32 +08:00
|
|
|
|
|
|
|
noCacheHeaders();
|
|
|
|
|
|
|
|
$eventsWindow = 'zm'.ucfirst(ZM_WEB_EVENTS_VIEW);
|
|
|
|
$left_columns = 3;
|
|
|
|
if ( count($servers) ) $left_columns += 1;
|
|
|
|
if ( ZM_WEB_ID_ON_CONSOLE ) $left_columns += 1;
|
|
|
|
if ( $show_storage_areas ) $left_columns += 1;
|
|
|
|
|
|
|
|
xhtmlHeaders( __FILE__, translate('Console') );
|
|
|
|
?>
|
|
|
|
<body>
|
|
|
|
<form name="monitorForm" method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
|
|
|
<input type="hidden" name="action" value=""/>
|
|
|
|
|
|
|
|
<?php echo $navbar ?>
|
|
|
|
<div class="controlHeader">
|
|
|
|
<span id="groupControl"><label><?php echo translate('Group') ?>:</label>
|
|
|
|
<?php
|
2017-10-05 22:46:04 +08:00
|
|
|
# This will end up with the group_id of the deepest selection
|
|
|
|
$group_id = Group::get_group_dropdowns();
|
|
|
|
$groupSql = Group::get_group_sql( $group_id );
|
|
|
|
?>
|
|
|
|
</span>
|
|
|
|
<span id="monitorControl"><label><?php echo translate('Monitor') ?>:</label>
|
|
|
|
<?php
|
2017-10-01 02:19:32 +08:00
|
|
|
|
2017-10-06 04:11:43 +08:00
|
|
|
$monitor_id = 0;
|
|
|
|
if ( isset( $_REQUEST['monitor_id'] ) ) {
|
|
|
|
$monitor_id = $_REQUEST['monitor_id'];
|
|
|
|
} else if ( isset($_COOKIE['zmMonitorId']) ) {
|
|
|
|
$monitor_id = $_COOKIE['zmMonitorId'];
|
|
|
|
}
|
|
|
|
|
2017-10-01 02:19:32 +08:00
|
|
|
$maxWidth = 0;
|
|
|
|
$maxHeight = 0;
|
|
|
|
# Used to determine if the Cycle button should be made available
|
2017-10-06 04:11:43 +08:00
|
|
|
|
2017-10-19 21:50:07 +08:00
|
|
|
$conditions = array();
|
|
|
|
$values = array();
|
|
|
|
|
|
|
|
if ( $groupSql )
|
|
|
|
$conditions[] = $groupSql;
|
|
|
|
if ( isset($_SESSION['ServerFilter']) ) {
|
|
|
|
$conditions[] = 'ServerId=?';
|
|
|
|
$values[] = $_SESSION['ServerFilter'];
|
|
|
|
}
|
|
|
|
if ( isset($_SESSION['StorageFilter']) ) {
|
|
|
|
$conditions[] = 'StorageId=?';
|
|
|
|
$values[] = $_SESSION['StorageFilter'];
|
|
|
|
}
|
|
|
|
$sql = 'SELECT * FROM Monitors' . ( count($conditions) ? ' WHERE ' . implode(' AND ', $conditions ) : '' ).' ORDER BY Sequence ASC';
|
|
|
|
$monitors = dbFetchAll( $sql, null, $values );
|
2017-10-01 02:19:32 +08:00
|
|
|
$displayMonitors = array();
|
2017-10-05 22:46:04 +08:00
|
|
|
$monitors_dropdown = array(''=>'All');
|
|
|
|
|
2017-10-01 02:19:32 +08:00
|
|
|
for ( $i = 0; $i < count($monitors); $i++ ) {
|
2017-10-06 04:11:43 +08:00
|
|
|
if ( $monitor_id and ( $monitors[$i]['Id'] != $monitor_id ) ) {
|
|
|
|
continue;
|
|
|
|
}
|
2017-10-01 02:19:32 +08:00
|
|
|
if ( !visibleMonitor( $monitors[$i]['Id'] ) ) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if ( $monitors[$i]['Function'] != 'None' ) {
|
|
|
|
$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;
|
|
|
|
}
|
|
|
|
$displayMonitors[] = $monitors[$i];
|
2017-10-05 22:46:04 +08:00
|
|
|
$monitors_dropdown[$monitors[$i]['Id']] = $monitors[$i]['Name'];
|
|
|
|
}
|
|
|
|
|
|
|
|
echo htmlSelect( 'monitor_id', $monitors_dropdown, $monitor_id, array('onchange'=>'changeMonitor(this);') );
|
2017-10-01 02:19:32 +08:00
|
|
|
|
|
|
|
$cycleWidth = $maxWidth;
|
|
|
|
$cycleHeight = $maxHeight;
|
2017-10-05 22:46:04 +08:00
|
|
|
$zoneCount = 0;
|
2016-05-07 02:30:32 +08:00
|
|
|
|
2016-05-07 03:52:07 +08:00
|
|
|
for( $i = 0; $i < count($displayMonitors); $i += 1 ) {
|
2016-05-07 03:44:23 +08:00
|
|
|
$monitor = $displayMonitors[$i];
|
2016-05-07 02:33:56 +08:00
|
|
|
$monitor['zmc'] = zmcStatus( $monitor );
|
|
|
|
$monitor['zma'] = zmaStatus( $monitor );
|
|
|
|
$monitor['ZoneCount'] = dbFetchOne( 'select count(Id) as ZoneCount from Zones where MonitorId = ?', 'ZoneCount', array($monitor['Id']) );
|
|
|
|
$counts = array();
|
2016-05-07 03:56:01 +08:00
|
|
|
for ( $j = 0; $j < count($eventCounts); $j += 1 ) {
|
2017-07-06 22:49:10 +08:00
|
|
|
$filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['Query']['terms']), array( 'cnj' => 'and', 'attr' => 'MonitorId', 'op' => '=', 'val' => $monitor['Id'] ) );
|
2016-05-07 02:33:56 +08:00
|
|
|
parseFilter( $filter );
|
2017-07-21 22:54:33 +08:00
|
|
|
$counts[] = 'count(if(1'.$filter['sql'].",1,NULL)) as EventCount$j";
|
2016-05-07 02:33:56 +08:00
|
|
|
$monitor['eventCounts'][$j]['filter'] = $filter;
|
|
|
|
}
|
2017-10-01 02:19:32 +08:00
|
|
|
$sql = 'SELECt '.join($counts,', ').' from Events as E where MonitorId = ?';
|
2016-05-07 02:33:56 +08:00
|
|
|
$counts = dbFetchOne( $sql, NULL, array($monitor['Id']) );
|
2016-05-07 03:56:01 +08:00
|
|
|
if ( $counts )
|
|
|
|
$displayMonitors[$i] = $monitor = array_merge( $monitor, $counts );
|
|
|
|
for ( $j = 0; $j < count($eventCounts); $j += 1 ) {
|
2016-05-07 03:44:23 +08:00
|
|
|
$eventCounts[$j]['total'] += $monitor['EventCount'.$j];
|
2016-05-07 02:38:08 +08:00
|
|
|
}
|
|
|
|
$zoneCount += $monitor['ZoneCount'];
|
2016-05-07 02:30:32 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2017-10-01 02:19:32 +08:00
|
|
|
</span>
|
2017-10-19 01:24:41 +08:00
|
|
|
<?php if ( count($ServersById) > 0 ) { ?>
|
|
|
|
<span id="ServerFilter"><label><?php echo translate('Server')?>:</label>
|
|
|
|
<?php
|
2017-10-19 21:50:07 +08:00
|
|
|
echo htmlSelect( 'ServerFilter', array_merge(array(''=>'All'), $ServersById ), (isset($_SESSION['ServerFilter'])?$_SESSION['ServerFilter']:''), array('onchange'=>'changeFilter(this);') );
|
2017-10-19 01:24:41 +08:00
|
|
|
?>
|
|
|
|
</span>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ( count($StorageById) > 0 ) { ?>
|
2017-10-19 21:50:07 +08:00
|
|
|
<span id="StorageFilter"><label><?php echo translate('Storage')?>:</label>
|
2017-10-19 01:24:41 +08:00
|
|
|
<?php
|
2017-10-19 21:50:07 +08:00
|
|
|
echo htmlSelect( 'StorageFilter', array_merge(array(''=>'All'), $StorageById ), (isset($_SESSION['StorageFilter'])?$_SESSION['StorageFilter']:''), array('onchange'=>'changeFilter(this);') );
|
2017-10-19 01:24:41 +08:00
|
|
|
?>
|
|
|
|
</span>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
2017-10-01 02:19:32 +08:00
|
|
|
</div>
|
2016-03-12 16:28:02 +08:00
|
|
|
|
|
|
|
<div class="container-fluid">
|
2017-05-26 03:29:31 +08:00
|
|
|
<table class="table table-striped table-hover table-condensed" id="consoleTable">
|
2008-07-14 21:54:50 +08:00
|
|
|
<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>
|
2016-02-03 22:42:50 +08:00
|
|
|
<?php if ( $show_storage_areas ) { ?>
|
|
|
|
<th class="colStorage"><?php echo translate('Storage') ?></th>
|
|
|
|
<?php } ?>
|
2017-02-03 01:15:16 +08:00
|
|
|
<?php for ( $i = 0; $i < count($eventCounts); $i++ ) { ?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<th class="colEvents"><?php echo $eventCounts[$i]['title'] ?></th>
|
2017-02-03 01:15:16 +08:00
|
|
|
<?php } ?>
|
2017-03-30 22:45:55 +08:00
|
|
|
<th class="colZones"><a href="<?php echo $_SERVER['PHP_SELF'] ?>?view=zones_overview"><?php echo translate('Zones') ?></a></th>
|
2017-02-03 01:15:16 +08:00
|
|
|
<?php if ( canEdit('Monitors') ) { ?>
|
2017-10-06 04:11:43 +08:00
|
|
|
<th class="colMark"><input type="checkbox" name="toggleCheck" value="1" onclick="toggleCheckbox( this, 'markMids[]' );"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/> <?php echo translate('All') ?></th>
|
2017-01-24 22:30:56 +08:00
|
|
|
<?php } ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2017-01-23 23:12:57 +08:00
|
|
|
<tbody id="consoleTableBody">
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2016-05-06 23:26:53 +08:00
|
|
|
for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
|
|
|
|
$monitor = $displayMonitors[$monitor_i];
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2017-01-23 23:12:57 +08:00
|
|
|
<tr id="<?php echo 'monitor_id-'.$monitor['Id'] ?>" title="<?php echo $monitor['Id'] ?>">
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-06-05 23:11:34 +08:00
|
|
|
if ( !$monitor['zmc'] ) {
|
|
|
|
$dclass = 'errorText';
|
|
|
|
} else {
|
|
|
|
// https://github.com/ZoneMinder/ZoneMinder/issues/1082
|
|
|
|
if ( !$monitor['zma'] && $monitor['Function']!='Monitor' )
|
|
|
|
$dclass = 'warnText';
|
2008-07-14 21:54:50 +08:00
|
|
|
else
|
2017-06-05 23:11:34 +08:00
|
|
|
$dclass = 'infoText';
|
|
|
|
}
|
|
|
|
if ( $monitor['Function'] == 'None' )
|
|
|
|
$fclass = 'errorText';
|
|
|
|
//elseif ( $monitor['Function'] == 'Monitor' )
|
|
|
|
// $fclass = 'warnText';
|
|
|
|
else
|
|
|
|
$fclass = 'infoText';
|
|
|
|
if ( !$monitor['Enabled'] )
|
|
|
|
$fclass .= ' disabledText';
|
|
|
|
$scale = max( reScale( SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
|
|
|
|
?>
|
|
|
|
<?php
|
|
|
|
if ( ZM_WEB_ID_ON_CONSOLE ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2017-02-03 01:15:16 +08:00
|
|
|
<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>
|
2017-06-05 23:11:34 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2017-02-03 01:15:16 +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>
|
2017-06-05 23:11:34 +08:00
|
|
|
<?php
|
|
|
|
if ( count($servers) ) { ?>
|
2017-10-11 03:11:59 +08:00
|
|
|
<td class="colServer"><?php $Server = isset($ServersById[$monitor['ServerId']]) ? $ServersById[$monitor['ServerId']] : new Server( $monitor['ServerId'] ); echo $Server->Name(); ?></td>
|
2017-06-05 23:11:34 +08:00
|
|
|
<?php
|
|
|
|
}
|
2017-07-21 23:04:32 +08:00
|
|
|
$source = '';
|
2017-06-05 23:11:34 +08:00
|
|
|
if ( $monitor['Type'] == 'Local' ) {
|
2017-07-21 23:04:32 +08:00
|
|
|
$source = $monitor['Device'].' ('.$monitor['Channel'].')';
|
2017-07-26 22:48:42 +08:00
|
|
|
} elseif ( $monitor['Type'] == 'Remote' ) {
|
|
|
|
$source = preg_replace( '/^.*@/', '', $monitor['Host'] );
|
2017-07-21 23:04:32 +08:00
|
|
|
} elseif ( $monitor['Type'] == 'File' || $monitor['Type'] == 'cURL' ) {
|
|
|
|
$source = preg_replace( '/^.*\//', '', $monitor['Path'] );
|
2017-06-05 23:11:34 +08:00
|
|
|
} elseif ( $monitor['Type'] == 'Ffmpeg' || $monitor['Type'] == 'Libvlc' ) {
|
2013-12-22 09:29:40 +08:00
|
|
|
$domain = parse_url( $monitor['Path'], PHP_URL_HOST );
|
2017-07-21 23:04:32 +08:00
|
|
|
$source = $domain ? $domain : preg_replace( '/^.*\//', '', $monitor['Path'] );
|
2017-06-05 23:11:34 +08:00
|
|
|
}
|
2017-07-21 23:04:32 +08:00
|
|
|
if ( $source == '' ) {
|
|
|
|
$source = 'Monitor ' . $monitor['Id'];
|
|
|
|
}
|
|
|
|
echo '<td class="colSource">'. makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.$source.'</span>', canEdit( 'Monitors' ) ).'</td>';
|
2017-06-05 23:11:34 +08:00
|
|
|
if ( $show_storage_areas ) {
|
|
|
|
?>
|
2017-10-06 04:11:43 +08:00
|
|
|
<td class="colStorage"><?php if ( isset( $StorageById[ $monitor['StorageId'] ] ) ) { echo $StorageById[ $monitor['StorageId'] ]->Name(); } ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-06-05 23:11:34 +08:00
|
|
|
}
|
2017-07-14 21:57:25 +08:00
|
|
|
|
2017-06-05 23:11:34 +08:00
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2017-10-17 03:19:38 +08:00
|
|
|
<td class="colEvents"><?php echo makePopupLink( '?view='.ZM_WEB_EVENTS_VIEW.'&page=1'.$monitor['eventCounts'][$i]['filter']['query'], $eventsWindow, ZM_WEB_EVENTS_VIEW, $monitor['EventCount'.$i], canView( 'Events' ) ) ?></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-06-05 23:11:34 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
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>
|
2017-06-05 23:11:34 +08:00
|
|
|
<?php
|
|
|
|
if ( canEdit('Monitors') ) {
|
|
|
|
?>
|
2017-01-24 10:51:17 +08:00
|
|
|
<td class="colMark">
|
2017-02-03 01:15:16 +08:00
|
|
|
<input type="checkbox" name="markMids[]" value="<?php echo $monitor['Id'] ?>" onclick="setButtonStates( this )"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/>
|
|
|
|
<span class="glyphicon glyphicon-sort"></span>
|
2017-01-24 10:51:17 +08:00
|
|
|
</td>
|
2017-06-05 23:11:34 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
2017-05-26 03:29:31 +08:00
|
|
|
} # end for each monitor
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
</tbody>
|
2017-06-01 21:36:00 +08:00
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<td class="colLeftButtons" colspan="<?php echo $left_columns ?>">
|
2017-10-01 02:19:32 +08:00
|
|
|
<input type="button" value="<?php echo translate('Refresh') ?>" onclick="location.reload(true);"/>
|
|
|
|
<input type="button" name="addBtn" value="<?php echo translate('AddNewMonitor') ?>" onclick="addMonitor( this )"/>
|
2017-06-01 21:36:00 +08:00
|
|
|
<!-- <?php echo makePopupButton( '?view=monitor', 'zmMonitor0', 'monitor', translate('AddNewMonitor'), (canEdit( 'Monitors' ) && !$user['MonitorIds']) ) ?> -->
|
2017-06-05 09:42:56 +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' ) ) ?>
|
2017-06-07 08:39:58 +08:00
|
|
|
<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"/>
|
2017-06-01 21:36:00 +08:00
|
|
|
</td>
|
|
|
|
<?php
|
2017-06-05 09:42:56 +08:00
|
|
|
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
|
|
|
parseFilter( $eventCounts[$i]['filter'] );
|
2017-06-01 21:36:00 +08:00
|
|
|
?>
|
2017-10-17 03:19:38 +08:00
|
|
|
<td class="colEvents"><?php echo makePopupLink( '?view='.ZM_WEB_EVENTS_VIEW.'&page=1'.$eventCounts[$i]['filter']['query'], $eventsWindow, ZM_WEB_EVENTS_VIEW, $eventCounts[$i]['total'], canView( 'Events' ) ) ?></td>
|
2017-06-01 21:36:00 +08:00
|
|
|
<?php
|
2017-06-05 09:42:56 +08:00
|
|
|
}
|
2017-06-01 21:36:00 +08:00
|
|
|
?>
|
|
|
|
<td class="colZones"><?php echo $zoneCount ?></td>
|
2017-06-05 09:42:56 +08:00
|
|
|
<?php if ( canEdit('Monitors') ) { ?>
|
|
|
|
<td class="colMark"></td>
|
|
|
|
<?php } ?>
|
2017-06-01 21:36:00 +08:00
|
|
|
</tr>
|
|
|
|
</tfoot>
|
2008-07-14 21:54:50 +08:00
|
|
|
</table>
|
|
|
|
</div>
|
2017-07-13 00:49:01 +08:00
|
|
|
</form>
|
|
|
|
<?php xhtmlFooter() ?>
|