2011-09-05 19:59:39 +00:00
|
|
|
@using NzbDrone.Core.Instrumentation
|
2012-02-13 06:38:57 +00:00
|
|
|
@model IEnumerable<Log>
|
2011-12-10 05:05:17 +00:00
|
|
|
@{ ViewBag.Title = "Logs";}
|
2011-04-21 06:18:28 +00:00
|
|
|
@section ActionMenu{
|
2011-11-24 05:50:41 +00:00
|
|
|
<ul class="sub-menu">
|
2012-02-11 05:00:22 +00:00
|
|
|
<li>@Ajax.ActionLink("Clear Logs", "Clear", "Log", new AjaxOptions { OnSuccess = "redrawGrid" })</li>
|
2012-01-23 02:24:16 +00:00
|
|
|
<li>@Html.ActionLink("File", "File", "Log")</li>
|
2011-11-24 05:50:41 +00:00
|
|
|
</ul>
|
2011-04-21 06:18:28 +00:00
|
|
|
}
|
2012-02-09 17:41:51 +00:00
|
|
|
@section HeaderContent{
|
|
|
|
<style>
|
2012-02-13 06:38:57 +00:00
|
|
|
#logGrid td
|
|
|
|
{
|
2012-02-09 17:41:51 +00:00
|
|
|
padding: 2px 8px 2px 8px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
}
|
2011-12-01 05:25:01 +00:00
|
|
|
<div class="infoBox">
|
|
|
|
Log entries older than 30 days are automatically deleted.</div>
|
2012-02-09 17:41:51 +00:00
|
|
|
<div class="grid-container">
|
|
|
|
<table id="logGrid" class="dataTablesGrid hidden-grid">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2012-02-13 06:38:57 +00:00
|
|
|
<th>
|
|
|
|
Time
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Level
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Source
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Message
|
|
|
|
</th>
|
2012-02-09 17:41:51 +00:00
|
|
|
@*Details Column*@
|
2012-02-13 06:38:57 +00:00
|
|
|
<th style="display: none;">
|
|
|
|
Details
|
|
|
|
</th>
|
2012-02-09 17:41:51 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
@section Scripts{
|
|
|
|
<script type="text/javascript">
|
2012-02-13 06:38:57 +00:00
|
|
|
$(document).ready(function () {
|
2012-02-09 17:41:51 +00:00
|
|
|
$('.dataTablesGrid').removeClass('hidden-grid');
|
|
|
|
|
|
|
|
oTable = $('#logGrid').dataTable({
|
|
|
|
"sAjaxSource": "Log/AjaxBinding",
|
2012-02-18 00:43:16 +00:00
|
|
|
"bProcessing": false,
|
2012-02-09 17:41:51 +00:00
|
|
|
"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
|
2012-02-25 23:14:48 +00:00
|
|
|
{sWidth: '60px', "mDataProp": "Level" }, //Level
|
2012-02-13 06:38:57 +00:00
|
|
|
{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>";
|
|
|
|
|
|
|
|
if (row.aData["ExceptionType"] !== null) {
|
|
|
|
result += "<div>Exception Type: " + row.aData["ExceptionType"] + "</div>" +
|
|
|
|
"<div class=\"stackFrame\">Exception: " + row.aData["Exception"] + "</div>";
|
2012-02-09 17:41:51 +00:00
|
|
|
}
|
2012-02-13 06:38:57 +00:00
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} //Details
|
2012-02-09 17:41:51 +00:00
|
|
|
],
|
|
|
|
"aaSorting": [[0, 'desc']],
|
2012-02-13 06:38:57 +00:00
|
|
|
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
|
|
|
|
fnRowCallback(nRow, aData);
|
2012-02-09 17:41:51 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
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>
|
2012-02-13 06:38:57 +00:00
|
|
|
}
|