Merge pull request #1418 from pliablepixels/1417-clone-monitor
Clone feature added
This commit is contained in:
commit
81757a0465
|
@ -230,6 +230,7 @@ $SLANG = array(
|
||||||
'ChooseLogFormat' => 'Choose a log format',
|
'ChooseLogFormat' => 'Choose a log format',
|
||||||
'ChooseLogSelection' => 'Choose a log selection',
|
'ChooseLogSelection' => 'Choose a log selection',
|
||||||
'ChoosePreset' => 'Choose Preset',
|
'ChoosePreset' => 'Choose Preset',
|
||||||
|
'CloneMonitor' => 'Clone Monitor',
|
||||||
'Close' => 'Close',
|
'Close' => 'Close',
|
||||||
'Colour' => 'Colour',
|
'Colour' => 'Colour',
|
||||||
'Command' => 'Command',
|
'Command' => 'Command',
|
||||||
|
|
|
@ -77,8 +77,8 @@ $run_state = dbFetchOne('select Name from States where IsActive = 1', 'Name' );
|
||||||
|
|
||||||
$group = NULL;
|
$group = NULL;
|
||||||
if ( ! empty($_COOKIE['zmGroup']) ) {
|
if ( ! empty($_COOKIE['zmGroup']) ) {
|
||||||
if ( $group = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_COOKIE['zmGroup'])) )
|
if ( $group = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_COOKIE['zmGroup'])) )
|
||||||
$groupIds = array_flip(explode( ',', $group['MonitorIds'] ));
|
$groupIds = array_flip(explode( ',', $group['MonitorIds'] ));
|
||||||
}
|
}
|
||||||
|
|
||||||
noCacheHeaders();
|
noCacheHeaders();
|
||||||
|
@ -182,6 +182,7 @@ $seqDownFile = getSkinFile( 'graphics/seq-d.gif' );
|
||||||
|
|
||||||
$versionClass = (ZM_DYN_DB_VERSION&&(ZM_DYN_DB_VERSION!=ZM_VERSION))?'errorText':'';
|
$versionClass = (ZM_DYN_DB_VERSION&&(ZM_DYN_DB_VERSION!=ZM_VERSION))?'errorText':'';
|
||||||
|
|
||||||
|
|
||||||
xhtmlHeaders( __FILE__, translate('Console') );
|
xhtmlHeaders( __FILE__, translate('Console') );
|
||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
|
@ -243,7 +244,7 @@ else
|
||||||
<th class="colName"><?php echo translate('Name') ?></th>
|
<th class="colName"><?php echo translate('Name') ?></th>
|
||||||
<th class="colFunction"><?php echo translate('Function') ?></th>
|
<th class="colFunction"><?php echo translate('Function') ?></th>
|
||||||
<?php if ( count($servers) ) { ?>
|
<?php if ( count($servers) ) { ?>
|
||||||
<th class="colServer"><?php echo translate('Server') ?></th>
|
<th class="colServer"><?php echo translate('Server') ?></th>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<th class="colSource"><?php echo translate('Source') ?></th>
|
<th class="colSource"><?php echo translate('Source') ?></th>
|
||||||
<?php
|
<?php
|
||||||
|
@ -270,7 +271,8 @@ if ( canEdit('Monitors') )
|
||||||
<tr>
|
<tr>
|
||||||
<td class="colLeftButtons" colspan="<?php echo count($servers) ? 4 : 3 ?>">
|
<td class="colLeftButtons" colspan="<?php echo count($servers) ? 4 : 3 ?>">
|
||||||
<input type="button" value="<?php echo translate('Refresh') ?>" onclick="location.reload(true);"/>
|
<input type="button" value="<?php echo translate('Refresh') ?>" onclick="location.reload(true);"/>
|
||||||
<?php echo makePopupButton( '?view=monitor', 'zmMonitor0', 'monitor', translate('AddNewMonitor'), (canEdit( 'Monitors' ) && !$user['MonitorIds']) ) ?>
|
<input type="button" name="addBtn" value="<?php echo translate('AddNewMonitor') ?>" onclick="addMonitor( this )"/>
|
||||||
|
<!-- <?php echo makePopupButton( '?view=monitor', 'zmMonitor0', 'monitor', translate('AddNewMonitor'), (canEdit( 'Monitors' ) && !$user['MonitorIds']) ) ?> -->
|
||||||
<?php echo makePopupButton( '?view=filter&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3c&filter[terms][0][val]=now', 'zmFilter', 'filter', translate('Filters'), canView( 'Events' ) ) ?>
|
<?php echo makePopupButton( '?view=filter&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3c&filter[terms][0][val]=now', 'zmFilter', 'filter', translate('Filters'), canView( 'Events' ) ) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
|
@ -297,7 +299,7 @@ foreach( $displayMonitors as $monitor )
|
||||||
$dclass = "errorText";
|
$dclass = "errorText";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// https://github.com/ZoneMinder/ZoneMinder/issues/1082
|
// https://github.com/ZoneMinder/ZoneMinder/issues/1082
|
||||||
if ( !$monitor['zma'] && $monitor['Function']!='Monitor' )
|
if ( !$monitor['zma'] && $monitor['Function']!='Monitor' )
|
||||||
$dclass = "warnText";
|
$dclass = "warnText";
|
||||||
else
|
else
|
||||||
|
@ -316,7 +318,7 @@ foreach( $displayMonitors as $monitor )
|
||||||
<td class="colName"><?php echo makePopupLink( '?view=watch&mid='.$monitor['Id'], 'zmWatch'.$monitor['Id'], array( 'watch', reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ) ), $monitor['Name'], $running && ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
|
<td class="colName"><?php echo makePopupLink( '?view=watch&mid='.$monitor['Id'], 'zmWatch'.$monitor['Id'], array( 'watch', reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ) ), $monitor['Name'], $running && ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
|
||||||
<td class="colFunction"><?php echo makePopupLink( '?view=function&mid='.$monitor['Id'], 'zmFunction', 'function', '<span class="'.$fclass.'">'.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', disabled' : '' ) .'</span>', canEdit( 'Monitors' ) ) ?></td>
|
<td class="colFunction"><?php echo makePopupLink( '?view=function&mid='.$monitor['Id'], 'zmFunction', 'function', '<span class="'.$fclass.'">'.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', disabled' : '' ) .'</span>', canEdit( 'Monitors' ) ) ?></td>
|
||||||
<?php if ( count($servers) ) { ?>
|
<?php if ( count($servers) ) { ?>
|
||||||
<td class="colServer"><?php
|
<td class="colServer"><?php
|
||||||
$Server = new Server( $monitor['ServerId'] );
|
$Server = new Server( $monitor['ServerId'] );
|
||||||
echo $Server->Name();
|
echo $Server->Name();
|
||||||
?></td>
|
?></td>
|
||||||
|
@ -330,9 +332,9 @@ echo $Server->Name();
|
||||||
<?php } elseif ( $monitor['Type'] == "Ffmpeg" || $monitor['Type'] == "Libvlc" ) {
|
<?php } elseif ( $monitor['Type'] == "Ffmpeg" || $monitor['Type'] == "Libvlc" ) {
|
||||||
$domain = parse_url( $monitor['Path'], PHP_URL_HOST );
|
$domain = parse_url( $monitor['Path'], PHP_URL_HOST );
|
||||||
$shortpath = $domain ? $domain : preg_replace( '/^.*\//', '', $monitor['Path'] );
|
$shortpath = $domain ? $domain : preg_replace( '/^.*\//', '', $monitor['Path'] );
|
||||||
if ( $shortpath == '' ) {
|
if ( $shortpath == '' ) {
|
||||||
$shortpath = 'Monitor ' . $monitor['Id'];
|
$shortpath = 'Monitor ' . $monitor['Id'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.$shortpath.'</span>', canEdit( 'Monitors' ) ) ?></td>
|
<td class="colSource"><?php echo makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$dclass.'">'.$shortpath.'</span>', canEdit( 'Monitors' ) ) ?></td>
|
||||||
<?php } elseif ( $monitor['Type'] == "cURL" ) { ?>
|
<?php } elseif ( $monitor['Type'] == "cURL" ) { ?>
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
var jsTranslatedAddText;
|
||||||
|
var jsTranslatedCloneText;
|
||||||
|
|
||||||
function setButtonStates( element )
|
function setButtonStates( element )
|
||||||
{
|
{
|
||||||
var form = element.form;
|
var form = element.form;
|
||||||
|
@ -15,9 +18,36 @@ function setButtonStates( element )
|
||||||
}
|
}
|
||||||
$(element).getParent( 'tr' ).toggleClass( 'highlight' );
|
$(element).getParent( 'tr' ).toggleClass( 'highlight' );
|
||||||
form.editBtn.disabled = (checked!=1);
|
form.editBtn.disabled = (checked!=1);
|
||||||
|
form.addBtn.value = (checked==1) ? jsTranslatedCloneText:jsTranslatedAddText;
|
||||||
|
|
||||||
form.deleteBtn.disabled = (checked==0);
|
form.deleteBtn.disabled = (checked==0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addMonitor( element)
|
||||||
|
{
|
||||||
|
|
||||||
|
var form = element.form;
|
||||||
|
var dupParam;
|
||||||
|
var monitorId=-1;
|
||||||
|
if (form.addBtn.value == jsTranslatedCloneText)
|
||||||
|
{
|
||||||
|
// get the value of the first checkbox
|
||||||
|
for ( var i = 0; i < form.elements.length; i++ )
|
||||||
|
{
|
||||||
|
if ( form.elements[i].type == "checkbox" )
|
||||||
|
{
|
||||||
|
if ( form.elements[i].checked )
|
||||||
|
{
|
||||||
|
monitorId = form.elements[i].value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dupParam = (monitorId == -1 ) ? '': '&dupId='+monitorId;
|
||||||
|
createPopup( '?view=monitor'+dupParam, 'zmMonitor0','monitor' );
|
||||||
|
}
|
||||||
|
|
||||||
function editMonitor( element )
|
function editMonitor( element )
|
||||||
{
|
{
|
||||||
var form = element.form;
|
var form = element.form;
|
||||||
|
@ -55,6 +85,8 @@ function reloadWindow()
|
||||||
|
|
||||||
function initPage()
|
function initPage()
|
||||||
{
|
{
|
||||||
|
jsTranslatedAddText = translatedAddText;
|
||||||
|
jsTranslatedCloneText = translatedCloneText;
|
||||||
reloadWindow.periodical( consoleRefreshTimeout );
|
reloadWindow.periodical( consoleRefreshTimeout );
|
||||||
if ( showVersionPopup )
|
if ( showVersionPopup )
|
||||||
createPopup( '?view=version', 'zmVersion', 'version' );
|
createPopup( '?view=version', 'zmVersion', 'version' );
|
||||||
|
|
|
@ -26,7 +26,7 @@ elseif ( ZM_DYN_SHOW_DONATE_REMINDER )
|
||||||
?>
|
?>
|
||||||
var showVersionPopup = <?php echo isset($showVersionPopup )?'true':'false' ?>;
|
var showVersionPopup = <?php echo isset($showVersionPopup )?'true':'false' ?>;
|
||||||
var showDonatePopup = <?php echo isset($showDonatePopup )?'true':'false' ?>;
|
var showDonatePopup = <?php echo isset($showDonatePopup )?'true':'false' ?>;
|
||||||
|
var translatedAddText = "<?php echo translate('AddNewMonitor') ?>";
|
||||||
|
var translatedCloneText = "<?php echo translate('CloneMonitor') ?>";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,11 +42,11 @@ if ( isset($_REQUEST['tab']) )
|
||||||
else
|
else
|
||||||
$tab = "general";
|
$tab = "general";
|
||||||
|
|
||||||
$Server = null;
|
$Server = null;
|
||||||
if ( defined( 'ZM_SERVER_ID' ) ) {
|
if ( defined( 'ZM_SERVER_ID' ) ) {
|
||||||
$Server = dbFetchOne( 'SELECT * FROM Servers WHERE Id=?', NULL, array( ZM_SERVER_ID ) );
|
$Server = dbFetchOne( 'SELECT * FROM Servers WHERE Id=?', NULL, array( ZM_SERVER_ID ) );
|
||||||
}
|
}
|
||||||
if ( ! $Server ) {
|
if ( ! $Server ) {
|
||||||
$Server = array( 'Id' => '' );
|
$Server = array( 'Id' => '' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,74 +56,11 @@ if ( ! empty($_REQUEST['mid']) ) {
|
||||||
$x10Monitor = dbFetchOne( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid']) );
|
$x10Monitor = dbFetchOne( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid']) );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$nextId = getTableAutoInc( 'Monitors' );
|
$nextId = getTableAutoInc( 'Monitors' );
|
||||||
$monitor = array(
|
$monitor = getMonitorObject($_REQUEST['dupId']);
|
||||||
'Id' => 0,
|
$clonedName = $monitor['Name'];
|
||||||
'Name' => translate('Monitor').'-'.$nextId,
|
$monitor['Name'] = translate('Monitor').'-'.$nextId;
|
||||||
'Function' => "Monitor",
|
$monitor['Id']='0';
|
||||||
'Enabled' => true,
|
|
||||||
'LinkedMonitors' => "",
|
|
||||||
'Type' => "",
|
|
||||||
'Device' => "/dev/video0",
|
|
||||||
'Channel' => "0",
|
|
||||||
'Format' => 0x000000ff,
|
|
||||||
'Protocol' => "",
|
|
||||||
'Method' => "",
|
|
||||||
'Host' => "",
|
|
||||||
'Path' => "",
|
|
||||||
'Options' => "",
|
|
||||||
'Port' => "80",
|
|
||||||
'User' => "",
|
|
||||||
'Pass' => "",
|
|
||||||
'Colours' => 3,
|
|
||||||
'Palette' => 0,
|
|
||||||
'Width' => "320",
|
|
||||||
'Height' => "240",
|
|
||||||
'Orientation' => "0",
|
|
||||||
'Deinterlacing' => 0,
|
|
||||||
'RTSPDescribe' => 0,
|
|
||||||
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S',
|
|
||||||
'LabelX' => 0,
|
|
||||||
'LabelY' => 0,
|
|
||||||
'LabelSize' => 1,
|
|
||||||
'ImageBufferCount' => 50,
|
|
||||||
'WarmupCount' => 25,
|
|
||||||
'PreEventCount' => 25,
|
|
||||||
'PostEventCount' => 25,
|
|
||||||
'StreamReplayBuffer' => 1000,
|
|
||||||
'AlarmFrameCount' => 1,
|
|
||||||
'Controllable' => 0,
|
|
||||||
'ControlId' => "",
|
|
||||||
'ControlType' => 0,
|
|
||||||
'ControlDevice' => "",
|
|
||||||
'ControlAddress' => "",
|
|
||||||
'AutoStopTimeout' => "",
|
|
||||||
'TrackMotion' => 0,
|
|
||||||
'TrackDelay' => "",
|
|
||||||
'ReturnLocation' => -1,
|
|
||||||
'ReturnDelay' => "",
|
|
||||||
'SectionLength' => 600,
|
|
||||||
'FrameSkip' => 0,
|
|
||||||
'MotionFrameSkip' => 0,
|
|
||||||
'EventPrefix' => 'Event-',
|
|
||||||
'AnalysisFPS' => "",
|
|
||||||
'AnalysisUpdateDelay' => 0,
|
|
||||||
'MaxFPS' => "",
|
|
||||||
'AlarmMaxFPS' => "",
|
|
||||||
'FPSReportInterval' => 1000,
|
|
||||||
'RefBlendPerc' => 6,
|
|
||||||
'AlarmRefBlendPerc' => 6,
|
|
||||||
'DefaultView' => 'Events',
|
|
||||||
'DefaultRate' => '100',
|
|
||||||
'DefaultScale' => '100',
|
|
||||||
'SignalCheckColour' => '#0000c0',
|
|
||||||
'WebColour' => 'red',
|
|
||||||
'Exif' => '0',
|
|
||||||
'Triggers' => "",
|
|
||||||
'V4LMultiBuffer' => '',
|
|
||||||
'V4LCapturesPerFrame' => 1,
|
|
||||||
'ServerId' => $Server['Id'],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ZM_OPT_X10 && empty($x10Monitor) )
|
if ( ZM_OPT_X10 && empty($x10Monitor) )
|
||||||
|
@ -135,6 +72,85 @@ if ( ZM_OPT_X10 && empty($x10Monitor) )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMonitorObject( $mid = null)
|
||||||
|
{
|
||||||
|
if ($mid !== null)
|
||||||
|
{
|
||||||
|
$monitor = dbFetchMonitor($mid);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$monitor = array(
|
||||||
|
'Id' => 0,
|
||||||
|
'Name' => "willbereplaced",
|
||||||
|
'Function' => "Monitor",
|
||||||
|
'Enabled' => true,
|
||||||
|
'LinkedMonitors' => "",
|
||||||
|
'Type' => "",
|
||||||
|
'Device' => "/dev/video0",
|
||||||
|
'Channel' => "0",
|
||||||
|
'Format' => 0x000000ff,
|
||||||
|
'Protocol' => "",
|
||||||
|
'Method' => "",
|
||||||
|
'Host' => "",
|
||||||
|
'Path' => "",
|
||||||
|
'Options' => "",
|
||||||
|
'Port' => "80",
|
||||||
|
'User' => "",
|
||||||
|
'Pass' => "",
|
||||||
|
'Colours' => 3,
|
||||||
|
'Palette' => 0,
|
||||||
|
'Width' => "320",
|
||||||
|
'Height' => "240",
|
||||||
|
'Orientation' => "0",
|
||||||
|
'Deinterlacing' => 0,
|
||||||
|
'RTSPDescribe' => 0,
|
||||||
|
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S',
|
||||||
|
'LabelX' => 0,
|
||||||
|
'LabelY' => 0,
|
||||||
|
'LabelSize' => 1,
|
||||||
|
'ImageBufferCount' => 50,
|
||||||
|
'WarmupCount' => 25,
|
||||||
|
'PreEventCount' => 25,
|
||||||
|
'PostEventCount' => 25,
|
||||||
|
'StreamReplayBuffer' => 1000,
|
||||||
|
'AlarmFrameCount' => 1,
|
||||||
|
'Controllable' => 0,
|
||||||
|
'ControlId' => "",
|
||||||
|
'ControlType' => 0,
|
||||||
|
'ControlDevice' => "",
|
||||||
|
'ControlAddress' => "",
|
||||||
|
'AutoStopTimeout' => "",
|
||||||
|
'TrackMotion' => 0,
|
||||||
|
'TrackDelay' => "",
|
||||||
|
'ReturnLocation' => -1,
|
||||||
|
'ReturnDelay' => "",
|
||||||
|
'SectionLength' => 600,
|
||||||
|
'FrameSkip' => 0,
|
||||||
|
'MotionFrameSkip' => 0,
|
||||||
|
'EventPrefix' => 'Event-',
|
||||||
|
'AnalysisFPS' => "",
|
||||||
|
'AnalysisUpdateDelay' => 0,
|
||||||
|
'MaxFPS' => "",
|
||||||
|
'AlarmMaxFPS' => "",
|
||||||
|
'FPSReportInterval' => 1000,
|
||||||
|
'RefBlendPerc' => 6,
|
||||||
|
'AlarmRefBlendPerc' => 6,
|
||||||
|
'DefaultView' => 'Events',
|
||||||
|
'DefaultRate' => '100',
|
||||||
|
'DefaultScale' => '100',
|
||||||
|
'SignalCheckColour' => '#0000c0',
|
||||||
|
'WebColour' => 'red',
|
||||||
|
'Exif' => '0',
|
||||||
|
'Triggers' => "",
|
||||||
|
'V4LMultiBuffer' => '',
|
||||||
|
'V4LCapturesPerFrame' => 1,
|
||||||
|
'ServerId' => $Server['Id'],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return ($monitor);
|
||||||
|
}
|
||||||
|
|
||||||
function fourcc( $a, $b, $c, $d )
|
function fourcc( $a, $b, $c, $d )
|
||||||
{
|
{
|
||||||
return( ord($a) | (ord($b) << 8) | (ord($c) << 16) | (ord($d) << 24) );
|
return( ord($a) | (ord($b) << 8) | (ord($c) << 16) | (ord($d) << 24) );
|
||||||
|
@ -450,16 +466,31 @@ xhtmlHeaders(__FILE__, translate('Monitor')." - ".validHtmlStr($monitor['Name'])
|
||||||
if ( canEdit( 'Monitors' ) )
|
if ( canEdit( 'Monitors' ) )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( isset ($_REQUEST['dupId']))
|
||||||
|
{
|
||||||
|
$dupId = $_REQUEST['dupId'];
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="alert alert-info">
|
||||||
|
Configuration cloned from Monitor: <?php echo $clonedName ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<div id="headerButtons">
|
<div id="headerButtons">
|
||||||
<a href="#" onclick="createPopup( '?view=monitorprobe&mid=<?php echo $monitor['Id'] ?>', 'zmMonitorProbe<?php echo $monitor['Id'] ?>', 'monitorprobe' ); return( false );"><?php echo translate('Probe') ?></a>
|
<a href="#" onclick="createPopup( '?view=monitorprobe&mid=<?php echo $monitor['Id'] ?>', 'zmMonitorProbe<?php echo $monitor['Id'] ?>', 'monitorprobe' ); return( false );"><?php echo translate('Probe') ?></a>
|
||||||
<?php
|
<?php
|
||||||
if ( ZM_HAS_ONVIF )
|
if ( ZM_HAS_ONVIF )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<a href="#" onclick="createPopup( '?view=onvifprobe&mid=<?php echo $monitor['Id'] ?>', 'zmOnvifProbe<?php echo $monitor['Id'] ?>', 'onvifprobe' ); return( false );"><?php echo translate('OnvifProbe') ?></a>
|
<a href="#" onclick="createPopup( '?view=onvifprobe&mid=<?php echo $monitor['Id'] ?>', 'zmOnvifProbe<?php echo $monitor['Id'] ?>', 'onvifprobe' ); return( false );"><?php echo translate('OnvifProbe') ?></a>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<a href="#" onclick="createPopup( '?view=monitorpreset&mid=<?php echo $monitor['Id'] ?>', 'zmMonitorPreset<?php echo $monitor['Id'] ?>', 'monitorpreset' ); return( false );"><?php echo translate('Presets') ?></a>
|
<a href="#" onclick="createPopup( '?view=monitorpreset&mid=<?php echo $monitor['Id'] ?>', 'zmMonitorPreset<?php echo $monitor['Id'] ?>', 'monitorpreset' ); return( false );"><?php echo translate('Presets') ?></a>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
@ -651,14 +682,14 @@ switch ( $tab )
|
||||||
<tr><td><?php echo translate('Name') ?></td><td><input type="text" name="newMonitor[Name]" value="<?php echo validHtmlStr($newMonitor['Name']) ?>" size="16"/></td></tr>
|
<tr><td><?php echo translate('Name') ?></td><td><input type="text" name="newMonitor[Name]" value="<?php echo validHtmlStr($newMonitor['Name']) ?>" size="16"/></td></tr>
|
||||||
<tr><td><?php echo translate('Server') ?></td><td>
|
<tr><td><?php echo translate('Server') ?></td><td>
|
||||||
<?php
|
<?php
|
||||||
$servers = array(''=>'None');
|
$servers = array(''=>'None');
|
||||||
$result = dbQuery( 'SELECT * FROM Servers ORDER BY Name');
|
$result = dbQuery( 'SELECT * FROM Servers ORDER BY Name');
|
||||||
$results = $result->fetchALL(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Server' );
|
$results = $result->fetchALL(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Server' );
|
||||||
foreach ( $results as $row => $server_obj ) {
|
foreach ( $results as $row => $server_obj ) {
|
||||||
$servers[$server_obj->Id] = $server_obj->Name();
|
$servers[$server_obj->Id] = $server_obj->Name();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php echo buildSelect( "newMonitor[ServerId]", $servers ); ?>
|
<?php echo buildSelect( "newMonitor[ServerId]", $servers ); ?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><?php echo translate('SourceType') ?></td><td><?php echo buildSelect( "newMonitor[Type]", $sourceTypes ); ?></td></tr>
|
<tr><td><?php echo translate('SourceType') ?></td><td><?php echo buildSelect( "newMonitor[Type]", $sourceTypes ); ?></td></tr>
|
||||||
<tr><td><?php echo translate('Function') ?></td><td><select name="newMonitor[Function]">
|
<tr><td><?php echo translate('Function') ?></td><td><select name="newMonitor[Function]">
|
||||||
|
@ -709,13 +740,13 @@ switch ( $tab )
|
||||||
<tr><td><?php echo translate('AlarmMaximumFPS') ?></td><td><input type="text" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/></td></tr>
|
<tr><td><?php echo translate('AlarmMaximumFPS') ?></td><td><input type="text" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/></td></tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if ( ZM_FAST_IMAGE_BLENDS )
|
if ( ZM_FAST_IMAGE_BLENDS )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr><td><?php echo translate('RefImageBlendPct') ?></td><td><select name="newMonitor[RefBlendPerc]"><?php foreach ( $fastblendopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['RefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?php echo translate('RefImageBlendPct') ?></td><td><select name="newMonitor[RefBlendPerc]"><?php foreach ( $fastblendopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['RefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
||||||
<tr><td><?php echo translate('AlmRefImageBlendPct') ?></td><td><select name="newMonitor[AlarmRefBlendPerc]"><?php foreach ( $fastblendopts_alarm as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['AlarmRefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?php echo translate('AlmRefImageBlendPct') ?></td><td><select name="newMonitor[AlarmRefBlendPerc]"><?php foreach ( $fastblendopts_alarm as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['AlarmRefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<tr><td><?php echo translate('RefImageBlendPct') ?></td><td><input type="text" name="newMonitor[RefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['RefBlendPerc']) ?>" size="4"/></td></tr>
|
<tr><td><?php echo translate('RefImageBlendPct') ?></td><td><input type="text" name="newMonitor[RefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['RefBlendPerc']) ?>" size="4"/></td></tr>
|
||||||
<tr><td><?php echo translate('AlarmRefImageBlendPct') ?></td><td><input type="text" name="newMonitor[AlarmRefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['AlarmRefBlendPerc']) ?>" size="4"/></td></tr>
|
<tr><td><?php echo translate('AlarmRefImageBlendPct') ?></td><td><input type="text" name="newMonitor[AlarmRefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['AlarmRefBlendPerc']) ?>" size="4"/></td></tr>
|
||||||
|
@ -775,15 +806,15 @@ switch ( $tab )
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr><td><?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 ( $newMonitor['V4LMultiBuffer'] == 1 ? 'checked="checked"' : '' ) ?>/>
|
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]1" value="1" <?php echo ( $newMonitor['V4LMultiBuffer'] == 1 ? 'checked="checked"' : '' ) ?>/>
|
||||||
<label for="newMonitor[V4LMultiBuffer]1">Yes</label>
|
<label for="newMonitor[V4LMultiBuffer]1">Yes</label>
|
||||||
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]0" value="0" <?php echo ( $newMonitor['V4LMultiBuffer'] == 0 ? 'checked="checked"' : '' ) ?>/>
|
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]0" value="0" <?php echo ( $newMonitor['V4LMultiBuffer'] == 0 ? 'checked="checked"' : '' ) ?>/>
|
||||||
<label for="newMonitor[V4LMultiBuffer]0">No</label>
|
<label for="newMonitor[V4LMultiBuffer]0">No</label>
|
||||||
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]" value="" <?php echo ( empty($newMonitor['V4LMultiBuffer']) ? 'checked="checked"' : '' ) ?>/>
|
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]" value="" <?php echo ( empty($newMonitor['V4LMultiBuffer']) ? 'checked="checked"' : '' ) ?>/>
|
||||||
<label for="newMonitor[V4LMultiBuffer]">Use Config Value</label>
|
<label for="newMonitor[V4LMultiBuffer]">Use Config Value</label>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><?php echo translate('V4LCapturesPerFrame') ?></td><td><input type="number" name="newMonitor[V4LCapturesPerFrame]" value="<?php echo $newMonitor['V4LCapturesPerFrame'] ?>"/></td></tr>
|
<tr><td><?php echo translate('V4LCapturesPerFrame') ?></td><td><input type="number" name="newMonitor[V4LCapturesPerFrame]" value="<?php echo $newMonitor['V4LCapturesPerFrame'] ?>"/></td></tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
elseif ( $newMonitor['Type'] == "Remote" )
|
elseif ( $newMonitor['Type'] == "Remote" )
|
||||||
|
@ -826,9 +857,9 @@ switch ( $tab )
|
||||||
elseif ( $newMonitor['Type'] == "Ffmpeg" || $newMonitor['Type'] == "Libvlc")
|
elseif ( $newMonitor['Type'] == "Ffmpeg" || $newMonitor['Type'] == "Libvlc")
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr><td><?php echo translate('SourcePath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
|
<tr><td><?php echo translate('SourcePath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
|
||||||
<tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo buildSelect( "newMonitor[Method]", $rtspMethods ); ?></td></tr>
|
<tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo buildSelect( "newMonitor[Method]", $rtspMethods ); ?></td></tr>
|
||||||
<tr><td><?php echo translate('Options') ?> (<?php echo makePopupLink( '?view=optionhelp&option=OPTIONS_'.strtoupper($newMonitor['Type']), 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" name="newMonitor[Options]" value="<?php echo validHtmlStr($newMonitor['Options']) ?>" size="36"/></td></tr>
|
<tr><td><?php echo translate('Options') ?> (<?php echo makePopupLink( '?view=optionhelp&option=OPTIONS_'.strtoupper($newMonitor['Type']), 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" name="newMonitor[Options]" value="<?php echo validHtmlStr($newMonitor['Options']) ?>" size="36"/></td></tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -956,8 +987,9 @@ switch ( $tab )
|
||||||
<div id="contentButtons">
|
<div id="contentButtons">
|
||||||
<input type="submit" value="<?php echo translate('Save') ?>"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/><input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow()"/>
|
<input type="submit" value="<?php echo translate('Save') ?>"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/><input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow()"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue