2012-01-30 04:38:44 +03:00
|
|
|
@using NzbDrone.Common
|
2011-09-05 22:59:39 +03:00
|
|
|
@using NzbDrone.Core.Instrumentation
|
2012-01-23 05:24:16 +03:00
|
|
|
@using NzbDrone.Web.Helpers
|
2011-04-22 07:03:59 +03:00
|
|
|
@model IEnumerable<NzbDrone.Core.Instrumentation.Log>
|
2011-12-10 08:05:17 +03:00
|
|
|
@{ ViewBag.Title = "Logs";}
|
2011-04-21 09:18:28 +03:00
|
|
|
@section ActionMenu{
|
2011-11-24 08:50:41 +03:00
|
|
|
<ul class="sub-menu">
|
2012-02-11 08:00:22 +03:00
|
|
|
<li>@Ajax.ActionLink("Clear Logs", "Clear", "Log", new AjaxOptions { OnSuccess = "redrawGrid" })</li>
|
2012-01-23 05:24:16 +03:00
|
|
|
<li>@Html.ActionLink("File", "File", "Log")</li>
|
2011-11-24 08:50:41 +03:00
|
|
|
</ul>
|
2011-04-21 09:18:28 +03:00
|
|
|
}
|
2012-02-09 20:41:51 +03:00
|
|
|
|
|
|
|
@section HeaderContent{
|
|
|
|
<style>
|
|
|
|
#logGrid td {
|
|
|
|
padding: 2px 8px 2px 8px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
}
|
|
|
|
|
2011-12-01 08:25:01 +03:00
|
|
|
<div class="infoBox">
|
|
|
|
Log entries older than 30 days are automatically deleted.</div>
|
2012-02-09 20:41:51 +03:00
|
|
|
|
|
|
|
<div class="grid-container">
|
|
|
|
<table id="logGrid" class="dataTablesGrid hidden-grid">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Time</th>
|
|
|
|
<th>Level</th>
|
|
|
|
<th>Source</th>
|
|
|
|
<th>Message</th>
|
|
|
|
@*Details Column*@
|
|
|
|
<th style="display: none;">Details</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@section Scripts{
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('.dataTablesGrid').removeClass('hidden-grid');
|
|
|
|
|
|
|
|
oTable = $('#logGrid').dataTable({
|
|
|
|
"sAjaxSource": "Log/AjaxBinding",
|
|
|
|
"bProcessing": true,
|
|
|
|
"bServerSide": true,
|
|
|
|
"bShowAll": false,
|
|
|
|
"bPaginate": true,
|
|
|
|
"bLengthChange": false,
|
|
|
|
"bFilter": true,
|
|
|
|
"bSort": true,
|
|
|
|
"bInfo": true,
|
|
|
|
"bAutoWidth": false,
|
|
|
|
"iDisplayLength": 50,
|
|
|
|
"sPaginationType": "four_button",
|
|
|
|
"aoColumns": [
|
|
|
|
{ sWidth: '150px', "mDataProp": "Time" }, //Time
|
|
|
|
{ sWidth: '80px', "mDataProp": "Level" }, //Level
|
|
|
|
{ sWidth: '240px', "mDataProp": "Source" }, //Source
|
|
|
|
{ sWidth: 'auto', "mDataProp": "Message", "bSortable": false }, //Message
|
|
|
|
{ sWidth: 'auto', "mDataProp": "Details", "bSortable": false, "bVisible": false, "fnRender": function (row) {
|
|
|
|
var result = "<div>Method: " + row.aData["Method"] + "</div>" +
|
|
|
|
"<div>Exception Type: " + row.aData["ExceptionType"] + "</div>" +
|
|
|
|
"<div class=\"stackFrame\">Exception: " + row.aData["Exception"] + "</div>";
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} //Details
|
|
|
|
],
|
|
|
|
"aaSorting": [[0, 'desc']],
|
|
|
|
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull) {
|
|
|
|
fnRowCallback(nRow, aData);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
function fnRowCallback(nRow, aData) {
|
|
|
|
//e.row.style.boarder = "";
|
|
|
|
|
|
|
|
if (aData["Level"] == "Warn") {
|
|
|
|
nRow.style.backgroundColor = "#FFD700";
|
|
|
|
}
|
|
|
|
else if (aData["Level"] == "Error") {
|
|
|
|
nRow.style.backgroundColor = "#FF7500";
|
|
|
|
}
|
|
|
|
else if (aData["Level"] == "Fatal") {
|
|
|
|
nRow.style.backgroundColor = "black";
|
|
|
|
nRow.style.color = "red";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
}
|