Fix PrevCycle because monIdx was empty.

This commit is contained in:
Isaac Connor 2021-12-14 17:05:56 -05:00
parent 4fa804e9a2
commit f6d0274f74
2 changed files with 6 additions and 3 deletions

View File

@ -904,9 +904,10 @@ function initPage() {
if (monitorType != 'WebSite') {
if (streamMode == 'single') {
statusCmdTimer = setTimeout(statusCmdQuery, (Math.random()+0.1)*statusRefreshTimeout);
statusCmdTimer = setTimeout(statusCmdQuery, 100);
setInterval(watchdogCheck, statusRefreshTimeout*2, 'status');
} else {
streamCmdTimer = setTimeout(streamCmdQuery, 100);
setInterval(watchdogCheck, statusRefreshTimeout*2, 'stream');
}
@ -1054,9 +1055,11 @@ function cycleNext() {
}
function cyclePrev() {
console.log(monIdx);
monIdx --;
if (monIdx < 0) {
monIdx = monitorData.length - 1;
console.log(monIdx);
}
if (!monitorData[monIdx]) {
console.log('No monitorData for ' + monIdx);

View File

@ -1,5 +1,5 @@
<?php
global $monIdx;
global $monitor_index;
global $nextMid;
global $options;
global $monitors;
@ -53,7 +53,7 @@ var monitorRefresh = '<?php echo $monitor->Refresh() ?>';
var monitorStreamReplayBuffer = <?php echo $monitor->StreamReplayBuffer() ?>;
var monitorControllable = <?php echo $monitor->Controllable()?'true':'false' ?>;
var monIdx = '<?php echo $monIdx; ?>';
var monIdx = <?php echo $monitor_index; ?>;
var nextMid = "<?php echo isset($nextMid)?$nextMid:'' ?>";
var mode = "<?php echo $options['mode'] ?>";