only expose monitor info which are being used in client
This commit is contained in:
parent
2fd6cbe742
commit
59b0675588
|
@ -22,7 +22,7 @@ function createEventHtml( event, frame )
|
|||
if ( event.Archived > 0 )
|
||||
eventHtml.addClass( 'archived' );
|
||||
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', monitorNames[event.MonitorId] );
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', monitors[event.MonitorId].Name );
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.Name+(frame?("("+frame.FrameId+")"):"") );
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.StartTime+" - "+event.Length+"s" );
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.Cause );
|
||||
|
|
|
@ -1,17 +1,21 @@
|
|||
var filterQuery = '<?php echo validJsStr($filterQuery) ?>';
|
||||
|
||||
var monitorNames = {};
|
||||
<?php
|
||||
$jsMonitors = array();
|
||||
$fields = array('Name', 'SaveJPEGs', 'VideoWriter');
|
||||
foreach ( $monitors as $monitor )
|
||||
{
|
||||
if ( !empty($monitorIds[$monitor['Id']]) )
|
||||
{
|
||||
?>
|
||||
monitorNames[<?php echo $monitor['Id'] ?>] = '<?php echo validJsStr($monitor['Name']) ?>';
|
||||
<?php
|
||||
$jsMonitor = array();
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
$jsMonitor[$field] = $monitor[$field];
|
||||
}
|
||||
$jsMonitors[$monitor['Id']] = $jsMonitor;
|
||||
}
|
||||
}
|
||||
?>
|
||||
var monitors = <?php echo json_encode($monitors) ?>;
|
||||
var monitors = <?php echo json_encode($jsMonitors) ?>;
|
||||
|
||||
var archivedString = "<?php echo translate('Archived') ?>";
|
||||
|
|
Loading…
Reference in New Issue