2010-10-24 09:46:58 +02:00
|
|
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<NzbDrone.Core.Instrumentation.Log>>" %>
|
|
|
|
|
|
|
|
<%@ Import Namespace="Telerik.Web.Mvc.UI" %>
|
2010-10-24 19:35:58 +02:00
|
|
|
<asp:Content ContentPlaceHolderID="Scripts" runat="server">
|
|
|
|
<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";
|
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>
|
|
|
|
</asp:Content>
|
2010-10-24 09:46:58 +02:00
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
|
|
|
Logs
|
|
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Menu" ContentPlaceHolderID="ActionMenu" runat="server">
|
|
|
|
<%
|
|
|
|
Html.Telerik().Menu().Name("logMenu").Items(items => items.Add().Text("Clear Logs").Action("Clear", "Log")).Render();
|
|
|
|
%>
|
|
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
|
|
|
<%Html.Telerik().Grid(Model).Name("logs")
|
|
|
|
.Columns(columns =>
|
|
|
|
{
|
|
|
|
columns.Bound(c => c.Time).Title("Time").Width(190);
|
|
|
|
columns.Bound(c => c.DisplayLevel).Title("Level").Width(0);
|
|
|
|
columns.Bound(c => c.Message);
|
|
|
|
})
|
2010-10-30 04:46:32 +02:00
|
|
|
.DetailView(detailView => detailView.ClientTemplate(
|
|
|
|
|
2010-10-24 19:35:58 +02:00
|
|
|
"<div><#= Logger #></div>" +
|
|
|
|
"<div><#= ExceptionType #></div>" +
|
|
|
|
"<div><#= ExceptionMessage #></div>" +
|
2010-10-30 04:46:32 +02:00
|
|
|
"<div class='stackframe'><#= ExceptionString #></div>"
|
|
|
|
|
|
|
|
)).DataBinding(data => data.Ajax().Select("_AjaxBinding", "Log"))
|
2010-10-24 09:46:58 +02:00
|
|
|
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Time).Descending()).Enabled(true))
|
2010-10-30 04:46:32 +02:00
|
|
|
.Pageable(c => c.PageSize(20).Position(GridPagerPosition.Both).Style(GridPagerStyles.PageInput | GridPagerStyles.NextPreviousAndNumeric))
|
2010-10-24 09:46:58 +02:00
|
|
|
.Filterable()
|
2010-10-24 19:35:58 +02:00
|
|
|
.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
|
2010-10-24 09:46:58 +02:00
|
|
|
.Render();
|
|
|
|
%>
|
|
|
|
</asp:Content>
|