-
Notifications
You must be signed in to change notification settings - Fork 1
/
querytest.html
89 lines (84 loc) · 2.39 KB
/
querytest.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<title>Remoku</title>
<style>
.address{
width:30px;}
</style>
<script type="text/javascript">
var rokuFound = false;
var lastOctet = 1;
var address = "";
var rokus = [];
var rokuCount = 2;
var canceled = false;
var cancel;
function findRokus(){
var ifr = document.getElementById('apps');
if (lastOctet<255 && rokus.length != rokuCount && cancel!=true){
rokuFound = false;
address = document.getElementById('octet1').value+"."+document.getElementById('octet2').value+"."+document.getElementById('octet3').value+"."+lastOctet;
ifr.src = "http://" + address +":8060/query/apps";
setTimeout('checkRokuLoadResult()',750);
}else{
lastOctet = 1;
ifr.src = "about:blank";
//document.getElementById('rokus').innerHTML=rokus;
var rokupicker = "<form><select>";
while(rokus.length>0){
rokupicker += "<option>"+rokus.shift();+ "</option>"//TODOHERE
}
rokupicker +="<select></form>";
document.getElementById('rokus').innerHTML=rokupicker;
cancel=false;
document.getElementById('scan').innerHTML="Scan";
canceled = false;
return true;
}
}
function loadedframe(){
rokuFound = true;
}
function checkRokuLoadResult(){
var result
if (rokuFound == true ){
result = "Loaded: " + address + "<br>";
rokus.push(address);
} else {
result = "Not Loaded: " + address + "<br>";
}
document.getElementById('rokus').innerHTML=result + "Total: " + rokus.length;
lastOctet++;
findRokus();
}
function Scan(){
if(canceled==false){
document.getElementById('scan').innerHTML="Cancel Scan";
cancel = false
canceled=true;
findRokus();
}
else{
canceled = false;
cancel = true;
document.getElementById('scan').innerHTML="Scan";
}
}
</script>
</head>
<body>
<div id="content">
<h1>Scan for Network for Rokus</h1>
<label>Network Base Address</label>
<input class="address" id="octet1" value="192"></input>.<input class="address" id="octet2" value="168"></input>.<input class="address" id="octet3" value="1"></input>.X
<iframe style="visibility:none; display: none;"
id="apps" src="about:blank" onload="loadedframe();">
</iframe>
</div>
<div id="rokus"></div>
<button id="scan" onclick="Scan();">Scan</button>
</body>
</html>