1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00
Sonarr/NzbDrone.Web/Views/Log/Index.cshtml

61 lines
2.4 KiB
Plaintext
Raw Normal View History

@using NzbDrone.Core.Instrumentation
@model IEnumerable<NzbDrone.Core.Instrumentation.Log>
@section Scripts{
2010-10-24 20:35:58 +03:00
<script type="text/javascript">
function onRowDataBound(e) {
e.row.style.boarder = "";
2011-04-22 08:49:50 +03:00
if (e.dataItem.Level == "Warn") {
2010-10-24 20:35:58 +03:00
e.row.style.backgroundColor = "#FFD700";
}
2011-04-22 08:49:50 +03:00
else if (e.dataItem.Level == "Error") {
2010-10-24 20:35:58 +03:00
e.row.style.backgroundColor = "#FF7500";
}
2011-04-22 08:49:50 +03:00
else if (e.dataItem.Level == "Fatal") {
2010-10-24 20:35:58 +03:00
e.row.style.backgroundColor = "black";
e.row.style.color = "red";
2010-10-24 20:35:58 +03:00
}
//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" })
2011-04-10 05:44:01 +03:00
.Columns(columns =>
{
columns.Bound(c => c.Time).Title("Time").Width(170);
columns.Bound(c => c.Level).Title("Level");
columns.Bound(c => c.Logger).Title("Source");
2011-04-10 05:44:01 +03:00
columns.Bound(c => c.Message);
})
.DetailView(detailView => detailView.ClientTemplate(
2011-07-04 08:23:38 +03:00
"<div>Method: <#= Method #></div>" +
2011-05-21 03:21:31 +03:00
"<div><#= ExceptionType #></div>" +
"<div class='stackframe'><#= Exception #></div>"
))
.DataBinding(data =>
{
data.Server().Select("AjaxBinding", "Log", new { ajax = true });
data.Ajax().Select("AjaxBinding", "Log").Enabled(true);
})
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Time).Descending()).Enabled(true))
2011-05-21 03:21:31 +03:00
.Pageable(c => c.PageSize(50).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious))
.Filterable()
2011-04-10 05:44:01 +03:00
.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();}
}
<script type="text/javascript">
function reloadGrid() {
var grid = $('#logsGrid').data('tGrid');
grid.rebind();
}
</script>