recorder/docroot/index.html

123 lines
3.5 KiB
HTML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Recorder</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2015-10-12 09:19:04 -07:00
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
2015-10-13 04:53:36 -07:00
<link rel="icon" sizes="192x192" href="img/recorder.png" />
<link rel="apple-touch-icon" href="img/recorder.png" />
2015-10-12 09:19:04 -07:00
2016-02-11 13:06:03 -07:00
<script src="static/js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="static/js/mustache.js" type="text/javascript"></script>
<script src="static/js/moment.min.js" type="text/javascript"></script>
<style>
body, a, a:visited {
font-family: Helvetica, sans-serif;
color: #3f72b5;
}
#usertable {
font-family: Helvetica, sans-serif;
width: 80%;
border-collapse: collapse;
}
#usertable td, #usertable th {
font-size: 1em;
border: 1px solid #305e9f;
padding: 3px 7px 2px 7px;
}
#usertable th {
font-size: 1.1em;
text-align: left;
padding-top: 5px;
padding-bottom: 4px;
background-color: #305e9f;
color: white;
}
</style>
<script type="text/javascript">
function getuserlist() {
var dataURI = location.protocol + "//" + location.host;
var parts = location.pathname.split('/');
for (var i = 1; i < parts.length - 1; i++) {
dataURI = dataURI + "/" + parts[i];
}
dataURI = dataURI + "/api/0/last" + location.search;
console.log("dataURI = " + dataURI);
2015-09-15 05:58:14 -07:00
var now = moment();
2015-09-29 01:04:02 -07:00
var f12 = now.subtract(12, 'hours').utc().format('YYYY-MM-DDTHH:mm');
var f7 = now.subtract(7, 'days').utc().format('YYYY-MM-DDTHH:mm');
var f30 = now.subtract(30, 'days').utc().format('YYYY-MM-DDTHH:mm');
2015-09-15 05:58:14 -07:00
$.ajax({
url: dataURI,
type: "GET",
dataType: 'json',
success: function(data) {
// console.log(JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
var d = data[i];
2015-09-15 05:58:14 -07:00
d['udev'] = "user=" + d['username'] + "&device=" + d['device'];
d['f12'] = f12;
d['f7'] = f7;
d['f30'] = f30;
var line = "<tr><td>{{ username }} / {{ device }}</td>" +
"<td><a href='map/index.html?{{udev}}&format=geojson&from={{f12}}'>12h</a></td>" +
"<td><a href='map/index.html?{{udev}}&format=geojson&from={{f7}}'>7d</a></td>" +
2015-09-15 05:58:14 -07:00
"<td><a href='map/index.html?{{udev}}&format=linestring&from={{f12}}'>12h</a></td>" +
"<td><a href='map/index.html?{{udev}}&format=linestring&from={{f7}}'>7d</a></td>" +
"<td><a href='map/index.html?{{udev}}&format=linestring&from={{f30}}'>30d</a></td>" +
"</tr>";
var row = Mustache.render(line, d);
$('#usertable > tbody:last-child').append(row);
}
},
error: function(jqXHR, textstatus, errorthrown) {
console.log(textstatus, errorthrown);
console.log(jqXHR.status + " " + jqXHR.responseText);
},
});
}
$(document).ready(function() {
getuserlist();
});
</script>
</head>
<body>
<div>
<ul>
2015-09-30 23:41:08 -07:00
<li><a href="last/index.html">Live MAP of current locations</a></li>
<li><a href="table/index.html">TABLE of current locations</a></li>
</ul>
</div>
<div id='content'>
<table id='usertable'>
<thead>
<tr><th>User/Device</th><th>Points</th><th>Points</th><th>Track</th><th>Track</th><th>Track</th></tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</body>
2015-09-03 08:25:07 -07:00
</html>