2011-09-05 21:59:39 +02:00
|
|
|
@using NzbDrone.Core.Instrumentation
|
|
|
|
@model IEnumerable<NzbDrone.Core.Instrumentation.Log>
|
|
|
|
@section Scripts{
|
|
|
|
<script type="text/javascript">
|
|
|
|
function onRowDataBound(e) {
|
|
|
|
|
|
|
|
e.row.style.boarder = "";
|
|
|
|
|
|
|
|
if (e.dataItem.Level == "Warn") {
|
|
|
|
e.row.style.backgroundColor = "#FFD700";
|
|
|
|
}
|
|
|
|
else if (e.dataItem.Level == "Error") {
|
|
|
|
e.row.style.backgroundColor = "#FF7500";
|
|
|
|
}
|
|
|
|
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.RenderPartial("SubMenu");}
|
|
|
|
}
|
|
|
|
|
|
|
|
@section MainContent{
|
|
|
|
@{Html.Telerik().Grid<Log>().Name("logsGrid")
|
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
|
|
|
.Columns(columns =>
|
|
|
|
{
|
2011-09-08 02:11:13 +02:00
|
|
|
columns.Bound(c => c.Time).Title("Time").Width(170);
|
|
|
|
columns.Bound(c => c.Level).Title("Level");
|
|
|
|
columns.Bound(c => c.Logger).Title("Source");
|
2011-09-05 21:59:39 +02:00
|
|
|
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("_AllAjaxBinding", "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()
|
|
|
|
.EnableCustomBinding(true)
|
|
|
|
.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
|
|
|
|
.Render();}
|
|
|
|
}
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function reloadGrid() {
|
|
|
|
var grid = $('#logsGrid').data('tGrid');
|
|
|
|
grid.rebind();
|
|
|
|
}
|
|
|
|
</script>
|