This commit is contained in:
Isaac Connor 2021-09-28 10:31:04 -04:00
commit 509a5549be
5 changed files with 44 additions and 16 deletions

1
.gitignore vendored
View File

@ -124,6 +124,7 @@ src/zmc
src/zmf
src/zms
src/zmu
src/zm_rtsp_server
src/zoneminder-zmc.8
src/zoneminder-zmc.8.gz
src/zoneminder-zmf.8

View File

@ -399,7 +399,6 @@ sub checkFilter {
) {
$Event->save();
}
$ZoneMinder::Database::dbh->commit() if !$$filter{LockRows};
} # end if UpdateDiskSpace
} # end foreach event
ZoneMinder::Database::end_transaction($dbh, $in_transaction) if $$filter{LockRows};

View File

@ -61,13 +61,15 @@ static enum AVPixelFormat find_fmt_by_hw_type(const enum AVHWDeviceType type) {
case AV_HWDEVICE_TYPE_DXVA2:
return AV_PIX_FMT_DXVA2_VLD;
case AV_HWDEVICE_TYPE_D3D11VA:
return = AV_PIX_FMT_D3D11;
return AV_PIX_FMT_D3D11;
case AV_HWDEVICE_TYPE_VDPAU:
return AV_PIX_FMT_VDPAU;
case AV_HWDEVICE_TYPE_CUDA:
return AV_PIX_FMT_CUDA;
#ifdef AV_HWDEVICE_TYPE_MMAL
case AV_HWDEVICE_TYPE_MMAL:
return AV_PIX_FMT_MMAL;
#endif
case AV_HWDEVICE_TYPE_VIDEOTOOLBOX:
return AV_PIX_FMT_VIDEOTOOLBOX;
default:

View File

@ -69,6 +69,11 @@
// setlocale( LC_CTYPE, 'en_GB' ); Character class settings 4.3.0 and after
// setlocale( LC_TIME, 'en_GB' ); Date and time formatting 4.3.0 and after
setlocale( LC_TIME, 'en_GB.utf8' );
define("DATE_FMT_CONSOLE_LONG", "%a %d %b, %Hh%M");
define( "STRF_FMT_DATETIME_SHORT", "%d/%m/%y %H:%M:%S" );
define( "STRF_FMT_DATETIME_SHORTER", "%x %H:%M:%S" );
// Simple String Replacements
$SLANG = array(
'SystemLog' => 'System Log',

View File

@ -38,9 +38,15 @@ $monitor = null;
if (!empty($_REQUEST['mid'])) {
$mid = validInt($_REQUEST['mid']);
$monitor = new ZM\Monitor($mid);
if ( $monitor and ZM_OPT_X10 )
if ($monitor->Id()) {
if (ZM_OPT_X10) {
$x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($mid));
}
} else {
$monitor->Name(translate('Monitor').'-'.$mid);
$monitor->WebColour(random_colour());
}
}
if (!$monitor) {
$monitor = new ZM\Monitor();
@ -349,6 +355,7 @@ $codecs = array(
'MJPEG' => translate('MJPEG'),
);
$monitors = dbFetchAll('SELECT Id, Name FROM Monitors ORDER BY Name,Sequence ASC');
$controls = ZM\Control::find(null, array('order'=>'lower(Name)'));
xhtmlHeaders(__FILE__, translate('Monitor').' - '.validHtmlStr($monitor->Name()));
@ -446,6 +453,21 @@ foreach ( $tabs as $name=>$value ) {
switch ( $name ) {
case 'general' :
{
if (!$monitor->Id()) {
$monitor_ids = array();
foreach ($monitors as $m) { $monitor_ids[] = $m['Id']; }
$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><input type="number" step="1" min="1" name="newMonitor[Id]" placeholder="leave blank for auto"/><br/>
10 Available Ids:
<?php echo implode(', ', array_slice($available_monitor_ids, 0, 10)); ?>
</td>
</tr>
<?php
} # end if ! $monitor->Id()
?>
<tr class="Name">
<td class="text-right pr-3"><?php echo translate('Name') ?></td>
@ -518,7 +540,6 @@ switch ( $name ) {
<td class="text-right pr-3"><?php echo translate('LinkedMonitors'); echo makeHelpLink('OPTIONS_LINKED_MONITORS') ?></td>
<td>
<?php
$monitors = dbFetchAll('SELECT Id, Name FROM Monitors ORDER BY Name,Sequence ASC');
$monitor_options = array();
foreach ( $monitors as $linked_monitor ) {
if ( (!$monitor->Id() || ($monitor->Id()!= $linked_monitor['Id'])) && visibleMonitor($linked_monitor['Id']) ) {