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