mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
38927e3ca1
New: Search History, review recent searches and force specific reports to download (Under history)
46 lines
2.1 KiB
Plaintext
46 lines
2.1 KiB
Plaintext
@using DataTables.Mvc.Core
|
|
@using DataTables.Mvc.Core.Enum
|
|
@model NzbDrone.Web.Models.SearchDetailsModel
|
|
|
|
@{
|
|
ViewBag.Title = "Search Details";
|
|
}
|
|
|
|
<h2>@Model.DisplayName</h2>
|
|
|
|
@Html.GridHtml("searchDetailsGrid")
|
|
|
|
@section Scripts
|
|
{
|
|
@(Html.GridScriptFor(m => m.SearchHistoryItems, "#searchDetailsGrid")
|
|
.PageLength(20)
|
|
.ChangePageLength(false)
|
|
.AddColumn(new Column().Image("/Content/Images/Indexers/{Indexer}.png", new { alt = "{Indexer}", title = "{Indexer}" }, "{Indexer}").Sortable(false).Title("").Width("20px"))
|
|
.AddColumn(new Column().DataProperty("ReportTitle").Title("Report Title"))
|
|
.AddColumn(new Column().DataProperty("Success").Title("Successful").Width("120px"))
|
|
.AddColumn(new Column().DisplayAndSort("Quality", "QualityInt").Title("Quality").Width("80px"))
|
|
.AddColumn(new Column().DataProperty("SearchError").Title("Error"))
|
|
.AddColumn(new Column().DataProperty("return actionColumn(source, type, val);", true))
|
|
.AddColumn(new Column().DataProperty("Details").RenderFunction("return getDetails(row, val);").Visible(false))
|
|
.AddSorting(3, SortDirection.Desc))
|
|
|
|
<script type="text/javascript">
|
|
function getDetails(row, val) {
|
|
var result = "<a href=\"" + row.aData["NzbInfoUrl"] + "\">Nzb Info</a><br/>" +
|
|
"<b>Proper: </b>" + row.aData["Proper"] + " <br/>" +
|
|
"<b>Age: </b>" + row.aData["Age"] + " days<br/>" +
|
|
"<b>Size: </b>" + row.aData["Size"] + " <br/>" +
|
|
"<b>Language: </b>" + row.aData["Language"] + " <br/>";
|
|
return result;
|
|
}
|
|
|
|
function actionColumn(source, type, val) {
|
|
if (type === 'display' || type === 'filter') {
|
|
return '<a href="/SearchHistory/ForceDownload/' + source["Id"] + '" data-ajax="true" data-ajax-confirm="Are you sure?"><img src="/Content/Images/Plus.png" alt="Force" title="Force" class="gridAction"/></a>';
|
|
}
|
|
// 'sort' and 'type' both just use the raw data
|
|
return '';
|
|
}
|
|
</script>
|
|
}
|