1
0
mirror of https://github.com/DigitalDevices/octonet.git synced 2023-10-10 13:36:52 +02:00
octonet/octoserve/var/www/tunerstatus.html

126 lines
3.6 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML>
2015-08-05 22:22:06 +02:00
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2015-08-05 22:22:06 +02:00
<title>OctopusNet</title>
<link rel="stylesheet" type="text/css" href="/style.css">
<script type="text/javascript" src="/menu.js"></script>
<!-- Add additional scripts and settings here -->
<meta http-equiv="Pragma" content="no-cache" />
<!-- Add page scripts here -->
<script type="text/javascript">
var xmlhttp = new XMLHttpRequest();
var url = "/octoserve/tunerstatus.json";
xmlhttp.onreadystatechange=function()
2015-08-05 22:22:06 +02:00
{
if (xmlhttp.readyState == 4 )
{
if( xmlhttp.status == 200 )
myFunction(xmlhttp.responseText);
}
}
function myFunction(response)
{
try
{
var tl = JSON.parse(response);
Show(tl.TunerList);
}
catch(err) {}
window.setTimeout(renew,1000);
}
function Show(TunerList)
{
for( var i = 0; i < TunerList.length ; i++ )
2015-08-05 22:22:06 +02:00
{
if( TunerList[i].Status != "Inactive" )
2015-08-05 22:22:06 +02:00
{
if( TunerList[i].Lock )
{
document.getElementById("tdStatus"+i).firstChild.nodeValue = "Locked";
document.getElementById("tdStrength"+i).firstChild.nodeValue = (TunerList[i].Strength/1000+108.75).toFixed(1)+" dBµV";
document.getElementById("tdSNR"+i).firstChild.nodeValue = (TunerList[i].SNR/1000).toFixed(1) + " dB";
document.getElementById("tdQuality"+i).firstChild.nodeValue = TunerList[i].Quality.toFixed(0) + "%";
2015-08-05 22:22:06 +02:00
}
else
{
document.getElementById("tdStatus"+i).firstChild.nodeValue = "No Signal";
document.getElementById("tdStrength"+i).firstChild.nodeValue = "";
document.getElementById("tdSNR"+i).firstChild.nodeValue = "";
document.getElementById("tdQuality"+i).firstChild.nodeValue = "";
2015-08-05 22:22:06 +02:00
}
}
document.getElementById("trTuner"+i).style.display = "table-row";
2015-08-05 22:22:06 +02:00
}
}
function renew()
{
xmlhttp.open("GET", url, true);
xmlhttp.send();
}
function OnLoad()
{
window.setTimeout(renew,1000);
2015-08-05 22:22:06 +02:00
}
</script>
</head>
<body onload="OnLoad()">
2015-08-05 22:22:06 +02:00
<table class="maintable" align="center">
<colgroup>
<col width="182px"/>
<col width="728px"/>
</colgroup>
<tr><td class="maintd" colspan="2">
<a href="http://www.digitaldevices.de"><img src="/BannerDD.jpg" alt="DD" width="910" height="130" /></a>
</td></tr>
<tr><td class="maintd" colspan="2">&nbsp;</td></tr>
<tr>
<td class="maintd"><script type="text/javascript">CreateMenu();</script></td>
<td class="maintd">
<div class="content">
<!-- Begin Content -->
<table id="tunerstatus" align="center">
<tr>
<th>Tuner</th>
<th>Lock</th>
<th>Strength</th>
<th>SNR</th>
<th>Quality</th>
</tr>
<script type="text/javascript">
for( var i = 0; i < 12 ; i++ )
{
document.write('<tr id="trTuner'+i+'" style="display:none">');
document.write('<td>' + (i+1) + '</td>');
document.write('<td id="tdStatus'+i+'">&nbsp;</td>');
document.write('<td id="tdStrength'+i+'">&nbsp;</td>');
document.write('<td id="tdSNR'+i+'">&nbsp;</td>');
document.write('<td id="tdQuality'+i+'">&nbsp;</td>');
document.write('</tr>');
}
</script>
2015-08-05 22:22:06 +02:00
</table>
<!-- End Content -->
</div>
</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
</table>
</body>
</html>