2020-08-05 06:07:01 +08:00
|
|
|
<?php
|
|
|
|
global $connkey;
|
|
|
|
global $Event;
|
2021-12-06 06:48:49 +08:00
|
|
|
global $monitor;
|
2020-08-18 05:42:03 +08:00
|
|
|
global $filterQuery;
|
2020-08-05 06:07:01 +08:00
|
|
|
global $sortQuery;
|
|
|
|
global $rates;
|
|
|
|
global $rate;
|
|
|
|
global $scale;
|
|
|
|
global $streamMode;
|
|
|
|
global $popup;
|
|
|
|
?>
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
// Import constants
|
|
|
|
//
|
2014-12-05 07:44:23 +08:00
|
|
|
var CMD_NONE = <?php echo CMD_NONE ?>;
|
|
|
|
var CMD_PAUSE = <?php echo CMD_PAUSE ?>;
|
|
|
|
var CMD_PLAY = <?php echo CMD_PLAY ?>;
|
2020-10-16 05:18:38 +08:00
|
|
|
var CMD_VARPLAY = <?php echo CMD_VARPLAY ?>;
|
2014-12-05 07:44:23 +08:00
|
|
|
var CMD_STOP = <?php echo CMD_STOP ?>;
|
|
|
|
var CMD_FASTFWD = <?php echo CMD_FASTFWD ?>;
|
|
|
|
var CMD_SLOWFWD = <?php echo CMD_SLOWFWD ?>;
|
|
|
|
var CMD_SLOWREV = <?php echo CMD_SLOWREV ?>;
|
|
|
|
var CMD_FASTREV = <?php echo CMD_FASTREV ?>;
|
|
|
|
var CMD_ZOOMIN = <?php echo CMD_ZOOMIN ?>;
|
|
|
|
var CMD_ZOOMOUT = <?php echo CMD_ZOOMOUT ?>;
|
|
|
|
var CMD_PAN = <?php echo CMD_PAN ?>;
|
|
|
|
var CMD_SCALE = <?php echo CMD_SCALE ?>;
|
|
|
|
var CMD_PREV = <?php echo CMD_PREV ?>;
|
|
|
|
var CMD_NEXT = <?php echo CMD_NEXT ?>;
|
|
|
|
var CMD_SEEK = <?php echo CMD_SEEK ?>;
|
|
|
|
var CMD_QUERY = <?php echo CMD_QUERY ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var SCALE_BASE = <?php echo SCALE_BASE ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// PHP variables to JS
|
|
|
|
//
|
2014-12-05 07:44:23 +08:00
|
|
|
var connKey = '<?php echo $connkey ?>';
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2011-02-08 22:30:59 +08:00
|
|
|
var eventData = {
|
2021-01-26 07:49:03 +08:00
|
|
|
<?php if ( $Event->Id() ) { ?>
|
2016-10-13 03:39:53 +08:00
|
|
|
Id: '<?php echo $Event->Id() ?>',
|
2020-12-01 23:07:42 +08:00
|
|
|
Name: '<?php echo $Event->Name() ?>',
|
2016-10-13 03:39:53 +08:00
|
|
|
MonitorId: '<?php echo $Event->MonitorId() ?>',
|
2021-12-06 06:48:49 +08:00
|
|
|
MonitorName: '<?php echo validJsStr($monitor->Name()) ?>',
|
2020-12-14 11:19:38 +08:00
|
|
|
Cause: '<?php echo validHtmlStr($Event->Cause()) ?>',
|
2021-12-06 06:48:49 +08:00
|
|
|
Notes: '<?php echo $Event->Notes()?>',
|
2016-10-13 03:39:53 +08:00
|
|
|
Width: '<?php echo $Event->Width() ?>',
|
|
|
|
Height: '<?php echo $Event->Height() ?>',
|
2017-10-22 09:57:24 +08:00
|
|
|
Length: '<?php echo $Event->Length() ?>',
|
2020-11-05 02:53:45 +08:00
|
|
|
StartDateTime: '<?php echo $Event->StartDateTime() ?>',
|
2021-06-09 03:58:17 +08:00
|
|
|
StartDateTimeShort: '<?php echo strftime(STRF_FMT_DATETIME_SHORT, strtotime($Event->StartDateTime())) ?>',
|
2020-11-05 02:53:45 +08:00
|
|
|
EndDateTime: '<?php echo $Event->EndDateTime() ?>',
|
2017-11-12 00:19:31 +08:00
|
|
|
Frames: '<?php echo $Event->Frames() ?>',
|
2020-12-14 11:19:38 +08:00
|
|
|
AlarmFrames: '<?php echo $Event->AlarmFrames() ?>',
|
|
|
|
TotScore: '<?php echo $Event->TotScore() ?>',
|
|
|
|
AvgScore: '<?php echo $Event->AvgScore() ?>',
|
|
|
|
MaxScore: '<?php echo $Event->MaxScore() ?>',
|
2020-12-01 23:07:42 +08:00
|
|
|
DiskSpace: '<?php echo human_filesize($Event->DiskSpace(null)) ?>',
|
2020-12-14 11:19:38 +08:00
|
|
|
Storage: '<?php echo validHtmlStr($Event->Storage()->Name()).( $Event->SecondaryStorageId() ? ', '.validHtmlStr($Event->SecondaryStorage()->Name()) : '' ) ?>',
|
2020-12-14 20:55:45 +08:00
|
|
|
Archived: <?php echo $Event->Archived?'true':'false' ?>,
|
|
|
|
Emailed: <?php echo $Event->Emailed?'true':'false' ?>
|
2021-01-26 07:49:03 +08:00
|
|
|
<?php } ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
};
|
2020-12-14 11:19:38 +08:00
|
|
|
|
2021-06-09 03:58:17 +08:00
|
|
|
var yesStr = '<?php echo translate('Yes') ?>';
|
|
|
|
var noStr = '<?php echo translate('No') ?>';
|
|
|
|
|
2020-12-14 11:19:38 +08:00
|
|
|
var eventDataStrings = {
|
|
|
|
Id: '<?php echo translate('EventId') ?>',
|
|
|
|
Name: '<?php echo translate('EventName') ?>',
|
|
|
|
MonitorId: '<?php echo translate('AttrMonitorId') ?>',
|
|
|
|
MonitorName: '<?php echo translate('AttrMonitorName') ?>',
|
|
|
|
Cause: '<?php echo translate('Cause') ?>',
|
2021-12-06 06:48:49 +08:00
|
|
|
Notes: '<?php echo translate('Notes') ?>',
|
2021-06-09 03:58:17 +08:00
|
|
|
StartDateTimeShort: '<?php echo translate('AttrStartTime') ?>',
|
2020-12-14 11:19:38 +08:00
|
|
|
Length: '<?php echo translate('Duration') ?>',
|
|
|
|
Frames: '<?php echo translate('AttrFrames') ?>',
|
|
|
|
AlarmFrames: '<?php echo translate('AttrAlarmFrames') ?>',
|
|
|
|
TotScore: '<?php echo translate('AttrTotalScore') ?>',
|
|
|
|
AvgScore: '<?php echo translate('AttrAvgScore') ?>',
|
|
|
|
MaxScore: '<?php echo translate('AttrMaxScore') ?>',
|
|
|
|
DiskSpace: '<?php echo translate('DiskSpace') ?>',
|
|
|
|
Storage: '<?php echo translate('Storage') ?>',
|
2021-06-09 03:58:17 +08:00
|
|
|
Archived: '<?php echo translate('Archived') ?>',
|
|
|
|
Emailed: '<?php echo translate('Emailed') ?>'
|
2020-12-14 11:19:38 +08:00
|
|
|
};
|
|
|
|
|
2019-08-28 03:19:18 +08:00
|
|
|
var monitorUrl = '<?php echo $Event->Storage()->Server()->UrlToIndex(); ?>';
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2017-09-30 09:49:58 +08:00
|
|
|
var filterQuery = '<?php echo isset($filterQuery)?validJsStr(htmlspecialchars_decode($filterQuery)):'' ?>';
|
|
|
|
var sortQuery = '<?php echo isset($sortQuery)?validJsStr(htmlspecialchars_decode($sortQuery)):'' ?>';
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2017-11-12 00:19:31 +08:00
|
|
|
var rates = <?php echo json_encode(array_keys($rates)) ?>;
|
2018-11-29 22:43:21 +08:00
|
|
|
var rate = '<?php echo $rate ?>'; // really only used when setting up initial playback rate.
|
2017-10-22 09:57:24 +08:00
|
|
|
var scale = "<?php echo $scale ?>";
|
2021-12-06 06:48:49 +08:00
|
|
|
var LabelFormat = "<?php echo validJsStr($monitor->LabelFormat())?>";
|
2017-10-22 09:57:24 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var streamTimeout = <?php echo 1000*ZM_WEB_REFRESH_STATUS ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var canStreamNative = <?php echo canStreamNative()?'true':'false' ?>;
|
2017-11-22 11:49:27 +08:00
|
|
|
var streamMode = '<?php echo $streamMode ?>';
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// Strings
|
|
|
|
//
|
2020-04-10 23:05:48 +08:00
|
|
|
var deleteString = "<?php echo validJsStr(translate('Delete')) ?>";
|
|
|
|
var causeString = "<?php echo validJsStr(translate('AttrCause')) ?>";
|
2021-12-06 06:48:49 +08:00
|
|
|
var showZonesString = "<?php echo validJsStr(translate('Show Zones'))?>";
|
|
|
|
var hideZonesString = "<?php echo validJsStr(translate('Hide Zones'))?>";
|
2018-11-15 04:54:01 +08:00
|
|
|
var WEB_LIST_THUMB_WIDTH = '<?php echo ZM_WEB_LIST_THUMB_WIDTH ?>';
|
|
|
|
var WEB_LIST_THUMB_HEIGHT = '<?php echo ZM_WEB_LIST_THUMB_HEIGHT ?>';
|
2018-12-21 23:50:19 +08:00
|
|
|
var popup = '<?php echo $popup ?>';
|