anabasis-clients/templates/index.html

110 lines
2.5 KiB
HTML
Raw Normal View History

2021-02-10 23:07:37 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ANABASIS CLIENTS</title>
<meta http-equiv="refresh" content="60">
<style>
body {
font-family: "Courier New", "Courier", monospace;
color: white;
background: black;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
h1, h2 {
margin-bottom: 0 !important;
}
.status {
font-size: 24pt;
font-weight: bold;
border: 2px solid;
padding: .25rem .5rem;
}
.status-container {
margin: 1rem 0;
}
.status-empty {
border-color: red;
}
2021-02-11 01:26:16 +01:00
.status-populated {
2021-02-10 23:07:37 +01:00
border-color: green;
}
2021-02-11 01:55:15 +01:00
.log-out {
color: red;
}
.log-in {
color: green;
}
2021-02-10 23:07:37 +01:00
.datetime {
font-weight: bold;
margin: 1em 0;
}
</style>
<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>
<h2>STATUS</h2>
<div class="status-container">
2021-02-11 01:26:16 +01:00
<div class="status status-{{'populated' if status.open else 'empty'}}">
{{'POPULATED' if status.open else 'EMPTY'}}
2021-02-11 01:09:40 +01:00
</div>
2021-02-10 23:07:37 +01:00
<div class="status-explanation">{{status.text}}</div>
</div>
2021-02-11 01:09:40 +01:00
<div>
Since:
{% if last_change %}
{{last_change['ts'].strftime("%c")}}
{% if not status.open %}({{last_change.leases | map(attribute='display') | join(', ')}}){% endif %}
{% else %}
forever?
{% endif %}
</div>
2021-02-10 23:07:37 +01:00
<h2>Current clients</h2>
<div class="datetime">{{now.strftime("%c")}}</div>
<table>
<tr>
<th>MAC</th>
<th>hostname</th>
<th>IP address</th>
</tr>
{% for lease in leases %}
<tr>
<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>
</tr>
{% endfor %}
</table>
2021-02-11 01:55:15 +01:00
<h2>Log</h2>
<table>
{% 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>
2021-02-10 23:07:37 +01:00
</body>
</html>