anabasis-clients/templates/index.html

84 lines
No EOL
2 KiB
HTML

<!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;
}
.status-occupied {
border-color: green;
}
.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">
<div class="status status-{{'occupied' if status.open else 'empty'}}">
{{'OCCUPIED' if status.open else 'EMPTY'}}
</div>
<div class="status-explanation">{{status.text}}</div>
</div>
<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>
<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>
<td>{{lease.hostname or "???"}}</td>
<td>{{lease.ip}}</td>
</tr>
{% endfor %}
</table>
</body>
</html>