Add readme and colors.

This commit is contained in:
Matt
2020-05-19 22:15:25 -05:00
parent 1515db776e
commit 3882f914cd
5 changed files with 73 additions and 21 deletions

39
templates/index.html Normal file
View File

@ -0,0 +1,39 @@
<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>