Initial setup

This commit is contained in:
Peter Stockings
2025-12-22 12:14:37 +11:00
commit 0810acb7e9
8 changed files with 219 additions and 0 deletions

40
templates/apps_table.html Normal file
View File

@@ -0,0 +1,40 @@
<div class="muted">Generated at: {{ data.generated_at }}</div>
<table>
<thead>
<tr>
<th>App</th>
<th>URLs</th>
<th>Running</th>
<th>CPU</th>
<th>RAM</th>
<th>Dokku status</th>
</tr>
</thead>
<tbody>
{% for r in data.apps %}
<tr>
<td><strong>{{ r.app }}</strong></td>
<td>
{% if r.urls %}
{% for u in r.urls %}
<div><a href="{{ u }}">{{ u }}</a></div>
{% endfor %}
{% else %}
<span class="muted"></span>
{% endif %}
</td>
<td>{{ r.running or "—" }}</td>
<td>{{ r.cpu or "—" }}</td>
<td>
{% if r.mem_used %}
{{ r.mem_used }} / {{ r.mem_limit }} ({{ r.mem_pct }})
{% else %}
{% endif %}
</td>
<td class="muted">{{ r.status_web_1 or "—" }}</td>
</tr>
{% endfor %}
</tbody>
</table>

56
templates/index.html Normal file
View File

@@ -0,0 +1,56 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Status - peterstockings.com</title>
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
<style>
body {
font-family: system-ui, Arial;
margin: 24px;
}
table {
border-collapse: collapse;
width: 100%;
}
th,
td {
border-bottom: 1px solid #ddd;
padding: 8px;
vertical-align: top;
}
th {
text-align: left;
}
.muted {
color: #666;
font-size: 0.9em;
}
.pill {
display: inline-block;
padding: 2px 8px;
border-radius: 999px;
background: #eee;
}
</style>
</head>
<body>
<h1>Status</h1>
<div class="muted">
Auto-refresh every {{ poll_seconds }}s
· <a href="/api/status">JSON</a>
</div>
<div hx-get="/partial/apps" hx-trigger="load, every {{ poll_seconds }}s" hx-swap="innerHTML">
Loading…
</div>
</body>
</html>