reformat (w/ prettier?)
This commit is contained in:
parent
93e86fbe04
commit
4c4c9b654b
1 changed files with 98 additions and 97 deletions
|
@ -1,129 +1,130 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<title>ANABASIS CLIENTS</title>
|
<title>ANABASIS CLIENTS</title>
|
||||||
<meta http-equiv="refresh" content="60">
|
<meta http-equiv="refresh" content="60" />
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: "Courier New", "Courier", monospace;
|
font-family: "Courier New", "Courier", monospace;
|
||||||
color: white;
|
color: white;
|
||||||
background: black;
|
background: black;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2 {
|
h1,
|
||||||
margin-bottom: 0 !important;
|
h2 {
|
||||||
}
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
font-size: 24pt;
|
font-size: 24pt;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border: 2px solid;
|
border: 2px solid;
|
||||||
padding: .25rem .5rem;
|
padding: 0.25rem 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-container {
|
.status-container {
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-empty {
|
.status-empty {
|
||||||
border-color: red;
|
border-color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-populated {
|
.status-populated {
|
||||||
border-color: green;
|
border-color: green;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log {
|
.log {
|
||||||
padding: 1em 0;
|
padding: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-out {
|
.log-out {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-in {
|
.log-in {
|
||||||
color: green;
|
color: green;
|
||||||
}
|
}
|
||||||
|
|
||||||
.datetime {
|
.datetime {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.level {
|
.level {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<link rel="stylesheet" href="https://necolas.github.io/normalize.css/8.0.1/normalize.css"
|
<link
|
||||||
integrity="sha384-M86HUGbBFILBBZ9ykMAbT3nVb0+2C7yZlF8X2CiKNpDOQjKroMJqIeGZ/Le8N2Qp" crossorigin="anonymous">
|
rel="stylesheet"
|
||||||
</head>
|
href="https://necolas.github.io/normalize.css/8.0.1/normalize.css"
|
||||||
<body>
|
integrity="sha384-M86HUGbBFILBBZ9ykMAbT3nVb0+2C7yZlF8X2CiKNpDOQjKroMJqIeGZ/Le8N2Qp"
|
||||||
<h1>/|\ Anabasis Clients</h1>
|
crossorigin="anonymous"
|
||||||
<h2>STATUS</h2>
|
/>
|
||||||
<div class="status-container">
|
</head>
|
||||||
<div class="status status-{{'populated' if status.level > 0 else 'empty'}}">
|
<body>
|
||||||
|
<h1>/|\ Anabasis Clients</h1>
|
||||||
|
<h2>STATUS</h2>
|
||||||
|
<div class="status-container">
|
||||||
|
<div
|
||||||
|
class="status status-{{'populated' if status.level > 0 else 'empty'}}"
|
||||||
|
>
|
||||||
{{status.description}}
|
{{status.description}}
|
||||||
|
</div>
|
||||||
|
<div class="status-explanation">{{status.text}}</div>
|
||||||
|
<div class="level">{{status.level}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-explanation">{{status.text}}</div>
|
<div>
|
||||||
<div class="level">{{status.level}}</div>
|
Since: {% if last_change %} {{last_change['ts'].strftime("%c")}} {% if
|
||||||
</div>
|
status.level == 0 %}({{last_change.leases | map(attribute='display') |
|
||||||
<div>
|
join(', ')}}){% endif %} {% else %} forever? {% endif %}
|
||||||
Since:
|
</div>
|
||||||
{% if last_change %}
|
<h2>Current clients</h2>
|
||||||
{{last_change['ts'].strftime("%c")}}
|
<div class="datetime">{{now.strftime("%c")}}</div>
|
||||||
{% if status.level == 0 %}({{last_change.leases | map(attribute='display') | join(', ')}}){% endif %}
|
<table>
|
||||||
{% else %}
|
<tr>
|
||||||
forever?
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<h2>Current clients</h2>
|
|
||||||
<div class="datetime">{{now.strftime("%c")}}</div>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<th>MAC</th>
|
<th>MAC</th>
|
||||||
<th>hostname</th>
|
<th>hostname</th>
|
||||||
<th>IP address</th>
|
<th>IP address</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for lease in leases %}
|
{% for lease in leases %}
|
||||||
<tr class="current-lease">
|
<tr class="current-lease">
|
||||||
<td>{{lease.mac}}</td>
|
<td>{{lease.mac}}</td>
|
||||||
<td>{{lease.hostname or "???"}}</td>
|
<td>{{lease.hostname or "???"}}</td>
|
||||||
<td>{{lease.ip}}</td>
|
<td>{{lease.ip}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{%if internal %}
|
{%if internal %}
|
||||||
<h2>Log</h2>
|
<h2>Log</h2>
|
||||||
<table class="log">
|
<table class="log">
|
||||||
{% for entry in log %}
|
{% for entry in log %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{entry.ts.strftime("%c")}}</td>
|
<td>{{entry.ts.strftime("%c")}}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if entry.state %}
|
{% if entry.state %}
|
||||||
<span class="log-in">IN</span>
|
<span class="log-in">IN</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="log-out">OUT</span>
|
<span class="log-out">OUT</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>{{entry.lease.display}}</td>
|
||||||
{{entry.lease.display}}
|
</tr>
|
||||||
</td>
|
{% endfor %}
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>Leaderboard</h2>
|
<h2>Leaderboard</h2>
|
||||||
<ol>
|
<ol>
|
||||||
{% for entry in leaderboard %}
|
{% for entry in leaderboard %}
|
||||||
<li>{{entry.name}} ({{entry.total}})</li>
|
<li>{{entry.name}} ({{entry.total}})</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue