You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

131 lines
4.9 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="cache-control"
content="max-age=0" />
<meta http-equiv="cache-control"
content="no-store" />
<meta http-equiv="expires"
content="-1" />
<meta http-equiv="expires"
content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma"
content="no-cache" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--meta http-equiv="refresh" content="300" />--> <!--Refresh each 5s-->
<meta charset="utf-8" />
<title>Logs</title>
<link href="lib/logs/bootstrap.min.css" rel="stylesheet">
<style>
body, html {
font-family: "Arial";
font-size: 14px;
}
</style>
<script src="jquery_3_2_1.min.js"></script>
<script src="lib/logs/bootstrap.min.js"></script>
<script src="lib/logs/geotools.min.js"></script>
<script src="lib/logs/geotools-swedish-zipcodes.min.js"></script>
<script src="lib/logs/moment.min.js"></script>
<script src="lib/logs/fancyTable.js"></script>
<script>
$(document).ready(function () {
});
</script>
</head>
<body>
<div class="container" style="border:0px gray solid;padding:0px;margin-bottom:0px;margin-top:0px;">
<nobr style="font-size:14px;">Log session start time: </nobr><nobr style="font-size:14px;" id="log_session_start_time"></nobr>
<table id="sampleTableA" class="table table-striped sampleTable">
<thead>
<tr>
<th style="padding:0px;width:125px;">Time</th>
<th style="padding:0px;width:150px;">Thread</th>
<th style="padding:0px;width:75px;">Level</th>
<th style="padding:0px;width:150px;">Logger</th>
<th style="padding:0px">Message</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<!--<button id="loadDataSimulation" class="btn btn-success">Load new data</button>-->
</div>
<script>
var logs_data;
var log_session_start_time = "";
func_getlogs();
func_showlogs();
function func_getlogs() {
$.ajax({
url: "/Aida_data/logs.js",
type: "GET",
async: false,
beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
},
success: function (retdata) {
//console.log(retdata);
logs_data = retdata.split("\n");
},
error: function (retdata) {
console.warn(retdata);
}
});
}
function func_showlogs() {
// Generate a big table
for (var n = 0; n < logs_data.length && n < 1000; n++) {
var a_log = logs_data[n].split("][");
if (a_log.length == 5) {
var row = $("<tr>");
$("#sampleTableA").find("thead th").each(function (index) {
$("<td>", {
html: adjust_a_log(a_log,index,n),
style: "padding-top:0px;padding-bottom:0px;padding-left:5px;padding-right:0px;font-size:12px;border: 1px solid gray;"
}).appendTo($(row));
});
row.appendTo($("#sampleTableA").find("tbody"));
}
}
document.getElementById("log_session_start_time").innerHTML = log_session_start_time;
document.getElementById("log_session_start_time").innerHTML += ", Level: DEBUG,INFO,WARN,ERROR";
}
function adjust_a_log(a_log,index,n) {
var temp_a_log = a_log[index];
if (index == 0) {
temp_a_log = temp_a_log.replace("[", "");
if(n == 0)
log_session_start_time = temp_a_log;
}
else if (index == 4) {
temp_a_log = temp_a_log.replace("]", "");
}
return temp_a_log;
}
// And make them fancy
var fancyTableA = $("#sampleTableA").fancyTable({
sortColumn: 0,
pagination: true,
perPage: 34,
sortOrder: 'descending',
globalSearch: true
});
</script>
</body>
</html>