populate mid if specified to enable reusing mids. Fix auto-populating resolution dropdown

This commit is contained in:
Isaac Connor 2021-02-01 16:45:13 -05:00
parent 0dc6b60985
commit 49209d9e72
1 changed files with 7 additions and 4 deletions

View File

@ -465,7 +465,7 @@ if ( canEdit('Monitors') ) {
<div class="d-flex flex-row container-fluid pr-0"> <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">
<input type="hidden" name="tab" value="<?php echo $tab?>"/> <input type="hidden" name="tab" value="<?php echo $tab?>"/>
<input type="hidden" name="mid" value="<?php echo $monitor->Id()?>"/> <input type="hidden" name="mid" value="<?php echo $monitor->Id() ? $monitor->Id() : validHtmlStr($_REQUEST['mid']) ?>"/>
<input type="hidden" name="origMethod" value="<?php echo ( null !== $monitor->Method())?validHtmlStr($monitor->Method()):'' ?>"/> <input type="hidden" name="origMethod" value="<?php echo ( null !== $monitor->Method())?validHtmlStr($monitor->Method()):'' ?>"/>
<div class="tab-content" id="pills-tabContent"> <div class="tab-content" id="pills-tabContent">
<?php <?php
@ -872,9 +872,12 @@ include('_monitor_source_nvsocket.php');
'2592x1944'=>'2592x1944 5MP', '2592x1944'=>'2592x1944 5MP',
'3840x2160'=>'3840x2160 4K UHD', '3840x2160'=>'3840x2160 4K UHD',
); );
$selected = $monitor->Width().'x'.$monitor->Height(); $selected = '';
if ( ! ($monitor->Width() and $monitor->Height()) ) { if ( $monitor->Width() and $monitor->Height() ) {
$resolutions[$selected] = $selected; $selected = $monitor->Width().'x'.$monitor->Height();
if ( ! isset($resolutions[$selected]) ) {
$resolutions[$selected] = $selected;
}
} }
echo htmlselect('dimensions_select', $resolutions, $selected); echo htmlselect('dimensions_select', $resolutions, $selected);
?> ?>