source: tmcsimulator/trunk/webapps/unifiedlogmonitor.html @ 442

Revision 442, 1.9 KB checked in by jdalbey, 7 years ago (diff)

minor formatting improvements to unified log monitor

Line 
1<!DOCTYPE html>
2<html>
3  <head>
4  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
5    <title>Unified Logger v</title> 
6<style>
7* {
8  box-sizing: border-box;
9}
10body {
11   background-color: #000033;
12   color: goldenrod
13}
14/* Padding for table cells */
15td { padding-top:2px; padding-right:10px; padding-bottom:2px; padding-left:10px; }
16/* styling for messages */
17#msgs{
18  padding: 15px 10% 15px 10%;
19  font-size: 20px;
20  font-family: monospace;
21  font-weight:lighter;
22  color: white;
23  padding-left: 2%;
24  padding-right: 2%;
25}
26</style>
27</head>
28<body>
29<div class="row">
30    <p id="msgs"></p>
31</div>
32    <script  src="common/js/fileutils.js"></script>
33    <script  src="common/js/revision_number.dat"></script>
34    <script  src="common/js/displayutils.js"></script> 
35   <script>
36// Load the unified log
37function loadLog()
38{
39    var display = document.getElementById("msgs");
40    display.innerHTML = ""
41    // Asynchronous file read of unified log data
42    loadJSON("dynamicdata/unifiedlog.csv", function(response)
43    {
44        // Format the csv data into an HTML table
45        var allRows = response.split(/\r?\n|\r/);
46        var table = '<table>';
47        // Put the last log entry at the TOP of the table
48        for (var singleRow = allRows.length-1; singleRow >= 0; singleRow--)
49        {
50            table += '<tr>';
51            var rowCells = allRows[singleRow].split(',');
52            for (var rowCell = 0; rowCell < rowCells.length; rowCell++)
53            {
54                table += '<td>';
55                table += rowCells[rowCell];
56                table += '</td>';
57            }
58            table += '</tr>';
59        }
60        table += '</table>';
61        // Add the table to the messages div
62        display.innerHTML += table;
63    }
64    );
65}
66// Start
67showRevision();
68loadLog();
69// start an interval timer to refresh the log every 5 seconds
70var displayTimer = setInterval(loadLog, 5000);
71   </script>
72  </body>
73</html>
Note: See TracBrowser for help on using the repository browser.