2020-08-06 07:15:01 +08:00
|
|
|
<?php
|
|
|
|
global $filterQuery;
|
|
|
|
global $monitors;
|
2020-08-12 01:47:37 +08:00
|
|
|
global $minTime;
|
|
|
|
global $midTime;
|
|
|
|
global $maxTime;
|
|
|
|
global $range;
|
|
|
|
global $majXScale;
|
2022-02-12 07:03:35 +08:00
|
|
|
global $monEventSlots;
|
|
|
|
global $monFrameSlots;
|
2020-08-06 07:15:01 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
var filterQuery = '<?php echo validJsStr($filterQuery) ?>';
|
2022-02-12 07:03:35 +08:00
|
|
|
var events = {};
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
<?php
|
2022-02-12 07:03:35 +08:00
|
|
|
//ZM\Debug(print_r($monEventSlots, true));
|
|
|
|
//ZM\Debug(print_r($monFrameSlots, true));
|
2015-10-03 11:04:10 +08:00
|
|
|
$jsMonitors = array();
|
2017-10-19 00:44:07 +08:00
|
|
|
|
2015-11-19 13:21:56 +08:00
|
|
|
$fields = array('Name', 'LabelFormat', 'SaveJPEGs', 'VideoWriter');
|
2022-02-12 07:03:35 +08:00
|
|
|
foreach ($monitors as $monitor) {
|
2019-09-29 02:23:23 +08:00
|
|
|
$jsMonitor = array();
|
|
|
|
foreach ($fields as $field) {
|
|
|
|
$jsMonitor[$field] = $monitor->$field();
|
2017-07-14 05:35:06 +08:00
|
|
|
}
|
2022-02-12 07:03:35 +08:00
|
|
|
$firstEvent = reset($monEventSlots[$monitor->Id()])['event'];
|
|
|
|
|
|
|
|
$jsMonitor['FirstEventId'] = $firstEvent['Id'];
|
|
|
|
echo 'events['.$firstEvent['Id'].']='.json_encode($firstEvent).';'.PHP_EOL;
|
|
|
|
|
2019-09-29 02:23:23 +08:00
|
|
|
$jsMonitors[$monitor->Id()] = $jsMonitor;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
?>
|
2015-10-03 11:04:10 +08:00
|
|
|
var monitors = <?php echo json_encode($jsMonitors) ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2015-05-10 21:10:30 +08:00
|
|
|
var archivedString = "<?php echo translate('Archived') ?>";
|
2019-09-29 02:23:23 +08:00
|
|
|
|
|
|
|
var minTime = '<?php echo $minTime?>';
|
|
|
|
var midTime = '<?php echo $midTime?>';
|
|
|
|
var maxTime = '<?php echo $maxTime?>';
|
|
|
|
var range = '<?php echo $range?>';
|
|
|
|
var zoomout_range = '<?php (int)($range*$majXScale['zoomout']) ?>';
|
2022-02-12 07:03:35 +08:00
|
|
|
|