Add DecodingEnabled to Function modal

This commit is contained in:
Isaac Connor 2020-12-10 14:06:40 -05:00
parent ced396e437
commit 4667e21636
4 changed files with 27 additions and 4 deletions

View File

@ -50,7 +50,7 @@ if ( !canEdit('Monitors') ) return;
?>
</div>
</div>
<div class="form-group" id="FunctionEnabled">
<div class="form-group" id="FunctionAnalysisEnabled">
<label for="newEnabled"><?php echo translate('Analysis Enabled') ?></label>
<input type="checkbox" name="newEnabled" id="newEnabled" value="1"/>
<?php
@ -59,6 +59,16 @@ if ( !canEdit('Monitors') ) return;
}
?>
</div>
<div class="form-group" id="FunctionDecodingEnabled">
<label for="newDecodingEnabled"><?php echo translate('Decoding Enabled') ?></label>
<input type="checkbox" name="newDecodingEnabled" id="newDecodingEnabled" value="1"/>
<?php
if ( isset($OLANG['FUNCTION_DECODING_ENABLED']) ) {
echo '<div class="form-text">'.$OLANG['FUNCTION_DECODING_ENABLED']['Help'].'</div>';
}
?>
</div>
</div>
<div class="modal-footer">

View File

@ -1130,7 +1130,13 @@ $OLANG = array(
When not enabled no motion detection or linked monitor checking will be performed and
no events will be created. The zma process will still be running waiting to be enabled.
'
)
),
'FUNCTION_DECODING_ENABLED' => array(
'Help' => '
When in Record or Nodect mode and using H264Passthrough with no jpegs being saved, we can
optionally choose to not decode the H264/H265 packets. This will drastically reduce cpu use
but will make live view unavailable for this monitor.'
),
// 'LANG_DEFAULT' => array(
// 'Prompt' => "This is a new prompt for this option",

View File

@ -155,15 +155,21 @@ function manageFunctionModal(evt) {
$j('#function_help div').hide();
$j('#'+this.value+'Help').show();
if ( this.value == 'Monitor' || this.value == 'None' ) {
$j('#FunctionEnabled').hide();
$j('#FunctionAnalysisEnabled').hide();
} else {
$j('#FunctionEnabled').show();
$j('#FunctionAnalysisEnabled').show();
}
if ( this.value == 'Record' || this.value == 'Nodect' ) {
$j('#FunctionDecodingEnabled').show();
} else {
$j('#FunctionDecodingEnabled').hide();
}
};
function_form.elements['newFunction'].value = monitor.Function;
function_form.elements['newFunction'].onchange();
function_form.elements['newEnabled'].checked = monitor.Enabled == '1';
function_form.elements['newDecodingEnabled'].checked = monitor.DecodingEnabled == '1';
function_form.elements['mid'].value = mid;
document.getElementById('function_monitor_name').innerHTML = monitor.Name;

View File

@ -25,6 +25,7 @@ var monitors = new Array();
'Type': '<?php echo $monitor->Type() ?>',
'Function': '<?php echo $monitor->Function() ?>',
'Enabled': '<?php echo $monitor->Enabled() ?>'
'DecodingEnabled': '<?php echo $monitor->DecodingEnabled() ?>'
};
<?php
}