anabasis-clients/templates/index.html

149 lines
3.3 KiB
HTML
Raw Normal View History

2021-02-10 23:07:37 +01:00
<!DOCTYPE html>
<html lang="en">
2022-01-03 20:22:56 +01:00
<head>
<meta charset="UTF-8" />
2021-02-10 23:07:37 +01:00
<title>ANABASIS CLIENTS</title>
2022-01-03 20:22:56 +01:00
<meta http-equiv="refresh" content="60" />
2022-01-03 20:27:01 +01:00
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&display=swap"
rel="stylesheet"
/>
2021-02-10 23:07:37 +01:00
<style>
2022-01-03 20:22:56 +01:00
body {
2022-01-03 20:27:01 +01:00
font-family: "IBM Plex Sans", sans-serif;
2022-01-03 20:22:56 +01:00
color: white;
background: black;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
2021-02-10 23:07:37 +01:00
2022-01-03 20:22:56 +01:00
h1,
h2 {
2022-01-03 20:27:01 +01:00
margin-top: 1.5em;
2022-01-03 20:22:56 +01:00
margin-bottom: 0 !important;
}
2021-02-10 23:07:37 +01:00
2022-01-03 20:22:56 +01:00
.status {
font-size: 24pt;
2022-01-03 20:27:01 +01:00
font-weight: 600;
2022-01-03 20:22:56 +01:00
border: 2px solid;
2022-01-03 20:27:01 +01:00
border-radius: 3px;
padding: 0.5em 0.75em;
2022-01-03 20:22:56 +01:00
}
2021-02-10 23:07:37 +01:00
2022-01-03 20:22:56 +01:00
.status-container {
margin: 1rem 0;
}
2021-02-10 23:07:37 +01:00
2022-01-03 20:27:01 +01:00
.status-container div {
margin-bottom: 0.5em;
}
2022-01-03 20:22:56 +01:00
.status-empty {
2022-01-03 20:27:01 +01:00
background: darkred;
2022-01-03 20:22:56 +01:00
}
2021-02-10 23:07:37 +01:00
2022-01-03 20:22:56 +01:00
.status-populated {
2022-01-03 20:27:01 +01:00
background: darkgreen;
}
td {
padding: .1em .5em;
2022-01-03 20:22:56 +01:00
}
2021-02-10 23:07:37 +01:00
2022-01-03 20:22:56 +01:00
.log {
padding: 1em 0;
}
2021-02-11 02:11:02 +01:00
2022-01-03 20:22:56 +01:00
.log-out {
color: red;
}
2021-02-11 01:55:15 +01:00
2022-01-03 20:22:56 +01:00
.log-in {
color: green;
}
2021-02-11 01:55:15 +01:00
2022-01-03 20:22:56 +01:00
.datetime {
2022-01-03 20:27:01 +01:00
font-weight: 600;
2022-01-03 20:22:56 +01:00
margin: 1em 0;
}
2021-02-28 23:34:21 +01:00
2022-01-03 20:22:56 +01:00
.level {
display: none;
}
2021-02-10 23:07:37 +01:00
</style>
2022-01-03 20:22:56 +01:00
<link
rel="stylesheet"
href="https://necolas.github.io/normalize.css/8.0.1/normalize.css"
integrity="sha384-M86HUGbBFILBBZ9ykMAbT3nVb0+2C7yZlF8X2CiKNpDOQjKroMJqIeGZ/Le8N2Qp"
crossorigin="anonymous"
/>
</head>
<body>
<h1>/|\ Anabasis Clients</h1>
2022-01-03 20:27:01 +01:00
<div class="datetime">{{now.strftime("%c")}}</div>
2022-01-03 20:22:56 +01:00
<h2>STATUS</h2>
<div class="status-container">
<div
class="status status-{{'populated' if status.level > 0 else 'empty'}}"
>
2021-02-11 02:08:59 +01:00
{{status.description}}
2022-01-03 20:22:56 +01:00
</div>
<div class="status-explanation">{{status.text}}</div>
<div class="level">{{status.level}}</div>
2022-01-03 20:27:01 +01:00
<div>
<strong>Since:</strong> {% if last_change %} {{last_change['ts'].strftime("%c")}} {% if
status.level == 0 %}({{last_change.leases | map(attribute='display') |
join(', ')}}){% endif %} {% else %} forever? {% endif %}
</div>
2022-01-03 20:22:56 +01:00
</div>
<h2>Current clients</h2>
<table>
<tr>
2021-02-10 23:07:37 +01:00
<th>MAC</th>
<th>hostname</th>
<th>IP address</th>
2022-01-03 20:22:56 +01:00
</tr>
{% for lease in leases %}
<tr class="current-lease">
2021-02-10 23:07:37 +01:00
<td>{{lease.mac}}</td>
2021-02-10 23:46:56 +01:00
<td>{{lease.hostname or "???"}}</td>
2021-02-10 23:07:37 +01:00
<td>{{lease.ip}}</td>
2022-01-03 20:22:56 +01:00
</tr>
{% endfor %}
</table>
2022-01-03 20:22:56 +01:00
{%if internal %}
<h2>Log</h2>
<table class="log">
2022-01-03 20:22:56 +01:00
{% for entry in log %}
<tr>
<td>{{entry.ts.strftime("%c")}}</td>
<td>
{% if entry.state %}
<span class="log-in">IN</span>
{% else %}
<span class="log-out">OUT</span>
{% endif %}
</td>
<td>{{entry.lease.display}}</td>
</tr>
{% endfor %}
</table>
<h2>Leaderboard</h2>
<ol>
2022-01-03 20:22:56 +01:00
{% for entry in leaderboard %}
<li>{{entry.name}} ({{entry.total}})</li>
{% endfor %}
</ol>
2022-01-03 20:22:56 +01:00
{% endif %}
</body>
</html>