-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (71 loc) · 2.64 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wake On LAN</title>
<style>
body {
background-color: #292F33; /* Set background color to a dark color */
color: #fff; /* Set text color to light color */
text-align: center; /* Center-align text */
padding: 20px; /* Add some padding for better readability */
font-family: monospace,monospace:
}
h1 {
color: #55ACEE; /* Set header color to a lighter shade */
font-faimly: monospace, monospace;
}
button {
background-color: #66757F; /* Set button background color */
color: #fff; /* Set button text color */
padding: 10px 20px; /* Add padding to the buttons */
margin: 5px; /* Add margin for better spacing */
border: none; /* Remove button border */
cursor: pointer; /* Add pointer cursor on hover */
font-family: monospace, monospace;
font-size: 20px; /*Set the font size for buttons */
}
#message {
margin-top: 20px;
padding: 10px;
}
.success {
background-color: #4CAF50;
}
.failure {
background-color: #f44336;
}
</style>
</head>
<body>
<h1>Choose a Device to Wake</h1>
<button onclick="wakeDevice('PC1')">PC1</button><br>
<button onclick="wakeDevice('PC2')">PC2</button><br>
<button onclick="wakeDevice('PC3')">PC3</button><br>
<button onclick="wakeDevice('PC4')">PC4</button><br>
<!-- Add more buttons as needed -->
<!-- Make sure you don't UPPERCASE the word WakeDevice -->
<!-- I don't think the Failure actually works based on my testing.-->
<div id="message"></div> <!-- This is where the success/failure message will be displayed -->
<script>
function wakeDevice(device) {
var xhr = new XMLHttpRequest();
xhr.open("GET", "wake_device.php?device=" + device, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var messageDiv = document.getElementById("message");
if (xhr.responseText.includes("Success")) {
messageDiv.innerHTML = "Operation successful!";
messageDiv.className = "success";
} else {
messageDiv.innerHTML = "Operation failed!";
messageDiv.className = "failure";
}
}
};
xhr.send();
}
</script>
</body>
</html>