2015-09-14 08:56:29 -07:00
|
|
|
<?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">
|
|
|
|
<script src="table/js/jquery-1.11.3.min.js" type="text/javascript"></script>
|
|
|
|
<script src="table/js/mustache.js" type="text/javascript"></script>
|
2015-09-15 05:58:14 -07:00
|
|
|
<script src="table/js/moment.min.js" type="text/javascript"></script>
|
2015-09-14 08:56:29 -07:00
|
|
|
<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
|
|
|
|
2015-09-14 08:56:29 -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-14 08:56:29 -07:00
|
|
|
|
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>";
|
2015-09-14 08:56:29 -07:00
|
|
|
|
|
|
|
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 08:32:36 -07:00
|
|
|
<li><a href="last/index.html">Live MAP of current locations</a>
|
|
|
|
(<a href="last/index.html?fit=1">auto zoom</a>)
|
|
|
|
</li>
|
2015-09-14 08:56:29 -07:00
|
|
|
<li><a href="table/index.html">TABLE of current locations</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id='content'>
|
|
|
|
<table id='usertable'>
|
|
|
|
<thead>
|
2015-09-16 02:45:18 -07:00
|
|
|
<tr><th>User/Device</th><th>Points</th><th>Points</th><th>Track</th><th>Track</th><th>Track</th></tr>
|
2015-09-14 08:56:29 -07:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
2015-09-03 08:25:07 -07:00
|
|
|
</html>
|