init
This commit is contained in:
commit
0e3323b7ab
13 changed files with 1625 additions and 0 deletions
53
templates/index.html
Normal file
53
templates/index.html
Normal file
|
@ -0,0 +1,53 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2>VPN Session Logs</h2>
|
||||
|
||||
<div class="navigation-links">
|
||||
<a href="/combined" class="nav-link">View Combined Logs</a>
|
||||
</div>
|
||||
|
||||
<div class="api-info">
|
||||
<h3>API Endpoints</h3>
|
||||
<p>Get all logs: <a href="/api/logs" target="_blank">/api/logs</a></p>
|
||||
<p>Filter logs by gateway: <a href="/api/logs?gateway={{ selected_gateway }}" target="_blank">/api/logs?gateway={{ selected_gateway }}</a></p>
|
||||
<p>Get all gateways: <a href="/api/gateways" target="_blank">/api/gateways</a></p>
|
||||
<p>Get log content: <a href="/api/log-content/{{ logs[0].filename if logs else 'filename.logs' }}" target="_blank">/api/log-content/{filename}</a></p>
|
||||
</div>
|
||||
|
||||
<div class="filter-section">
|
||||
<form method="get">
|
||||
<label for="gateway-select">Filter by Gateway:</label>
|
||||
<select id="gateway-select" onchange="this.form.submit()" name="gateway">
|
||||
<option value="">All Gateways</option>
|
||||
{% for gateway in gateways %}
|
||||
<option value="{{ gateway }}" {% if gateway == selected_gateway %}selected{% endif %}>{{ gateway }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Gateway</th>
|
||||
<th>Timestamp</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for log in logs %}
|
||||
<tr>
|
||||
<td>{{ log.gateway }}</td>
|
||||
<td>{{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S UTC') }}</td>
|
||||
<td><a href="/view/{{ log.filename }}">View</a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">No logs found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue