Merge branch 'master' into reports

pull/3588/head
Isaac Connor 2022-08-31 18:38:08 +02:00
commit 4eeb49d09a
17 changed files with 198 additions and 182 deletions

View File

@ -440,7 +440,7 @@ if(NOT ZM_NO_PRCE)
endif()
if(NOT ZM_NO_MQTT)
find_package(Mosquitto)
find_package(MOSQUITTO)
if(MOSQUITTO_FOUND)
include_directories(${MOSQUITTO_INCLUDE_DIRS})
list(APPEND ZM_BIN_LIBS "${MOSQUITTO_LIBRARIES}")
@ -449,7 +449,7 @@ if(NOT ZM_NO_MQTT)
set(optlibsnotfound "${optlibsnotfound} Mosquitto")
endif (MOSQUITTO_FOUND)
find_package(Mosquittopp)
find_package(MOSQUITTOPP)
if(MOSQUITTOPP_FOUND)
include_directories(${MOSQUITTOPP_INCLUDE_DIRS})
list(APPEND ZM_BIN_LIBS "${MOSQUITTOPP_LIBRARIES}")

View File

@ -76,7 +76,7 @@ Event::Event(
if (start_time.time_since_epoch() == Seconds(0)) {
Warning("Event has zero time, setting to now");
start_time = now;
end_time = start_time = now;
} else if (start_time > now) {
char buffer[26];
char buffer_now[26];
@ -92,7 +92,7 @@ Event::Event(
Error("StartDateTime in the future. Difference: %" PRIi64 " s\nstarttime: %s\nnow: %s",
static_cast<int64>(std::chrono::duration_cast<Seconds>(now - start_time).count()),
buffer, buffer_now);
start_time = now;
end_time = start_time = now;
}
unsigned int state_id = 0;

View File

@ -387,7 +387,7 @@ void Logger::openFile() {
if (mLogFile.size()) {
if ( (mLogFileFP = fopen(mLogFile.c_str(), "a")) == nullptr ) {
mFileLevel = NOLOG;
Error("fopen() for %s %d, error = %s", mLogFile.c_str(), mLogFile.size(), strerror(errno));
Error("fopen() for %s %zu, error = %s", mLogFile.c_str(), mLogFile.size(), strerror(errno));
}
} else {
puts("Called Logger::openFile() without a filename");

View File

@ -2662,11 +2662,13 @@ bool Monitor::Decode() {
} // end if have convert_context
} // end if need transfer to image
} else {
Debug(1, "No packet.size(%d) or packet->in_frame(%p). Not decoding", packet->packet->size, packet->in_frame.get());
Debug(1, "Ret from decode %d, zm_terminate %d", ret, zm_terminate);
}
} else {
Debug(1, "Not Decoding ? %s", Decoding_Strings[decoding].c_str());
} // end if doing decoding
} else {
Debug(1, "No packet.size(%d) or packet->in_frame(%p). Not decoding", packet->packet->size, packet->in_frame.get());
} // end if need_decoding
if (packet->image) {

View File

@ -39,7 +39,12 @@ class Server extends ZM_Object {
} else if ( $this->Id() ) {
return $this->{'Name'};
}
if (isset($_SERVER['HTTP_HOST'])) {
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
return $_SERVER['HTTP_X_FORWARDED_HOST'];
} else if (isset($_SERVER['HTTP_X_FORWARDED_SERVER'])) {
return $_SERVER['HTTP_X_FORWARDED_SERVER'];
} else if (isset($_SERVER['HTTP_HOST'])) {
# This theoretically will match ipv6 addresses as well
if ( preg_match( '/^(\[[[:xdigit:]:]+\]|[^:]+)(:[[:digit:]]+)?$/', $_SERVER['HTTP_HOST'], $matches ) ) {
return $matches[1];

View File

@ -62,6 +62,7 @@ if ($action == 'save') {
}
}
$newMonitor['ManufacturerId'] = $newManufacturer->Id();
unset($newMonitor['Manufacturer']);
}
if (!$newMonitor['ModelId'] and ($newMonitor['Model'] != '')) {
@ -77,6 +78,7 @@ if ($action == 'save') {
}
}
$newMonitor['ModelId'] = $newModel->Id();
unset($newMonitor['Model']);
}
$monitor = new ZM\Monitor($mid);

View File

@ -2345,17 +2345,17 @@ function get_subnets($interface) {
return $subnets;
}
function extract_auth_values_from_url($url): array {
function extract_auth_values_from_url($url) {
$protocolPrefixPos = strpos($url, '://');
if( $protocolPrefixPos === false )
if ($protocolPrefixPos === false)
return array();
$authSeparatorPos = strpos($url, '@', $protocolPrefixPos+3);
if( $authSeparatorPos === false )
if ($authSeparatorPos === false)
return array();
$fieldsSeparatorPos = strpos($url, ':', $protocolPrefixPos+3);
if( $fieldsSeparatorPos === false || $authSeparatorPos < $fieldsSeparatorPos )
if ($fieldsSeparatorPos === false || $authSeparatorPos < $fieldsSeparatorPos)
return array();
$username = substr( $url, $protocolPrefixPos+3, $fieldsSeparatorPos-($protocolPrefixPos+3) );

View File

@ -548,25 +548,27 @@ function MonitorStream(monitorData) {
const captureFPSValue = $j('#captureFPSValue'+this.id);
const analysisFPSValue = $j('#analysisFPSValue'+this.id);
const fpses = respObj.monitor.FrameRate.split(",");
fpses.forEach(function(fps) {
const name_values = fps.split(':');
const name = name_values[0].trim();
const value = name_values[1].trim().toLocaleString(undefined, {minimumFractionDigits: 1, maximumFractionDigits: 1});
if (respObj.monitor.FrameRate) {
const fpses = respObj.monitor.FrameRate.split(",");
fpses.forEach(function(fps) {
const name_values = fps.split(':');
const name = name_values[0].trim();
const value = name_values[1].trim().toLocaleString(undefined, {minimumFractionDigits: 1, maximumFractionDigits: 1});
if (name == 'analysis') {
this.status.analysisfps = value;
if (analysisFPSValue.length && (analysisFPSValue.text() != value)) {
analysisFPSValue.text(value);
if (name == 'analysis') {
this.status.analysisfps = value;
if (analysisFPSValue.length && (analysisFPSValue.text() != value)) {
analysisFPSValue.text(value);
}
} else if (name == 'capture') {
if (captureFPSValue.length && (captureFPSValue.text() != value)) {
captureFPSValue.text(value);
}
} else {
console.log("Unknown fps name " + name);
}
} else if (name == 'capture') {
if (captureFPSValue.length && (captureFPSValue.text() != value)) {
captureFPSValue.text(value);
}
} else {
console.log("Unknown fps name " + name);
}
});
});
}
if (canEdit.Monitors) {
if (monitorStatus.enabled) {

View File

@ -69,17 +69,8 @@ tr td input[type="checkbox"],
tr td input[type="radio"] {
margin: 6px 0;
}
.tab-content,
.tab-content .active {
width: 100%;
}
.tab-content .active table {
width: 100%;
table-layout: fixed;
}
.tab-content .active table tr {
height: 32px;
}
.tab-content .active table td.text-right {
width: 245px;
.tab-pane td:first-child {
padding-right: 1rem;
text-align: right;
}

View File

@ -421,8 +421,7 @@ function getStorageHTML() {
$result = '';
if ( !canView('System') ) return $result;
$func = function($S) {
$class = '';
$func = function($S, $class='') {
if ( $S->disk_usage_percent() > 98 ) {
$class = 'text-danger';
} else if ( $S->disk_usage_percent() > 90 ) {
@ -430,7 +429,7 @@ function getStorageHTML() {
}
$title = human_filesize($S->disk_used_space()) . ' of ' . human_filesize($S->disk_total_space()).
( ( $S->disk_used_space() != $S->event_disk_space() ) ? ' ' .human_filesize($S->event_disk_space()) . ' used by events' : '' );
return '<a class="dropdown-item '.$class.'" title="'.$title.'" href="?view=options&amp;tab=storage">'.validHtmlStr($S->Name()) . ': ' . $S->disk_usage_percent().'%' . '</a>';
return '<a class="'.$class.'" title="'.$title.'" href="?view=options&amp;tab=storage">'.validHtmlStr($S->Name()) . ': ' . $S->disk_usage_percent().'%' . '</a>';
};
$storage_areas = ZM\Storage::find(array('Enabled'=>true));
@ -450,15 +449,23 @@ function getStorageHTML() {
$class = 'text-warning';
}
$result .= '<li id="getStorageHTML" class="nav-item dropdown mx-2">'.PHP_EOL;
$result .= '<a class="dropdown-toggle mr-2 '.$class.'" href="#" id="dropdown_storage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="material-icons md-18 mr-1">folder_shared</i>Storage</a>'.PHP_EOL;
$result .= '<div class="dropdown-menu" aria-labelledby="dropdown_storage">'.PHP_EOL;
foreach ( $storage_areas as $area ) {
$result .= $func($area).PHP_EOL;
}
$result .= '</div>'.PHP_EOL;
$result .= '</li>'.PHP_EOL;
if (count($storage_areas) <= 2) {
$result .= '<li id="getStorageHTML" class="nav-item mx-2">'.PHP_EOL;
foreach ( $storage_areas as $area ) {
$result .= $func($area).PHP_EOL;
}
$result .= '</li>'.PHP_EOL;
} else {
$result .= '<li id="getStorageHTML" class="nav-item dropdown mx-2">'.PHP_EOL;
$result .= '<a class="dropdown-toggle mr-2 '.$class.'" href="#" id="dropdown_storage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="material-icons md-18 mr-1">folder_shared</i>Storage</a>'.PHP_EOL;
$result .= '<div class="dropdown-menu" aria-labelledby="dropdown_storage">'.PHP_EOL;
foreach ( $storage_areas as $area ) {
$result .= $func($area, 'dropdown-item ').PHP_EOL;
}
$result .= '</div>'.PHP_EOL;
$result .= '</li>'.PHP_EOL;
}
return $result;
}

View File

@ -155,8 +155,8 @@ while ( $event_row = dbFetchNext($results) ) {
<td class="colMonitorName"><?php echo makeLink('?view=monitor&amp;mid='.$event->MonitorId(), $event->MonitorName(), canEdit('Monitors')) ?></td>
<td class="colCause"><?php echo makeLink($event_link, validHtmlStr($event->Cause()), canView('Events'), 'title="' .htmlspecialchars($event->Notes()). '" class="eDetailLink" data-eid="'.$event->Id().'"') ?></td>
<td class="colTime"><?php echo $dateTimeFormatter->format(strtotime($event->StartDateTime())) .
( $event->EndDateTime() ? ' until ' . $dateTimeFormater->format(strtotime($event->EndDateTime())) : '' ) ?></td>
<td class="colDuration"><?php echo gmdate('H:i:s', $event->Length()) ?></td>
( $event->EndDateTime() ? ' until ' . $dateTimeFormatter->format(strtotime($event->EndDateTime())) : '' ) ?></td>
<td class="colDuration"><?php echo gmdate('H:i:s', intval($event->Length())) ?></td>
<td class="colFrames"><?php echo makeLink('?view=frames&amp;eid='.$event->Id(), $event->Frames()) ?></td>
<td class="colAlarmFrames"><?php echo makeLink('?view=frames&amp;eid='.$event->Id(), $event->AlarmFrames()) ?></td>
<td class="colTotScore"><?php echo $event->TotScore() ?></td>

View File

@ -91,6 +91,7 @@ xhtmlHeaders(__FILE__, translate('Frame').' - '.$Event->Id().' - '.$Frame->Frame
<div class="d-flex flex-row justify-content-between px-3 pt-1">
<div id="toolbar" >
<button type="button" id="backBtn" class="btn btn-normal" data-toggle="tooltip" data-placement="top" title="<?php echo translate('Back') ?>" disabled><i class="fa fa-arrow-left"></i></button>
<button type="button" id="framesBtn" class="btn btn-normal" data-toggle="tooltip" data-placement="top" title="<?php echo translate('Frames') ?>" ><i class="fa fa-picture-o"></i></button>
<button type="button" id="refreshBtn" class="btn btn-normal" data-toggle="tooltip" data-placement="top" title="<?php echo translate('Refresh') ?>" ><i class="fa fa-refresh"></i></button>
<button type="button" id="statsBtn" class="btn btn-normal" data-toggle="tooltip" data-placement="top" title="<?php echo translate('Stats') ?>" ><i class="fa fa-info"></i></button>
<button type="button" id="statsViewBtn" class="btn btn-normal" data-toggle="tooltip" data-placement="top" title="<?php echo translate('Stats').' '.translate('View') ?>" ><i class="fa fa-table"></i></button>

View File

@ -152,6 +152,12 @@ function initPage() {
} else {
onStatsResize($j('#base_width').val() * scale / SCALE_BASE);
}
// Manage the FRAMES Button
bindButton('#framesBtn', 'click', null, function onFramesClick(evt) {
evt.preventDefault();
window.location.assign('?view=frames&eid='+eid);
});
}
// Kick everything off

View File

@ -368,7 +368,7 @@ function change_Path(event) {
// check the formatting of the url
var authSeparatorPos = pathInput.value.indexOf( '@', protoPrefixPos+3 );
if ( authSeparatorPos == -1 ) {
console.warn('ignoring URL incorrectly formatted, missing "@"');
console.log('ignoring URL without "@"');
return;
}

View File

@ -428,7 +428,7 @@ if (canEdit('Monitors')) {
<!-- BEGIN ITEM LIST -->
<div class="d-flex flex-row container-fluid pr-0">
<form name="contentForm" id="contentForm" method="post" action="?view=monitor">
<form name="contentForm" id="contentForm" method="post" action="?view=monitor" autocomplete="off">
<input type="hidden" name="tab" value="<?php echo $tab?>"/>
<input type="hidden" name="mid" value="<?php echo $monitor->Id() ? $monitor->Id() : $mid ?>"/>
<input type="hidden" name="origMethod" value="<?php echo (null !== $monitor->Method())?validHtmlStr($monitor->Method()):'' ?>"/>
@ -449,7 +449,7 @@ switch ($name) {
$available_monitor_ids = array_diff(range(min($monitor_ids),max($monitor_ids)), $monitor_ids);
?>
<tr class="Id">
<td class="text-right pr-3"><?php echo translate('Id') ?></td>
<td><?php echo translate('Id') ?></td>
<td><input type="number" step="1" min="1" name="newMonitor[Id]" placeholder="leave blank for auto"/><br/>
<?php
if (count($available_monitor_ids)) {
@ -462,15 +462,15 @@ switch ($name) {
} # end if ! $monitor->Id() and count($monitors)
?>
<tr class="Name">
<td class="text-right pr-3"><?php echo translate('Name') ?></td>
<td><?php echo translate('Name') ?></td>
<td><input type="text" name="newMonitor[Name]" value="<?php echo validHtmlStr($monitor->Name()) ?>"/></td>
</tr>
<tr class="Notes">
<td class="text-right pr-3"><?php echo translate('Notes') ?></td>
<td><?php echo translate('Notes') ?></td>
<td><textarea name="newMonitor[Notes]" rows="4"><?php echo validHtmlStr($monitor->Notes()) ?></textarea></td>
</tr>
<tr class="Manufacturer">
<td class="text-right pr-3"><?php echo translate('Manufacturer') ?></td>
<td><?php echo translate('Manufacturer') ?></td>
<td>
<?php
require_once('includes/Manufacturer.php');
@ -489,7 +489,7 @@ switch ($name) {
</td>
</tr>
<tr class="Model">
<td class="text-right pr-3"><?php echo translate('Model') ?></td>
<td><?php echo translate('Model') ?></td>
<td>
<?php
require_once('includes/Model.php');
@ -512,7 +512,7 @@ switch ($name) {
if (count($Servers)) {
?>
<tr class="Server">
<td class="text-right pr-3"><?php echo translate('Server') ?></td><td>
<td><?php echo translate('Server') ?></td><td>
<?php
$servers = array(''=>'None', 'auto'=>'Auto');
foreach ($Servers as $Server) {
@ -526,16 +526,16 @@ switch ($name) {
} # end if count($Servers)
?>
<tr class="Type">
<td class="text-right pr-3"><?php echo translate('SourceType') ?></td>
<td><?php echo translate('SourceType') ?></td>
<td><?php echo htmlSelect('newMonitor[Type]', $sourceTypes, $monitor->Type()); ?></td>
</tr>
<tr class="Groups">
<td class="text-right pr-3"><?php echo translate('Groups'); ?></td>
<td><?php echo translate('Groups'); ?></td>
<td><select name="newMonitor[GroupIds][]" multiple="multiple" class="chosen"><?php
echo htmlOptions(ZM\Group::get_dropdown_options(), $monitor->GroupIds());
?></select></td>
</tr>
<tr><td class="text-right pr-3"><?php echo translate('Triggers') ?></td><td>
<tr><td><?php echo translate('Triggers') ?></td><td>
<?php
$optTriggers = getSetValues('Monitors', 'Triggers');
ZM\Debug("Triggers: " . print_r($optTriggers, true));
@ -564,34 +564,34 @@ switch ($name) {
{
?>
<tr>
<td class="text-right pr-3"><?php echo translate('ONVIF_URL') ?></td>
<td><?php echo translate('ONVIF_URL') ?></td>
<td><input type="text" name="newMonitor[ONVIF_URL]" value="<?php echo validHtmlStr($monitor->ONVIF_URL()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Username') ?></td>
<td><?php echo translate('Username') ?></td>
<td><input type="text" name="newMonitor[ONVIF_Username]" value="<?php echo validHtmlStr($monitor->ONVIF_Username()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Password') ?></td>
<td><?php echo translate('Password') ?></td>
<td>
<input type="password" id="newMonitor[ONVIF_Password]" name="newMonitor[ONVIF_Password]" value="<?php echo validHtmlStr($monitor->ONVIF_Password()) ?>"/>
<span class="material-icons md-18" data-on-click-this="toggle_password_visibility" data-password-input="newMonitor[ONVIF_Password]">visibility</span>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ONVIF_Options') ?></td>
<td><?php echo translate('ONVIF_Options') ?></td>
<td><input type="text" name="newMonitor[ONVIF_Options]" value="<?php echo validHtmlStr($monitor->ONVIF_Options()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ONVIF_Alarm_Text') ?></td>
<td><?php echo translate('ONVIF_Alarm_Text') ?></td>
<td><input type="text" name="newMonitor[ONVIF_Alarm_Text]" value="<?php echo validHtmlStr($monitor->ONVIF_Alarm_Text()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ONVIF_Event_Listener') ?></td>
<td><?php echo translate('ONVIF_Event_Listener') ?></td>
<td><?php echo html_radio('newMonitor[ONVIF_Event_Listener]', array('1'=>translate('Enabled'), '0'=>translate('Disabled')), $monitor->ONVIF_Event_Listener()); ?></td>
</tr>
<tr id="function_use_Amcrest_API">
<td class="text-right pr-3"><?php echo translate('use_Amcrest_API') ?></td>
<td><?php echo translate('use_Amcrest_API') ?></td>
<td><?php echo html_radio('newMonitor[use_Amcrest_API]', array('1'=>translate('Enabled'), '0'=>translate('Disabled')), $monitor->use_Amcrest_API()); ?></td>
</tr>
<?php
@ -601,7 +601,7 @@ switch ($name) {
{
?>
<tr class="Capturing">
<td class="text-right pr-3"><?php echo translate('Capturing'); echo makeHelpLink('OPTIONS_CAPTURING'); ?></td>
<td><?php echo translate('Capturing'); echo makeHelpLink('OPTIONS_CAPTURING'); ?></td>
<td>
<?php
echo htmlSelect('newMonitor[Capturing]', ZM\Monitor::getCapturingOptions(), $monitor->Capturing());
@ -621,11 +621,11 @@ switch ($name) {
if ( ZM_HAS_V4L2 && $monitor->Type() == 'Local' ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('DevicePath') ?></td>
<td><?php echo translate('DevicePath') ?></td>
<td><input type="text" name="newMonitor[Device]" value="<?php echo validHtmlStr($monitor->Device()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('CaptureMethod') ?></td>
<td><?php echo translate('CaptureMethod') ?></td>
<td><?php
$localMethods = array(
'v4l2' => 'Video For Linux version 2',
@ -641,21 +641,21 @@ echo htmlSelect('newMonitor[Method]', $localMethods,
if ( ZM_HAS_V4L2 && $monitor->Method() == 'v4l2' ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('DeviceChannel') ?></td>
<td><?php echo translate('DeviceChannel') ?></td>
<td><?php echo htmlSelect('newMonitor[Channel]', $v4l2DeviceChannels, $monitor->Channel()); ?></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('DeviceFormat') ?></td>
<td><?php echo translate('DeviceFormat') ?></td>
<td><?php echo htmlSelect('newMonitor[Format]', $v4l2DeviceFormats, $monitor->Format()); ?></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('CapturePalette') ?></td>
<td><?php echo translate('CapturePalette') ?></td>
<td><?php echo htmlSelect('newMonitor[Palette]', $v4l2LocalPalettes, $monitor->Palette()); ?></td>
</tr>
<?php
}
?>
<tr><td class="text-right pr-3"><?php echo translate('V4LMultiBuffer') ?></td><td>
<tr><td><?php echo translate('V4LMultiBuffer') ?></td><td>
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]1" value="1" <?php echo ( $monitor->V4LMultiBuffer() == '1' ? 'checked="checked"' : '' ) ?>/>
<label for="newMonitor[V4LMultiBuffer]1">Yes</label>
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]0" value="0" <?php echo ( $monitor->V4LMultiBuffer() == '0' ? 'checked="checked"' : '' ) ?>/>
@ -664,7 +664,7 @@ echo htmlSelect('newMonitor[Method]', $localMethods,
<label for="newMonitor[V4LMultiBuffer]">Use Config Value</label>
</td></tr>
<tr>
<td class="text-right pr-3"><?php echo translate('V4LCapturesPerFrame') ?></td>
<td><?php echo translate('V4LCapturesPerFrame') ?></td>
<td><input type="number" name="newMonitor[V4LCapturesPerFrame]" value="<?php echo validHtmlStr($monitor->V4LCapturesPerFrame()); ?>" min="1"/></td>
</tr>
<?php
@ -674,19 +674,19 @@ include('_monitor_source_nvsocket.php');
} else if ( $monitor->Type() == 'VNC' ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('RemoteHostName') ?></td>
<td><?php echo translate('RemoteHostName') ?></td>
<td><input type="text" name="newMonitor[Host]" value="<?php echo validHtmlStr($monitor->Host()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('RemoteHostPort') ?></td>
<td><?php echo translate('RemoteHostPort') ?></td>
<td><input type="number" name="newMonitor[Port]" value="<?php echo validHtmlStr($monitor->Port()) ?>" step="1" min="1" max="65536" /></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Username') ?></td>
<td><?php echo translate('Username') ?></td>
<td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($monitor->User()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Password') ?></td>
<td><?php echo translate('Password') ?></td>
<td>
<input type="password" id="newMonitor[Pass]" name="newMonitor[Pass]" value="<?php echo validHtmlStr($monitor->Pass()) ?>"/>
<span class="material-icons md-18" data-on-click-this="toggle_password_visibility" data-password-input="newMonitor[Pass]">visibility</span>
@ -695,20 +695,20 @@ include('_monitor_source_nvsocket.php');
<?php
} else if ( $monitor->Type() == 'Remote' ) {
?>
<tr><td class="text-right pr-3"><?php echo 'Username' ?></td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($monitor->User()) ?>"/></td></tr>
<tr><td><?php echo 'Username' ?></td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($monitor->User()) ?>"/></td></tr>
<tr>
<td class="text-right pr-3"><?php echo 'Password' ?></td>
<td><?php echo 'Password' ?></td>
<td>
<input type="password" id="newMonitor[Pass]" name="newMonitor[Pass]" value="<?php echo validHtmlStr($monitor->Pass()) ?>"/>
<span class="material-icons md-18" data-on-click-this="toggle_password_visibility" data-password-input="newMonitor[Pass]">visibility</span>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('RemoteProtocol') ?></td>
<td><?php echo translate('RemoteProtocol') ?></td>
<td><?php echo htmlSelect('newMonitor[Protocol]', $remoteProtocols, $monitor->Protocol(), "updateMethods( this );if(this.value=='rtsp'){\$('RTSPDescribe').setStyle('display','table-row');}else{\$('RTSPDescribe').hide();}" ); ?></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('RemoteMethod') ?></td>
<td><?php echo translate('RemoteMethod') ?></td>
<td>
<?php
if ( !$monitor->Protocol() || $monitor->Protocol() == 'http' ) {
@ -720,7 +720,7 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('RemoteHostName') ?></td>
<td><?php echo translate('RemoteHostName') ?></td>
<td><input type="text" name="newMonitor[Host]" value="<?php echo validHtmlStr($monitor->Host()) ?>"/></td></tr>
<tr><td><?php echo translate('RemoteHostPort') ?></td><td><input type="number" name="newMonitor[Port]" value="<?php echo validHtmlStr($monitor->Port()) ?>" min="0" max="65535"/></td></tr>
<tr><td><?php echo translate('RemoteHostPath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($monitor->Path()) ?>"/></td></tr>
@ -728,16 +728,16 @@ include('_monitor_source_nvsocket.php');
} else if ( $monitor->Type() == 'File' ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('SourcePath') ?></td>
<td><?php echo translate('SourcePath') ?></td>
<td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($monitor->Path()) ?>"/></td>
</tr>
<?php
} elseif ( $monitor->Type() == 'cURL' ) {
?>
<tr><td class="text-right pr-3"><?php echo 'URL' ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($monitor->Path()) ?>"/></td></tr>
<tr><td class="text-right pr-3"><?php echo 'Username' ?></td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($monitor->User()) ?>"/></td></tr>
<tr><td><?php echo 'URL' ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($monitor->Path()) ?>"/></td></tr>
<tr><td><?php echo 'Username' ?></td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($monitor->User()) ?>"/></td></tr>
<tr>
<td class="text-right pr-3"><?php echo 'Password' ?></td>
<td><?php echo 'Password' ?></td>
<td>
<input type="password" id="newMonitor[Pass]" name="newMonitor[Pass]" value="<?php echo validHtmlStr($monitor->Pass()) ?>"/>
<span class="material-icons md-18" data-on-click-this="toggle_password_visibility" data-password-input="newMonitor[Pass]">visibility</span>
@ -747,7 +747,7 @@ include('_monitor_source_nvsocket.php');
} elseif ( $monitor->Type() == 'WebSite' ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('WebSiteUrl') ?></td>
<td><?php echo translate('WebSiteUrl') ?></td>
<td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($monitor->Path()) ?>"/></td>
</tr>
<tr>
@ -755,42 +755,42 @@ include('_monitor_source_nvsocket.php');
<td><input type="number" name="newMonitor[Width]" value="<?php echo validHtmlStr($monitor->Width()) ?>" min="1" step="1"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Height') ?> (<?php echo translate('Pixels') ?>)</td>
<td><?php echo translate('Height') ?> (<?php echo translate('Pixels') ?>)</td>
<td><input type="number" name="newMonitor[Height]" value="<?php echo validHtmlStr($monitor->Height()) ?>" min="1" step="1"/></td>
</tr>
<tr>
<td class="text-right pr-3"<?php echo 'Web Site Refresh (Optional)' ?></td>
<td<?php echo 'Web Site Refresh (Optional)' ?></td>
<td><input type="number" name="newMonitor[Refresh]" value="<?php echo validHtmlStr($monitor->Refresh()) ?>" min="1" step="1"/></td>
</tr>
<?php
} else if ( $monitor->Type() == 'Ffmpeg' || $monitor->Type() == 'Libvlc' ) {
?>
<tr class="SourcePath">
<td class="text-right pr-3"><?php echo translate('SourcePath') ?></td>
<td><?php echo translate('SourcePath') ?></td>
<td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($monitor->Path()) ?>" /></td>
</tr>
<tr><td class="text-right pr-3"><?php echo 'Username' ?></td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($monitor->User()) ?>"/></td></tr>
<tr><td><?php echo 'Username' ?></td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($monitor->User()) ?>"/></td></tr>
<tr>
<td class="text-right pr-3"><?php echo 'Password' ?></td>
<td><?php echo 'Password' ?></td>
<td>
<input type="password" id="newMonitor[Pass]" name="newMonitor[Pass]" value="<?php echo validHtmlStr($monitor->Pass()) ?>"/>
<span class="material-icons md-18" data-on-click-this="toggle_password_visibility" data-password-input="newMonitor[Pass]">visibility</span>
</td>
</tr>
<tr>
<td class="text-right pr-3">
<td>
<?php echo translate('RemoteMethod'); echo makeHelpLink('OPTIONS_RTSPTrans') ?></td>
<td><?php echo htmlSelect('newMonitor[Method]', $rtspFFMpegMethods, $monitor->Method()) ?></td>
</tr>
<tr class="SourceOptions">
<td class="text-right pr-3"><?php echo translate('Options'); echo makeHelpLink('OPTIONS_'.strtoupper($monitor->Type())) ?></td>
<td><?php echo translate('Options'); echo makeHelpLink('OPTIONS_'.strtoupper($monitor->Type())) ?></td>
<td><input type="text" name="newMonitor[Options]" value="<?php echo validHtmlStr($monitor->Options()) ?>"/></td>
</tr>
<?php
}
?>
<tr class="Decoding">
<td class="text-right pr-3"><?php echo translate('Decoding'); echo makeHelpLink('FUNCTION_DECODING');?></td>
<td><?php echo translate('Decoding'); echo makeHelpLink('FUNCTION_DECODING');?></td>
<td>
<?php
echo htmlSelect('newMonitor[Decoding]', ZM\Monitor::getDecodingOptions(), $monitor->Decoding());
@ -810,17 +810,17 @@ include('_monitor_source_nvsocket.php');
if ( $monitor->Type() == 'Ffmpeg' ) {
?>
<tr class="SourceSecondPath">
<td class="text-right pr-3"><?php echo translate('SourceSecondPath') ?></td>
<td><?php echo translate('SourceSecondPath') ?></td>
<td><input type="text" name="newMonitor[SecondPath]" value="<?php echo validHtmlStr($monitor->SecondPath()) ?>" data-on-input-this="SecondPath_onChange"/></td>
</tr>
<tr class="DecoderHWAccelName">
<td class="text-right pr-3">
<td>
<?php echo translate('DecoderHWAccelName'); echo makeHelpLink('OPTIONS_DECODERHWACCELNAME') ?>
</td>
<td><input type="text" name="newMonitor[DecoderHWAccelName]" value="<?php echo validHtmlStr($monitor->DecoderHWAccelName()) ?>"/></td>
</tr>
<tr class="DecoderHWAccelDevice">
<td class="text-right pr-3"><?php echo translate('DecoderHWAccelDevice') ?>
<td><?php echo translate('DecoderHWAccelDevice') ?>
<?php echo makeHelpLink('OPTIONS_DECODERHWACCELDEVICE') ?>
</td>
<td><input type="text" name="newMonitor[DecoderHWAccelDevice]" value="<?php echo validHtmlStr($monitor->DecoderHWAccelDevice()) ?>"/></td>
@ -830,11 +830,11 @@ include('_monitor_source_nvsocket.php');
if ( $monitor->Type() != 'NVSocket' && $monitor->Type() != 'WebSite' ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('TargetColorspace') ?></td>
<td><?php echo translate('TargetColorspace') ?></td>
<td><?php echo htmlSelect('newMonitor[Colours]', $Colours, $monitor->Colours()) ?></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('CaptureResolution') ?> (<?php echo translate('Pixels') ?>)</td>
<td><?php echo translate('CaptureResolution') ?> (<?php echo translate('Pixels') ?>)</td>
<td>
<input type="number" name="newMonitor[Width]" value="<?php echo validHtmlStr($monitor->Width()) ?>" min="1" step="1"/>
<input type="number" name="newMonitor[Height]" value="<?php echo validHtmlStr($monitor->Height()) ?>" min="1" step="1"/>
@ -881,11 +881,11 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('PreserveAspect') ?></td>
<td><?php echo translate('PreserveAspect') ?></td>
<td><input type="checkbox" name="preserveAspectRatio" value="1"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Orientation') ?></td>
<td><?php echo translate('Orientation') ?></td>
<td><?php echo htmlselect('newMonitor[Orientation]', $orientations, $monitor->Orientation());?></td>
</tr>
<?php
@ -893,14 +893,14 @@ include('_monitor_source_nvsocket.php');
if ( $monitor->Type() == 'Local' ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('Deinterlacing') ?></td>
<td><?php echo translate('Deinterlacing') ?></td>
<td><?php echo htmlselect('newMonitor[Deinterlacing]', $deinterlaceopts_v4l2, $monitor->Deinterlacing())?></td>
</tr>
<?php
} else if ( $monitor->Type() != 'WebSite' ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('Deinterlacing') ?></td>
<td><?php echo translate('Deinterlacing') ?></td>
<td><?php echo htmlselect('newMonitor[Deinterlacing]', $deinterlaceopts, $monitor->Deinterlacing())?></td>
</tr>
<?php
@ -908,14 +908,14 @@ include('_monitor_source_nvsocket.php');
if ( $monitor->Type() == 'Remote' ) {
?>
<tr id="RTSPDescribe"<?php if ( $monitor->Protocol()!= 'rtsp' ) { echo ' style="display:none;"'; } ?>>
<td class="text-right pr-3"><?php echo translate('RTSPDescribe'); echo makeHelpLink('OPTIONS_RTSPDESCRIBE') ?></td>
<td><?php echo translate('RTSPDescribe'); echo makeHelpLink('OPTIONS_RTSPDESCRIBE') ?></td>
<td><input type="checkbox" name="newMonitor[RTSPDescribe]" value="1"<?php if ( $monitor->RTSPDescribe() ) { ?> checked="checked"<?php } ?>/></td>
</tr>
<?php
} # end if monitor->Type() == 'Remote'
?>
<tr>
<td class="text-right pr-3"><?php echo translate('MaximumFPS'); echo makeHelpLink('OPTIONS_MAXFPS') ?></td>
<td><?php echo translate('MaximumFPS'); echo makeHelpLink('OPTIONS_MAXFPS') ?></td>
<td>
<input type="number" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($monitor->MaxFPS()) ?>" min="0" step="any"/>
<?php
@ -926,7 +926,7 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('AlarmMaximumFPS'); echo makeHelpLink('OPTIONS_MAXFPS') ?></td>
<td><?php echo translate('AlarmMaximumFPS'); echo makeHelpLink('OPTIONS_MAXFPS') ?></td>
<td>
<input type="number" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($monitor->AlarmMaxFPS()) ?>" min="0" step="any"/>
<?php
@ -942,7 +942,7 @@ include('_monitor_source_nvsocket.php');
case 'analysis' : {
?>
<tr class="Analysing">
<td class="text-right pr-3"><?php echo translate('Motion Detection') ?></td>
<td><?php echo translate('Motion Detection') ?></td>
<td>
<?php
echo htmlSelect('newMonitor[Analysing]', ZM\Monitor::getAnalysingOptions(),
@ -960,7 +960,7 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr id="AnalysisSource"<?php echo $monitor->SecondPath() ? '' : ' style="display:none;"' ?>>
<td class="text-right pr-3"><?php echo translate('AnalysisSource') ?></td>
<td><?php echo translate('AnalysisSource') ?></td>
<td>
<?php
echo htmlSelect('newMonitor[AnalysisSource]', ZM\Monitor::getAnalysisSourceOptions(), $monitor->AnalysisSource());
@ -968,7 +968,7 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr id="AnalysisImage">
<td class="text-right pr-3"><?php echo translate('Analysis Image') ?></td>
<td><?php echo translate('Analysis Image') ?></td>
<td>
<?php
echo htmlSelect('newMonitor[AnalysisImage]', ZM\Monitor::getAnalysisImageOptions(), $monitor->AnalysisImage());
@ -976,36 +976,36 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('AnalysisFPS') ?></td>
<td><?php echo translate('AnalysisFPS') ?></td>
<td><input type="number" name="newMonitor[AnalysisFPSLimit]" value="<?php echo validHtmlStr($monitor->AnalysisFPSLimit()) ?>" min="0" step="any"/></td>
</tr>
<?php
if ( ZM_FAST_IMAGE_BLENDS ) {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('RefImageBlendPct') ?></td>
<td><?php echo translate('RefImageBlendPct') ?></td>
<td><?php echo htmlSelect('newMonitor[RefBlendPerc]', $fastblendopts, $monitor->RefBlendPerc()); ?></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('AlarmRefImageBlendPct') ?></td>
<td><?php echo translate('AlarmRefImageBlendPct') ?></td>
<td><?php echo htmlSelect('newMonitor[AlarmRefBlendPerc]', $fastblendopts_alarm, $monitor->AlarmRefBlendPerc()); ?></td>
</tr>
<?php
} else {
?>
<tr>
<td class="text-right pr-3"><?php echo translate('RefImageBlendPct') ?></td>
<td><?php echo translate('RefImageBlendPct') ?></td>
<td><input type="number" name="newMonitor[RefBlendPerc]" value="<?php echo validHtmlStr($monitor->RefBlendPerc()) ?>" step="any" min="0"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('AlarmRefImageBlendPct') ?></td>
<td><?php echo translate('AlarmRefImageBlendPct') ?></td>
<td><input type="number" name="newMonitor[AlarmRefBlendPerc]" value="<?php echo validHtmlStr($monitor->AlarmRefBlendPerc()) ?>" step="any" min="0"/></td>
</tr>
<?php
}
?>
<tr class="LinkedMonitors">
<td class="text-right pr-3"><?php echo translate('LinkedMonitors'); echo makeHelpLink('OPTIONS_LINKED_MONITORS') ?></td>
<td><?php echo translate('LinkedMonitors'); echo makeHelpLink('OPTIONS_LINKED_MONITORS') ?></td>
<td><input type="text" name="newMonitor[LinkedMonitors]" value="<?php echo $monitor->LinkedMonitors() ?>" data-on-input="updateLinkedMonitorsUI"/><br/>
<div id="LinkedMonitorsUI"></div>
@ -1055,7 +1055,7 @@ include('_monitor_source_nvsocket.php');
{
?>
<tr>
<td class="text-right pr-3"><?php echo translate('Recording') ?></td>
<td><?php echo translate('Recording') ?></td>
<td>
<?php
echo htmlSelect('newMonitor[Recording]', ZM\Monitor::getRecordingOptions(),
@ -1074,7 +1074,7 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr id="RecordingSource"<?php echo $monitor->SecondPath() ? '' : ' style="display:none;"' ?>>
<td class="text-right pr-3"><?php echo translate('RecordingSource') ?></td>
<td><?php echo translate('RecordingSource') ?></td>
<td>
<?php
echo htmlSelect('newMonitor[RecordingSource]', ZM\Monitor::getRecordingSourceOptions(), $monitor->RecordingSource());
@ -1082,7 +1082,7 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('StorageArea') ?></td>
<td><?php echo translate('StorageArea') ?></td>
<td>
<?php
$storage_areas = array(0=>'Default');
@ -1094,7 +1094,7 @@ include('_monitor_source_nvsocket.php');
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('SaveJPEGs') ?></td>
<td><?php echo translate('SaveJPEGs') ?></td>
<td>
<?php
$savejpegopts = array(
@ -1107,7 +1107,7 @@ include('_monitor_source_nvsocket.php');
?>
</td>
</tr>
<tr><td class="text-right pr-3"><?php echo translate('VideoWriter') ?></td><td>
<tr><td><?php echo translate('VideoWriter') ?></td><td>
<?php
$videowriteropts = array(
0 => translate('Disabled'),
@ -1172,13 +1172,13 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('OptionalEncoderParam'); echo makeHelpLink('OPTIONS_ENCODER_PARAMETERS') ?></td>
<td><?php echo translate('OptionalEncoderParam'); echo makeHelpLink('OPTIONS_ENCODER_PARAMETERS') ?></td>
<td>
<textarea name="newMonitor[EncoderParameters]" rows="<?php echo count(explode("\n", $monitor->EncoderParameters())); ?>"><?php echo validHtmlStr($monitor->EncoderParameters()) ?></textarea>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('RecordAudio') ?></td><td>
<td><?php echo translate('RecordAudio') ?></td><td>
<?php if ( $monitor->Type() == 'Ffmpeg' ) { ?>
<input type="checkbox" name="newMonitor[RecordAudio]" value="1"<?php if ( $monitor->RecordAudio() ) { ?> checked="checked"<?php } ?>/>
<?php } else { ?>
@ -1188,11 +1188,11 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Event Start Command') ?></td>
<td><?php echo translate('Event Start Command') ?></td>
<td><input type="text" name="newMonitor[EventStartCommand]" value="<?php echo validHtmlStr($monitor->EventStartCommand()) ?>" /></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Event End Command') ?></td>
<td><?php echo translate('Event End Command') ?></td>
<td><input type="text" name="newMonitor[EventEndCommand]" value="<?php echo validHtmlStr($monitor->EventEndCommand()) ?>" /></td>
</tr>
<?php
@ -1201,7 +1201,7 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
case 'viewing' :
?>
<tr id="FunctionJanusEnabled">
<td class="text-right pr-3"><?php echo translate('Janus Live Stream') ?></td>
<td><?php echo translate('Janus Live Stream') ?></td>
<td><input type="checkbox" name="newMonitor[JanusEnabled]" value="1"<?php echo $monitor->JanusEnabled() ? ' checked="checked"' : '' ?>/>
<?php
if ( isset($OLANG['FUNCTION_JANUS_ENABLED']) ) {
@ -1211,7 +1211,7 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
</td>
</tr>
<tr id="FunctionJanusAudioEnabled">
<td class="text-right pr-3"><?php echo translate('Janus Live Stream Audio') ?></td>
<td><?php echo translate('Janus Live Stream Audio') ?></td>
<td><input type="checkbox" name="newMonitor[JanusAudioEnabled]" value="1"<?php echo $monitor->JanusAudioEnabled() ? ' checked="checked"' : '' ?>/>
<?php
if ( isset($OLANG['FUNCTION_JANUS_AUDIO_ENABLED']) ) {
@ -1221,7 +1221,7 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
</td>
</tr>
<tr id="FunctionJanusProfileOverride">
<td class="text-right pr-3"><?php echo translate('Janus Profile-ID Override') ?></td>
<td><?php echo translate('Janus Profile-ID Override') ?></td>
<td><input type="text" name="newMonitor[Janus_Profile_Override]" value="<?php echo $monitor->Janus_Profile_Override()?>"/>
<?php
if ( isset($OLANG['FUNCTION_JANUS_PROFILE_OVERRIDE']) ) {
@ -1231,7 +1231,7 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
</td>
</tr>
<tr id="FunctionJanusUseRTSPRestream">
<td class="text-right pr-3"><?php echo translate('Janus Use RTSP Restream') ?></td>
<td><?php echo translate('Janus Use RTSP Restream') ?></td>
<td><input type="checkbox" name="newMonitor[Janus_Use_RTSP_Restream]" value="1"<?php echo $monitor->Janus_Use_RTSP_Restream() ? ' checked="checked"' : '' ?>/>
<?php
if ( isset($OLANG['FUNCTION_JANUS_USE_RTSP_RESTREAM']) ) {
@ -1241,15 +1241,15 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('DefaultRate') ?></td>
<td><?php echo translate('DefaultRate') ?></td>
<td><?php echo htmlSelect('newMonitor[DefaultRate]', $rates, $monitor->DefaultRate()); ?></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('DefaultScale') ?></td>
<td><?php echo translate('DefaultScale') ?></td>
<td><?php echo htmlSelect('newMonitor[DefaultScale]', $scales, $monitor->DefaultScale()); ?></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('DefaultCodec') ?></td>
<td><?php echo translate('DefaultCodec') ?></td>
<td><?php
$codecs = array(
'auto' => translate('Auto'),
@ -1264,19 +1264,19 @@ $codecs = array(
{
?>
<tr>
<td class="text-right pr-3"><?php echo translate('TimestampLabelFormat') ?></td>
<td><?php echo translate('TimestampLabelFormat') ?></td>
<td><input type="text" name="newMonitor[LabelFormat]" value="<?php echo validHtmlStr($monitor->LabelFormat()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('TimestampLabelX') ?></td>
<td><?php echo translate('TimestampLabelX') ?></td>
<td><input type="number" name="newMonitor[LabelX]" value="<?php echo validHtmlStr($monitor->LabelX()) ?>" min="0"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('TimestampLabelY') ?></td>
<td><?php echo translate('TimestampLabelY') ?></td>
<td><input type="number" name="newMonitor[LabelY]" value="<?php echo validHtmlStr($monitor->LabelY()) ?>" min="0"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('TimestampLabelSize') ?></td>
<td><?php echo translate('TimestampLabelSize') ?></td>
<td><?php echo htmlselect('newMonitor[LabelSize]', $label_size, $monitor->LabelSize()) ?></td>
</tr>
<?php
@ -1286,35 +1286,35 @@ $codecs = array(
{
?>
<tr>
<td class="text-right pr-3"><?php echo translate('ImageBufferSize'); echo makeHelpLink('ImageBufferCount'); ?></td>
<td><?php echo translate('ImageBufferSize'); echo makeHelpLink('ImageBufferCount'); ?></td>
<td><input type="number" name="newMonitor[ImageBufferCount]" value="<?php echo validHtmlStr($monitor->ImageBufferCount()) ?>" min="1"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('MaxImageBufferCount'); echo makeHelpLink('MaxImageBufferCount'); ?></td>
<td><?php echo translate('MaxImageBufferCount'); echo makeHelpLink('MaxImageBufferCount'); ?></td>
<td><input type="number" name="newMonitor[MaxImageBufferCount]" value="<?php echo validHtmlStr($monitor->MaxImageBufferCount()) ?>" min="0"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('WarmupFrames') ?></td>
<td><?php echo translate('WarmupFrames') ?></td>
<td><input type="number" name="newMonitor[WarmupCount]" value="<?php echo validHtmlStr($monitor->WarmupCount()) ?>" min="0"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('PreEventImageBuffer') ?></td>
<td><?php echo translate('PreEventImageBuffer') ?></td>
<td><input type="number" name="newMonitor[PreEventCount]" value="<?php echo validHtmlStr($monitor->PreEventCount()) ?>" min="0"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('PostEventImageBuffer') ?></td>
<td><?php echo translate('PostEventImageBuffer') ?></td>
<td><input type="number" name="newMonitor[PostEventCount]" value="<?php echo validHtmlStr($monitor->PostEventCount()) ?>" min="0"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('StreamReplayBuffer') ?></td>
<td><?php echo translate('StreamReplayBuffer') ?></td>
<td><input type="number" name="newMonitor[StreamReplayBuffer]" value="<?php echo validHtmlStr($monitor->StreamReplayBuffer()) ?>" min="0"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('AlarmFrameCount') ?></td>
<td><?php echo translate('AlarmFrameCount') ?></td>
<td><input type="number" name="newMonitor[AlarmFrameCount]" value="<?php echo validHtmlStr($monitor->AlarmFrameCount()) ?>" min="1"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Estimated Ram Use') ?></td>
<td><?php echo translate('Estimated Ram Use') ?></td>
<td id="estimated_ram_use"></td>
</tr>
<?php
@ -1324,11 +1324,11 @@ $codecs = array(
{
?>
<tr>
<td class="text-right pr-3"><?php echo translate('Controllable') ?></td>
<td><?php echo translate('Controllable') ?></td>
<td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( $monitor->Controllable() ) { ?> checked="checked"<?php } ?>/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ControlType') ?></td>
<td><?php echo translate('ControlType') ?></td>
<td>
<?php
$controls = ZM\Control::find(null, array('order'=>'lower(Name)'));
@ -1345,31 +1345,31 @@ $codecs = array(
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ControlDevice') ?></td>
<td><?php echo translate('ControlDevice') ?></td>
<td><input type="text" name="newMonitor[ControlDevice]" value="<?php echo validHtmlStr($monitor->ControlDevice()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ControlAddress') ?></td>
<td><?php echo translate('ControlAddress') ?></td>
<td><input type="text" name="newMonitor[ControlAddress]" value="<?php echo validHtmlStr($monitor->ControlAddress()) ? : 'user:port@ip' ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ModectDuringPTZ') ?></td>
<td><?php echo translate('ModectDuringPTZ') ?></td>
<td><input type="checkbox" name="newMonitor[ModectDuringPTZ]" value="1"<?php if ( $monitor->ModectDuringPTZ() ) { ?> checked="checked"<?php } ?>/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('AutoStopTimeout') ?></td>
<td><?php echo translate('AutoStopTimeout') ?></td>
<td><input type="number" name="newMonitor[AutoStopTimeout]" value="<?php echo validHtmlStr($monitor->AutoStopTimeout()) ?>" min="0" step="any"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('TrackMotion') ?></td>
<td><?php echo translate('TrackMotion') ?></td>
<td><input type="checkbox" name="newMonitor[TrackMotion]" value="1"<?php if ( $monitor->TrackMotion() ) { ?> checked="checked"<?php } ?>/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('TrackDelay') ?></td>
<td><?php echo translate('TrackDelay') ?></td>
<td><input type="number" name="newMonitor[TrackDelay]" value="<?php echo validHtmlStr($monitor->TrackDelay()) ?>" min="0" step="any"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ReturnLocation') ?></td>
<td><?php echo translate('ReturnLocation') ?></td>
<td><?php
$return_options = array(
'-1' => translate('None'),
@ -1379,7 +1379,7 @@ $codecs = array(
echo htmlSelect('newMonitor[ReturnLocation]', $return_options, $monitor->ReturnLocation()); ?></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('ReturnDelay') ?></td>
<td><?php echo translate('ReturnDelay') ?></td>
<td><input type="number" name="newMonitor[ReturnDelay]" value="<?php echo validHtmlStr($monitor->ReturnDelay()) ?>" min="0" step="any"/></td>
</tr>
<?php
@ -1388,9 +1388,9 @@ echo htmlSelect('newMonitor[ReturnLocation]', $return_options, $monitor->ReturnL
case 'x10' :
{
?>
<tr><td class="text-right pr-3"><?php echo translate('X10ActivationString') ?></td><td><input type="text" name="newX10Monitor[Activation]" value="<?php echo validHtmlStr($newX10Monitor['Activation']) ?>" size="20"/></td></tr>
<tr><td class="text-right pr-3"><?php echo translate('X10InputAlarmString') ?></td><td><input type="text" name="newX10Monitor[AlarmInput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmInput']) ?>" size="20"/></td></tr>
<tr><td class="text-right pr-3"><?php echo translate('X10OutputAlarmString') ?></td><td><input type="text" name="newX10Monitor[AlarmOutput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmOutput']) ?>" size="20"/></td></tr>
<tr><td><?php echo translate('X10ActivationString') ?></td><td><input type="text" name="newX10Monitor[Activation]" value="<?php echo validHtmlStr($newX10Monitor['Activation']) ?>" size="20"/></td></tr>
<tr><td><?php echo translate('X10InputAlarmString') ?></td><td><input type="text" name="newX10Monitor[AlarmInput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmInput']) ?>" size="20"/></td></tr>
<tr><td><?php echo translate('X10OutputAlarmString') ?></td><td><input type="text" name="newX10Monitor[AlarmOutput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmOutput']) ?>" size="20"/></td></tr>
<?php
break;
}
@ -1398,65 +1398,65 @@ echo htmlSelect('newMonitor[ReturnLocation]', $return_options, $monitor->ReturnL
{
?>
<tr>
<td class="text-right pr-3"><?php echo translate('EventPrefix') ?></td>
<td><?php echo translate('EventPrefix') ?></td>
<td><input type="text" name="newMonitor[EventPrefix]" value="<?php echo validHtmlStr($monitor->EventPrefix()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Sectionlength') ?></td>
<td><?php echo translate('Sectionlength') ?></td>
<td>
<input type="number" name="newMonitor[SectionLength]" value="<?php echo validHtmlStr($monitor->SectionLength()) ?>" min="0"/>
<?php echo translate('seconds')?>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('MinSectionlength') ?></td>
<td><?php echo translate('MinSectionlength') ?></td>
<td>
<input type="number" name="newMonitor[MinSectionLength]" value="<?php echo validHtmlStr($monitor->MinSectionLength()) ?>" min="0"/>
<?php echo translate('seconds')?>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('FrameSkip') ?></td>
<td><?php echo translate('FrameSkip') ?></td>
<td>
<input type="number" name="newMonitor[FrameSkip]" value="<?php echo validHtmlStr($monitor->FrameSkip()) ?>" min="0"/>
<?php echo translate('frames')?>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('MotionFrameSkip') ?></td>
<td><?php echo translate('MotionFrameSkip') ?></td>
<td>
<input type="number" name="newMonitor[MotionFrameSkip]" value="<?php echo validHtmlStr($monitor->MotionFrameSkip()) ?>" min="0"/>
<?php echo translate('frames')?>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('AnalysisUpdateDelay') ?></td>
<td><?php echo translate('AnalysisUpdateDelay') ?></td>
<td>
<input type="number" name="newMonitor[AnalysisUpdateDelay]" value="<?php echo validHtmlStr($monitor->AnalysisUpdateDelay()) ?>" min="0"/>
<?php echo translate('seconds')?>
</td></tr>
<tr>
<td class="text-right pr-3"><?php echo translate('FPSReportInterval') ?></td>
<td><?php echo translate('FPSReportInterval') ?></td>
<td>
<input type="number" name="newMonitor[FPSReportInterval]" value="<?php echo validHtmlStr($monitor->FPSReportInterval()) ?>" min="0"/>
<?php echo translate('frames')?>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('SignalCheckPoints') ?></td>
<td><?php echo translate('SignalCheckPoints') ?></td>
<td>
<input type="number" name="newMonitor[SignalCheckPoints]" value="<?php echo validInt($monitor->SignalCheckPoints()) ?>" min="0"/>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('SignalCheckColour') ?></td>
<td><?php echo translate('SignalCheckColour') ?></td>
<td>
<input type="color" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($monitor->SignalCheckColour()) ?>"/>
<span id="SignalCheckSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($monitor->SignalCheckColour()); ?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('WebColour') ?></td>
<td><?php echo translate('WebColour') ?></td>
<td>
<input type="color" name="newMonitor[WebColour]" value="<?php echo validHtmlStr($monitor->WebColour()) ?>"/>
<span id="WebSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($monitor->WebColour()) ?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span>
@ -1465,19 +1465,19 @@ echo htmlSelect('newMonitor[ReturnLocation]', $return_options, $monitor->ReturnL
</td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Exif'); echo makeHelpLink('OPTIONS_EXIF') ?></td>
<td><?php echo translate('Exif'); echo makeHelpLink('OPTIONS_EXIF') ?></td>
<td><input type="checkbox" name="newMonitor[Exif]" value="1"<?php echo $monitor->Exif() ? ' checked="checked"' : '' ?>/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('RTSPServer'); echo makeHelpLink('OPTIONS_RTSPSERVER') ?></td>
<td><?php echo translate('RTSPServer'); echo makeHelpLink('OPTIONS_RTSPSERVER') ?></td>
<td><input type="checkbox" name="newMonitor[RTSPServer]" value="1"<?php echo $monitor->RTSPServer() ? ' checked="checked"' : '' ?>/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('RTSPStreamName'); echo makeHelpLink('OPTIONS_RTSPSTREAMNAME') ?></td>
<td><?php echo translate('RTSPStreamName'); echo makeHelpLink('OPTIONS_RTSPSTREAMNAME') ?></td>
<td><input type="text" name="newMonitor[RTSPStreamName]" value="<?php echo validHtmlStr($monitor->RTSPStreamName()) ?>"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Importance'); echo makeHelpLink('OPTIONS_IMPORTANCE') ?></td>
<td><?php echo translate('Importance'); echo makeHelpLink('OPTIONS_IMPORTANCE') ?></td>
<td>
<?php
echo htmlselect('newMonitor[Importance]',
@ -1495,15 +1495,15 @@ echo htmlSelect('newMonitor[ReturnLocation]', $return_options, $monitor->ReturnL
case 'location':
?>
<tr>
<td class="text-right pr-3"><?php echo translate('Latitude') ?></td>
<td><?php echo translate('Latitude') ?></td>
<td><input type="number" name="newMonitor[Latitude]" step="any" value="<?php echo $monitor->Latitude() ?>" min="-90" max="90"/></td>
</tr>
<tr>
<td class="text-right pr-3"><?php echo translate('Longitude') ?></td>
<td><?php echo translate('Longitude') ?></td>
<td><input type="number" name="newMonitor[Longitude]" step="any" value="<?php echo $monitor->Longitude() ?>" min="-180" max="180"/></td>
</tr>
<tr>
<td class="text-right pr-3"></td>
<td></td>
<td><button type="button" data-on-click="getLocation"><?php echo translate('GetCurrentLocation') ?></button></td>
</tr>
<tr>