sonarr-repo-only/NzbDrone.Web/Views/Log/Index.cshtml

51 lines
1.9 KiB
Plaintext
Raw Normal View History

@model IEnumerable<NzbDrone.Core.Instrumentation.Log>
@section Scripts{
2010-10-24 17:35:58 +00:00
<script type="text/javascript">
function onRowDataBound(e) {
e.row.style.boarder = "";
if (e.dataItem.Level == 3) {
e.row.style.backgroundColor = "#FFD700";
}
else if (e.dataItem.Level == 4) {
e.row.style.backgroundColor = "#FF7500";
}
else if (e.dataItem.Level == 5) {
e.row.style.backgroundColor = "black";
e.row.style.color = "red";
2010-10-24 17:35:58 +00:00
}
//e.row.style.color = 'blue';
}
</script>
}
@section TitleContent{
Logs
}
@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 02:44:01 +00:00
.Columns(columns =>
{
columns.Bound(c => c.Time).Title("Time").Width(190);
columns.Bound(c => c.Level).Title("Level").Width(0);
2011-04-10 02:44:01 +00:00
columns.Bound(c => c.Message);
})
.DetailView(detailView => detailView.ClientTemplate(
2010-10-24 17:35:58 +00:00
"<div><#= Logger #></div>" +
"<div><#= ExceptionType #></div>" +
"<div class='stackframe'><#= Exception #></div>"
2011-04-10 02:44:01 +00: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 03:00:20 +00:00
c.PageSize(50).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious))
2011-04-10 02:44:01 +00:00
.Filterable()
.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();}
}