Merge branch 'master' of github.com:zoneminder/ZoneMinder

This commit is contained in:
Isaac Connor 2020-04-13 10:45:37 -04:00
commit f1d61cefaa
21 changed files with 419 additions and 382 deletions

View File

@ -1,14 +1,15 @@
<?php
ini_set('display_errors', '0');
# Moved up here because it is used in several spots.
# These are the valid columns that you can filter on.
$filterFields = array( 'Component', 'ServerId', 'Pid', 'Level', 'File', 'Line' );
$filterFields = array('Component', 'ServerId', 'Pid', 'Level', 'File', 'Line');
function buildLogQuery($action) {
global $filterFields;
$minTime = isset($_REQUEST['minTime'])?$_REQUEST['minTime']:NULL;
$maxTime = isset($_REQUEST['maxTime'])?$_REQUEST['maxTime']:NULL;
$minTime = isset($_REQUEST['minTime']) ? $_REQUEST['minTime'] : NULL;
$maxTime = isset($_REQUEST['maxTime']) ? $_REQUEST['maxTime'] : NULL;
$limit = 100;
if ( isset($_REQUEST['limit']) ) {
@ -42,10 +43,10 @@ function buildLogQuery($action) {
foreach ( $filter as $field=>$value ) {
if ( !in_array($field, $filterFields) ) {
ZM\Error("'$field' is not in valid filter fields " . print_r($filterField,true));
ZM\Error("'$field' is not in valid filter fields " . print_r($filterField, true));
continue;
}
if ( $field == 'Level' ){
if ( $field == 'Level' ) {
$where[] = $field.' <= ?';
$values[] = $value;
} else {
@ -69,8 +70,8 @@ switch ( $_REQUEST['task'] ) {
$string = $_POST['message'];
$file = !empty($_POST['file']) ? preg_replace( '/\w+:\/\/[\w.:]+\//', '', $_POST['file'] ) : '';
if ( !empty( $_POST['line'] ) ) {
$file = !empty($_POST['file']) ? preg_replace('/\w+:\/\/[\w.:]+\//', '', $_POST['file']) : '';
if ( !empty($_POST['line']) ) {
$line = validInt($_POST['line']);
} else {
$line = NULL;
@ -82,6 +83,8 @@ switch ( $_REQUEST['task'] ) {
}
$level = $levels[$_POST['level']];
ZM\Logger::fetch()->logPrint($level, $string, $file, $line);
} else {
ZM\Error('Invalid log create: '.print_r($_POST, true));
}
ajaxResponse();
break;
@ -93,12 +96,7 @@ switch ( $_REQUEST['task'] ) {
$query = buildLogQuery('DELETE');
$result = dbQuery($query['sql'], $query['values']);
ajaxResponse( array(
'result'=>'Ok',
'deleted'=>$result->rowCount(),
) );
ajaxResponse(array('result'=>'Ok', 'deleted'=>$result->rowCount()));
}
case 'query' :
{
@ -107,10 +105,12 @@ switch ( $_REQUEST['task'] ) {
$total = dbFetchOne('SELECT count(*) AS Total FROM Logs', 'Total');
$query = buildLogQuery('SELECT *');
$servers = ZM\Server::find();
global $Servers;
if ( !$Servers )
$Servers = ZM\Server::find();
$servers_by_Id = array();
# There is probably a better way to do this.
foreach ( $servers as $server ) {
foreach ( $Servers as $server ) {
$servers_by_Id[$server->Id()] = $server;
}
@ -120,11 +120,9 @@ switch ( $_REQUEST['task'] ) {
foreach ( dbFetchAll($query['sql'], NULL, $query['values']) as $log ) {
$log['DateTime'] = strftime('%Y-%m-%d %H:%M:%S', intval($log['TimeKey']));
#Warning("TimeKey: " . $log['TimeKey'] . 'Intval:'.intval($log['TimeKey']).' DateTime:'.$log['DateTime']);
#$log['DateTime'] = preg_replace('/^\d+/', strftime('%Y-%m-%d %H:%M:%S', intval($log['TimeKey'])), $log['TimeKey']);
$log['Server'] = ( $log['ServerId'] and isset($servers_by_Id[$log['ServerId']]) ) ? $servers_by_Id[$log['ServerId']]->Name() : '';
$log['Message'] = preg_replace('/[\x00-\x1F\x7F-\xFF]/', '', $log['Message']);
foreach( $filterFields as $field ) {
foreach ( $filterFields as $field ) {
if ( !isset($options[$field]) )
$options[$field] = array();
$value = $log[$field];
@ -141,21 +139,21 @@ switch ( $_REQUEST['task'] ) {
}
}
$logs[] = $log;
}
} # end foreach log db row
foreach ( $options as $field => $values ) {
asort($options[$field]);
}
$available = count($logs);
ajaxResponse( array(
'updated' => preg_match('/%/', DATE_FMT_CONSOLE_LONG)?strftime(DATE_FMT_CONSOLE_LONG):date(DATE_FMT_CONSOLE_LONG),
ajaxResponse(array(
'updated' => preg_match('/%/', DATE_FMT_CONSOLE_LONG) ? strftime(DATE_FMT_CONSOLE_LONG) : date(DATE_FMT_CONSOLE_LONG),
'total' => $total,
'available' => isset($available) ? $available : $total,
'logs' => $logs,
'state' => logState(),
'options' => $options,
) );
));
break;
}
case 'export' :
@ -163,9 +161,9 @@ switch ( $_REQUEST['task'] ) {
if ( !canView('System') )
ajaxError('Insufficient permissions to export logs');
$minTime = isset($_POST['minTime'])?$_POST['minTime']:NULL;
$maxTime = isset($_POST['maxTime'])?$_POST['maxTime']:NULL;
if ( !is_null($minTime) && !is_null($maxTime) && $minTime > $maxTime ) {
$minTime = isset($_POST['minTime']) ? $_POST['minTime'] : NULL;
$maxTime = isset($_POST['maxTime']) ? $_POST['maxTime'] : NULL;
if ( !is_null($minTime) && !is_null($maxTime) && ($minTime > $maxTime) ) {
$tempTime = $minTime;
$minTime = $maxTime;
$maxTime = $tempTime;
@ -174,15 +172,17 @@ switch ( $_REQUEST['task'] ) {
$filter = isset($_POST['filter'])?$_POST['filter']:array();
$sortField = 'TimeKey';
if ( isset($_POST['sortField']) ) {
if ( ! in_array( $_POST['sortField'], $filterFields ) and ( $_POST['sortField'] != 'TimeKey' ) ) {
ZM\Error("Invalid sort field " . $_POST['sortField'] );
if ( !in_array($_POST['sortField'], $filterFields) and ($_POST['sortField'] != 'TimeKey') ) {
ZM\Error('Invalid sort field '.$_POST['sortField']);
} else {
$sortField = $_POST['sortField'];
}
}
$sortOrder = (isset($_POST['sortOrder']) and $_POST['sortOrder']) == 'asc' ? 'asc':'desc';
$sortOrder = (isset($_POST['sortOrder']) and $_POST['sortOrder']) == 'asc' ? 'asc' : 'desc';
$servers = ZM\Server::find();
global $Servers;
if ( !$Servers )
$Servers = ZM\Server::find();
$servers_by_Id = array();
# There is probably a better way to do this.
foreach ( $servers as $server ) {
@ -193,11 +193,9 @@ switch ( $_REQUEST['task'] ) {
$where = array();
$values = array();
if ( $minTime ) {
ZM\Logger::Debug("MinTime: $minTime");
if ( preg_match('/(.+)(\.\d+)/', $minTime, $matches) ) {
# This handles sub second precision
$minTime = strtotime($matches[1]).$matches[2];
ZM\Logger::Debug("MinTime: $minTime");
} else {
$minTime = strtotime($minTime);
}
@ -225,11 +223,11 @@ switch ( $_REQUEST['task'] ) {
}
}
if ( count($where) )
$sql.= ' WHERE '.join( ' AND ', $where );
$sql.= ' WHERE '.join(' AND ', $where);
$sql .= ' ORDER BY '.$sortField.' '.$sortOrder;
//$sql .= " limit ".dbEscape($limit);
$format = isset($_POST['format'])?$_POST['format']:'text';
switch( $format ) {
$format = isset($_POST['format']) ? $_POST['format'] : 'text';
switch ( $format ) {
case 'text' :
$exportExt = 'txt';
break;
@ -245,43 +243,40 @@ switch ( $_REQUEST['task'] ) {
default :
ZM\Fatal("Unrecognised log export format '$format'");
}
$exportKey = substr(md5(rand()),0,8);
$exportFile = "zm-log.$exportExt";
if ( ! file_exists(ZM_DIR_EXPORTS) ) {
ZM\Logger::Debug('Creating ' . ZM_DIR_EXPORTS);
if ( ! mkdir(ZM_DIR_EXPORTS) ) {
ZM\Fatal("Can't create exports dir at '".ZM_DIR_EXPORTS."'");
}
$exportKey = substr(md5(rand()), 0, 8);
$exportFile = 'zm-log.'.$exportExt;
if ( ! ( mkdir(ZM_DIR_EXPORTS) || file_exists(ZM_DIR_EXPORTS) ) ) {
ZM\Fatal('Can\'t create exports dir at \''.ZM_DIR_EXPORTS.'\'');
}
$exportPath = ZM_DIR_EXPORTS."/zm-log-$exportKey.$exportExt";
$exportPath = ZM_DIR_EXPORTS.'/zm-log-'.$exportKey.$exportExt;
ZM\Logger::Debug("Exporting to $exportPath");
if ( !($exportFP = fopen($exportPath, 'w')) )
ZM\Fatal("Unable to open log export file $exportPath");
$logs = array();
foreach ( dbFetchAll($sql, NULL, $values) as $log ) {
$log['DateTime'] = preg_replace('/^\d+/', strftime( "%Y-%m-%d %H:%M:%S", intval($log['TimeKey']) ), $log['TimeKey']);
$log['DateTime'] = preg_replace('/^\d+/', strftime('%Y-%m-%d %H:%M:%S', intval($log['TimeKey'])), $log['TimeKey']);
$log['Server'] = ( $log['ServerId'] and isset($servers_by_Id[$log['ServerId']]) ) ? $servers_by_Id[$log['ServerId']]->Name() : '';
$logs[] = $log;
}
ZM\Logger::Debug(count($logs)." lines being exported by $sql " . implode(',',$values));
ZM\Logger::Debug(count($logs).' lines being exported by '.$sql.implode(',', $values));
switch( $format ) {
case 'text' :
{
foreach ( $logs as $log ) {
if ( $log['Line'] )
fprintf( $exportFP, "%s %s[%d].%s-%s/%d [%s]\n",
$log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], $log['File'], $log['Line'], $log['Message'] );
fprintf($exportFP, "%s %s[%d].%s-%s/%d [%s]\n",
$log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], $log['File'], $log['Line'], $log['Message']);
else
fprintf( $exportFP, "%s %s[%d].%s-%s [%s]\n",
$log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], $log['File'], $log['Message'] );
fprintf($exportFP, "%s %s[%d].%s-%s [%s]\n",
$log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], $log['File'], $log['Message']);
}
break;
}
case 'tsv' :
{
# This line doesn't need fprintf, it could use fwrite
fprintf( $exportFP, join( "\t",
fprintf($exportFP, join("\t",
translate('DateTime'),
translate('Component'),
translate('Server'),
@ -290,17 +285,17 @@ switch ( $_REQUEST['task'] ) {
translate('Message'),
translate('File'),
translate('Line')
)."\n" );
)."\n");
foreach ( $logs as $log ) {
fprintf( $exportFP, "%s\t%s\t%s\t%d\t%s\t%s\t%s\t%s\n", $log['DateTime'], $log['Component'], $log['Server'], $log['Pid'], $log['Code'], $log['Message'], $log['File'], $log['Line'] );
fprintf($exportFP, "%s\t%s\t%s\t%d\t%s\t%s\t%s\t%s\n",
$log['DateTime'], $log['Component'], $log['Server'], $log['Pid'], $log['Code'], $log['Message'], $log['File'], $log['Line']);
}
break;
}
case 'html' :
{
fwrite( $exportFP,
'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
fwrite($exportFP,
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>'.translate('ZoneMinderLog').'</title>
@ -339,34 +334,36 @@ switch ( $_REQUEST['task'] ) {
</head>
<body>
<h3>'.translate('ZoneMinderLog').'</h3>
<p>'.htmlspecialchars(preg_match( '/%/', DATE_FMT_CONSOLE_LONG )?strftime( DATE_FMT_CONSOLE_LONG ):date( DATE_FMT_CONSOLE_LONG )).'</p>
<p>'.htmlspecialchars(preg_match('/%/', DATE_FMT_CONSOLE_LONG) ? strftime(DATE_FMT_CONSOLE_LONG) : date(DATE_FMT_CONSOLE_LONG)).'</p>
<p>'.count($logs).' '.translate('Logs').'</p>
<table>
<tbody>
<tr><th>'.translate('DateTime').'</th><th>'.translate('Component').'</th><th>'.translate('Server').'</th><th>'.translate('Pid').'</th><th>'.translate('Level').'</th><th>'.translate('Message').'</th><th>'.translate('File').'</th><th>'.translate('Line').'</th></tr>
' );
');
foreach ( $logs as $log ) {
$classLevel = $log['Level'];
if ( $classLevel < ZM\Logger::FATAL )
if ( $classLevel < ZM\Logger::FATAL ) {
$classLevel = ZM\Logger::FATAL;
elseif ( $classLevel > ZM\Logger::DEBUG )
} else if ( $classLevel > ZM\Logger::DEBUG ) {
$classLevel = ZM\Logger::DEBUG;
}
$logClass = 'log-'.strtolower(ZM\Logger::$codes[$classLevel]);
fprintf( $exportFP, " <tr class=\"%s\"><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $logClass, $log['DateTime'], $log['Component'], $log['Server'], $log['Pid'], $log['Code'], $log['Message'], $log['File'], $log['Line'] );
fprintf($exportFP, ' <tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>
', $logClass, $log['DateTime'], $log['Component'], $log['Server'], $log['Pid'], $log['Code'], $log['Message'], $log['File'], $log['Line']);
}
fwrite( $exportFP,
fwrite($exportFP,
' </tbody>
</table>
</body>
</html>' );
</html>');
break;
}
case 'xml' :
{
fwrite( $exportFP,
fwrite($exportFP,
'<?xml version="1.0" encoding="utf-8"?>
<logexport title="'.translate('ZoneMinderLog').'" date="'.htmlspecialchars(preg_match( '/%/', DATE_FMT_CONSOLE_LONG )?strftime( DATE_FMT_CONSOLE_LONG ):date( DATE_FMT_CONSOLE_LONG )).'">
<selector>'.$_POST['selector'].'</selector>' );
<logexport title="'.translate('ZoneMinderLog').'" date="'.htmlspecialchars(preg_match('/%/', DATE_FMT_CONSOLE_LONG) ? strftime(DATE_FMT_CONSOLE_LONG) : date(DATE_FMT_CONSOLE_LONG)).'">
<selector>'.$_POST['selector'].'</selector>');
foreach ( $filter as $field=>$value )
if ( $value != '' )
fwrite( $exportFP,
@ -381,7 +378,7 @@ switch ( $_REQUEST['task'] ) {
' );
foreach ( $logs as $log ) {
fprintf( $exportFP,
" <log>
' <log>
<datetime>%s</datetime>
<component>%s</component>
<server>%s</server>
@ -390,7 +387,8 @@ switch ( $_REQUEST['task'] ) {
<message><![CDATA[%s]]></message>
<file>%s</file>
<line>%d</line>
</log>\n", $log['DateTime'], $log['Component'], $log['Server'], $log['Pid'], $log['Code'], utf8_decode( $log['Message'] ), $log['File'], $log['Line'] );
</log>
', $log['DateTime'], $log['Component'], $log['Server'], $log['Pid'], $log['Code'], utf8_decode( $log['Message'] ), $log['File'], $log['Line'] );
}
fwrite( $exportFP,
' </logs>
@ -419,7 +417,7 @@ switch ( $_REQUEST['task'] ) {
ZM\Fatal('No log export format given');
$format = $_REQUEST['format'];
switch( $format ) {
switch ( $format ) {
case 'text' :
$exportExt = 'txt';
break;
@ -436,15 +434,15 @@ switch ( $_REQUEST['task'] ) {
ZM\Fatal("Unrecognised log export format '$format'");
}
$exportFile = "zm-log.$exportExt";
$exportPath = ZM_DIR_EXPORTS."/zm-log-$exportKey.$exportExt";
$exportFile = 'zm-log.'.$exportExt;
$exportPath = ZM_DIR_EXPORTS.'/zm-log-'.$exportKey.$exportExt;
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false ); // required by certain browsers
header('Cache-Control: private', false); // required by certain browsers
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="'.$exportFile.'"' );
header('Content-Disposition: attachment; filename="'.$exportFile.'"');
header('Content-Transfer-Encoding: binary');
header('Content-Type: application/force-download');
header('Content-Length: '.filesize($exportPath));
@ -452,6 +450,6 @@ switch ( $_REQUEST['task'] ) {
exit(0);
break;
}
}
} // end switch ( $_REQUEST['task'] )
ajaxError('Unrecognised action or insufficient permissions');
?>

View File

@ -96,6 +96,7 @@ $statusData = array(
'selector' => 'Events.MonitorId',
'elements' => array(
'Id' => true,
'MonitorId' => true,
'Name' => true,
'Cause' => true,
'Notes' => true,

View File

@ -11,7 +11,7 @@ class Monitor extends ZM_Object {
protected $defaults = array(
'Id' => null,
'Name' => '',
'Name' => array('type'=>'text','filter_regexp'=>'/[^\w\-\.\(\)\:\/ ]/'),
'Notes' => '',
'ServerId' => 0,
'StorageId' => 0,

View File

@ -39,10 +39,13 @@ class ZM_Object {
public function __call($fn, array $args){
$type = (array_key_exists($fn, $this->defaults) && is_array($this->defaults[$fn])) ? $this->defaults[$fn]['type'] : 'scalar';
if ( count($args) ) {
if ( $type == 'set' and is_array($args[0]) )
if ( $type == 'set' and is_array($args[0]) ) {
$this->{$fn} = implode(',', $args[0]);
else
} else if ( array_key_exists($fn, $this->defaults) && is_array($this->defaults[$fn]) && isset($this->defaults[$fn]['filter_regexp']) ) {
$this->{$fn} = preg_replace($this->defaults[$fn]['filter_regexp'], '', $args[0]);
} else {
$this->{$fn} = $args[0];
}
}
if ( property_exists($this, $fn) ) {
@ -63,7 +66,7 @@ class ZM_Object {
public static function _find($class, $parameters = null, $options = null ) {
$table = $class::$table;
$filters = array();
$sql = "SELECT * FROM `$table` ";
$sql = 'SELECT * FROM `'.$table.'` ';
$values = array();
if ( $parameters ) {
@ -164,24 +167,11 @@ class ZM_Object {
# perhaps should turn into a comma-separated string
$this->{$k} = implode(',', $v);
} else if ( is_string($v) ) {
if ( 0 ) {
# Remarking this out. We are setting a value, not asking for a default to be set.
# So don't do defaults here, do them somewhere else
if ( ($v == null) and array_key_exists($k, $this->defaults) ) {
Logger::Debug("$k => Have default for $v: ");
if ( is_array($this->defaults[$k]) ) {
$this->{$k} = $this->defaults[$k]['default'];
} else {
$this->{$k} = $this->defaults[$k];
Logger::Debug("$k => Have default for $v: " . $this->{$k});
}
} else {
if ( array_key_exists($k, $this->defaults) && is_array($this->defaults[$k]) && isset($this->defaults[$k]['filter_regexp']) ) {
$this->{$k} = preg_replace($this->defaults[$k]['filter_regexp'], '', trim($v));
} else {
$this->{$k} = trim($v);
}
} else {
$this->{$k} = trim($v);
}
} else if ( is_integer($v) ) {
$this->{$k} = $v;
} else if ( is_bool($v) ) {
@ -251,6 +241,9 @@ Logger::Debug("$k => Have default for $v: ");
# Input might be a command separated string, or an array
} else {
if ( array_key_exists($field, $this->defaults) && is_array($this->defaults[$field]) && isset($this->defaults[$field]['filter_regexp']) ) {
$value = preg_replace($this->defaults[$field]['filter_regexp'], '', trim($value));
}
if ( $this->{$field} != $value ) {
$changes[$field] = $value;
}
@ -271,17 +264,6 @@ Logger::Debug("$k => Have default for $v: ");
$changes[$field] = $value;
}
}
#if ( (!array_key_exists($field, $this)) or ( $this->{$field} != $new_values[$field] ) ) {
#Logger::Debug("Checking default $field => $default_value changes becaause" . $new_values[$field].' != '.$new_values[$field]);
#$changes[$field] = $new_values[$field];
##} else if {
#Logger::Debug("Checking default $field => $default_value changes becaause " . $new_values[$field].' != '.$new_values[$field]);
##array_push( $changes, [$field=>$defaults[$field]] );
#}
#} else {
#Logger::Debug("Checking default $field => $default_value not in new_values");
#}
} # end foreach newvalue

View File

@ -1065,7 +1065,7 @@ function parseSort($saveToSession=false, $querySep='&amp;') {
$sortColumn = 'E.StartTime';
break;
}
if ( !$_REQUEST['sort_asc'] )
if ( !isset($_REQUEST['sort_asc']) )
$_REQUEST['sort_asc'] = 0;
$sortOrder = $_REQUEST['sort_asc'] ? 'asc' : 'desc';
$sortQuery = $querySep.'sort_field='.validHtmlStr($_REQUEST['sort_field']).$querySep.'sort_asc='.validHtmlStr($_REQUEST['sort_asc']);
@ -1235,6 +1235,7 @@ function parseFilter(&$filter, $saveToSession=false, $querySep='&amp;') {
break;
}
$valueList = array();
if ( !isset($term['val']) ) $term['val'] = '';
foreach ( preg_split('/["\'\s]*?,["\'\s]*?/', preg_replace('/^["\']+?(.+)["\']+?$/', '$1', $term['val'])) as $value ) {
switch ( $term['attr'] ) {

View File

@ -52,6 +52,7 @@ require_once('includes/Event.php');
require_once('includes/Group.php');
require_once('includes/Monitor.php');
global $Servers;
$Servers = ZM\Server::find();
if (
@ -154,8 +155,6 @@ if (
setcookie('zmCSS', $css, time()+3600*24*30*12*10);
}
# Running is global but only do the daemonCheck if it is actually needed
$running = null;
@ -176,7 +175,6 @@ $user = null;
if ( isset($_REQUEST['view']) )
$view = detaintPath($_REQUEST['view']);
# Add CSP Headers
$cspNonce = bin2hex(zm_random_bytes(16));

View File

@ -49,18 +49,21 @@ function logReport( level, message, file, line ) {
/* eslint-disable no-caller */
if ( arguments && arguments.callee && arguments.callee.caller && arguments.callee.caller.caller && arguments.callee.caller.caller.name ) {
message += ' - '+arguments.callee.caller.caller.name+'()';
//console.log("arguments");
} else {
message += new Error().stack;
//message += new Error().stack;
//console.log("stack");
}
/* eslint-enable no-caller */
if ( !debugReq ) {
debugParms = "view=request&request=log&task=create";
if ( Browser ) {
debugParms = "view=request&request=log&task=create&browser[name]="+Browser.name+"&browser[version]="+Browser.version+"&browser[platform]="+(Browser.Platform?Browser.Platform.name:'unknown');
debugParms += "&browser[name]="+Browser.name+"&browser[version]="+Browser.version+"&browser[platform]="+(Browser.Platform?Browser.Platform.name:'unknown');
} else {
debugParms = "view=request&request=log&task=create&browser[name]=unknown&browser[version]=unknown&browser[platform]=unknown";
debugParms += "&browser[name]=unknown&browser[version]=unknown&browser[platform]=unknown";
}
debugReq = new Request.JSON( {url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'chain'} );
debugReq = new Request.JSON({url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'chain'});
}
var requestParms = debugParms;
requestParms += "&level="+level+"&message="+encodeURIComponent(message);
@ -73,57 +76,57 @@ function logReport( level, message, file, line ) {
if ( line ) {
requestParms += "&line="+line;
}
debugReq.send( requestParms );
debugReq.send(requestParms);
}
function Panic( message ) {
console.error( message );
logReport( "PNC", message );
alert( "PANIC: "+message );
function Panic(message) {
console.error(message);
logReport("PNC", message);
alert("PANIC: "+message);
}
function Fatal( message ) {
console.error( message );
function Fatal(message) {
console.error(message);
logReport( "FAT", message );
alert( "FATAL: "+message );
}
function Error( message ) {
console.error( message );
logReport( "ERR", message );
function Error(message) {
console.error(message);
logReport("ERR", message);
}
function Warning( message ) {
console.warn( message );
logReport( "WAR", message );
function Warning(message) {
console.warn(message);
logReport("WAR", message);
}
function Info( message ) {
console.info( message );
logReport( "INF", message );
function Info(message) {
console.info(message);
logReport("INF", message);
}
function Debug( message ) {
console.debug( message );
//logReport( "DBG", message );
function Debug(message) {
console.debug(message);
//logReport("DBG", message);
}
function Dump( value, label ) {
function Dump(value, label) {
if ( label ) {
console.debug( label+" => " );
console.debug(label+" => ");
}
console.debug( value );
console.debug(value);
}
window.onerror =
function( message, url, line ) {
logReport( "ERR", message, url, line );
logReport("ERR", message, url, line);
};
window.addEventListener("securitypolicyviolation", function logCSP(evt) {
var level = evt.disposition == "enforce" ? "ERR" : "DBG";
var message = evt.blockedURI + " violated CSP " + evt.violatedDirective;
if (evt.sample) {
if ( evt.sample ) {
message += " (Sample: " + evt.sample + ")";
}
logReport(level, message, evt.sourceFile, evt.lineNumber);

View File

@ -74,12 +74,14 @@ $SLANG = array(
'24BitColour' => '24 位彩色',
'32BitColour' => '32 位彩色', // Added - 2011-06-15
'8BitGrey' => '8 位灰度',
'API' => 'API', // Added - 2020-04-09
'APIEnabled' => 'API已启用', // Added - 2020-04-09
'Action' => '活动动作',
'Actual' => '实际',
'AddNewControl' => '新建控制',
'AddNewMonitor' => '新建监视器',
'AddNewServer' => 'Add New Server', // Added - 2018-08-30
'AddNewStorage' => 'Add New Storage', // Added - 2018-08-30
'AddNewServer' => '新建服务器', // Added - 2018-08-30
'AddNewStorage' => '新建存储', // Added - 2018-08-30
'AddNewUser' => '新建用户',
'AddNewZone' => '新建区域',
'Alarm' => '报警',
@ -90,11 +92,12 @@ $SLANG = array(
'AlarmMaximumFPS' => '报警最大帧率FPS',
'AlarmPx' => '报警像素',
'AlarmRGBUnset' => '你必须设置一个报警颜色(RGB)',
'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18
'AlarmRefImageBlendPct'=> '报警参考影像混合 %ge', // Added - 2015-04-18
'Alert' => '警报',
'All' => '全部',
'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22
'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23
'AllTokensRevoked' => '已撤销所有tokens', // Added - 2020-04-09
'AnalysisFPS' => '分析帧率 FPS', // Added - 2015-07-22
'AnalysisUpdateDelay' => '分析更新延迟', // Added - 2015-07-23
'Apply' => '应用',
'ApplyingStateChange' => '状态改变生效',
'ArchArchived' => '仅限于存档',
@ -107,30 +110,31 @@ $SLANG = array(
'AttrArchiveStatus' => '存档状态',
'AttrAvgScore' => '平均分数',
'AttrCause' => '原因',
'AttrDiskBlocks' => '磁区块',
'AttrDiskPercent' => '磁百分比',
'AttrDiskSpace' => 'Disk Space', // Added - 2018-08-30
'AttrDiskBlocks' => '磁区块',
'AttrDiskPercent' => '磁百分比',
'AttrDiskSpace' => '磁盘空间', // Added - 2018-08-30
'AttrDuration' => '过程',
'AttrEndDate' => 'End Date', // Added - 2018-08-30
'AttrEndDateTime' => 'End Date/Time', // Added - 2018-08-30
'AttrEndTime' => 'End Time', // Added - 2018-08-30
'AttrEndWeekday' => 'End Weekday', // Added - 2018-08-30
'AttrFilterServer' => 'Server Filter is Running On', // Added - 2018-08-30
'AttrEndDate' => '结束日期', // Added - 2018-08-30
'AttrEndDateTime' => '结束日期/时间', // Added - 2018-08-30
'AttrEndTime' => '结束时间', // Added - 2018-08-30
'AttrEndWeekday' => '结束星期', // Added - 2018-08-30
'AttrFilterServer' => '过滤服务正运行在', // Added - 2018-08-30
'AttrFrames' => '帧',
'AttrId' => 'Id',
'AttrMaxScore' => '最大分数',
'AttrMonitorId' => '监视器 Id',
'AttrMonitorName' => '监视器名称',
'AttrMonitorServer' => 'Server Monitor is Running On', // Added - 2018-08-30
'AttrMonitorServer' => '监控服务正运行在', // Added - 2018-08-30
'AttrName' => '名称',
'AttrNotes' => '备注',
'AttrStartDate' => 'Start Date', // Added - 2018-08-30
'AttrStartDateTime' => 'Start Date/Time', // Added - 2018-08-30
'AttrStartTime' => 'Start Time', // Added - 2018-08-30
'AttrStartWeekday' => 'Start Weekday', // Added - 2018-08-30
'AttrStateId' => 'Run State', // Added - 2018-08-30
'AttrStorageArea' => 'Storage Area', // Added - 2018-08-30
'AttrStorageServer' => 'Server Hosting Storage', // Added - 2018-08-30
'AttrSecondaryStorageArea'=> '第二存储区域', // Added - 2020-04-09
'AttrStartDate' => '开始日期', // Added - 2018-08-30
'AttrStartDateTime' => '开始日期/时间', // Added - 2018-08-30
'AttrStartTime' => '开始时间', // Added - 2018-08-30
'AttrStartWeekday' => '开始星期', // Added - 2018-08-30
'AttrStateId' => '运行状态', // Added - 2018-08-30
'AttrStorageArea' => '存储区域', // Added - 2018-08-30
'AttrStorageServer' => '存储服务器', // Added - 2018-08-30
'AttrSystemLoad' => '系统负载',
'AttrTotalScore' => '总分数',
'Auto' => '自动',
@ -141,10 +145,10 @@ $SLANG = array(
'BackgroundFilter' => '在后台运行筛选器',
'BadAlarmFrameCount' => '报警帧数必须设为大于1的整数',
'BadAlarmMaxFPS' => '报警最大帧率必须是正整数或正浮点数',
'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22
'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23
'BadAnalysisFPS' => '分析帧率 FPS 必须是正整数或正浮点数', // Added - 2015-07-22
'BadAnalysisUpdateDelay'=> '分析更新延迟必须设为大于零的整数', // Added - 2015-07-23
'BadChannel' => '通道必须设为大于零的整数',
'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15
'BadColours' => '颜色必须设置为有效值', // Added - 2011-06-15
'BadDevice' => '必须为器件设置有效值',
'BadFPSReportInterval' => 'FPS帧数报告间隔缓冲数必须是0以上整数',
'BadFormat' => '格式必须设为大于零的整数',
@ -155,9 +159,10 @@ $SLANG = array(
'BadLabelX' => '标签 X 坐标必须设为大于零的整数',
'BadLabelY' => '标签 Y 坐标必须设为大于零的整数',
'BadMaxFPS' => '最大帧数FPS必须设为正整数或着浮点数',
'BadMotionFrameSkip' => 'Motion Frame skip count must be an integer of zero or more',
'BadMotionFrameSkip' => '运动跳帧数必须设为大于零的整数',
'BadNameChars' => '名称只可以包含字母,数字,波折号和下划线',
'BadPalette' => 'Palette must be set to a valid value', // Added - 2009-03-31
'BadNoSaveJPEGsOrVideoWriter'=> '保存为JPEGs和保存为视频同时禁用后。不会有任何记录 ', // Added - 2020-04-09
'BadPalette' => '调色板必须设为有效值', // Added - 2009-03-31
'BadPath' => '路径必须设为有效值',
'BadPort' => '端口必须设为有效数字',
'BadPostEventCount' => '之后事件影像数目必须设为大于零的整数',
@ -165,11 +170,11 @@ $SLANG = array(
'BadRefBlendPerc' => '参考混合百分比必须设为一个正整数',
'BadSectionLength' => '节长度必须设为30的整数倍',
'BadSignalCheckColour' => '信号检查颜色必须设为有效的RGB颜色字符',
'BadSourceType' => 'Source Type \"Web Site\" requires the Function to be set to \"Monitor\"', // Added - 2018-08-30
'BadSourceType' => '源类型 \"网站\" 要求 功能 设置为 \"监视\"', // Added - 2018-08-30
'BadStreamReplayBuffer' => '流重放缓冲必须为零或更多整数',
'BadWarmupCount' => '预热帪必须设为零或更多整数',
'BadWebColour' => 'Web颜色必须设为有效Web颜色字符',
'BadWebSitePath' => 'Please enter a complete website url, including the http:// or https:// prefix.', // Added - 2018-08-30
'BadWebSitePath' => '请输入一个完整的网站链接包括http://或https://前缀。', // Added - 2018-08-30
'BadWidth' => '宽度必须设为有效值',
'Bandwidth' => '带宽',
'BandwidthHead' => 'Bandwidth', // This is the end of the bandwidth status on the top of the console, different in many language due to phrasing
@ -177,9 +182,9 @@ $SLANG = array(
'BlobSizes' => 'Blob大小',
'Blobs' => 'Blobs',
'Brightness' => '亮度',
'Buffer' => 'Buffer', // Added - 2015-04-18
'Buffer' => '缓冲', // Added - 2015-04-18
'Buffers' => '缓冲器',
'CSSDescription' => 'Change the default css for this computer', // Added - 2015-04-18
'CSSDescription' => '改变本机默认css', // Added - 2015-04-18
'CanAutoFocus' => '可以自动对焦',
'CanAutoGain' => '可以自动增益控制',
'CanAutoIris' => '可以自动光圈',
@ -204,8 +209,8 @@ $SLANG = array(
'CanMoveMap' => '可以映射网格移动',
'CanMoveRel' => '可以相对移动',
'CanPan' => '可以平移' ,
'CanReboot' => '可以重启',
'CanReset' => '可以复位',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => '可以进行预设',
'CanSleep' => '可以休眠',
'CanTilt' => '可以倾斜',
@ -224,22 +229,23 @@ $SLANG = array(
'CaptureHeight' => '捕获高度',
'CaptureMethod' => '捕获方式',
'CapturePalette' => '捕获调色板',
'CaptureResolution' => 'Capture Resolution', // Added - 2015-04-18
'CaptureResolution' => '捕获分辨率', // Added - 2015-04-18
'CaptureWidth' => '捕获宽度',
'Cause' => '原因',
'CheckMethod' => '报警检查方式',
'ChooseDetectedCamera' => 'Choose Detected Camera', // Added - 2009-03-31
'ChooseDetectedCamera' => '选择检测到的摄像头', // Added - 2009-03-31
'ChooseDetectedProfile'=> '选择检测到的流媒体', // Added - 2020-04-09
'ChooseFilter' => '选择筛选器',
'ChooseLogFormat' => 'Choose a log format', // Added - 2011-06-17
'ChooseLogFormat' => '选择日志格式', // Added - 2011-06-17
'ChooseLogSelection' => 'Choose a log selection', // Added - 2011-06-17
'ChoosePreset' => '选择预置',
'Clear' => 'Clear', // Added - 2011-06-16
'CloneMonitor' => 'Clone', // Added - 2018-08-30
'Clear' => '清除', // Added - 2011-06-16
'CloneMonitor' => '克隆', // Added - 2018-08-30
'Close' => '关闭',
'Colour' => '彩色',
'Command' => '命令',
'Component' => 'Component', // Added - 2011-06-16
'ConcurrentFilter' => 'Run filter concurrently', // Added - 2018-08-30
'Component' => '组件', // Added - 2011-06-16
'ConcurrentFilter' => '同时应用筛选器', // Added - 2018-08-30
'Config' => '配置',
'ConfiguredFor' => '配置标的',
'ConfirmDeleteEvents' => '确认希望删除所选事件?',
@ -257,24 +263,25 @@ $SLANG = array(
'ControlDevice' => '控制设备',
'ControlType' => '控制类型',
'Controllable' => '可控',
'Current' => 'Current', // Added - 2015-04-18
'Current' => '现在', // Added - 2015-04-18
'Cycle' => '循环',
'CycleWatch' => '循环监视',
'DateTime' => 'Date/Time', // Added - 2011-06-16
'DateTime' => '日期', // Added - 2011-06-16
'Day' => '日',
'Debug' => '调试',
'DefaultCodec' => '默认即时观看方法', // Added - 2020-04-09
'DefaultRate' => '缺省速率',
'DefaultScale' => '缺省缩放',
'DefaultView' => '缺省视角',
'Deinterlacing' => 'Deinterlacing', // Added - 2015-04-18
'Delay' => 'Delay', // Added - 2015-04-18
'Deinterlacing' => '去隔行', // Added - 2015-04-18
'Delay' => '延迟', // Added - 2015-04-18
'Delete' => '删除',
'DeleteAndNext' => '删除并下一个',
'DeleteAndPrev' => '删除并前一个',
'DeleteSavedFilter' => '删除存储过滤器',
'Description' => '描述',
'DetectedCameras' => 'Detected Cameras', // Added - 2009-03-31
'DetectedProfiles' => 'Detected Profiles', // Added - 2015-04-18
'DetectedCameras' => '检测到的摄像头', // Added - 2009-03-31
'DetectedProfiles' => '检测到的流媒体', // Added - 2015-04-18
'Device' => '设备',
'DeviceChannel' => '设备通道',
'DeviceFormat' => '设备格式',
@ -283,10 +290,10 @@ $SLANG = array(
'Devices' => '设备',
'Dimensions' => '维度',
'DisableAlarms' => '关闭警报',
'Disk' => '磁',
'Display' => 'Display', // Added - 2011-01-30
'Displaying' => 'Displaying', // Added - 2011-06-16
'DoNativeMotionDetection'=> 'Do Native Motion Detection',
'Disk' => '磁',
'Display' => '显示', // Added - 2011-01-30
'Displaying' => '正在显示', // Added - 2011-06-16
'DoNativeMotionDetection'=> '在本机进行运动检测',
'Donate' => '请捐款',
'DonateAlready' => '不,我已经捐赠过了',
'DonateEnticement' => '迄今您已经运行ZoneMinder有一阵子了希望它能够有助于增强您家或者办公区域的安全。尽管ZoneMinder是并将保持免费和开源该项目依然在研发和支持中投入了资金和精力。如果您愿意支持今后的开发和新功能那么请考虑为该项目捐款。捐款不是必须的任何数量的捐赠我们都很感谢。<br/><br/>如果您愿意捐款,请选择下列选项,或者访问 https://zoneminder.com/donate/ 捐赠主页。<br/><br/>感谢您使用ZoneMinder并且不要忘记访问访问ZoneMinder.com的论坛以获得支持或建议这可以提升您的ZoneMinder的体验。',
@ -297,11 +304,11 @@ $SLANG = array(
'DonateRemindWeek' => '现在不1星期内再次提醒我',
'DonateYes' => '好,我现在就捐款',
'Download' => '下载',
'DownloadVideo' => 'Download Video', // Added - 2018-08-30
'DownloadVideo' => '下载视频', // Added - 2018-08-30
'DuplicateMonitorName' => 'Duplicate Monitor Name', // Added - 2009-03-31
'Duration' => 'Duration',
'Edit' => '编辑',
'EditLayout' => 'Edit Layout', // Added - 2018-08-30
'EditLayout' => '编辑布局', // Added - 2018-08-30
'Email' => 'Email',
'EnableAlarms' => '启动报警',
'Enabled' => '已启动',
@ -318,8 +325,9 @@ $SLANG = array(
'Events' => '事件',
'Exclude' => '排除',
'Execute' => '执行',
'Exif' => 'Embed EXIF data into image', // Added - 2018-08-30
'Exif' => '嵌入EXIF信息到图片', // Added - 2018-08-30
'Export' => '导出',
'ExportCompress' => '使用压缩', // Added - 2020-04-09
'ExportDetails' => '导出时间详情',
'ExportFailed' => '导出失败',
'ExportFormat' => '导出文件格式',
@ -327,7 +335,8 @@ $SLANG = array(
'ExportFormatZip' => 'Zip',
'ExportFrames' => '导出帧详情',
'ExportImageFiles' => '导出影像文件',
'ExportLog' => 'Export Log', // Added - 2011-06-17
'ExportLog' => '导出日志', // Added - 2011-06-17
'ExportMatches' => '导出匹配项', // Added - 2020-04-09
'ExportMiscFiles' => '导出其他文件 (如果存在)',
'ExportOptions' => '导出选项',
'ExportSucceeded' => '导出成功',
@ -341,29 +350,30 @@ $SLANG = array(
'Feed' => '转送源',
'Ffmpeg' => 'Ffmpeg',
'File' => '文件',
'Filter' => 'Filter', // Added - 2015-04-18
'FilterArchiveEvents' => '将全部匹配项存档',
'FilterDeleteEvents' => '将全部匹配项删除',
'FilterEmailEvents' => '将全部匹配项详情电邮出去',
'Filter' => '过滤器', // Added - 2015-04-18
'FilterArchiveEvents' => '存档全部匹配项',
'FilterCopyEvents' => '复制全部匹配项', // Added - 2020-04-09
'FilterDeleteEvents' => '删除全部匹配项',
'FilterEmailEvents' => '邮件发送全部匹配项详情',
'FilterExecuteEvents' => '执行全部匹配项命令',
'FilterLog' => 'Filter log', // Added - 2015-04-18
'FilterLog' => '过滤日志', // Added - 2015-04-18
'FilterMessageEvents' => '全部匹配项的信息详情',
'FilterMoveEvents' => 'Move all matches', // Added - 2018-08-30
'FilterMoveEvents' => '移除全部匹配项', // Added - 2018-08-30
'FilterPx' => '过滤器像素',
'FilterUnset' => '您必须指定过滤器宽度和高度',
'FilterUpdateDiskSpace'=> 'Update used disk space', // Added - 2018-08-30
'FilterUpdateDiskSpace'=> '刷新磁盘空间', // Added - 2018-08-30
'FilterUploadEvents' => '上传全部匹配项',
'FilterVideoEvents' => '为全部匹配项创建视频',
'Filters' => '过滤器',
'First' => '首先',
'FlippedHori' => '水平翻转',
'FlippedVert' => '垂直翻转',
'FnMocord' => 'Mocord', // Added 2013.08.16.
'FnModect' => 'Modect', // Added 2013.08.16.
'FnMonitor' => 'Monitor', // Added 2013.08.16.
'FnMocord' => '运动侦测并录制', // Added 2013.08.16.
'FnModect' => '运动侦测', // Added 2013.08.16.
'FnMonitor' => '监视', // Added 2013.08.16.
'FnNodect' => 'Nodect', // Added 2013.08.16.
'FnNone' => 'None', // Added 2013.08.16.
'FnRecord' => 'Record', // Added 2013.08.16.
'FnNone' => '', // Added 2013.08.16.
'FnRecord' => '录制', // Added 2013.08.16.
'Focus' => '聚焦',
'ForceAlarm' => '强制报警',
'Format' => '格式',
@ -376,7 +386,7 @@ $SLANG = array(
'Function' => '功能',
'Gain' => '增益',
'General' => '一般',
'GenerateDownload' => 'Generate Download', // Added - 2018-08-30
'GenerateDownload' => '创建下载项', // Added - 2018-08-30
'GenerateVideo' => '创建视频',
'GeneratingVideo' => '正在创建视频',
'GoToZoneMinder' => '访问 ZoneMinder.com',
@ -397,7 +407,7 @@ $SLANG = array(
'High' => '高',
'HighBW' => '高&nbsp;B/W',
'Home' => '主页',
'Hostname' => 'Hostname', // Added - 2018-08-30
'Hostname' => '主机名', // Added - 2018-08-30
'Hour' => '小时',
'Hue' => '色调',
'Id' => 'Id',
@ -408,6 +418,7 @@ $SLANG = array(
'Images' => '影像',
'In' => '在',
'Include' => '包含',
'InvalidateTokens' => '使所有创建的tokens无效', // Added - 2020-04-09
'Inverted' => '反向',
'Iris' => '光圈',
'KeyString' => '密钥字符',
@ -415,19 +426,19 @@ $SLANG = array(
'Language' => '语言',
'Last' => '最后',
'Layout' => '布局',
'Level' => 'Level', // Added - 2011-06-16
'Level' => '级别', // Added - 2011-06-16
'Libvlc' => 'Libvlc',
'LimitResultsPost' => '个结果', // This is used at the end of the phrase 'Limit to first N results only'
'LimitResultsPre' => '仅限于开始', // This is used at the beginning of the phrase 'Limit to first N results only'
'Line' => 'Line', // Added - 2011-06-16
'Line' => '', // Added - 2011-06-16
'LinkedMonitors' => '管理监视器',
'List' => '列表',
'ListMatches' => 'List Matches', // Added - 2018-08-30
'ListMatches' => '列出匹配项', // Added - 2018-08-30
'Load' => '加载',
'Local' => '本地',
'Log' => 'Log', // Added - 2011-06-16
'Log' => '日志', // Added - 2011-06-16
'LoggedInAs' => '登录为',
'Logging' => 'Logging', // Added - 2011-06-16
'Logging' => '日志', // Added - 2011-06-16
'LoggingIn' => '登录',
'Login' => '登入',
'Logout' => '登出',
@ -465,7 +476,7 @@ $SLANG = array(
'MaximumFPS' => '最大帧率 FPS',
'Medium' => '中等',
'MediumBW' => '中等&nbsp;B/W',
'Message' => 'Message', // Added - 2011-06-16
'Message' => '消息', // Added - 2011-06-16
'MinAlarmAreaLtMax' => '最小报警区域应该小于最大区域',
'MinAlarmAreaUnset' => '您必须指定最小报警像素数量',
'MinBlobAreaLtMax' => '最小blob区必须小数最大区域',
@ -500,25 +511,25 @@ $SLANG = array(
'MinZoomSpeed' => '最小缩放速度',
'MinZoomStep' => '最小缩放步进',
'Misc' => '杂项',
'Mode' => 'Mode', // Added - 2015-04-18
'Mode' => '模式', // Added - 2015-04-18
'Monitor' => '监视器',
'MonitorIds' => '监视器&nbsp;Ids',
'MonitorPreset' => '监视器预设值',
'MonitorPresetIntro' => '从以下列表中选择一个合适的预设值.<br/><br/>请注意该方式可能覆盖您为该监视器配置的数值.<br/><br/>',
'MonitorProbe' => 'Monitor Probe', // Added - 2009-03-31
'MonitorProbeIntro' => 'The list below shows detected analog and network cameras and whether they are already being used or available for selection.<br/><br/>Select the desired entry from the list below.<br/><br/>Please note that not all cameras may be detected and that choosing a camera here may overwrite any values you already have configured for the current monitor.<br/><br/>', // Added - 2009-03-31
'MonitorProbe' => '监视器探测', // Added - 2009-03-31
'MonitorProbeIntro' => '以下列表显示了检测到的模拟和网络摄像头,以及其可用状态<br/><br/>请从列表中选择你想要的项<br/><br/>请注意可能有些摄像头并没有检测到,而且选择一个摄像头可能覆盖一些你已经设置的配置。<br/><br/>', // Added - 2009-03-31
'Monitors' => '监视器',
'Montage' => '镜头组接',
'MontageReview' => 'Montage Review', // Added - 2018-08-30
'Month' => '月',
'More' => 'More', // Added - 2011-06-16
'MotionFrameSkip' => 'Motion Frame Skip',
'More' => '更多', // Added - 2011-06-16
'MotionFrameSkip' => '运动侦测跳帧',
'Move' => '移动',
'Mtg2widgrd' => '2-wide grid', // Added 2013.08.15.
'Mtg3widgrd' => '3-wide grid', // Added 2013.08.15.
'Mtg3widgrx' => '3-wide grid, scaled, enlarge on alarm', // Added 2013.08.15.
'Mtg4widgrd' => '4-wide grid', // Added 2013.08.15.
'MtgDefault' => 'Default', // Added 2013.08.15.
'MtgDefault' => '默认', // Added 2013.08.15.
'MustBeGe' => '必须大于等于',
'MustBeLe' => '必须小于等于',
'MustConfirmPassword' => '您必须确认密码',
@ -534,9 +545,10 @@ $SLANG = array(
'NewState' => '新状态',
'NewUser' => '新用户',
'Next' => '下一个',
'NextMonitor' => '下一个监视器', // Added - 2020-04-09
'No' => '不',
'NoDetectedCameras' => 'No Detected Cameras', // Added - 2009-03-31
'NoDetectedProfiles' => 'No Detected Profiles', // Added - 2018-08-30
'NoDetectedCameras' => '没有检测到摄像头', // Added - 2009-03-31
'NoDetectedProfiles' => '没有检测到流媒体', // Added - 2018-08-30
'NoFramesRecorded' => '该事件没有相关帧的记录',
'NoGroup' => '无组',
'NoSavedFilters' => '没有保存过滤器',
@ -548,25 +560,27 @@ $SLANG = array(
'NumPresets' => '数值预置',
'Off' => '关',
'On' => '开',
'OnvifCredentialsIntro'=> 'Please supply user name and password for the selected camera.<br/>If no user has been created for the camera then the user given here will be created with the given password.<br/><br/>', // Added - 2015-04-18
'OnvifCredentialsIntro'=> '请为所选摄像头提供用户名和密码。<br/>如果还没有为这台摄像头创建过用户,那么将会使用提供的用户名和密码创建用户<br/><br/>', // Added - 2015-04-18
'OnvifProbe' => 'ONVIF', // Added - 2015-04-18
'OnvifProbeIntro' => 'The list below shows detected ONVIF cameras and whether they are already being used or available for selection.<br/><br/>Select the desired entry from the list below.<br/><br/>Please note that not all cameras may be detected and that choosing a camera here may overwrite any values you already have configured for the current monitor.<br/><br/>', // Added - 2015-04-18
'OnvifProbeIntro' => '以下列表显示了检测到的ONVIF摄像头和其可用状态。<br/><br/>选择一个你想要的项<br/><br/>请注意可能有些摄像头并没有检测到,而且选择一个摄像头可能覆盖一些你已经设置的配置。<br/><br/>', // Added - 2015-04-18
'OpEq' => '等于',
'OpGt' => '大于',
'OpGtEq' => '大于等于',
'OpIn' => '在集',
'OpIs' => 'is', // Added - 2018-08-30
'OpIsNot' => 'is not', // Added - 2018-08-30
'OpIs' => '是', // Added - 2018-08-30
'OpIsNot' => '不是', // Added - 2018-08-30
'OpLike' => '包含', // Added - 2020-04-09
'OpLt' => '小于',
'OpLtEq' => '小于等于',
'OpMatches' => '匹配',
'OpNe' => '不等于',
'OpNotIn' => '未在集',
'OpNotLike' => '未包含', // Added - 2020-04-09
'OpNotMatches' => '不匹配',
'Open' => '打开',
'OptionHelp' => '选项帮助',
'OptionRestartWarning' => '这些改动在系统运行时可以不会完全生效.\n 当你设置完毕改动后\n请确认\n您重新启动 ZoneMinder.',
'OptionalEncoderParam' => 'Optional Encoder Parameters', // Added - 2018-08-30
'OptionalEncoderParam' => '编码参数(可选)', // Added - 2018-08-30
'Options' => '选项',
'OrEnterNewName' => '或输入新名词',
'Order' => '次序',
@ -579,10 +593,15 @@ $SLANG = array(
'PanRight' => '向右平移',
'PanTilt' => '平移/倾斜',
'Parameter' => '参数',
'ParentGroup' => '父组', // Added - 2020-04-09
'Password' => '密码',
'PasswordsDifferent' => '新建密码和确认密码不一致',
'PathToApi' => 'Api路径', // Added - 2020-04-09
'PathToIndex' => 'Index路径', // Added - 2020-04-09
'PathToZMS' => 'ZMS路径', // Added - 2020-04-09
'Paths' => '路径',
'Pause' => '暂停',
'PauseCycle' => 'Pause Cycle', // Added - 2020-04-09
'Phone' => '电话',
'PhoneBW' => '电话&nbsp;B/W',
'Pid' => 'PID', // Added - 2011-06-16
@ -590,8 +609,9 @@ $SLANG = array(
'Pixels' => '像素',
'Play' => '播放',
'PlayAll' => '播放全部',
'PlayCycle' => 'Play Cycle', // Added - 2020-04-09
'PleaseWait' => '请等待',
'Plugins' => 'Plugins',
'Plugins' => '插件',
'Point' => '点',
'PostEventImageBuffer' => '事件之后影像数',
'PreEventImageBuffer' => '时间之前影像数',
@ -599,18 +619,31 @@ $SLANG = array(
'Preset' => '预置',
'Presets' => '预置',
'Prev' => '前',
'Probe' => 'Probe', // Added - 2009-03-31
'ProfileProbe' => 'Stream Probe', // Added - 2015-04-18
'ProfileProbeIntro' => 'The list below shows the existing stream profiles of the selected camera .<br/><br/>Select the desired entry from the list below.<br/><br/>Please note that ZoneMinder cannot configure additional profiles and that choosing a camera here may overwrite any values you already have configured for the current monitor.<br/><br/>', // Added - 2015-04-18
'PreviousMonitor' => '前一个监视器', // Added - 2020-04-09
'Privacy' => 'Privacy', // Added - 2020-04-09
'PrivacyAbout' => '关于', // Added - 2020-04-09
'PrivacyAboutText' => 'Since 2002, ZoneMinder has been the premier free and open-source Video Management System (VMS) solution for Linux platforms. ZoneMinder is supported by the community and is managed by those who choose to volunteer their spare time to the project. The best way to improve ZoneMinder is to get involved.', // Added - 2020-04-09
'PrivacyConclusionText'=> 'We are <u>NOT</u> collecting any image specific data from your cameras. We dont know what your cameras are watching. This data will not be sold or used for any purpose not stated herein. By clicking accept, you agree to send us this data to help make ZoneMinder a better product. By clicking decline, you can still freely use ZoneMinder and all its features.', // Added - 2020-04-09
'PrivacyContact' => '联系', // Added - 2020-04-09
'PrivacyContactText' => 'Please contact us <a href="https://zoneminder.com/contact/">here</a> for any questions regarding our privacy policy or to have your information removed.<br><br>For support, there are three primary ways to engage with the community:<ul><li>The ZoneMinder <a href="https://forums.zoneminder.com/">user forum</a></li><li>The ZoneMinder <a href="https://zoneminder-chat.herokuapp.com/">Slack channel</a></li><li>The ZoneMinder <a href="https://github.com/ZoneMinder/zoneminder/issues">Github forum</a></li></ul><p>Our Github forum is only for bug reporting. Please use our user forum or slack channel for all other questions or comments.</p>', // Added - 2020-04-09
'PrivacyCookies' => 'Cookies', // Added - 2020-04-09
'PrivacyCookiesText' => 'Whether you use a web browser or a mobile app to communicate with the ZoneMinder server, a ZMSESSID cookie is created on the client to uniquely identify a session with the ZoneMinder server. ZmCSS and zmSkin cookies are created to remember your style and skin choices.', // Added - 2020-04-09
'PrivacyMonitorList' => 'The following configuration parameters from each monitor are collected:<ul><li>Id<li>Name<li>Type<li>Function<li>Width<li>Height<li>Colours<li>MaxFPS<li>AlarmMaxFPS</ul>', // Added - 2020-04-09
'PrivacyTelemetry' => 'Telemetry', // Added - 2020-04-09
'PrivacyTelemetryList' => 'The ZoneMinder Telemetry daemon collects the following data about your system:<ul><li>A unique identifier (UUID) <li>City based location is gathered by querying <a href="https://ipinfo.io/geo">ipinfo.io</a>. City, region, country, latitude, and longitude parameters are saved. The latitude and longitude coordinates are accurate down to the city or town level only!<li>Current time<li>Total number of monitors<li>Total number of events<li>System architecture<li>Operating system kernel, distro, and distro version<li>Version of ZoneMinder<li>Total amount of memory<li>Number of cpu cores</ul>', // Added - 2020-04-09
'PrivacyTelemetryText' => 'Because ZoneMinder is open-source, anyone can install it without registering. This makes it difficult to answer questions such as: how many systems are out there, what is the largest system out there, what kind of systems are out there, or where are these systems located? Knowing the answers to these questions, helps users who ask us these questions, and it helps us set priorities based on the majority user base.', // Added - 2020-04-09
'Probe' => '探测', // Added - 2009-03-31
'ProfileProbe' => '流媒体探测', // Added - 2015-04-18
'ProfileProbeIntro' => '以下列表显示了所选摄像头可用的流媒体。<br/><br/>从列表中选择一个你想要的项<br/><br/>请注意ZoneMinder不能设置额外的配置并且选择摄像头可能会覆盖一些你已设置的配置。<br/><br/>', // Added - 2015-04-18
'Progress' => 'Progress', // Added - 2015-04-18
'Protocol' => '协议',
'RTSPDescribe' => 'Use RTSP Response Media URL', // Added - 2018-08-30
'RTSPTransport' => 'RTSP Transport Protocol', // Added - 2018-08-30
'RTSPDescribe' => '使用 RTSP Response 媒体链接', // Added - 2018-08-30
'RTSPTransport' => 'RTSP传输协议', // Added - 2018-08-30
'Rate' => '速率',
'Real' => '实际',
'RecaptchaWarning' => 'Your reCaptcha secret key is invalid. Please correct it, or reCaptcha will not work', // Added - 2018-08-30
'RecaptchaWarning' => '你的reCaptcha秘匙无效。 请更正否则reCaptcha无法工作', // Added - 2018-08-30
'Record' => '记录',
'RecordAudio' => 'Whether to store the audio stream when saving an event.', // Added - 2018-08-30
'RecordAudio' => '记录事件时保存音频.', // Added - 2018-08-30
'RefImageBlendPct' => '参考影像混合 %ge',
'Refresh' => '刷新',
'Remote' => '远程',
@ -626,7 +659,7 @@ $SLANG = array(
'ReplayAll' => '全部事件',
'ReplayGapless' => '无间隙事件',
'ReplaySingle' => '单一事件',
'ReportEventAudit' => 'Audit Events Report', // Added - 2018-08-30
'ReportEventAudit' => '事件报表', // Added - 2018-08-30
'Reset' => '重置',
'ResetEventCounts' => '重置事件数',
'Restart' => '重启动',
@ -635,24 +668,29 @@ $SLANG = array(
'RestrictedMonitors' => '受限监视器',
'ReturnDelay' => '返回延时',
'ReturnLocation' => '返回位置',
'RevokeAllTokens' => '撤销所有Tokens', // Added - 2020-04-09
'Rewind' => '重绕',
'RotateLeft' => '向左旋转',
'RotateRight' => '向右旋转',
'RunLocalUpdate' => 'Please run zmupdate.pl to update', // Added - 2011-05-25
'RunAudit' => '审计', // Added - 2020-04-09
'RunEventNotification' => '事件提醒', // Added - 2020-04-09
'RunLocalUpdate' => '请运行zmupdate.pl来更新', // Added - 2011-05-25
'RunMode' => '运行模式',
'RunState' => '运行状态',
'RunStats' => '状态检测', // Added - 2020-04-09
'RunTrigger' => '触发', // Added - 2020-04-09
'Running' => '运行',
'Save' => '保存',
'SaveAs' => '另存为',
'SaveFilter' => '存储过滤器',
'SaveJPEGs' => 'Save JPEGs', // Added - 2018-08-30
'SaveJPEGs' => '保存为JPEGs', // Added - 2018-08-30
'Scale' => '比例',
'Score' => '分数',
'Secs' => '秒',
'Sectionlength' => '段长度',
'Select' => '选择',
'SelectFormat' => 'Select Format', // Added - 2011-06-17
'SelectLog' => 'Select Log', // Added - 2011-06-17
'SelectFormat' => '选择格式', // Added - 2011-06-17
'SelectLog' => '选择日志', // Added - 2011-06-17
'SelectMonitors' => '选择监视器',
'SelfIntersecting' => '多边形边线不得交叉',
'Set' => '设置',
@ -661,10 +699,11 @@ $SLANG = array(
'Settings' => '设置',
'ShowFilterWindow' => '显示过滤器视窗',
'ShowTimeline' => '显示时间轴',
'SignalCheckColour' => '型号检查颜色',
'SignalCheckPoints' => 'Signal Check Points', // Added - 2018-08-30
'Shutdown' => '关机', // Added - 2020-04-09
'SignalCheckColour' => '信号检查颜色',
'SignalCheckPoints' => '信号检测点数目', // Added - 2018-08-30
'Size' => '大小',
'SkinDescription' => 'Change the default skin for this computer', // Added - 2011-01-30
'SkinDescription' => '改变本机默认皮肤', // Added - 2011-01-30
'Sleep' => '睡眠',
'SortAsc' => '升序',
'SortBy' => '排序',
@ -682,10 +721,10 @@ $SLANG = array(
'State' => '状态',
'Stats' => '统计',
'Status' => '状况',
'StatusConnected' => 'Capturing', // Added - 2018-08-30
'StatusNotRunning' => 'Not Running', // Added - 2018-08-30
'StatusRunning' => 'Not Capturing', // Added - 2018-08-30
'StatusUnknown' => 'Unknown', // Added - 2018-08-30
'StatusConnected' => '正在捕获', // Added - 2018-08-30
'StatusNotRunning' => '未运行', // Added - 2018-08-30
'StatusRunning' => '未捕获', // Added - 2018-08-30
'StatusUnknown' => '未知', // Added - 2018-08-30
'Step' => '步进',
'StepBack' => '单步后退',
'StepForward' => '单步前进',
@ -696,14 +735,16 @@ $SLANG = array(
'Stills' => '静止',
'Stop' => '停止',
'Stopped' => '已停止',
'StorageArea' => 'Storage Area', // Added - 2018-08-30
'StorageScheme' => 'Scheme', // Added - 2018-08-30
'StorageArea' => '存储区域', // Added - 2018-08-30
'StorageDoDelete' => '开始删除', // Added - 2020-04-09
'StorageScheme' => '存储方案', // Added - 2018-08-30
'Stream' => '流',
'StreamReplayBuffer' => '流重放影像缓冲',
'Submit' => '发送',
'System' => '系统',
'SystemLog' => 'System Log', // Added - 2011-06-16
'TargetColorspace' => 'Target colorspace', // Added - 2015-04-18
'SystemLog' => '系统日志', // Added - 2011-06-16
'TZUnset' => '未设置 - 使用php.ini的配置', // Added - 2020-04-09
'TargetColorspace' => '色彩空间', // Added - 2015-04-18
'Tele' => 'Tele',
'Thumbnail' => '缩略图',
'Tilt' => '倾斜',
@ -711,18 +752,18 @@ $SLANG = array(
'TimeDelta' => '相对时间',
'TimeStamp' => '时间戳',
'Timeline' => '时间轴',
'TimelineTip1' => 'Pass your mouse over the graph to view a snapshot image and event details.', // Added 2013.08.15.
'TimelineTip2' => 'Click on the coloured sections of the graph, or the image, to view the event.', // Added 2013.08.15.
'TimelineTip1' => '移动你的鼠标到图表上来查看快照图片和事件详情。', // Added 2013.08.15.
'TimelineTip2' => '单击图形或图像的彩色部分来查看事件。', // Added 2013.08.15.
'TimelineTip3' => 'Click on the background to zoom in to a smaller time period based around your click.', // Added 2013.08.15.
'TimelineTip4' => 'Use the controls below to zoom out or navigate back and forward through the time range.', // Added 2013.08.15.
'Timestamp' => '时间戳',
'TimestampLabelFormat' => '时间戳标签格式',
'TimestampLabelSize' => 'Font Size', // Added - 2018-08-30
'TimestampLabelSize' => '字体大小', // Added - 2018-08-30
'TimestampLabelX' => '时间戳标签 X',
'TimestampLabelY' => '时间戳标签 Y',
'Today' => '今天',
'Tools' => '工具',
'Total' => 'Total', // Added - 2011-06-16
'Total' => '', // Added - 2011-06-16
'TotalBrScore' => '总<br/>分数',
'TrackDelay' => '轨迹延时',
'TrackMotion' => '轨迹运动',
@ -737,23 +778,24 @@ $SLANG = array(
'Update' => '更新',
'UpdateAvailable' => '有新版本的ZoneMinder.',
'UpdateNotNecessary' => '无须更新',
'Updated' => 'Updated', // Added - 2011-06-16
'Upload' => 'Upload', // Added - 2011-08-23
'Updated' => '已更新', // Added - 2011-06-16
'Upload' => '上传', // Added - 2011-08-23
'UseFilter' => '使用筛选器',
'UseFilterExprsPost' => '&nbsp;筛选器&nbsp;表达式', // This is used at the end of the phrase 'use N filter expressions'
'UseFilterExprsPre' => '使用&nbsp;', // This is used at the beginning of the phrase 'use N filter expressions'
'UsedPlugins' => 'Used Plugins',
'UsedPlugins' => '已使用的插件',
'User' => '用户',
'Username' => '用户名',
'Users' => '用户',
'V4L' => 'V4L', // Added - 2015-04-18
'V4LCapturesPerFrame' => 'Captures Per Frame', // Added - 2015-04-18
'V4LMultiBuffer' => 'Multi Buffering', // Added - 2015-04-18
'V4LCapturesPerFrame' => '每帧捕获', // Added - 2015-04-18
'V4LMultiBuffer' => '多缓冲', // Added - 2015-04-18
'Value' => '数值',
'Version' => '版本',
'VersionIgnore' => '忽略该版本',
'VersionRemindDay' => '一天内再次提醒',
'VersionRemindHour' => '一小时内再次提醒',
'VersionRemindMonth' => '一个月内再次提醒', // Added - 2020-04-09
'VersionRemindNever' => '不再提醒新版本',
'VersionRemindWeek' => '一周内再次提醒',
'Video' => '视频',
@ -764,17 +806,18 @@ $SLANG = array(
'VideoGenParms' => '视频产生参数',
'VideoGenSucceeded' => '视频产生成功!',
'VideoSize' => '视频尺寸',
'VideoWriter' => 'Video Writer', // Added - 2018-08-30
'VideoWriter' => '保存为视频', // Added - 2018-08-30
'View' => '查看',
'ViewAll' => '查看全部',
'ViewEvent' => '查看事件',
'ViewMatches' => '查看匹配项', // Added - 2020-04-09
'ViewPaged' => '查看分页',
'Wake' => '唤醒',
'WarmupFrames' => '预热帪',
'Watch' => '观察',
'Web' => 'Web',
'WebColour' => 'Web颜色',
'WebSiteUrl' => 'Website URL', // Added - 2018-08-30
'WebSiteUrl' => '网站链接', // Added - 2018-08-30
'Week' => '周',
'White' => '白',
'WhiteBalance' => '白平衡',
@ -797,7 +840,7 @@ $SLANG = array(
'ZoneMinMaxBlobs' => '最小/最大污渍区数 Blobs',
'ZoneMinMaxFiltArea' => '最小/最大过滤区域',
'ZoneMinMaxPixelThres' => '最小/最大像素阈值(0-255)',
'ZoneMinderLog' => 'ZoneMinder Log', // Added - 2011-06-17
'ZoneMinderLog' => 'ZoneMinder日志', // Added - 2011-06-17
'ZoneOverloadFrames' => '忽略过载帪数',
'Zones' => '区域',
'Zoom' => '缩放',
@ -814,7 +857,7 @@ $CLANG = array(
'MonitorCount' => '%1$s %2$s', // For example '4 Monitors' (from Vlang below)
'MonitorFunction' => '监视器 %1$s 功能',
'RunningRecentVer' => '您运行的是最新版的 ZoneMinder, v%s.',
'VersionMismatch' => 'Version mismatch, system is version %1$s, database is %2$s.', // Added - 2011-05-25
'VersionMismatch' => '版本不匹配, 系统版本是 %1$s, 数据库版本是 %2$s.', // Added - 2011-05-25
);
// The next section allows you to describe a series of word ending and counts used to

View File

@ -25,15 +25,15 @@ function controlFocus($monitor, $cmds) {
?>
<div class="arrowControl focusControls">
<div class="arrowLabel"><?php echo translate('Near') ?></div>
<button type="button" class="longArrowBtn upBtn" onclick="controlCmd('<?php echo $cmds['FocusNear'] ?>',event,0,-1)"></button>
<button type="button" class="arrowCenter"<?php if ( $control->CanFocusCon() ) { ?> onclick="controlCmd('<?php echo $cmds['FocusStop'] ?>')"<?php } ?>><?php echo translate('Focus') ?></button>
<button type="button" class="longArrowBtn downBtn" onclick="controlCmd('<?php echo $cmds['FocusFar'] ?>',event,0,1)"></button>
<button type="button" class="longArrowBtn upBtn" value="<?php echo $cmds['FocusNear'] ?>" data-on-click-this="controlCmd" data-xtell="0" data-ytell="-1"></button>
<button type="button" class="arrowCenter"<?php if ( $control->CanFocusCon() ) { ?> data-on-click-this="controlCmd" value="<?php echo $cmds['FocusStop'] ?>"<?php } ?>><?php echo translate('Focus') ?></button>
<button type="button" class="longArrowBtn downBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['FocusFar'] ?>" data-xtell="0" data-ytell="1"></button>
<div class="arrowLabel"><?php echo translate('Far') ?></div>
<?php
if ( $control->CanAutoFocus() ) {
?>
<button type="button" class="ptzTextBtn" value="<?php echo $cmds['FocusAuto'] ?>" onclick="controlCmd('<?php echo $cmds['FocusAuto'] ?>')"><?php echo translate('Auto') ?></button>
<button type="button" class="ptzTextBtn" value="<?php echo $cmds['FocusMan'] ?>" onclick="controlCmd('<?php echo $cmds['FocusMan'] ?>')"><?php echo translate('Man') ?></button>
<button type="button" class="ptzTextBtn" value="<?php echo $cmds['FocusAuto'] ?>" data-on-click-this="controlCmd"><?php echo translate('Auto') ?></button>
<button type="button" class="ptzTextBtn" value="<?php echo $cmds['FocusMan'] ?>" data-on-click-this="controlCmd"><?php echo translate('Man') ?></button>
<?php
}
?>
@ -48,15 +48,15 @@ function controlZoom($monitor, $cmds) {
?>
<div class="arrowControl zoomControls">
<div class="arrowLabel"><?php echo translate('Tele') ?></div>
<button type="button" class="longArrowBtn upBtn" onclick="controlCmd('<?php echo $cmds['ZoomTele'] ?>',event,0,-1)"></button>
<button type="button" class="arrowCenter"<?php if ( $control->CanZoomCon() ) { ?> onclick="controlCmd('<?php echo $cmds['ZoomStop'] ?>')"<?php } ?>><?php echo translate('Zoom') ?></button>
<button type="button" class="longArrowBtn downBtn" onclick="controlCmd('<?php echo $cmds['ZoomWide'] ?>',event,0,1)"></button>
<button type="button" class="longArrowBtn upBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['ZoomTele'] ?>" data-xtell="0" data-ytell="-1"></button>
<button type="button" class="arrowCenter"<?php if ( $control->CanZoomCon() ) { ?> data-on-click-this="controlCmd" value="<?php echo $cmds['ZoomStop'] ?>"<?php } ?>><?php echo translate('Zoom') ?></button>
<button type="button" class="longArrowBtn downBtn" data-on-click-data="controlCmd" value="<?php echo $cmds['ZoomWide'] ?>" data-xtell="0" data-ytell="1"></button>
<div class="arrowLabel"><?php echo translate('Wide') ?></div>
<?php
if ( $control->CanAutoZoom() ) {
?>
<button type="button" class="ptzTextBtn" value="Auto" onclick="controlCmd('<?php echo $cmds['ZoomAuto'] ?>')"><?php echo translate('Auto') ?></button>
<button type="button" class="ptzTextBtn" value="Man" onclick="controlCmd('<?php echo $cmds['ZoomMan'] ?>')"><?php echo translate('Man') ?></button>
<button type="button" class="ptzTextBtn" value="Auto" data-on-click-this="controlCmd" value="<?php echo $cmds['ZoomAuto'] ?>"><?php echo translate('Auto') ?></button>
<button type="button" class="ptzTextBtn" value="Man" data-on-click-this="controlCmd" value="<?php echo $cmds['ZoomMan'] ?>"><?php echo translate('Man') ?></button>
<?php
}
?>
@ -70,15 +70,15 @@ function controlIris($monitor, $cmds) {
?>
<div class="arrowControl irisControls">
<div class="arrowLabel"><?php echo translate('Open') ?></div>
<button type="button" class="longArrowBtn upBtn" onclick="controlCmd('<?php echo $cmds['IrisOpen'] ?>',event,0,-1)"></button>
<button type="button" class="arrowCenter"<?php if ( $control->CanIrisCon() ) { ?> onclick="controlCmd('<?php echo $cmds['IrisStop'] ?>')"<?php } ?>><?php echo translate('Iris') ?></button>
<button type="button" class="longArrowBtn downBtn" onclick="controlCmd('<?php echo $cmds['IrisClose'] ?>',event,0,1)"></button>
<button type="button" class="longArrowBtn upBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['IrisOpen'] ?>" data-xtell="0" data-ytell="-1"></button>
<button type="button" class="arrowCenter"<?php if ( $control->CanIrisCon() ) { ?> data-on-click-this="controlCmd" value="<?php echo $cmds['IrisStop'] ?>"<?php } ?>><?php echo translate('Iris') ?></button>
<button type="button" class="longArrowBtn downBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['IrisClose'] ?>" data-xtell="0" data-ytell="1"></button>
<div class="arrowLabel"><?php echo translate('Close') ?></div>
<?php
if ( $control->CanAutoIris() ) {
?>
<button type="button" class="ptzTextBtn" value="Auto" onclick="controlCmd('<?php echo $cmds['IrisAuto'] ?>')"><?php echo translate('Auto') ?></button>
<button type="button" class="ptzTextBtn" value="Man" onclick="controlCmd('<?php echo $cmds['IrisMan'] ?>')"><?php echo translate('Man') ?></button>
<button type="button" class="ptzTextBtn" value="Auto" data-on-click-this="controlCmd" value="<?php echo $cmds['IrisAuto'] ?>"><?php echo translate('Auto') ?></button>
<button type="button" class="ptzTextBtn" value="Man" data-on-click-this="controlCmd" value="<?php echo $cmds['IrisMan'] ?>"><?php echo translate('Man') ?></button>
<?php
}
?>
@ -93,15 +93,15 @@ function controlWhite($monitor, $cmds) {
?>
<div class="arrowControl whiteControls">
<div class="arrowLabel"><?php echo translate('In') ?></div>
<button type="button" class="longArrowBtn upBtn" onclick="controlCmd('<?php echo $cmds['WhiteIn'] ?>',event,0,-1)"></button>
<button type="button" class="arrowCenter"<?php if ( $control->CanWhiteCon() ) { ?> onclick="controlCmd('<?php echo $cmds['WhiteStop'] ?>')"<?php } ?>><?php echo translate('White') ?></button>
<button type="button" class="longArrowBtn downBtn" onclick="controlCmd('<?php echo $cmds['WhiteOut'] ?>',event,0,1)"></button>
<button type="button" class="longArrowBtn upBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['WhiteIn'] ?>" data-xtell="0" data-ytell="-1"></button>
<button type="button" class="arrowCenter"<?php if ( $control->CanWhiteCon() ) { ?> data-on-click-this="controlCmd" value="<?php echo $cmds['WhiteStop'] ?>"<?php } ?>><?php echo translate('White') ?></button>
<button type="button" class="longArrowBtn downBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['WhiteOut'] ?>" data-xtell="0" data-ytell="1)"></button>
<div class="arrowLabel"><?php echo translate('Out') ?></div>
<?php
if ( $control->CanAutoWhite() ) {
?>
<button type="button" class="ptzTextBtn" value="Auto" onclick="controlCmd('<?php echo $cmds['WhiteAuto'] ?>')"><?php echo translate('Auto') ?></button>
<button type="button" class="ptzTextBtn" value="Man" onclick="controlCmd('<?php echo $cmds['WhiteMan'] ?>')"><?php echo translate('Man') ?></button>
<button type="button" class="ptzTextBtn" value="Auto" data-on-click-this="controlCmd" value="<?php echo $cmds['WhiteAuto'] ?>"><?php echo translate('Auto') ?></button>
<button type="button" class="ptzTextBtn" value="Man" data-on-click-this="controlCmd" value="<?php echo $cmds['WhiteMan'] ?>"><?php echo translate('Man') ?></button>
<?php
}
?>
@ -122,19 +122,19 @@ function controlPanTilt($monitor, $cmds) {
$hasTilt = $control->CanTilt();
$hasDiag = $hasPan && $hasTilt && $control->CanMoveDiag();
?>
<button type="button" class="arrowBtn upLeftBtn<?php echo $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveUpLeft'] ?>',event,-1,-1)"></button>
<button type="button" class="arrowBtn upBtn<?php echo $hasTilt?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveUp'] ?>',event,0,-1)"></button>
<button type="button" class="arrowBtn upRightBtn<?php echo $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveUpRight'] ?>',event,1,-1)"></button>
<button type="button" class="arrowBtn leftBtn<?php echo $hasPan?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveLeft'] ?>',event,-1,0)"></button>
<button type="button" class="arrowBtn upLeftBtn<?php echo $hasDiag?'':' invisible' ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['MoveUpLeft'] ?>" data-xtell="-1" data-ytell="-1"></button>
<button type="button" class="arrowBtn upBtn<?php echo $hasTilt?'':' invisible' ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['MoveUp'] ?>" data-xtell="0" data-ytell="-1"></button>
<button type="button" class="arrowBtn upRightBtn<?php echo $hasDiag?'':' invisible' ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['MoveUpRight'] ?>" data-xtell="1" data-ytell="-1"></button>
<button type="button" class="arrowBtn leftBtn<?php echo $hasPan?'':' invisible' ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['MoveLeft'] ?>" data-xtell="-1" data-ytell="0"></button>
<?php if ( isset($cmds['Center']) ) { ?>
<button type="button" class="arrowBtn centerBtn" onclick="controlCmd('<?php echo $cmds['Center'] ?>')"></button>
<button type="button" class="arrowBtn centerBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['Center'] ?>"></button>
<?php } else { ?>
<button type="button" class="arrowBtn NocenterBtn"></button>
<?php } ?>
<button type="button" class="arrowBtn rightBtn<?php echo $hasPan?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveRight'] ?>',event,1,0)"></button>
<button type="button" class="arrowBtn downLeftBtn<?php echo $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveDownLeft'] ?>',event,-1,1)"></button>
<button type="button" class="arrowBtn downBtn<?php echo $hasTilt?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveDown'] ?>',event,0,1)"></button>
<button type="button" class="arrowBtn downRightBtn<?php echo $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveDownRight'] ?>',event,1,1)"></button>
<button type="button" class="arrowBtn rightBtn<?php echo $hasPan?'':' invisible' ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['MoveRight'] ?>" data-xtell="1" data-ytell="0"></button>
<button type="button" class="arrowBtn downLeftBtn<?php echo $hasDiag?'':' invisible' ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['MoveDownLeft'] ?>" data-xtell="-1" data-ytell="1"></button>
<button type="button" class="arrowBtn downBtn<?php echo $hasTilt?'':' invisible' ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['MoveDown'] ?>" data-xtell="0" data-ytell="1"></button>
<button type="button" class="arrowBtn downRightBtn<?php echo $hasDiag?'':' invisible' ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['MoveDownRight'] ?>" data-xtell="1" data-ytell="1"></button>
</div>
</div>
<?php
@ -148,7 +148,7 @@ function controlPresets($monitor, $cmds) {
$sql = 'SELECT * FROM ControlPresets WHERE MonitorId = ?';
$labels = array();
foreach( dbFetchAll( $sql, NULL, array( $monitor->Id() ) ) as $row ) {
foreach ( dbFetchAll($sql, NULL, array($monitor->Id())) as $row ) {
$labels[$row['Preset']] = $row['Label'];
}
@ -162,7 +162,7 @@ function controlPresets($monitor, $cmds) {
<?php
for ( $i = 1; $i <= $control->NumPresets(); $i++ ) {
?>
<button type="button" class="ptzNumBtn" title="<?php echo isset($labels[$i])?htmlentities($labels[$i]):'' ?>" value="<?php echo $i ?>" onclick="controlCmd('<?php echo $cmds['PresetGoto'] ?><?php echo $i ?>');"/><?php echo $i ?></button>
<button type="button" class="ptzNumBtn" title="<?php echo isset($labels[$i])?htmlentities($labels[$i]):'' ?>" value="<?php echo $i ?>" data-on-click-this="controlCmd" value="<?php echo $cmds['PresetGoto'] ?><?php echo $i ?>"/><?php echo $i ?></button>
<?php
} // end foreach preset
?>
@ -171,7 +171,7 @@ function controlPresets($monitor, $cmds) {
<?php
if ( $control->HasHomePreset() ) {
?>
<button type="button" class="ptzTextBtn" value="Home" onclick="controlCmd('<?php echo $cmds['PresetHome'] ?>');"><?php echo translate('Home') ?></button>
<button type="button" class="ptzTextBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['PresetHome'] ?>"><?php echo translate('Home') ?></button>
<?php
}
if ( canEdit('Monitors') && $control->CanSetPresets() ) {
@ -196,22 +196,22 @@ function controlPower($monitor, $cmds) {
<?php
if ( $control->CanWake() ) {
?>
<button type="button" class="ptzTextBtn" value="Wake" onclick="controlCmd('<?php echo $cmds['Wake'] ?>')"><?php echo translate('Wake') ?></button>
<button type="button" class="ptzTextBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['Wake'] ?>"><?php echo translate('Wake') ?></button>
<?php
}
if ( $control->CanSleep() ) {
?>
<button type="button" class="ptzTextBtn" value="Sleep" onclick="controlCmd('<?php echo $cmds['Sleep'] ?>')"><?php echo translate('Sleep') ?></button>
<button type="button" class="ptzTextBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['Sleep'] ?>"><?php echo translate('Sleep') ?></button>
<?php
}
if ( $control->CanReset() ) {
?>
<button type="button" class="ptzTextBtn" value="Reset" onclick="controlCmd('<?php echo $cmds['Reset'] ?>')"><?php echo translate('Reset') ?></button>
<button type="button" class="ptzTextBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['Reset'] ?>"><?php echo translate('Reset') ?></button>
<?php
}
if ( $control->CanReboot() ) {
?>
<button type="button" class="ptzTextBtn" value="Reboot" onclick="controlCmd('<?php echo $cmds['Reboot'] ?>')"><?php echo translate('Reboot') ?></button>
<button type="button" class="ptzTextBtn" data-on-click-this="controlCmd" value="<?php echo $cmds['Reboot'] ?>"><?php echo translate('Reboot') ?></button>
<?php
}
?>

View File

@ -280,7 +280,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
?>
<td class="colName">
<i class="material-icons md-18 <?php echo $dot_class ?>">lens</i>
<a <?php echo ($stream_available ? 'href="?view=watch&amp;mid='.$monitor['Id'].'">' : '>') . $monitor['Name'] ?></a><br/>
<a <?php echo ($stream_available ? 'href="?view=watch&amp;mid='.$monitor['Id'].'">' : '>') . validHtmlStr($monitor['Name']) ?></a><br/>
<div class="small text-nowrap text-muted">
<?php echo implode('<br/>',
@ -290,7 +290,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
$Groups = $Group->Parents();
array_push( $Groups, $Group );
}
return implode(' &gt; ', array_map(function($Group){ return '<a href="?view=montagereview&amp;GroupId='.$Group->Id().'">'.$Group->Name().'</a>'; }, $Groups ));
return implode(' &gt; ', array_map(function($Group){ return '<a href="?view=montagereview&amp;GroupId='.$Group->Id().'">'.validHtmlStr($Group->Name()).'</a>'; }, $Groups ));
}, $Monitor->GroupIds() ) );
?>
</div></td>
@ -315,13 +315,13 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
</div></td>
<?php
if ( count($servers) ) { ?>
<td class="colServer"><?php $Server = isset($ServersById[$monitor['ServerId']]) ? $ServersById[$monitor['ServerId']] : new ZM\Server($monitor['ServerId']); echo $Server->Name(); ?></td>
<td class="colServer"><?php $Server = isset($ServersById[$monitor['ServerId']]) ? $ServersById[$monitor['ServerId']] : new ZM\Server($monitor['ServerId']); echo validHtmlStr($Server->Name()); ?></td>
<?php
}
echo '<td class="colSource">'. makePopupLink( '?view=monitor&amp;mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$source_class.'">'.validHtmlStr($Monitor->Source()).'</span>', canEdit('Monitors') ).'</td>';
if ( $show_storage_areas ) {
?>
<td class="colStorage"><?php if ( isset($StorageById[$monitor['StorageId']]) ) { echo $StorageById[ $monitor['StorageId'] ]->Name(); } ?></td>
<td class="colStorage"><?php if ( isset($StorageById[$monitor['StorageId']]) ) { echo validHtmlStr($StorageById[$monitor['StorageId']]->Name()); } ?></td>
<?php
}

View File

@ -131,16 +131,16 @@ if ( !$Event->Id() ) {
?>
<div id="dataBar">
<span id="dataId" title="<?php echo translate('Id') ?>"><?php echo $Event->Id() ?></span>
<span id="dataMonitor" title="<?php echo translate('Monitor') ?>"><?php echo $Monitor->Id() . ' ' . $Monitor->Name() ?></span>
<span id="dataMonitor" title="<?php echo translate('Monitor') ?>"><?php echo $Monitor->Id().' '.validHtmlStr($Monitor->Name()) ?></span>
<span id="dataCause" title="<?php echo $Event->Notes()?validHtmlStr($Event->Notes()):translate('AttrCause') ?>"><?php echo validHtmlStr($Event->Cause()) ?></span>
<span id="dataTime" title="<?php echo translate('Time') ?>"><?php echo strftime( STRF_FMT_DATETIME_SHORT, strtotime($Event->StartTime() ) ) ?></span>
<span id="dataTime" title="<?php echo translate('Time') ?>"><?php echo strftime(STRF_FMT_DATETIME_SHORT, strtotime($Event->StartTime())) ?></span>
<span id="dataDuration" title="<?php echo translate('Duration') ?>"><?php echo $Event->Length().'s' ?></span>
<span id="dataFrames" title="<?php echo translate('AttrFrames').'/'.translate('AttrAlarmFrames') ?>"><?php echo $Event->Frames() ?>/<?php echo $Event->AlarmFrames() ?></span>
<span id="dataScore" title="<?php echo translate('AttrTotalScore').'/'.translate('AttrAvgScore').'/'.translate('AttrMaxScore') ?>"><?php echo $Event->TotScore() ?>/<?php echo $Event->AvgScore() ?>/<?php echo $Event->MaxScore() ?></span>
<span id="Storage">
<?php echo
human_filesize($Event->DiskSpace(null)) . ' on ' . $Event->Storage()->Name().
( $Event->SecondaryStorageId() ? ', ' . $Event->SecondaryStorage()->Name() :'' )
human_filesize($Event->DiskSpace(null)) . ' on ' . validHtmlStr($Event->Storage()->Name()).
( $Event->SecondaryStorageId() ? ', '.validHtmlStr($Event->SecondaryStorage()->Name()) : '' )
?></span>
<div id="closeWindow"><a href="#" onclick="<?php echo $popup ? 'window.close()' : 'window.history.back();return false;' ?>"><?php echo $popup ? translate('Close') : translate('Back') ?></a></div>
</div>

View File

@ -156,8 +156,10 @@ foreach ( dbFetchAll('SELECT `Id`, `Name` FROM `Monitors` ORDER BY lower(`Name`)
$zones = array();
foreach ( dbFetchAll('SELECT Id, Name, MonitorId FROM Zones ORDER BY lower(`Name`) ASC') as $zone ) {
if ( visibleMonitor($zone['MonitorId']) ) {
$zone['Name'] = validHtmlStr($monitors[$zone['MonitorId']]->Name().': '.$zone['Name']);
$zones[$zone['Id']] = new ZM\Zone($zone);
if ( isset($monitors[$zone['MonitorId']]) ) {
$zone['Name'] = validHtmlStr($monitors[$zone['MonitorId']]->Name().': '.$zone['Name']);
$zones[$zone['Id']] = new ZM\Zone($zone);
}
}
}

View File

@ -73,7 +73,7 @@ function group_line( $Group ) {
} else {
$html .= validHtmlStr($Group->Name());
}
$html .= '</td><td class="colIds">'. monitorIdsToNames($Group->MonitorIds(), 30).'</td>';
$html .= '</td><td class="colIds">'. validHtmlStr(monitorIdsToNames($Group->MonitorIds(), 30)).'</td>';
if ( canEdit('Groups') ) {
$html .= '<td class="colSelect"><input type="checkbox" name="gid[]" value="'. $Group->Id() .'" data-on-click-this="configureButtons"/></td>';
}

View File

@ -34,7 +34,7 @@ var eventData = {
StartTime: '<?php echo $Event->StartTime() ?>',
EndTime: '<?php echo $Event->EndTime() ?>',
Frames: '<?php echo $Event->Frames() ?>',
MonitorName: '<?php echo $Monitor->Name() ?>'
MonitorName: '<?php echo validJsStr($Monitor->Name()) ?>'
};
var monitorUrl = '<?php echo $Event->Storage()->Server()->UrlToIndex(); ?>';
@ -46,7 +46,7 @@ var rate = '<?php echo $rate ?>'; // really only used when setting up initial pl
var scale = "<?php echo $scale ?>";
var LabelFormat = "<?php echo validJsStr($Monitor->LabelFormat())?>";
var canEditEvents = <?php echo canEdit( 'Events' )?'true':'false' ?>;
var canEditEvents = <?php echo canEdit('Events')?'true':'false' ?>;
var streamTimeout = <?php echo 1000*ZM_WEB_REFRESH_STATUS ?>;
var canStreamNative = <?php echo canStreamNative()?'true':'false' ?>;
@ -55,8 +55,8 @@ var streamMode = '<?php echo $streamMode ?>';
//
// Strings
//
var deleteString = "<?php echo translate('Delete') ?>";
var causeString = "<?php echo translate('AttrCause') ?>";
var deleteString = "<?php echo validJsStr(translate('Delete')) ?>";
var causeString = "<?php echo validJsStr(translate('AttrCause')) ?>";
var WEB_LIST_THUMB_WIDTH = '<?php echo ZM_WEB_LIST_THUMB_WIDTH ?>';
var WEB_LIST_THUMB_HEIGHT = '<?php echo ZM_WEB_LIST_THUMB_HEIGHT ?>';
var popup = '<?php echo $popup ?>';

View File

@ -151,6 +151,11 @@ function deleteFilter( element ) {
form.submit();
}
}
var escape = document.createElement('textarea');
function escapeHTML(html) {
escape.textContent = html;
return escape.innerHTML;
}
function parseRows(rows) {
for ( var rowNum = 0; rowNum < rows.length; rowNum++ ) { //Each row is a term
@ -245,7 +250,7 @@ function parseRows(rows) {
} else if ( attr == 'MonitorName' ) { //Monitor names
var monitorSelect = $j('<select></select>').attr('name', queryPrefix + rowNum + '][val]').attr('id', queryPrefix + rowNum + '][val]');
for ( var monitor_id in monitors ) {
monitorSelect.append('<option value="' + monitors[monitor_id].Name + '">' + monitors[monitor_id].Name + '</option>');
monitorSelect.append('<option value="' + monitors[monitor_id].Name + '">' + escapeHTML(monitors[monitor_id].Name) + '</option>');
}
var monitorVal = inputTds.eq(4).children().val();
inputTds.eq(4).html(monitorSelect).children().val(monitorVal);

View File

@ -3,7 +3,7 @@ var server_utc_offset = <?php
$TimeZone = new DateTimeZone( ini_get('date.timezone') );
$now = new DateTime('now', $TimeZone);
$offset = $TimeZone->getOffset($now);
echo $offset . '; // ' . floor($offset / 3600) . ' hours ';
echo $offset.'; // '.floor($offset / 3600).' hours ';
?>
var currentScale=<?php echo $defaultScale?>;
@ -182,18 +182,18 @@ foreach ( $monitors as $m ) {
echo " monitorLoading[" . $m->Id() . "]=false;\n";
echo " monitorImageURL[" . $m->Id() . "]='".$m->getStreamSrc( array('mode'=>'single','scale'=>$defaultScale*100), '&' )."';\n";
echo " monitorLoadingStageURL[" . $m->Id() . "] = '';\n";
echo " monitorColour[" . $m->Id() . "]=\"" . $m->WebColour() . "\";\n";
echo " monitorWidth[" . $m->Id() . "]=" . $m->ViewWidth() . ";\n";
echo " monitorHeight[" . $m->Id() . "]=" . $m->ViewHeight() . ";\n";
echo " monitorColour[" . $m->Id() . "]=\"" . validHtmlStr($m->WebColour()) . "\";\n";
echo " monitorWidth[" . $m->Id() . "]=" . validHtmlStr($m->ViewWidth()) . ";\n";
echo " monitorHeight[" . $m->Id() . "]=" . validHtmlStr($m->ViewHeight()) . ";\n";
echo " monitorIndex[" . $m->Id() . "]=" . $numMonitors . ";\n";
echo " monitorServerId[" . $m->Id() . "]='" .($m->ServerId() ? $m->ServerId() : '0'). "';\n";
echo " monitorName[" . $m->Id() . "]=\"" . $m->Name() . "\";\n";
echo " monitorName[" . $m->Id() . "]=\"" . validHtmlStr($m->Name()) . "\";\n";
echo " monitorLoadStartTimems[" . $m->Id() . "]=0;\n";
echo " monitorLoadEndTimems[" . $m->Id() . "]=0;\n";
echo " monitorNormalizeScale[" . $m->Id() . "]=" . sqrt($avgArea / ($m->Width() * $m->Height() )) . ";\n";
$zoomScale=1.0;
if(isset($_REQUEST[ 'z' . $m->Id() ]) )
$zoomScale = floatval( validHtmlStr($_REQUEST[ 'z' . $m->Id() ]) );
if ( isset($_REQUEST['z'.$m->Id()]) )
$zoomScale = floatval(validHtmlStr($_REQUEST['z'.$m->Id()]));
echo " monitorZoomScale[" . $m->Id() . "]=" . $zoomScale . ";\n";
echo " monitorPtr[" . $numMonitors . "]=" . $m->Id() . ";\n";
$numMonitors += 1;
@ -205,14 +205,14 @@ var maxTimeSecs=parseInt($maxTimeSecs);
var minTime='$minTime';
var maxTime='$maxTime';
";
echo "var rangeTimeSecs=" . ( $maxTimeSecs - $minTimeSecs + 1) . ";\n";
if(isset($defaultCurrentTime))
echo "var currentTimeSecs=parseInt(" . strtotime($defaultCurrentTime) . ");\n";
echo 'var rangeTimeSecs='.($maxTimeSecs - $minTimeSecs + 1).";\n";
if ( isset($defaultCurrentTime) )
echo 'var currentTimeSecs=parseInt('.strtotime($defaultCurrentTime).");\n";
else
echo "var currentTimeSecs=parseInt(" . ($minTimeSecs + $maxTimeSecs)/2 . ");\n";
echo 'var currentTimeSecs=parseInt('.(($minTimeSecs + $maxTimeSecs)/2).");\n";
echo 'var speeds=[';
for ($i=0; $i<count($speeds); $i++)
for ( $i=0; $i < count($speeds); $i++ )
echo (($i>0)?', ':'') . $speeds[$i];
echo "];\n";
?>

View File

@ -672,8 +672,12 @@ function getControlResponse(respObj, respText) {
}
}
function controlCmd( control, event, xtell, ytell ) {
var locParms = "";
function controlCmd(button) {
control = button.getAttribute('value');
xtell = button.getAttribute('xtell');
ytell = button.getAttribute('ytell');
var locParms = '';
if ( event && (xtell || ytell) ) {
console.log(event);
var target = event.target;
@ -689,7 +693,7 @@ function controlCmd( control, event, xtell, ytell ) {
} else if ( xtell == 2 ) {
xge = 2*(50 - xge);
}
locParms += "&xge="+xge;
locParms += '&xge='+xge;
}
if ( ytell ) {
var yge = parseInt( (y*100)/coords.height );
@ -698,7 +702,7 @@ function controlCmd( control, event, xtell, ytell ) {
} else if ( ytell == 2 ) {
yge = 2*(50 - yge);
}
locParms += "&yge="+yge;
locParms += '&yge='+yge;
}
}
controlReq.send(controlParms+"&control="+control+locParms);

View File

@ -320,7 +320,7 @@ getBodyTopHTML();
<?php
// Monitor images - these had to be loaded after the monitors used were determined (after loading events)
foreach ( $monitors as $m ) {
echo '<canvas title="'.$m->Id().' ' .$m->Name().'" width="' . $m->Width() * $defaultScale . '" height="' . $m->Height() * $defaultScale . '" id="Monitor' . $m->Id() . '" style="border:1px solid ' . $m->WebColour() . '" monitor_id="'.$m->Id().'">No Canvas Support!!</canvas>
echo '<canvas title="'.$m->Id().' '.validHtmlStr($m->Name()).'" width="'.($m->Width() * $defaultScale).'" height="'.($m->Height() * $defaultScale).'" id="Monitor'.$m->Id().'" style="border:1px solid '.$m->WebColour().'" monitor_id="'.$m->Id().'">No Canvas Support!!</canvas>
';
}
?>

View File

@ -25,12 +25,12 @@ $filterbar = ob_get_contents();
ob_end_clean();
noCacheHeaders();
xhtmlHeaders( __FILE__, translate('Console') );
xhtmlHeaders( __FILE__, translate('Console'));
if ( isset($_REQUEST['minTime']) ) {
$minTime = validHtmlStr($_REQUEST['minTime']);
} else {
$minTime = strftime('%FT%T',time() - (2*3600) );
$minTime = strftime('%FT%T', time() - (2*3600));
}
if ( isset($_REQUEST['maxTime']) ) {
$maxTime = validHtmlStr($_REQUEST['maxTime']);
@ -47,13 +47,13 @@ $filter = array(
),
);
if ( count($selected_monitor_ids) ) {
$filter['Query']['terms'][] = (array('attr'=>'MonitorId', 'op'=>'IN', 'val'=>implode(',',$selected_monitor_ids), 'cnj'=>'and'));
$filter['Query']['terms'][] = (array('attr'=>'MonitorId', 'op'=>'IN', 'val'=>implode(',', $selected_monitor_ids), 'cnj'=>'and'));
} else if ( ( $group_id != 0 || isset($_SESSION['ServerId']) || isset($_SESSION['StorageId']) || isset($_SESSION['Status']) ) ) {
# this should be redundant
for ($i=0; $i < count($displayMonitors); $i++) {
if ($i == '0') {
for ( $i=0; $i < count($displayMonitors); $i++ ) {
if ( $i == 0 ) {
$filter['Query']['terms'][] = array('attr'=>'MonitorId', 'op'=>'=', 'val'=>$displayMonitors[$i]['Id'], 'cnj'=>'and', 'obr'=>'1');
} else if ($i == (count($displayMonitors)-1)) {
} else if ( $i == count($displayMonitors)-1 ) {
$filter['Query']['terms'][] = array('attr'=>'MonitorId', 'op'=>'=', 'val'=>$displayMonitors[$i]['Id'], 'cnj'=>'or', 'cbr'=>'1');
} else {
$filter['Query']['terms'][] = array('attr'=>'MonitorId', 'op'=>'=', 'val'=>$displayMonitors[$i]['Id'], 'cnj'=>'or');
@ -70,11 +70,11 @@ $eventsSql = 'SELECT *,
FROM Events AS E
WHERE 1 > 0
';
if ( ! empty($user['MonitorIds']) ) {
if ( !empty($user['MonitorIds']) ) {
$eventsSql .= ' AND MonitorId IN ('.$user['MonitorIds'].')';
}
if ( count($selected_monitor_ids) ) {
$eventsSql .= ' AND MonitorId IN (' . implode(',',$selected_monitor_ids).')';
$eventsSql .= ' AND MonitorId IN ('.implode(',', $selected_monitor_ids).')';
}
if ( isset($minTime) && isset($maxTime) ) {
$eventsSql .= " AND EndTime > '" . $minTime . "' AND StartTime < '" . $maxTime . "'";
@ -87,10 +87,10 @@ if ( !$result ) {
return;
}
$EventsByMonitor = array();
while( $event = $result->fetch(PDO::FETCH_ASSOC) ) {
while ( $event = $result->fetch(PDO::FETCH_ASSOC) ) {
$Event = new ZM\Event($event);
if ( ! isset($EventsByMonitor[$event['MonitorId']]) )
$EventsByMonitor[$event['MonitorId']] = array( 'Events'=>array(), 'MinGap'=>0, 'MaxGap'=>0, 'FileMissing'=>array(), 'ZeroSize'=>array() );
$EventsByMonitor[$event['MonitorId']] = array('Events'=>array(), 'MinGap'=>0, 'MaxGap'=>0, 'FileMissing'=>array(), 'ZeroSize'=>array());
if ( count($EventsByMonitor[$event['MonitorId']]['Events']) ) {
$last_event = end($EventsByMonitor[$event['MonitorId']]['Events']);
@ -103,7 +103,7 @@ while( $event = $result->fetch(PDO::FETCH_ASSOC) ) {
$EventsByMonitor[$event['MonitorId']]['MaxGap'] = $gap;
} # end if has previous events
if ( ! $Event->file_exists() ) {
if ( !$Event->file_exists() ) {
$EventsByMonitor[$event['MonitorId']]['FileMissing'][] = $Event;
} else if ( ! $Event->file_size() ) {
$EventsByMonitor[$event['MonitorId']]['ZeroSize'][] = $Event;
@ -122,8 +122,8 @@ while( $event = $result->fetch(PDO::FETCH_ASSOC) ) {
<?php echo $filterbar ?>
<div id="DateTimeDiv">
<label>Event Start Time</label>
<input type="text" name="minTime" id="minTime" value="<?php echo preg_replace('/T/', ' ', $minTime ) ?>" oninput="this.form.submit();"/> to
<input type="text" name="maxTime" id="maxTime" value="<?php echo preg_replace('/T/', ' ', $maxTime ) ?>" oninput="this.form.submit();"/>
<input type="text" name="minTime" id="minTime" value="<?php echo preg_replace('/T/', ' ', $minTime) ?>" oninput="this.form.submit();"/> to
<input type="text" name="maxTime" id="maxTime" value="<?php echo preg_replace('/T/', ' ', $maxTime) ?>" oninput="this.form.submit();"/>
</div>
</div><!--FilterBar-->
@ -145,10 +145,10 @@ while( $event = $result->fetch(PDO::FETCH_ASSOC) ) {
</thead>
<tbody>
<?php
for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
for ( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
$monitor = $displayMonitors[$monitor_i];
$Monitor = new ZM\Monitor($monitor);
$montagereview_link = "?view=montagereview&live=0&MonitorId=". $monitor['Id'] . '&minTime='.$minTime.'&maxTime='.$maxTime;
$montagereview_link = '?view=montagereview&live=0&MonitorId='.$monitor['Id'].'&minTime='.$minTime.'&maxTime='.$maxTime;
$monitor_filter = addFilterTerm(
$filter,
@ -178,7 +178,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
$FileMissing_filter = array(
'Query' => array(
'terms' => array(
array('attr'=>'Id','op'=>'IN', 'val'=>implode(',',array_map(function($Event){return $Event->Id();},$FileMissing)))
array('attr'=>'Id', 'op'=>'IN', 'val'=>implode(',', array_map(function($Event){return $Event->Id();}, $FileMissing)))
)
)
);
@ -188,7 +188,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
$ZeroSize_filter = array(
'Query' => array(
'terms' => array(
array('attr'=>'Id','op'=>'IN', 'val'=>implode(',',array_map(function($Event){return $Event->Id();},$ZeroSize)))
array('attr'=>'Id', 'op'=>'IN', 'val'=>implode(',', array_map(function($Event){return $Event->Id();}, $ZeroSize)))
)
)
);
@ -198,27 +198,28 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
<tr id="<?php echo 'monitor_id-'.$monitor['Id'] ?>" title="<?php echo $monitor['Id'] ?>">
<td class="colId"><a href="<?php echo $montagereview_link ?>"><?php echo $monitor['Id'] ?></a></td>
<td class="colName">
<a href="<?php echo $montagereview_link ?>"><?php echo $monitor['Name'] ?></a><br/><div class="small text-nowrap text-muted">
<a href="<?php echo $montagereview_link ?>"><?php echo validHtmlStr($monitor['Name']) ?></a><br/>
<div class="small text-nowrap text-muted">
<?php echo implode('<br/>',
array_map(function($group_id){
$Group = new ZM\Group($group_id);
$Groups = $Group->Parents();
array_push($Groups, $Group);
return implode(' &gt; ', array_map(function($Group){ return '<a href="?view=montagereview&GroupId='.$Group->Id().'">'.$Group->Name().'</a>'; }, $Groups ));
}, $Monitor->GroupIds() ) );
}, $Monitor->GroupIds()));
?>
</div></td>
<td class="colServer"><?php echo $Monitor->Server()->Name()?></td>
<td class="colServer"><?php echo validHtmlStr($Monitor->Server()->Name())?></td>
<td class="colEvents"><a href="?view=<?php echo ZM_WEB_EVENTS_VIEW ?>&amp;page=1<?php echo $monitor_filter['query'] ?>"><?php echo isset($EventsByMonitor[$Monitor->Id()])?count($EventsByMonitor[$Monitor->Id()]['Events']):0 ?></a></td>
<td class="colFirstEvent"><?php echo $FirstEvent ? $FirstEvent->link_to($FirstEvent->Id().' at ' . $FirstEvent->StartTime()) : 'none'?></td>
<td class="colLastEvent"><?php echo $LastEvent ? $LastEvent->link_to($LastEvent->Id().' at ' . $LastEvent->StartTime()) : 'none'?></td>
<td class="colFirstEvent"><?php echo $FirstEvent ? $FirstEvent->link_to($FirstEvent->Id().' at '.$FirstEvent->StartTime()) : 'none'?></td>
<td class="colLastEvent"><?php echo $LastEvent ? $LastEvent->link_to($LastEvent->Id().' at '.$LastEvent->StartTime()) : 'none'?></td>
<td class="colMinGap"><?php echo $MinGap ?></td>
<td class="colMaxGap"><?php echo $MaxGap ?></td>
<td class="colFileMissing<?php echo count($FileMissing) ? ' errorText' : ''?>">
<?php echo count($FileMissing) ? '<a href="?view='.ZM_WEB_EVENTS_VIEW .'&amp;page=1'.$FileMissing_filter['query'].'">'.count($FileMissing).'</a>' : '0' ?>
<?php echo count($FileMissing) ? '<a href="?view='.ZM_WEB_EVENTS_VIEW.'&amp;page=1'.$FileMissing_filter['query'].'">'.count($FileMissing).'</a>' : '0' ?>
</td>
<td class="colZeroSize<?php echo count($ZeroSize) ? ' errorText' : ''?>">
<?php echo count($ZeroSize) ? '<a href="?view='.ZM_WEB_EVENTS_VIEW .'&amp;page=1'.$ZeroSize_filter['query'].'">'.count($ZeroSize).'</a>' : '0' ?>
<?php echo count($ZeroSize) ? '<a href="?view='.ZM_WEB_EVENTS_VIEW.'&amp;page=1'.$ZeroSize_filter['query'].'">'.count($ZeroSize).'</a>' : '0' ?>
</td>
</tr>
<?php

View File

@ -1,6 +1,6 @@
<?php
//
// ZoneMinder web watch feed view file, $Date$, $Revision$
// ZoneMinder web watch feed view file
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
@ -53,17 +53,16 @@ $connkey = generateConnKey();
$streamMode = getStreamMode();
noCacheHeaders();
$popup = ((isset($_REQUEST['popup'])) && ($_REQUEST['popup'] == 1));
noCacheHeaders();
xhtmlHeaders(__FILE__, $monitor->Name().' - '.translate('Feed'));
?>
<body>
<div id="page">
<?php if ( !$popup ) echo getNavBarHTML() ?>
<div id="header">
<div id="monitorName"><?php echo $monitor->Name() ?></div>
<div id="monitorName"><?php echo validHtmlStr($monitor->Name()) ?></div>
<div id="menuControls">
<?php
if ( canView('Control') && $monitor->Type() == 'Local' ) {

View File

@ -1,6 +1,6 @@
<?php
//
// ZoneMinder file view file, $Date: 2008-09-29 14:15:13 +0100 (Mon, 29 Sep 2008) $, $Revision: 2640 $
// ZoneMinder file view file
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
@ -23,11 +23,13 @@ if ( !canView('Events') ) {
return;
}
$archivetype = $_REQUEST['type'];
$connkey = isset($_REQUEST['connkey'])?$_REQUEST['connkey']:'';
$archivetype = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';
if ( !$archivetype ) {
ZM\Error('No archive type given to archive.php. Please specify a tar or zip archive.');
return;
}
if ( $archivetype ) {
switch ($archivetype) {
switch ($archivetype) {
case 'tar.gz':
$mimetype = 'gzip';
$file_ext = 'tar.gz';
@ -43,31 +45,29 @@ if ( $archivetype ) {
default:
$mimetype = NULL;
$file_ext = NULL;
}
}
if ( $mimetype ) {
$filename = "zmExport_$connkey.$file_ext";
$filename_path = ZM_DIR_EXPORTS.'/'.$filename;
ZM\Logger::Debug("downloading archive from $filename_path");
if ( is_readable($filename_path) ) {
while (ob_get_level()) {
ZM\Logger::Debug('Clearing ob');
ob_end_clean();
}
header("Content-type: application/$mimetype" );
header("Content-Disposition: inline; filename=$filename");
header('Content-Length: '.filesize($filename_path));
set_time_limit(0);
if ( ! @readfile($filename_path) ) {
ZM\Error("Error sending $filename_path");
}
} else {
ZM\Error("$filename_path does not exist or is not readable.");
}
} else {
ZM\Error('Unsupported archive type specified. Supported archives are tar and zip');
if ( !$mimetype ) {
ZM\Error('Unsupported archive type specified. Supported archives are tar and zip');
return;
}
$connkey = isset($_REQUEST['connkey'])?$_REQUEST['connkey']:'';
$filename = "zmExport_$connkey.$file_ext";
$filename_path = ZM_DIR_EXPORTS.'/'.$filename;
ZM\Logger::Debug("downloading archive from $filename_path");
if ( is_readable($filename_path) ) {
while (ob_get_level()) {
ob_end_clean();
}
header("Content-type: application/$mimetype");
header("Content-Disposition: inline; filename=$filename");
header('Content-Length: '.filesize($filename_path));
set_time_limit(0);
if ( !@readfile($filename_path) ) {
ZM\Error("Error sending $filename_path");
}
} else {
ZM\Error('No archive type given to archive.php. Please specify a tar or zip archive.');
ZM\Error($filename_path.' does not exist or is not readable.');
}
?>