You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/NzbDrone.Web/Views/Log/Index.cshtml

102 lines
3.7 KiB

@using NzbDrone.Core.Instrumentation
13 years ago
@model IEnumerable<Log>
@{ ViewBag.Title = "Logs";}
@section ActionMenu{
<ul class="sub-menu">
<li>@Ajax.ActionLink("Clear Logs", "Clear", "Log", null, new AjaxOptions{ OnSuccess = "redrawGrid", Confirm = "Delete all logs?" }, new { Title = "Delete all logs" })</li>
<li>@Html.ActionLink("File", "File", "Log", null, new { Title = "View debug log file" })</li>
</ul>
}
@section HeaderContent{
<style>
13 years ago
#logGrid td
{
padding: 2px 8px 2px 8px;
}
</style>
}
<div class="infoBox">
Log entries older than 30 days are automatically deleted.</div>
<div class="grid-container">
<table id="logGrid" class="dataTablesGrid hidden-grid">
<thead>
<tr>
13 years ago
<th>
Time
</th>
<th>
Level
</th>
<th>
Source
</th>
<th>
Message
</th>
@*Details Column*@
13 years ago
<th style="display: none;">
Details
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
@section Scripts{
<script type="text/javascript">
13 years ago
$(document).ready(function () {
$('.dataTablesGrid').removeClass('hidden-grid');
oTable = $('#logGrid').dataTable({
"sAjaxSource": "Log/AjaxBinding",
13 years ago
"bProcessing": false,
"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: '60px', "mDataProp": "Level" }, //Level
13 years ago
{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>";
}
13 years ago
return result;
}
} //Details
],
"aaSorting": [[0, 'desc']],
13 years ago
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
fnRowCallback(nRow, aData);
}
});
});
function fnRowCallback(nRow, aData) {
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>
13 years ago
}