-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
31 lines (31 loc) · 1.04 KB
/
Copy pathindex.html
File metadata and controls
31 lines (31 loc) · 1.04 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>UFW Status</title>
<style>
body { font-family: sans-serif; margin: 2em; background: #f9f9f9; }
.good { color: green; }
.bad { color: red; }
</style>
</head>
<body>
<h1>UFW Firewall Status</h1>
<div id="status">Loading status...</div>
<script>
fetch('/status').then(res => res.json()).then(data => {
let msg;
if (!data.installed) {
msg = '<span class="bad">UFW is NOT installed</span>';
} else if (!data.enabled) {
msg = '<span class="bad">UFW is installed but DISABLED</span>';
} else {
msg = '<span class="good">UFW is ENABLED</span>';
}
document.getElementById('status').innerHTML = msg + `<br><small>Last checked: ${data.timestamp}</small>`;
}).catch(() => {
document.getElementById('status').innerHTML = '<span class="bad">Could not load status</span>';
});
</script>
</body>
</html>