Upload files to "templates"

This commit is contained in:
2026-10-11 00:15:30 +00:00
parent b75782fb7d
commit 25076c2acb
5 changed files with 134 additions and 0 deletions
+75
View File
@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html>
<head>
<title>Porygon</title>
<style>
.server {
margin: 10px 0;
}
.status {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
margin-right: 8px;
}
.online {
background-color: lightgreen;
}
.offline {
background-color: black;
}
body {
background: url("background.png") center / cover no-repeat fixed;
}
</style>
</head>
<body>
<font size=5><p>Hypervisors</p></font>
<div class="server">
<span id="hypervisor-status" class="status"></span>
<a href="hypervisor/">hypervisor</a>
</div>
<font size=5><p>On-Prem</p></font>
<div class="server">
<span id="realserver-status" class="status"></span>
<a href="realserver/">realserver</a>
</div>
<font size=5><p>Cloud</p></font>
<div class="server">
<span id="vps-status" class="status"></span>
<a href="vps/">vps</a>
</div>
<script>
fetch("status.json")
.then(response => response.json())
.then(status => {
for (const server in status) {
const element = document.getElementById(server + "-status");
if (!element) continue;
if (status[server]) {
element.classList.add("online");
} else {
element.classList.add("offline");
}
}
});
</script>
</body>
</html>
+4
View File
@@ -0,0 +1,4 @@
<div class="server">
<span id="$HOSTNAME-status" class="status"></span>
<a href="http://192.168.0.70/files/temp/$HOSTNAME/">$HOSTNAME</a>
</div>
+45
View File
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: black;
color: white;
}
</style>
</head>
<body>
<title>Server Stats</title>
<h1 id="hostname">Loading...</h1>
<p>Uptime: <span id="uptime">-</span></p>
<p>CPU usage: <span id="cpu">-</span>%</p>
<p>CPU count: <span id="cpu-count">-</span></p>
<p>RAM usage: <span id="ram">-</span>%</p>
<p>RAM total: <span id="ram-total">-</span> GB</p>
<p>Swap usage: <span id="swap">-</span>%</p>
<p>Swap total: <span id="swap-total">-</span> GB</p>
<p>Disk total: <span id="disk-total">-</span> GB</p>
<p>Disk usage: <span id="disk">-</span>%</p>
<p>Last updated: <span id="timestamp">-</span></p>
<script>
fetch("stats.json")
.then(response => response.json())
.then(data => {
document.getElementById("hostname").textContent = data.hostname;
document.getElementById("uptime").textContent = data.uptime;
document.getElementById("cpu").textContent = data.cpu_usage;
document.getElementById("cpu-count").textContent = data.cpu_count;
document.getElementById("ram").textContent = data.ram_usage;
document.getElementById("ram-total").textContent = data.ram_total_gb;
document.getElementById("swap").textContent = data.swap_usage;
document.getElementById("swap-total").textContent = data.swap_total_gb;
document.getElementById("disk-total").textContent = data.disk_total_gb;
document.getElementById("disk").textContent = data.disk_usage;
document.getElementById("timestamp").textContent = data.timestamp;
});
</script>
</body>
</html>
+2
View File
@@ -0,0 +1,2 @@
[server]
server ansible_host="$IP"
+8
View File
@@ -0,0 +1,8 @@
[servers]
server ansible_host="$IP"
[servers:vars]
ansible_user="$USER"
ansible_become=true
ansible_become_method=sudo
ansible_become_user=root