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 )
|
if ( event.Archived > 0 )
|
||||||
eventHtml.addClass( 'archived' );
|
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.Name+(frame?("("+frame.FrameId+")"):"") );
|
||||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.StartTime+" - "+event.Length+"s" );
|
new Element( 'p' ).inject( eventHtml ).set( 'text', event.StartTime+" - "+event.Length+"s" );
|
||||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.Cause );
|
new Element( 'p' ).inject( eventHtml ).set( 'text', event.Cause );
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
var filterQuery = '<?php echo validJsStr($filterQuery) ?>';
|
var filterQuery = '<?php echo validJsStr($filterQuery) ?>';
|
||||||
|
|
||||||
var monitorNames = {};
|
|
||||||
<?php
|
<?php
|
||||||
|
$jsMonitors = array();
|
||||||
|
$fields = array('Name', 'SaveJPEGs', 'VideoWriter');
|
||||||
foreach ( $monitors as $monitor )
|
foreach ( $monitors as $monitor )
|
||||||
{
|
{
|
||||||
if ( !empty($monitorIds[$monitor['Id']]) )
|
if ( !empty($monitorIds[$monitor['Id']]) )
|
||||||
{
|
{
|
||||||
?>
|
$jsMonitor = array();
|
||||||
monitorNames[<?php echo $monitor['Id'] ?>] = '<?php echo validJsStr($monitor['Name']) ?>';
|
foreach ($fields as $field)
|
||||||
<?php
|
{
|
||||||
|
$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') ?>";
|
var archivedString = "<?php echo translate('Archived') ?>";
|
||||||
|
|
Loading…
Reference in New Issue