2011-09-05 22:59:39 +03:00
|
|
|
@using NzbDrone.Core.Instrumentation
|
2011-04-22 07:03:59 +03:00
|
|
|
@model IEnumerable<NzbDrone.Core.Instrumentation.Log>
|
2011-04-21 09:18:28 +03:00
|
|
|
@section Scripts{
|
2010-10-24 20:35:58 +03:00
|
|
|
<script type="text/javascript">
|
|
|
|
function onRowDataBound(e) {
|
|
|
|
|
|
|
|
e.row.style.boarder = "";
|
|
|
|
|
2011-04-22 08:49:50 +03:00
|
|
|
if (e.dataItem.Level == "Warn") {
|
2010-10-24 20:35:58 +03:00
|
|
|
e.row.style.backgroundColor = "#FFD700";
|
|
|
|
}
|
2011-04-22 08:49:50 +03:00
|
|
|
else if (e.dataItem.Level == "Error") {
|
2010-10-24 20:35:58 +03:00
|
|
|
e.row.style.backgroundColor = "#FF7500";
|
|
|
|
}
|
2011-04-22 08:49:50 +03:00
|
|
|
else if (e.dataItem.Level == "Fatal") {
|
2010-10-24 20:35:58 +03:00
|
|
|
e.row.style.backgroundColor = "black";
|
2010-10-30 05:46:32 +03:00
|
|
|
e.row.style.color = "red";
|
2010-10-24 20:35:58 +03:00
|
|
|
}
|
|
|
|
//e.row.style.color = 'blue';
|
|
|
|
}
|
|
|
|
</script>
|
2011-04-21 09:18:28 +03:00
|
|
|
}
|
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">
|
|
|
|
<li>@Ajax.ActionLink("Clear Logs", "Clear", "Log", new AjaxOptions { OnSuccess = "reloadGrid" })</li>
|
|
|
|
</ul>
|
|
|
|
<div style="margin-bottom: 10px">
|
|
|
|
</div>
|
2011-04-21 09:18:28 +03:00
|
|
|
}
|
2011-12-01 08:25:01 +03:00
|
|
|
<div class="infoBox">
|
|
|
|
Log entries older than 30 days are automatically deleted.</div>
|
|
|
|
@{Html.Telerik().Grid<Log>().Name("logsGrid")
|
2011-04-21 09:18:28 +03:00
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
2011-04-10 05:44:01 +03:00
|
|
|
.Columns(columns =>
|
|
|
|
{
|
2011-09-08 03:11:13 +03:00
|
|
|
columns.Bound(c => c.Time).Title("Time").Width(170);
|
2011-11-24 08:50:41 +03:00
|
|
|
columns.Bound(c => c.Level).Title("Level").Width(70);
|
2011-09-08 03:11:13 +03:00
|
|
|
columns.Bound(c => c.Logger).Title("Source");
|
2011-04-10 05:44:01 +03:00
|
|
|
columns.Bound(c => c.Message);
|
|
|
|
})
|
|
|
|
.DetailView(detailView => detailView.ClientTemplate(
|
2011-07-04 08:23:38 +03:00
|
|
|
"<div>Method: <#= Method #></div>" +
|
2011-05-21 03:21:31 +03:00
|
|
|
"<div><#= ExceptionType #></div>" +
|
|
|
|
"<div class='stackframe'><#= Exception #></div>"
|
2011-09-05 22:59:39 +03:00
|
|
|
))
|
2011-11-24 08:50:41 +03:00
|
|
|
.DataBinding(data => data.Ajax().Select("AjaxBinding", "Log").Enabled(true))
|
2011-09-05 22:59:39 +03:00
|
|
|
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Time).Descending()).Enabled(true))
|
2011-11-24 08:50:41 +03:00
|
|
|
.Pageable(paging => paging.Style(GridPagerStyles.Status).PageOnScroll(true).PageSize(100))
|
2011-09-05 22:59:39 +03:00
|
|
|
.Filterable()
|
2011-04-10 05:44:01 +03:00
|
|
|
.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
|
2011-12-01 08:25:01 +03:00
|
|
|
.Scrollable(c => c.Height(500))
|
2011-04-21 09:18:28 +03:00
|
|
|
.Render();}
|
2011-08-06 05:04:35 +03:00
|
|
|
<script type="text/javascript">
|
|
|
|
function reloadGrid() {
|
|
|
|
var grid = $('#logsGrid').data('tGrid');
|
|
|
|
grid.rebind();
|
|
|
|
}
|
2011-11-23 09:41:38 +03:00
|
|
|
</script>
|