Changeset 551 in tmcsimulator for trunk/webapps/unifiedlogmonitor.html


Ignore:
Timestamp:
12/26/2019 03:14:52 PM (6 years ago)
Author:
jdalbey
Message:

Multi-file commit to implement saving evaluation ratings from einotebook to a log file and merging with unified log. Also fix defect #212. cgi-bin/saveEvals.py cgi-bin/saveRatingsToLog.py common/js/displayutils.js common/js/fileutils.js common/js/revision_number.dat common/unifiedlog.css dynamicdata/CADcomments.log dynamicdata/caddetails.csv dynamicdata cms_messages.json dynamicdata/har_messages.json dynamicdata highway_status.json dynamicdata/ratings.csv dynamicdata/unifiedlog.csv dynamicdata/unifiedlog_final.csv einotebook/roles/index.html einotebook roles/roles.js einotebook/script/index.html einotebook/script scrollframe.js einotebook/scripts/Evaluation.js einotebook/scripts/Event.js mergelogs.bash unifiedlogdisplay.html unifiedlogmonitor.html

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/unifiedlogmonitor.html

    r512 r551  
    44  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> 
    55    <title>Unified Logger v</title>  
    6 <style> 
    7 * { 
    8   box-sizing: border-box; 
    9 } 
    10 body { 
    11    background-color: #000033; 
    12    color: goldenrod 
    13 } 
    14  
    15 /* Color Code for unified logger */  
    16 .CAD-log{ 
    17     color: #00FFFF; 
    18 } 
    19 .Activity-log{ 
    20     color: #32CD32; 
    21 } 
    22 .CMS-Activated{ 
    23     color: #FFFF00; 
    24 } 
    25  
    26 /* Padding for table cells */ 
    27 td { padding-top:2px; padding-right:10px; padding-bottom:2px; padding-left:10px; } 
    28 /* styling for messages */ 
    29 #msgs{ 
    30   padding: 15px 10% 15px 10%; 
    31   font-size: 20px; 
    32   font-family: monospace; 
    33   font-weight:lighter; 
    34   color: white; 
    35   padding-left: 2%; 
    36   padding-right: 2%; 
    37 } 
    38 </style> 
     6<link href="common/unifiedlog.css" rel="stylesheet" type="text/css"> 
    397</head> 
    408<body> 
    419<div class="row"> 
    42     <p id="msgs"></p> 
     10    <p id="display"></p> 
    4311</div> 
    4412    <script  src="common/js/fileutils.js"></script> 
     
    4614    <script  src="common/js/displayutils.js"></script>  
    4715   <script> 
    48 // Load the unified log  
    49 function loadLog() 
     16function showLog() 
    5017{ 
    51     var display = document.getElementById("msgs"); 
    52     display.innerHTML = "" 
    53     // Asynchronous file read of unified log data 
    54     loadJSON("dynamicdata/unifiedlog.csv", function(response) 
    55     { 
    56         // Format the csv data into an HTML table 
    57         var allRows = response.split(/\r?\n|\r/); 
    58         var table = '<table>'; 
    59         // Put the last log entry at the TOP of the table 
    60         for (var singleRow = allRows.length-1; singleRow >= 0; singleRow--) 
    61         { 
    62             var rowCells = allRows[singleRow].split(','); 
    63             var msg_type = ""; 
    64  
    65             // trimming white space in the type of messages  
    66             // ingore the emtpy line  
    67             if (rowCells.length > 1) { 
    68                 console.log("row cell " , rowCells[1]); 
    69                 rowCells[1] = rowCells[1].trim(); 
    70             } 
    71             // Implement ticket #190  
    72             // Checking for the type of logging information  
    73             if (rowCells[1] == "CAD log") { 
    74                 msg_type = "class=\"CAD-log\""; 
    75             } else if (rowCells[1] == "Activity Log.") { 
    76                 msg_type = "class=\"Activity-log\""; 
    77             } else if (rowCells[1] == "CMS Activated.") { 
    78                 msg_type = "class=\"CMS-Activated\""; 
    79             }  
    80             // add the message type class to that row  
    81             table += '<tr ' + msg_type + '>'; 
    82             for (var rowCell = 0; rowCell < rowCells.length; rowCell++) 
    83             { 
    84                 table += '<td>'; 
    85                 table += rowCells[rowCell]; 
    86                 table += '</td>'; 
    87             } 
    88             table += '</tr>'; 
    89         } 
    90         table += '</table>'; 
    91         // Add the table to the messages div 
    92         display.innerHTML += table; 
    93     } 
    94     ); 
     18    var display = document.getElementById("display"); 
     19    // Utility reads from given file and puts into given DIV 
     20    loadLog("unifiedlog.csv", display); 
     21    // Start a timer to do this again in 5 seconds 
     22    var x = setTimeout(showLog, 5000); 
    9523} 
    9624// Start 
    9725showRevision(); 
    98 loadLog(); 
    99 // start an interval timer to refresh the log every 5 seconds 
    100 var displayTimer = setInterval(loadLog, 5000); 
     26showLog(); 
    10127   </script> 
    10228  </body> 
Note: See TracChangeset for help on using the changeset viewer.