2011-04-22 06:03:59 +02:00
|
|
|
@model IEnumerable<NzbDrone.Core.Instrumentation.Log>
|
2011-04-21 08:18:28 +02:00
|
|
|
@section Scripts{
|
2010-10-24 19:35:58 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
function onRowDataBound(e) {
|
|
|
|
|
|
|
|
e.row.style.boarder = "";
|
|
|
|
|
2011-04-22 07:49:50 +02:00
|
|
|
if (e.dataItem.Level == "Warn") {
|
2010-10-24 19:35:58 +02:00
|
|
|
e.row.style.backgroundColor = "#FFD700";
|
|
|
|
}
|
2011-04-22 07:49:50 +02:00
|
|
|
else if (e.dataItem.Level == "Error") {
|
2010-10-24 19:35:58 +02:00
|
|
|
e.row.style.backgroundColor = "#FF7500";
|
|
|
|
}
|
2011-04-22 07:49:50 +02:00
|
|
|
else if (e.dataItem.Level == "Fatal") {
|
2010-10-24 19:35:58 +02:00
|
|
|
e.row.style.backgroundColor = "black";
|
2010-10-30 04:46:32 +02:00
|
|
|
e.row.style.color = "red";
|
2010-10-24 19:35:58 +02:00
|
|
|
}
|
|
|
|
//e.row.style.color = 'blue';
|
|
|
|
}
|
|
|
|
</script>
|
2011-04-21 08:18:28 +02:00
|
|
|
}
|
|
|
|
@section TitleContent{
|
2011-04-22 06:03:59 +02:00
|
|
|
Logs
|
2011-04-21 08:18:28 +02:00
|
|
|
}
|
|
|
|
@section ActionMenu{
|
|
|
|
@{Html.Telerik().Menu().Name("logMenu").Items(items => items.Add().Text("Clear Logs").Action("Clear", "Log"))
|
|
|
|
.Render();}
|
|
|
|
}
|
|
|
|
@section MainContent{
|
|
|
|
@{Html.Telerik().Grid(Model).Name("logsGrid")
|
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
2011-04-10 04:44:01 +02:00
|
|
|
.Columns(columns =>
|
|
|
|
{
|
|
|
|
columns.Bound(c => c.Time).Title("Time").Width(190);
|
2011-04-21 04:30:28 +02:00
|
|
|
columns.Bound(c => c.Level).Title("Level").Width(0);
|
2011-04-10 04:44:01 +02:00
|
|
|
columns.Bound(c => c.Message);
|
|
|
|
})
|
|
|
|
.DetailView(detailView => detailView.ClientTemplate(
|
2010-10-24 19:35:58 +02:00
|
|
|
"<div><#= Logger #></div>" +
|
|
|
|
"<div><#= ExceptionType #></div>" +
|
2011-04-22 06:03:59 +02:00
|
|
|
"<div class='stackframe'><#= Exception #></div>"
|
2011-04-10 04:44:01 +02:00
|
|
|
)).DataBinding(data => data.Ajax().Select("_AjaxBinding", "Log"))
|
|
|
|
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Time).Descending()).Enabled(true))
|
|
|
|
.Pageable(
|
|
|
|
c =>
|
2011-04-10 05:00:20 +02:00
|
|
|
c.PageSize(50).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious))
|
2011-04-10 04:44:01 +02:00
|
|
|
.Filterable()
|
|
|
|
.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
|
2011-04-21 08:18:28 +02:00
|
|
|
.Render();}
|
|
|
|
}
|