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
|
2020-08-01 22:50:25 +08:00
|
|
|
// GNU General Public License for more details.
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
// 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-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-11-27 06:03:36 +08:00
|
|
|
'Total'=> array(
|
2017-10-01 02:19:32 +08:00
|
|
|
'title' => translate('Events'),
|
|
|
|
'filter' => array(
|
2017-11-09 00:18:23 +08:00
|
|
|
'Query' => array(
|
2017-10-01 02:19:32 +08:00
|
|
|
'terms' => array()
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-11-27 06:03:36 +08:00
|
|
|
'totalevents' => 0,
|
|
|
|
'totaldiskspace' => 0,
|
2017-10-01 02:19:32 +08:00
|
|
|
),
|
2017-11-23 09:03:37 +08:00
|
|
|
'Hour'=>array(
|
2017-10-01 02:19:32 +08:00
|
|
|
'title' => translate('Hour'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
2017-12-21 04:46:03 +08:00
|
|
|
array( 'attr' => 'StartDateTime', 'op' => '>=', 'val' => '-1 hour' ),
|
2017-10-01 02:19:32 +08:00
|
|
|
)
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-11-27 06:03:36 +08:00
|
|
|
'totalevents' => 0,
|
|
|
|
'totaldiskspace' => 0,
|
2017-10-01 02:19:32 +08:00
|
|
|
),
|
2017-11-23 09:03:37 +08:00
|
|
|
'Day'=>array(
|
2017-10-01 02:19:32 +08:00
|
|
|
'title' => translate('Day'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
2017-11-23 05:49:46 +08:00
|
|
|
array( 'attr' => 'StartDateTime', 'op' => '>=', 'val' => '-1 day' ),
|
2017-10-01 02:19:32 +08:00
|
|
|
)
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-11-27 06:03:36 +08:00
|
|
|
'totalevents' => 0,
|
|
|
|
'totaldiskspace' => 0,
|
2017-10-01 02:19:32 +08:00
|
|
|
),
|
2017-11-23 09:03:37 +08:00
|
|
|
'Week'=>array(
|
2017-10-01 02:19:32 +08:00
|
|
|
'title' => translate('Week'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
2017-11-23 05:49:46 +08:00
|
|
|
array( 'attr' => 'StartDateTime', 'op' => '>=', 'val' => '-7 day' ),
|
2017-10-01 02:19:32 +08:00
|
|
|
)
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-11-27 06:03:36 +08:00
|
|
|
'totalevents' => 0,
|
|
|
|
'totaldiskspace' => 0,
|
2017-10-01 02:19:32 +08:00
|
|
|
),
|
2017-11-23 09:03:37 +08:00
|
|
|
'Month'=>array(
|
2017-10-01 02:19:32 +08:00
|
|
|
'title' => translate('Month'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
2017-11-23 05:49:46 +08:00
|
|
|
array( 'attr' => 'StartDateTime', 'op' => '>=', 'val' => '-1 month' ),
|
2017-10-01 02:19:32 +08:00
|
|
|
)
|
|
|
|
)
|
2008-07-14 21:54:50 +08:00
|
|
|
),
|
2017-11-27 06:03:36 +08:00
|
|
|
'totalevents' => 0,
|
|
|
|
'totaldiskspace' => 0,
|
2017-10-01 02:19:32 +08:00
|
|
|
),
|
2017-11-23 09:03:37 +08:00
|
|
|
'Archived'=>array(
|
2017-10-01 02:19:32 +08:00
|
|
|
'title' => translate('Archived'),
|
|
|
|
'filter' => array(
|
|
|
|
'Query' => array(
|
|
|
|
'terms' => array(
|
|
|
|
array( 'attr' => 'Archived', 'op' => '=', 'val' => '1' ),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
2017-11-27 06:03:36 +08:00
|
|
|
'totalevents' => 0,
|
|
|
|
'totaldiskspace' => 0,
|
2017-10-01 02:19:32 +08:00
|
|
|
),
|
2008-07-14 21:54:50 +08:00
|
|
|
);
|
|
|
|
|
2016-05-07 02:30:32 +08:00
|
|
|
|
|
|
|
$navbar = getNavBarHTML();
|
2017-10-30 22:37:08 +08:00
|
|
|
ob_start();
|
|
|
|
include('_monitor_filters.php');
|
|
|
|
$filterbar = ob_get_contents();
|
|
|
|
ob_end_clean();
|
2017-10-01 02:19:32 +08:00
|
|
|
|
2020-02-25 03:34:21 +08:00
|
|
|
$show_storage_areas = (count($storage_areas) > 1) and (canEdit('System') ? 1 : 0);
|
2017-10-30 22:37:08 +08:00
|
|
|
$maxWidth = 0;
|
|
|
|
$maxHeight = 0;
|
|
|
|
$zoneCount = 0;
|
2018-04-25 02:18:41 +08:00
|
|
|
$total_capturing_bandwidth=0;
|
2018-04-06 00:53:53 +08:00
|
|
|
|
|
|
|
$status_counts = array();
|
2017-10-30 22:37:08 +08:00
|
|
|
for ( $i = 0; $i < count($displayMonitors); $i++ ) {
|
|
|
|
$monitor = &$displayMonitors[$i];
|
2020-02-25 03:34:21 +08:00
|
|
|
if ( !$monitor['Status'] ) {
|
2018-04-27 05:18:36 +08:00
|
|
|
if ( $monitor['Type'] == 'WebSite' )
|
|
|
|
$monitor['Status'] = 'Running';
|
|
|
|
else
|
2018-04-06 00:53:53 +08:00
|
|
|
$monitor['Status'] = 'NotRunning';
|
|
|
|
}
|
|
|
|
if ( !isset($status_counts[$monitor['Status']]) )
|
|
|
|
$status_counts[$monitor['Status']] = 0;
|
|
|
|
$status_counts[$monitor['Status']] += 1;
|
|
|
|
|
2017-10-30 22:37:08 +08:00
|
|
|
if ( $monitor['Function'] != 'None' ) {
|
2020-02-25 03:34:21 +08:00
|
|
|
$scaleWidth = reScale($monitor['Width'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE);
|
|
|
|
$scaleHeight = reScale($monitor['Height'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE);
|
2017-10-30 22:37:08 +08:00
|
|
|
if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth;
|
|
|
|
if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight;
|
2017-10-05 22:46:04 +08:00
|
|
|
}
|
2018-02-09 23:20:51 +08:00
|
|
|
#$monitor['zmc'] = zmcStatus( $monitor );
|
|
|
|
#$monitor['zma'] = zmaStatus( $monitor );
|
2017-10-30 22:37:08 +08:00
|
|
|
$zoneCount += $monitor['ZoneCount'];
|
|
|
|
|
2016-05-07 02:33:56 +08:00
|
|
|
$counts = array();
|
2020-02-25 03:34:21 +08:00
|
|
|
foreach ( array_keys($eventCounts) as $j ) {
|
2017-11-09 00:18:23 +08:00
|
|
|
$filter = addFilterTerm(
|
|
|
|
$eventCounts[$j]['filter'],
|
|
|
|
count($eventCounts[$j]['filter']['Query']['terms']),
|
2020-02-25 03:34:21 +08:00
|
|
|
array('cnj'=>'and', 'attr'=>'MonitorId', 'op'=>'=', 'val'=>$monitor['Id'])
|
2017-11-09 00:18:23 +08:00
|
|
|
);
|
2020-02-25 03:34:21 +08:00
|
|
|
parseFilter($filter);
|
2017-11-23 09:03:37 +08:00
|
|
|
#$counts[] = 'count(if(1'.$filter['sql'].",1,NULL)) AS EventCount$j, SUM(if(1".$filter['sql'].",DiskSpace,NULL)) As DiskSpace$j";
|
2016-05-07 02:33:56 +08:00
|
|
|
$monitor['eventCounts'][$j]['filter'] = $filter;
|
2017-11-27 06:03:36 +08:00
|
|
|
$eventCounts[$j]['totalevents'] += $monitor[$j.'Events'];
|
|
|
|
$eventCounts[$j]['totaldiskspace'] += $monitor[$j.'EventDiskSpace'];
|
2016-05-07 02:38:08 +08:00
|
|
|
}
|
2017-11-02 19:59:25 +08:00
|
|
|
unset($monitor);
|
2017-11-09 00:18:23 +08:00
|
|
|
} // end foreach display monitor
|
2017-10-30 22:37:08 +08:00
|
|
|
$cycleWidth = $maxWidth;
|
|
|
|
$cycleHeight = $maxHeight;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-02-25 03:34:21 +08:00
|
|
|
xhtmlHeaders(__FILE__, translate('Console'));
|
2018-11-08 01:33:54 +08:00
|
|
|
getBodyTopHTML();
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2020-07-28 00:40:46 +08:00
|
|
|
<?php echo $navbar ?>
|
2019-02-10 13:39:19 +08:00
|
|
|
<form name="monitorForm" method="get" action="?">
|
2017-10-30 22:37:08 +08:00
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
|
|
|
<input type="hidden" name="action" value=""/>
|
|
|
|
|
2020-07-28 05:14:15 +08:00
|
|
|
<div class="filterBar" id="fbpanel"<?php echo ( isset($_COOKIE['zmFilterBarFlip']) and $_COOKIE['zmFilterBarFlip'] == 'down' ) ? ' style="display:none;"' : '' ?>>
|
|
|
|
<?php echo $filterbar ?>
|
|
|
|
</div>
|
2020-07-28 21:59:28 +08:00
|
|
|
|
|
|
|
<div class="container-fluid pt-2">
|
|
|
|
<div class="statusBreakdown float-left">
|
2018-04-06 00:53:53 +08:00
|
|
|
<?php
|
|
|
|
$html = '';
|
|
|
|
foreach ( array_keys($status_counts) as $status ) {
|
|
|
|
|
|
|
|
$html .= '<span class="status"><label>'.translate('Status'.$status).'</label>'.round(100*($status_counts[$status]/count($displayMonitors)),1).'%</span>';
|
|
|
|
}
|
|
|
|
echo $html;
|
|
|
|
?>
|
2020-07-28 21:59:28 +08:00
|
|
|
</div>
|
2016-03-12 16:28:02 +08:00
|
|
|
|
2019-01-16 22:59:58 +08:00
|
|
|
<button type="button" name="addBtn" data-on-click-this="addMonitor"
|
2020-07-04 07:16:41 +08:00
|
|
|
<?php echo (canEdit('Monitors') && !$user['MonitorIds']) ? '' : ' disabled="disabled" title="'.translate('AddMonitorDisabled').'"' ?>
|
2018-05-04 00:39:09 +08:00
|
|
|
>
|
2019-12-03 03:21:51 +08:00
|
|
|
<i class="material-icons md-18">add_circle</i>
|
|
|
|
<?php echo translate('AddNewMonitor') ?>
|
2018-05-04 00:39:09 +08:00
|
|
|
</button>
|
2019-01-16 22:59:58 +08:00
|
|
|
<button type="button" name="cloneBtn" data-on-click-this="cloneMonitor"
|
2018-05-04 00:39:09 +08:00
|
|
|
<?php echo (canEdit('Monitors') && !$user['MonitorIds']) ? '' : ' disabled="disabled"' ?>
|
|
|
|
style="display:none;">
|
2020-01-06 06:34:27 +08:00
|
|
|
<i class="material-icons md-18">content_copy</i>
|
|
|
|
<!--content_copy used instead of file_copy as there is a bug in material-icons -->
|
2019-12-03 03:21:51 +08:00
|
|
|
<?php echo translate('CloneMonitor') ?>
|
2018-05-04 00:39:09 +08:00
|
|
|
</button>
|
2019-01-16 22:59:58 +08:00
|
|
|
<button type="button" name="editBtn" data-on-click-this="editMonitor" disabled="disabled">
|
2019-12-03 03:21:51 +08:00
|
|
|
<i class="material-icons md-18">edit</i>
|
|
|
|
<?php echo translate('Edit') ?>
|
2018-05-04 00:39:09 +08:00
|
|
|
</button>
|
2019-01-16 22:59:58 +08:00
|
|
|
<button type="button" name="deleteBtn" data-on-click-this="deleteMonitor" disabled="disabled">
|
2019-12-03 03:21:51 +08:00
|
|
|
<i class="material-icons md-18">delete</i>
|
|
|
|
<?php echo translate('Delete') ?>
|
2018-05-04 00:39:09 +08:00
|
|
|
</button>
|
2019-12-03 03:21:51 +08:00
|
|
|
<button type="button" name="selectBtn" data-on-click-this="selectMonitor" disabled="disabled">
|
|
|
|
<i class="material-icons md-18">view_list</i>
|
2020-01-06 06:34:27 +08:00
|
|
|
<?php echo translate('Select') ?>
|
2019-12-03 03:21:51 +08:00
|
|
|
</button>
|
2020-07-28 05:14:15 +08:00
|
|
|
|
|
|
|
<a href="#"><i id="fbflip" class="material-icons md-18">keyboard_arrow_<?php echo ( isset($_COOKIE['zmFilterBarFlip']) and $_COOKIE['zmFilterBarFlip'] == 'down') ? 'down' : 'up' ?></i></a>
|
2018-04-13 04:40:11 +08:00
|
|
|
<?php
|
2018-04-20 02:16:30 +08:00
|
|
|
ob_start();
|
2018-04-13 04:40:11 +08:00
|
|
|
?>
|
2020-08-01 22:49:27 +08:00
|
|
|
<div class="table-responsive-sm pt-2">
|
2018-04-20 02:16:30 +08:00
|
|
|
<table class="table table-striped table-hover table-condensed consoleTable">
|
2018-03-25 23:43:34 +08:00
|
|
|
<thead class="thead-highlight">
|
2008-07-14 21:54:50 +08:00
|
|
|
<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 } ?>
|
2018-03-25 21:28:00 +08:00
|
|
|
<th class="colName"><i class="material-icons md-18">videocam</i> <?php echo translate('Name') ?></th>
|
2015-05-10 21:10:30 +08:00
|
|
|
<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 } ?>
|
2018-03-25 21:28:00 +08:00
|
|
|
<th class="colSource"><i class="material-icons md-18">settings</i> <?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>
|
2017-11-27 06:03:36 +08:00
|
|
|
<?php }
|
2018-05-04 00:39:09 +08:00
|
|
|
foreach ( array_keys($eventCounts) as $j ) {
|
2019-06-07 00:58:33 +08:00
|
|
|
echo '<th class="colEvents">'. $eventCounts[$j]['title'] .'</th>';
|
2017-11-27 06:03:36 +08:00
|
|
|
}
|
|
|
|
?>
|
2018-10-11 02:13:12 +08:00
|
|
|
<th class="colZones"><?php echo translate('Zones') ?></th>
|
2017-02-03 01:15:16 +08:00
|
|
|
<?php if ( canEdit('Monitors') ) { ?>
|
2019-01-22 00:11:40 +08:00
|
|
|
<th class="colMark"><input type="checkbox" name="toggleCheck" value="1" data-checkbox-name="markMids[]" data-on-click-this="updateFormCheckboxesByName"/> <?php echo translate('All') ?></th>
|
2017-01-24 22:30:56 +08:00
|
|
|
<?php } ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2018-06-07 01:37:12 +08:00
|
|
|
<tbody id="consoleTableBody">
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2018-04-20 02:16:30 +08:00
|
|
|
$table_head = ob_get_contents();
|
|
|
|
ob_end_clean();
|
2018-04-20 02:33:05 +08:00
|
|
|
echo $table_head;
|
2018-04-20 02:16:30 +08:00
|
|
|
for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
|
|
|
|
$monitor = $displayMonitors[$monitor_i];
|
2019-02-22 22:19:07 +08:00
|
|
|
$Monitor = new ZM\Monitor($monitor);
|
2018-04-20 02:16:30 +08:00
|
|
|
|
2018-04-21 22:35:36 +08:00
|
|
|
if ( $monitor_i and ( $monitor_i % 100 == 0 ) ) {
|
|
|
|
echo '</table>';
|
2018-04-20 02:16:30 +08:00
|
|
|
echo $table_head;
|
2018-04-21 22:35:36 +08:00
|
|
|
} # monitor_i % 100
|
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
|
2018-04-27 05:18:36 +08:00
|
|
|
if ( (!$monitor['Status'] || $monitor['Status'] == 'NotRunning') && $monitor['Type']!='WebSite' ) {
|
2018-02-09 23:20:51 +08:00
|
|
|
$source_class = 'errorText';
|
2017-06-05 23:11:34 +08:00
|
|
|
} else {
|
2018-04-04 03:31:54 +08:00
|
|
|
if ( $monitor['CaptureFPS'] == '0.00' ) {
|
2018-02-09 23:20:51 +08:00
|
|
|
$source_class = 'errorText';
|
|
|
|
} else if ( (!$monitor['AnalysisFPS']) && ($monitor['Function']!='Monitor') && ($monitor['Function'] != 'Nodect') ) {
|
|
|
|
$source_class = 'warnText';
|
|
|
|
} else {
|
|
|
|
$source_class = 'infoText';
|
|
|
|
}
|
2017-06-05 23:11:34 +08:00
|
|
|
}
|
|
|
|
if ( $monitor['Function'] == 'None' )
|
2018-10-31 00:04:05 +08:00
|
|
|
$function_class = 'errorText';
|
2017-06-05 23:11:34 +08:00
|
|
|
else
|
2018-10-31 00:04:05 +08:00
|
|
|
$function_class = 'infoText';
|
|
|
|
|
|
|
|
|
2018-05-04 00:39:09 +08:00
|
|
|
$scale = max(reScale(SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE), SCALE_BASE);
|
|
|
|
$stream_available = canView('Stream') and $monitor['Type']=='WebSite' or ($monitor['CaptureFPS'] && $monitor['Function'] != 'None');
|
2018-10-31 00:04:05 +08:00
|
|
|
$dot_class = $source_class;
|
|
|
|
if ( $function_class != 'infoText' ) {
|
|
|
|
$dot_class = $function_class;
|
|
|
|
} else if ( !$monitor['Enabled'] ) {
|
|
|
|
$dot_class .= ' warnText';
|
|
|
|
}
|
2018-02-09 23:20:51 +08:00
|
|
|
|
2017-06-05 23:11:34 +08:00
|
|
|
if ( ZM_WEB_ID_ON_CONSOLE ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2018-02-09 23:20:51 +08:00
|
|
|
<td class="colId"><a <?php echo ($stream_available ? 'href="?view=watch&mid='.$monitor['Id'].'">' : '>') . $monitor['Id'] ?></a></td>
|
2017-06-05 23:11:34 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2018-03-02 11:23:46 +08:00
|
|
|
<td class="colName">
|
2019-12-03 03:31:05 +08:00
|
|
|
<i class="material-icons md-18 <?php echo $dot_class ?>">lens</i>
|
2020-04-11 00:42:41 +08:00
|
|
|
<a <?php echo ($stream_available ? 'href="?view=watch&mid='.$monitor['Id'].'">' : '>') . validHtmlStr($monitor['Name']) ?></a><br/>
|
2019-12-03 03:31:05 +08:00
|
|
|
<div class="small text-nowrap text-muted">
|
|
|
|
|
2018-03-02 11:23:46 +08:00
|
|
|
<?php echo implode('<br/>',
|
|
|
|
array_map(function($group_id){
|
2019-02-22 22:19:07 +08:00
|
|
|
$Group = ZM\Group::find_one(array('Id'=>$group_id));
|
2018-04-19 00:30:47 +08:00
|
|
|
if ( $Group ) {
|
|
|
|
$Groups = $Group->Parents();
|
|
|
|
array_push( $Groups, $Group );
|
|
|
|
}
|
2020-04-11 00:42:41 +08:00
|
|
|
return implode(' > ', array_map(function($Group){ return '<a href="?view=montagereview&GroupId='.$Group->Id().'">'.validHtmlStr($Group->Name()).'</a>'; }, $Groups ));
|
2018-03-02 11:23:46 +08:00
|
|
|
}, $Monitor->GroupIds() ) );
|
|
|
|
?>
|
2018-03-24 21:59:39 +08:00
|
|
|
</div></td>
|
2017-11-22 14:18:07 +08:00
|
|
|
<td class="colFunction">
|
2018-10-31 00:04:05 +08:00
|
|
|
<?php echo makePopupLink( '?view=function&mid='.$monitor['Id'], 'zmFunction', 'function', '<span class="'.$function_class.'">'.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', <span class="disabledText">disabled</span>' : '' ) .'</span>', canEdit('Monitors') ) ?><br/>
|
2018-04-17 02:51:10 +08:00
|
|
|
<?php echo translate('Status'.$monitor['Status']) ?><br/>
|
|
|
|
<div class="small text-nowrap text-muted">
|
2018-01-25 00:51:11 +08:00
|
|
|
<?php
|
|
|
|
$fps_string = '';
|
|
|
|
if ( isset($monitor['CaptureFPS']) ) {
|
|
|
|
$fps_string .= $monitor['CaptureFPS'];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( isset($monitor['AnalysisFPS']) and ( $monitor['Function'] == 'Mocord' or $monitor['Function'] == 'Modect' ) ) {
|
2018-03-24 21:59:39 +08:00
|
|
|
$fps_string .= '/' . $monitor['AnalysisFPS'];
|
2018-01-25 00:51:11 +08:00
|
|
|
}
|
2018-03-24 21:59:39 +08:00
|
|
|
if ($fps_string) $fps_string .= ' fps';
|
2018-04-25 02:11:27 +08:00
|
|
|
$fps_string .= ' ' . human_filesize($monitor['CaptureBandwidth']).'/s';
|
2018-04-25 02:18:41 +08:00
|
|
|
$total_capturing_bandwidth += $monitor['CaptureBandwidth'];
|
2018-01-25 00:51:11 +08:00
|
|
|
echo $fps_string;
|
|
|
|
?>
|
2018-03-24 21:59:39 +08:00
|
|
|
</div></td>
|
2017-06-05 23:11:34 +08:00
|
|
|
<?php
|
|
|
|
if ( count($servers) ) { ?>
|
2020-04-11 00:42:41 +08:00
|
|
|
<td class="colServer"><?php $Server = isset($ServersById[$monitor['ServerId']]) ? $ServersById[$monitor['ServerId']] : new ZM\Server($monitor['ServerId']); echo validHtmlStr($Server->Name()); ?></td>
|
2017-06-05 23:11:34 +08:00
|
|
|
<?php
|
|
|
|
}
|
2019-02-09 18:28:40 +08:00
|
|
|
echo '<td class="colSource">'. makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$source_class.'">'.validHtmlStr($Monitor->Source()).'</span>', canEdit('Monitors') ).'</td>';
|
2017-06-05 23:11:34 +08:00
|
|
|
if ( $show_storage_areas ) {
|
|
|
|
?>
|
2020-08-12 02:11:48 +08:00
|
|
|
<td class="colStorage"><?php echo isset($StorageById[$monitor['StorageId']]) ? validHtmlStr($StorageById[$monitor['StorageId']]->Name()) : ($monitor['StorageId']?'<span class="error">Deleted '.$monitor['StorageId'].'</span>' : '') ?></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
|
|
|
|
2018-05-04 00:39:09 +08:00
|
|
|
foreach ( array_keys($eventCounts) as $i ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2017-11-21 03:52:21 +08:00
|
|
|
<td class="colEvents"><a <?php echo (canView('Events') ? 'href="?view='.ZM_WEB_EVENTS_VIEW.'&page=1'.$monitor['eventCounts'][$i]['filter']['query'].'">' : '') .
|
2018-03-24 21:59:39 +08:00
|
|
|
$monitor[$i.'Events'] . '<br/></a><div class="small text-nowrap text-muted">' . human_filesize($monitor[$i.'EventDiskSpace']) ?></div></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
|
|
|
?>
|
2018-06-07 04:59:07 +08:00
|
|
|
<td class="colZones"><?php echo makePopupLink('?view=zones&mid='.$monitor['Id'], 'zmZones', array('zones', $monitor['Width'], $monitor['Height']), $monitor['ZoneCount'], 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">
|
2019-01-16 22:59:58 +08:00
|
|
|
<input type="checkbox" name="markMids[]" value="<?php echo $monitor['Id'] ?>" data-on-click-this="setButtonStates"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/>
|
2019-08-19 20:59:15 +08:00
|
|
|
<i class="material-icons sort" title="Click and drag to change order">swap_vert</i>
|
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>
|
2018-04-25 02:18:41 +08:00
|
|
|
<?php if ( ZM_WEB_ID_ON_CONSOLE ) { ?>
|
2018-03-25 05:34:46 +08:00
|
|
|
<td class="colId"><?php echo translate('Total').":".count($displayMonitors) ?></td>
|
2018-04-25 02:18:41 +08:00
|
|
|
<?php } ?>
|
|
|
|
<td class="colName"></td>
|
|
|
|
<td class="colFunction"><?php echo human_filesize($total_capturing_bandwidth ).'/s' ?></td>
|
|
|
|
<?php if ( count($servers) ) { ?>
|
|
|
|
<td class="colServer"></td>
|
|
|
|
<?php } ?>
|
|
|
|
<td class="colSource"></td>
|
|
|
|
<?php if ( $show_storage_areas ) { ?>
|
|
|
|
<td class="colStorage"></td>
|
2017-06-01 21:36:00 +08:00
|
|
|
<?php
|
2018-04-25 02:18:41 +08:00
|
|
|
}
|
2020-02-25 03:34:21 +08:00
|
|
|
foreach ( array_keys($eventCounts) as $i ) {
|
|
|
|
$filter = addFilterTerm(
|
|
|
|
$eventCounts[$i]['filter'],
|
|
|
|
count($eventCounts[$i]['filter']['Query']['terms']),
|
|
|
|
array(
|
|
|
|
'cnj'=>'and',
|
|
|
|
'attr'=>'MonitorId',
|
|
|
|
'op'=>'IN',
|
|
|
|
'val'=>implode(',',array_map(function($m){return $m['Id'];}, $displayMonitors))
|
|
|
|
)
|
|
|
|
);
|
|
|
|
parseFilter($filter);
|
2017-06-01 21:36:00 +08:00
|
|
|
?>
|
2017-11-27 06:03:36 +08:00
|
|
|
<td class="colEvents">
|
2020-02-25 03:34:21 +08:00
|
|
|
<a <?php echo
|
|
|
|
(canView('Events') ? 'href="?view='.ZM_WEB_EVENTS_VIEW.'&page=1'.$filter['query'].'">' : '') .
|
|
|
|
$eventCounts[$i]['totalevents'].'</a><br/>
|
|
|
|
<div class="small text-nowrap text-muted">'.human_filesize($eventCounts[$i]['totaldiskspace'])
|
|
|
|
?></div>
|
|
|
|
</td>
|
2017-06-01 21:36:00 +08:00
|
|
|
<?php
|
2020-02-25 03:34:21 +08:00
|
|
|
} // end foreach eventCounts
|
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 } ?>
|
2020-05-27 16:08:08 +08:00
|
|
|
</tr>
|
2017-06-01 21:36:00 +08:00
|
|
|
</tfoot>
|
2020-05-27 16:08:08 +08:00
|
|
|
</table>
|
|
|
|
</div>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
2017-07-13 00:49:01 +08:00
|
|
|
</form>
|
|
|
|
<?php xhtmlFooter() ?>
|