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

50 lines
2.2 KiB

@model IEnumerable<NzbDrone.Core.Instrumentation.Log>
@section Scripts{
<script type="text/javascript">
function onRowDataBound(e) {
e.row.style.boarder = "";
14 years ago
if (e.dataItem.Level == "Warn") {
e.row.style.backgroundColor = "#FFD700";
}
14 years ago
else if (e.dataItem.Level == "Error") {
e.row.style.backgroundColor = "#FF7500";
}
14 years ago
else if (e.dataItem.Level == "Fatal") {
e.row.style.backgroundColor = "black";
e.row.style.color = "red";
}
//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" })
.Columns(columns =>
{
columns.Bound(c => c.Time).Title("Time").Width(0);
columns.Bound(c => c.Level).Title("Level").Width(0);
columns.Bound(c => c.Logger).Title("Source").Width(0);
columns.Bound(c => c.Message);
})
.DetailView(detailView => detailView.ClientTemplate(
"<div>Method: <#= Method #></div>" +
"<div><#= ExceptionType #></div>" +
"<div class='stackframe'><#= Exception #></div>"
)).DataBinding(data => data.Ajax().Select("_AjaxBinding", "Log"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Time).Descending()).Enabled(true))
.Pageable(c => c.PageSize(50).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious))
.Filterable()
.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();}
}