feat: Add new updated version
All checks were successful
Build Docker / BuildImage (push) Successful in 1m0s

This commit is contained in:
2025-11-21 15:58:21 +11:00
parent f936973b8d
commit ff3f40beaf
9 changed files with 1049 additions and 426 deletions

View File

@@ -4,41 +4,100 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API | HNS DoH</title>
<link rel="icon" href="/assets/img/HNS.png" type="image/png">
<link rel="stylesheet" href="/assets/css/api.css">
<title>API Documentation - HNSDoH Status</title>
<link rel="stylesheet" href="/assets/style.css">
<link rel="icon" type="image/png" href="/favicon.png">
<style>
.endpoint-card {
background-color: var(--bg-card);
border: 1px solid var(--border);
border-radius: 0.75rem;
padding: 1.5rem;
margin-bottom: 1.5rem;
}
.endpoint-method {
display: inline-block;
background-color: rgba(59, 130, 246, 0.15);
color: var(--accent);
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-weight: 700;
font-size: 0.75rem;
margin-right: 0.75rem;
}
.endpoint-route {
font-family: monospace;
font-size: 1.1rem;
color: var(--text-main);
}
.endpoint-desc {
margin-top: 0.75rem;
color: var(--text-muted);
}
.param-table {
width: 100%;
margin-top: 1rem;
border: 1px solid var(--border);
border-radius: 0.5rem;
overflow: hidden;
}
.param-table th { background-color: rgba(0,0,0,0.2); }
.param-table td, .param-table th { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.param-table tr:last-child td { border-bottom: none; }
.back-link { display: inline-block; margin-bottom: 1rem; }
</style>
</head>
<body>
<div class="spacer"></div>
<div class="centre">
{% if endpoints %}
<h1 style="font-size: xx-large;">API Info</h1>
<p>Available endpoints:</p>
<ul style="width: fit-content;margin: auto;">
{% for endpoint in endpoints %}
<li class="top">
<strong>{{ endpoint.route }}</strong> - {{ endpoint.description }}
{% if endpoint.parameters %}
<ul>
<li><em>Parameters:</em></li>
{% for param in endpoint.parameters %}
<li>
<strong>{{ param.name }}:</strong>
({{ param.type }}) - {{ param.description }}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
<div class="container">
<header>
<div>
<h1>API Documentation</h1>
<div class="meta">Programmatic access to status data</div>
</div>
<div>
<a href="/" class="back-link">← Back to Dashboard</a>
</div>
</header>
{% else %}
<h1>404 | Page not found</h1>
<p>Sorry, the page you are looking for does not exist.</p>
<p><a href="/">Go back to the homepage</a></p>
{% endif %}
<div class="endpoints-list">
{% for endpoint in endpoints %}
<div class="endpoint-card">
<div>
<span class="endpoint-method">GET</span>
<a href="{{ endpoint.route }}" class="endpoint-route">{{ endpoint.route }}</a>
</div>
<div class="endpoint-desc">{{ endpoint.description }}</div>
{% if endpoint.parameters %}
<div class="param-table">
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for param in endpoint.parameters %}
<tr>
<td><code>{{ param.name }}</code></td>
<td><code>{{ param.type }}</code></td>
<td>{{ param.description }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
{% endfor %}
</div>
<div class="footer">
<p>Powered by <a href="https://nathan.woodburn.au">Nathan.Woodburn/</a></p>
</div>
</div>
</body>