2013-02-06 19:55:23 +00:00
|
|
|
<%inherit file="base.html"/>
|
2012-09-13 15:27:34 +00:00
|
|
|
<%!
|
2013-02-06 19:55:23 +00:00
|
|
|
import mylar
|
2012-09-13 15:27:34 +00:00
|
|
|
from mylar import helpers
|
|
|
|
%>
|
|
|
|
|
|
|
|
<%def name="body()">
|
|
|
|
<div class="title">
|
|
|
|
<h1 class="clearfix"><img src="interfaces/default/images/icon_logs.png" alt="Logs"/>Logs</h1>
|
|
|
|
</div>
|
|
|
|
<table class="display" id="log_table">
|
2013-07-30 04:57:37 +00:00
|
|
|
<form action="log_change" method="GET">
|
|
|
|
<div class="row">
|
2013-02-06 19:55:23 +00:00
|
|
|
<label>Interface</label>
|
2013-07-30 04:57:37 +00:00
|
|
|
<select name="loglevel">
|
|
|
|
%for loglevel in ['Info', 'Warning', 'Debug']:
|
2013-02-06 19:55:23 +00:00
|
|
|
<%
|
2013-07-30 04:57:37 +00:00
|
|
|
if loglevel == mylar.LOG_LEVEL:
|
2013-02-06 19:55:23 +00:00
|
|
|
selected = 'selected="selected"'
|
|
|
|
else:
|
|
|
|
selected = ''
|
|
|
|
%>
|
2013-07-30 04:57:37 +00:00
|
|
|
<option value="${loglevel}" ${selected}>${loglevel}</option>
|
2013-02-06 19:55:23 +00:00
|
|
|
%endfor
|
|
|
|
</select>
|
2013-07-30 04:57:37 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<input type="submit" value="Go"/>
|
2012-09-13 15:27:34 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th id="timestamp">Timestamp</th>
|
|
|
|
<th id="level">Level</th>
|
|
|
|
<th id="message">Message</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
%for line in lineList:
|
|
|
|
<%
|
|
|
|
timestamp, message, level, threadname = line
|
|
|
|
|
|
|
|
if level == 'WARNING' or level == 'ERROR':
|
|
|
|
grade = 'X'
|
|
|
|
else:
|
|
|
|
grade = 'Z'
|
|
|
|
%>
|
|
|
|
<tr class="grade${grade}">
|
|
|
|
<td id="timestamp">${timestamp}</td>
|
|
|
|
<td id="level">${level}</td>
|
|
|
|
<td id="message">${message}</td>
|
|
|
|
</tr>
|
|
|
|
%endfor
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</%def>
|
|
|
|
|
|
|
|
<%def name="headIncludes()">
|
|
|
|
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
|
|
|
|
</%def>
|
|
|
|
|
|
|
|
<%def name="javascriptIncludes()">
|
|
|
|
<script src="js/libs/jquery.dataTables.min.js"></script>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function()
|
|
|
|
{
|
|
|
|
$('#log_table').dataTable(
|
|
|
|
{
|
|
|
|
"oLanguage": {
|
|
|
|
"sLengthMenu":"Show _MENU_ lines per page",
|
|
|
|
"sEmptyTable": "No log information available",
|
|
|
|
"sInfo":"Showing _START_ to _END_ of _TOTAL_ lines",
|
|
|
|
"sInfoEmpty":"Showing 0 to 0 of 0 lines",
|
|
|
|
"sInfoFiltered":"(filtered from _MAX_ total lines)"},
|
|
|
|
"bStateSave": true,
|
|
|
|
"iDisplayLength": 100,
|
|
|
|
"sPaginationType": "full_numbers",
|
|
|
|
"aaSorting": []
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</%def>
|