spacing, default to fixed when appropriate, include state html if not website

pull/3468/head
Isaac Connor 2022-04-19 17:06:34 -04:00
parent 3885d853f9
commit b519e3b388
1 changed files with 42 additions and 34 deletions

View File

@ -29,7 +29,6 @@ include('_monitor_filters.php');
$filterbar = ob_get_contents(); $filterbar = ob_get_contents();
ob_end_clean(); ob_end_clean();
// This is for input sanitation // This is for input sanitation
$mid = isset($_REQUEST['mid']) ? intval($_REQUEST['mid']) : 0; $mid = isset($_REQUEST['mid']) ? intval($_REQUEST['mid']) : 0;
@ -121,21 +120,28 @@ $options['scale'] = $scale;
if (isset($_REQUEST['width'])) { if (isset($_REQUEST['width'])) {
$options['width'] = validInt($_REQUEST['width']); $options['width'] = validInt($_REQUEST['width']);
} else if ( isset($_COOKIE['zmCycleWidth']) and $_COOKIE['zmCycleWidth'] ) { } else if ( isset($_COOKIE['zmWatchWidth']) and $_COOKIE['zmWatchWidth'] ) {
$options['width'] = $_COOKIE['zmCycleWidth']; $options['width'] = $_COOKIE['zmWatchWidth'];
} else { } else {
$options['width'] = ''; $options['width'] = '';
} }
if (isset($_REQUEST['height'])) { if (isset($_REQUEST['height'])) {
$options['height'] =validInt($_REQUEST['height']); $options['height'] =validInt($_REQUEST['height']);
} else if (isset($_COOKIE['zmCycleHeight']) and $_COOKIE['zmCycleHeight']) { } else if (isset($_COOKIE['zmWatchHeight']) and $_COOKIE['zmWatchHeight']) {
$options['height'] = $_COOKIE['zmCycleHeight']; $options['height'] = $_COOKIE['zmWatchHeight'];
} else { } else {
$options['height'] = ''; $options['height'] = '';
} }
if (
($options['width'] and ($options['width'] != 'auto'))
or
($options['height'] and ($options['height'] != 'auto'))
) {
$options['scale'] = 'fixed';
}
$connkey = generateConnKey(); $connkey = generateConnKey();
if ( $monitor->JanusEnabled() ) { if ($monitor->JanusEnabled()) {
$streamMode = 'janus'; $streamMode = 'janus';
} else { } else {
$streamMode = getStreamMode(); $streamMode = getStreamMode();
@ -207,10 +213,10 @@ if ( $monitor->Status() != 'Connected' and $monitor->Type() != 'WebSite' ) {
echo '<div class="warning">Monitor is not capturing. We will be unable to provide an image</div>'; echo '<div class="warning">Monitor is not capturing. We will be unable to provide an image</div>';
} }
?> ?>
<div class="container-fluid h-100"> <div class="container-fluid h-100">
<div class="row flex-nowrap h-100" id="content"> <div class="row flex-nowrap h-100" id="content">
<nav id="sidebar" class="h-100"<?php echo $showCycle?'':' style="display:none;"'?>> <nav id="sidebar" class="h-100"<?php echo $showCycle?'':' style="display:none;"'?>>
<div id="cycleButtons" class="buttons"> <div id="cycleButtons" class="buttons">
<?php <?php
$seconds = translate('seconds'); $seconds = translate('seconds');
$minute = translate('minute'); $minute = translate('minute');
@ -227,40 +233,42 @@ if (!isset($cyclePeriodOptions[ZM_WEB_REFRESH_CYCLE])) {
} }
echo htmlSelect('cyclePeriod', $cyclePeriodOptions, $period, array('id'=>'cyclePeriod')); echo htmlSelect('cyclePeriod', $cyclePeriodOptions, $period, array('id'=>'cyclePeriod'));
?> ?>
<span id="secondsToCycle"></span><br/> <span id="secondsToCycle"></span><br/>
<button type="button" id="cyclePrevBtn" title="<?php echo translate('PreviousMonitor') ?>"> <button type="button" id="cyclePrevBtn" title="<?php echo translate('PreviousMonitor') ?>">
<i class="material-icons md-18">skip_previous</i> <i class="material-icons md-18">skip_previous</i>
</button> </button>
<button type="button" id="cyclePauseBtn" title="<?php echo translate('PauseCycle') ?>"> <button type="button" id="cyclePauseBtn" title="<?php echo translate('PauseCycle') ?>">
<i class="material-icons md-18">pause</i> <i class="material-icons md-18">pause</i>
</button> </button>
<button type="button" id="cyclePlayBtn" title="<?php echo translate('PlayCycle') ?>"> <button type="button" id="cyclePlayBtn" title="<?php echo translate('PlayCycle') ?>">
<i class="material-icons md-18">play_arrow</i> <i class="material-icons md-18">play_arrow</i>
</button> </button>
<button type="button" id="cycleNextBtn" title="<?php echo translate('NextMonitor') ?>"> <button type="button" id="cycleNextBtn" title="<?php echo translate('NextMonitor') ?>">
<i class="material-icons md-18">skip_next</i> <i class="material-icons md-18">skip_next</i>
</button> </button>
</div> </div>
<ul class="nav nav-pills flex-column h-100"> <ul class="nav nav-pills flex-column h-100">
<?php <?php
foreach ($monitors as $m) { foreach ($monitors as $m) {
echo '<li class="nav-item"><a class="nav-link'.( $m->Id() == $monitor->Id() ? ' active' : '' ).'" href="?view=watch&amp;mid='.$m->Id().'">'.$m->Name().'</a></li>'; echo '<li class="nav-item"><a class="nav-link'.( $m->Id() == $monitor->Id() ? ' active' : '' ).'" href="?view=watch&amp;mid='.$m->Id().'">'.$m->Name().'</a></li>';
} }
?> ?>
</ul> </ul>
</nav> </nav>
<div class="container-fluid col-sm-offset-2 h-100 pr-0"> <div class="container-fluid col-sm-offset-2 h-100 pr-0"
<div id="imageFeed<?php echo $monitor->Id() ?>"
<?php <?php
if ($streamMode == 'jpeg') { if ($streamMode == 'jpeg') {
echo 'title="Click to zoom, shift click to pan, ctrl click to zoom out"'; echo 'title="Click to zoom, shift click to pan, ctrl click to zoom out"';
} }
?> ?>
><?php echo getStreamHTML($monitor, $options); ?> >
</div> <?php
<?php if ($monitor->Type() != 'WebSite') { if ($monitor->Type() != 'WebSite') {
echo $monitor->getMonitorStateHTML(); $options['state'] = true;
?> }
echo $monitor->getStreamHTML($options);
if ($monitor->Type() != 'WebSite') {
?>
<div class="buttons" id="dvrControls"> <div class="buttons" id="dvrControls">
<?php <?php
if ($streamMode == 'jpeg') { if ($streamMode == 'jpeg') {