Merge pull request #2852 from connortechnology/Event_list_is_not_filtered_when_Group_is_selected_on_Console

Event list is not filtered when group is selected on console
This commit is contained in:
Isaac Connor 2020-02-24 14:37:42 -05:00 committed by GitHub
commit 173d58d8b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 15 deletions

View File

@ -707,7 +707,11 @@ Debug(1, "Loading image");
// when stored as an mp4, we just have the rotation as a flag in the headers // when stored as an mp4, we just have the rotation as a flag in the headers
// so we need to rotate it before outputting // so we need to rotate it before outputting
if ( event_data->Orientation != Monitor::ROTATE_0 ) { if (
(monitor->GetOptVideoWriter() == Monitor::H264PASSTHROUGH)
and
(event_data->Orientation != Monitor::ROTATE_0)
) {
Debug(2, "Rotating image %d", event_data->Orientation); Debug(2, "Rotating image %d", event_data->Orientation);
switch ( event_data->Orientation ) { switch ( event_data->Orientation ) {
case Monitor::ROTATE_0 : case Monitor::ROTATE_0 :

View File

@ -101,7 +101,7 @@ include('_monitor_filters.php');
$filterbar = ob_get_contents(); $filterbar = ob_get_contents();
ob_end_clean(); ob_end_clean();
$show_storage_areas = count($storage_areas) > 1 and canEdit( 'System' ) ? 1 : 0; $show_storage_areas = (count($storage_areas) > 1) and (canEdit('System') ? 1 : 0);
$maxWidth = 0; $maxWidth = 0;
$maxHeight = 0; $maxHeight = 0;
$zoneCount = 0; $zoneCount = 0;
@ -110,7 +110,7 @@ $total_capturing_bandwidth=0;
$status_counts = array(); $status_counts = array();
for ( $i = 0; $i < count($displayMonitors); $i++ ) { for ( $i = 0; $i < count($displayMonitors); $i++ ) {
$monitor = &$displayMonitors[$i]; $monitor = &$displayMonitors[$i];
if ( ! $monitor['Status'] ) { if ( !$monitor['Status'] ) {
if ( $monitor['Type'] == 'WebSite' ) if ( $monitor['Type'] == 'WebSite' )
$monitor['Status'] = 'Running'; $monitor['Status'] = 'Running';
else else
@ -121,8 +121,8 @@ for ( $i = 0; $i < count($displayMonitors); $i++ ) {
$status_counts[$monitor['Status']] += 1; $status_counts[$monitor['Status']] += 1;
if ( $monitor['Function'] != 'None' ) { if ( $monitor['Function'] != 'None' ) {
$scaleWidth = reScale( $monitor['Width'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); $scaleWidth = reScale($monitor['Width'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE);
$scaleHeight = reScale( $monitor['Height'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); $scaleHeight = reScale($monitor['Height'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE);
if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth; if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth;
if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight; if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight;
} }
@ -131,13 +131,13 @@ for ( $i = 0; $i < count($displayMonitors); $i++ ) {
$zoneCount += $monitor['ZoneCount']; $zoneCount += $monitor['ZoneCount'];
$counts = array(); $counts = array();
foreach ( array_keys( $eventCounts ) as $j ) { foreach ( array_keys($eventCounts) as $j ) {
$filter = addFilterTerm( $filter = addFilterTerm(
$eventCounts[$j]['filter'], $eventCounts[$j]['filter'],
count($eventCounts[$j]['filter']['Query']['terms']), count($eventCounts[$j]['filter']['Query']['terms']),
array( 'cnj' => 'and', 'attr' => 'MonitorId', 'op' => '=', 'val' => $monitor['Id'] ) array('cnj'=>'and', 'attr'=>'MonitorId', 'op'=>'=', 'val'=>$monitor['Id'])
); );
parseFilter( $filter ); parseFilter($filter);
#$counts[] = 'count(if(1'.$filter['sql'].",1,NULL)) AS EventCount$j, SUM(if(1".$filter['sql'].",DiskSpace,NULL)) As DiskSpace$j"; #$counts[] = 'count(if(1'.$filter['sql'].",1,NULL)) AS EventCount$j, SUM(if(1".$filter['sql'].",DiskSpace,NULL)) As DiskSpace$j";
$monitor['eventCounts'][$j]['filter'] = $filter; $monitor['eventCounts'][$j]['filter'] = $filter;
$eventCounts[$j]['totalevents'] += $monitor[$j.'Events']; $eventCounts[$j]['totalevents'] += $monitor[$j.'Events'];
@ -156,8 +156,7 @@ if ( count($servers) ) $left_columns += 1;
if ( ZM_WEB_ID_ON_CONSOLE ) $left_columns += 1; if ( ZM_WEB_ID_ON_CONSOLE ) $left_columns += 1;
if ( $show_storage_areas ) $left_columns += 1; if ( $show_storage_areas ) $left_columns += 1;
xhtmlHeaders(__FILE__, translate('Console'));
xhtmlHeaders( __FILE__, translate('Console') );
getBodyTopHTML(); getBodyTopHTML();
?> ?>
<form name="monitorForm" method="get" action="?"> <form name="monitorForm" method="get" action="?">
@ -364,14 +363,28 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
<td class="colStorage"></td> <td class="colStorage"></td>
<?php <?php
} }
foreach ( array_keys( $eventCounts ) as $i ) { foreach ( array_keys($eventCounts) as $i ) {
parseFilter( $eventCounts[$i]['filter'] ); $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);
?> ?>
<td class="colEvents"> <td class="colEvents">
<a <?php echo (canView('Events') ? 'href="?view='.ZM_WEB_EVENTS_VIEW.'&amp;page=1'.$eventCounts[$i]['filter']['query'].'">' : '') . <a <?php echo
$eventCounts[$i]['totalevents'].'<br/></a>'.'<div class="small text-nowrap text-muted">'.human_filesize($eventCounts[$i]['totaldiskspace']) ?></div></td> (canView('Events') ? 'href="?view='.ZM_WEB_EVENTS_VIEW.'&amp;page=1'.$filter['query'].'">' : '') .
$eventCounts[$i]['totalevents'].'</a><br/>
<div class="small text-nowrap text-muted">'.human_filesize($eventCounts[$i]['totaldiskspace'])
?></div>
</td>
<?php <?php
} } // end foreach eventCounts
?> ?>
<td class="colZones"><?php echo $zoneCount ?></td> <td class="colZones"><?php echo $zoneCount ?></td>
<?php if ( canEdit('Monitors') ) { ?> <?php if ( canEdit('Monitors') ) { ?>