40 lines
1.2 KiB
HTML
40 lines
1.2 KiB
HTML
<html>
|
|
<head>
|
|
<link href="/static/css/style.css" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
|
|
<div id="countdown"><span id="countdown_numbers"></span> seconds until refresh</div>
|
|
<script>
|
|
(function countdown(remaining) {
|
|
if(remaining <= 0)
|
|
location.reload(true);
|
|
document.getElementById('countdown_numbers').innerHTML = remaining;
|
|
setTimeout(function(){ countdown(remaining - 1); }, 1000);
|
|
})(15); // n seconds
|
|
</script>
|
|
|
|
<table class = "statuses">
|
|
<tr><th>What Happened?</th><th>When Did It Happen?</th><th>How Long Has It Been?</th></tr>
|
|
{% for status in statuses %}
|
|
<tr>
|
|
<td style="background-color: {{ status.color }}">{{ status.title }}</td><td>{{ status.timestamp_readable }}</td><td>{{ long_agos[loop.index0] }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
|
|
<h2>How does this work?</h2>
|
|
|
|
<p>Send a curl (or similar) request from any script or code and include your username and
|
|
password (see app.py, @auth.get_password).</p>
|
|
|
|
<code>
|
|
curl -u username:password -i "http://localhost:5000/new?title=a_status_without_spaces_goes_here"
|
|
</code>
|
|
|
|
<p>The entire list of statuses is kept in memory and limited to 1000 (or whatever you set
|
|
it to). If your service or server restarts, the list is wiped out.</p>
|
|
|
|
</body>
|
|
</html>
|