-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSoftReset_Buttons.html
More file actions
70 lines (66 loc) · 2.63 KB
/
SoftReset_Buttons.html
File metadata and controls
70 lines (66 loc) · 2.63 KB
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
<!DOCTYPE html>
<html><head>
<meta charset="windows-1252" />
<title>MCM9000 API: To SoftReset MCMs</title>
</head>
<body>
<h2>MCM9000 API: SoftReset MCMs</h2>
Enter MCM User Name: <input type="text" id="user" value="Admin">Password: <input type="password" id="password" value="Admin">
<div>
<span class="replace"> Displays Status </span>
</div>
<!-- I suggest you hard code values for quick operator pages -->
<br>
<input type="button" id="btn1" value="SoftReset 1" onclick="Btn1Command()">
MCM IP: <input type="text" id="IP1" value="192.168.3.54">
<br>
<br>
<input type="button" id="btn2" value="SoftReset 2" onclick="Btn2Command()">
MCM IP: <input type="text" id="IP2" value="192.168.3.55">
<br>
<br>
<input type="button" id="btn3" value="SoftReset 3" onclick="Btn3Command()">
MCM IP: <input type="text" id="IP3" value="192.168.3.56">
<br>
<br>
<input type="button" id="btn4" value="SoftReset 4" onclick="Btn4Command()">
MCM IP: <input type="text" id="IP4" value="192.168.3.57">
<script>
var XMLReq;
var AddressIP,BtnName;
// Setting Values befor call
function Btn1Command() {
AddressIP = document.getElementById('IP1').value ;
document.getElementById('btn1').value = "Sent" ;
PostMCMCommand();
}
function Btn2Command() {
AddressIP = document.getElementById('IP2').value ;
document.getElementById('btn2').value = "Sent" ;
PostMCMCommand();
}
function Btn3Command() {
AddressIP = document.getElementById('IP3').value ;
document.getElementById('btn3').value = "Sent" ;
PostMCMCommand();
}
function Btn4Command() {
AddressIP = document.getElementById('IP4').value ;
document.getElementById('btn4').value = "Sent" ;
PostMCMCommand();
}
// With set var of AddressIP and username and password set, it sends SoftReset command
function PostMCMCommand() {
XMLReq = new XMLHttpRequest();
XMLReq.onreadystatechange = function()
{
document.getElementsByClassName("replace")[0].innerHTML = "SoftReset: "+ AddressIP
+" (200 is good for return) Returned: " + XMLReq.status;
};
XMLReq.open("Get", "http://" + AddressIP + "/api/2.0/devices/command/softReset/.json");
XMLReq.setRequestHeader("Authorization", 'Basic ' + btoa("Admin:Admin"));
XMLReq.setRequestHeader("Content-Type", "application/json");
XMLReq.send();
}
</script>
</body></html>