Add readme and colors.
This commit is contained in:
		
							
								
								
									
										39
									
								
								templates/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								templates/index.html
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -1,19 +0,0 @@
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
<link href="/static/css/style.css" rel="stylesheet">
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
 | 
			
		||||
<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>{{ status.title }}</td><td>{{ status.timestamp_readable }}</td><td>{{ long_agos[loop.index0] }}</td>
 | 
			
		||||
  </tr>
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user