mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-12 11:15:43 +02:00
Renamed Download settings to Sabnzbd settings.
Moved Download Propers to Quality settings. Cleaned up Quality UI and enhanced it with some jQuery goodness. Mmmmm jQuery.
This commit is contained in:
parent
58b19b6f10
commit
8e214029c9
@ -162,7 +162,7 @@ public virtual String SabPassword
|
||||
|
||||
public virtual String SabTvCategory
|
||||
{
|
||||
get { return GetValue("SabTvCategory"); }
|
||||
get { return GetValue("SabTvCategory", "TV", false); }
|
||||
|
||||
set { SetValue("SabTvCategory", value); }
|
||||
}
|
||||
|
@ -100,15 +100,12 @@ public ActionResult Indexers()
|
||||
});
|
||||
}
|
||||
|
||||
public ActionResult Downloads()
|
||||
public ActionResult Sabnzbd()
|
||||
{
|
||||
ViewData["viewName"] = "Downloads";
|
||||
ViewData["viewName"] = "Sabnzbd";
|
||||
|
||||
var model = new DownloadSettingsModel
|
||||
var model = new SabnzbdSettingsModel
|
||||
{
|
||||
SyncFrequency = _configProvider.SyncFrequency,
|
||||
DownloadPropers = _configProvider.DownloadPropers,
|
||||
Retention = _configProvider.Retention,
|
||||
SabHost = _configProvider.SabHost,
|
||||
SabPort =_configProvider.SabPort,
|
||||
SabApiKey = _configProvider.SabApiKey,
|
||||
@ -116,8 +113,6 @@ public ActionResult Downloads()
|
||||
SabPassword = _configProvider.SabPassword,
|
||||
SabTvCategory = _configProvider.SabTvCategory,
|
||||
SabTvPriority = _configProvider.SabTvPriority,
|
||||
UseBlackHole = _configProvider.UseBlackhole,
|
||||
BlackholeDirectory = _configProvider.BlackholeDirectory
|
||||
};
|
||||
|
||||
return View("Index", model);
|
||||
@ -139,8 +134,8 @@ public ActionResult Quality()
|
||||
var userProfiles = _qualityProvider.GetAllProfiles().Where(q => q.UserProfile).ToList();
|
||||
var profiles = _qualityProvider.GetAllProfiles().ToList();
|
||||
|
||||
var defaultQualityQualityProfileId =
|
||||
Convert.ToInt32(_configProvider.DefaultQualityProfile);
|
||||
var defaultQualityQualityProfileId = Convert.ToInt32(_configProvider.DefaultQualityProfile);
|
||||
var downloadPropers = _configProvider.DownloadPropers;
|
||||
|
||||
var selectList = new SelectList(profiles, "QualityProfileId", "Name");
|
||||
|
||||
@ -149,6 +144,7 @@ public ActionResult Quality()
|
||||
Profiles = profiles,
|
||||
UserProfiles = userProfiles,
|
||||
DefaultQualityProfileId = defaultQualityQualityProfileId,
|
||||
DownloadPropers = downloadPropers,
|
||||
SelectList = selectList
|
||||
};
|
||||
|
||||
@ -426,7 +422,7 @@ public ActionResult SaveIndexers(IndexerSettingsModel data)
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult SaveDownloads(DownloadSettingsModel data)
|
||||
public ActionResult SaveSabnzbd(SabnzbdSettingsModel data)
|
||||
{
|
||||
var basicNotification = new BasicNotification();
|
||||
basicNotification.Type = BasicNotificationType.Info;
|
||||
@ -434,9 +430,6 @@ public ActionResult SaveDownloads(DownloadSettingsModel data)
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_configProvider.SyncFrequency = data.SyncFrequency;
|
||||
_configProvider.DownloadPropers = data.DownloadPropers;
|
||||
_configProvider.Retention = data.Retention;
|
||||
_configProvider.SabHost = data.SabHost;
|
||||
_configProvider.SabPort = data.SabPort;
|
||||
_configProvider.SabApiKey = data.SabApiKey;
|
||||
@ -444,8 +437,6 @@ public ActionResult SaveDownloads(DownloadSettingsModel data)
|
||||
_configProvider.SabTvCategory = data.SabTvCategory;
|
||||
_configProvider.SabUsername = data.SabUsername;
|
||||
_configProvider.SabTvPriority = data.SabTvPriority;
|
||||
_configProvider.UseBlackhole = data.UseBlackHole;
|
||||
_configProvider.BlackholeDirectory = data.BlackholeDirectory;
|
||||
|
||||
basicNotification.Title = SETTINGS_SAVED;
|
||||
_notificationProvider.Register(basicNotification);
|
||||
@ -466,7 +457,8 @@ public ActionResult SaveQuality(QualityModel data)
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_configProvider.SetValue("DefaultQualityProfile", data.DefaultQualityProfileId.ToString());
|
||||
_configProvider.DefaultQualityProfile = data.DefaultQualityProfileId;
|
||||
_configProvider.DownloadPropers = data.DownloadPropers;
|
||||
|
||||
//Saves only the Default Quality, skips User Profiles since none exist
|
||||
if (data.UserProfiles == null)
|
||||
|
@ -11,8 +11,13 @@ public class QualityModel
|
||||
public List<QualityProfile> UserProfiles { get; set; }
|
||||
|
||||
[DisplayName("Default Quality Profile")]
|
||||
[Description("The default quality to use when adding series to NzbDrone")]
|
||||
public int DefaultQualityProfileId { get; set; }
|
||||
|
||||
[DisplayName("Download Propers")]
|
||||
[Description("Should NzbDrone download proper releases (to replace non-proper files)?")]
|
||||
public bool DownloadPropers { get; set; }
|
||||
|
||||
public SelectList SelectList { get; set; }
|
||||
}
|
||||
}
|
@ -6,28 +6,11 @@
|
||||
|
||||
namespace NzbDrone.Web.Models
|
||||
{
|
||||
public class DownloadSettingsModel
|
||||
public class SabnzbdSettingsModel
|
||||
{
|
||||
public SelectList PrioritySelectList =
|
||||
new SelectList(new[] {"Default", "Paused", "Low", "Normal", "High", "Top"});
|
||||
|
||||
[Required]
|
||||
[Range(15, 120, ErrorMessage = "Must be between 15 and 120 minutes")]
|
||||
[DataType(DataType.Text)]
|
||||
[DisplayName("Sync Frequency")]
|
||||
[Description("Specifies how often NzbDrone should check RSS Feeds (Minutes)")]
|
||||
public int SyncFrequency { get; set; }
|
||||
|
||||
[DisplayName("Download Propers")]
|
||||
[Description("Should NzbDrone download proper releases (to replace non-proper files)?")]
|
||||
public bool DownloadPropers { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Please enter a valid number")]
|
||||
[DataType(DataType.Text)]
|
||||
[DisplayName("Retention")]
|
||||
[Description("Your newsgroup provider retention (Days)")]
|
||||
public int Retention { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Please enter a valid host")]
|
||||
[DataType(DataType.Text)]
|
||||
[DisplayName("SABnzbd Host")]
|
||||
@ -68,15 +51,5 @@ public class DownloadSettingsModel
|
||||
[DisplayName("SABnzbd Priority")]
|
||||
[Description("Priority to use when sending NZBs to SABnzbd")]
|
||||
public SabnzbdPriorityType SabTvPriority { get; set; }
|
||||
|
||||
[DisplayName("Use Blackhole")]
|
||||
[Description("Whether to use the blackhole directory instead of sending NZB to SABnzbd")]
|
||||
public bool UseBlackHole { get; set; }
|
||||
|
||||
[DataType(DataType.Text)]
|
||||
[DisplayFormat(ConvertEmptyStringToNull = false)]
|
||||
[DisplayName("Blackhole Directory")]
|
||||
[Description("Path to the blackhole directory")]
|
||||
public String BlackholeDirectory { get; set; }
|
||||
}
|
||||
}
|
@ -234,7 +234,7 @@
|
||||
<Compile Include="Models\AddExistingManualModel.cs" />
|
||||
<Compile Include="Models\AddExistingSeriesModel.cs" />
|
||||
<Compile Include="Models\AddNewSeriesModel.cs" />
|
||||
<Compile Include="Models\DownloadSettingsModel.cs" />
|
||||
<Compile Include="Models\SabnzbdSettingsModel.cs" />
|
||||
<Compile Include="Models\EpisodeSortingModel.cs" />
|
||||
<Compile Include="Models\HistoryModel.cs" />
|
||||
<Compile Include="Models\IndexerSettingsModel.cs" />
|
||||
@ -677,7 +677,7 @@
|
||||
<Content Include="Views\Web.config" />
|
||||
<Content Include="Views\Settings\Indexers.cshtml" />
|
||||
<Content Include="Views\System\Jobs.cshtml" />
|
||||
<Content Include="Views\Settings\Downloads.cshtml" />
|
||||
<Content Include="Views\Settings\Sabnzbd.cshtml" />
|
||||
<Content Include="Views\Settings\EpisodeSorting.cshtml" />
|
||||
<Content Include="Views\Settings\General.cshtml" />
|
||||
<Content Include="Views\Settings\Notifications.cshtml" />
|
||||
|
@ -1,241 +0,0 @@
|
||||
@using NzbDrone.Web.Helpers;
|
||||
@model NzbDrone.Web.Models.DownloadSettingsModel
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
selectDownloadOptionAtStart(); //Load either SAB or Blackhole div
|
||||
var options = {
|
||||
target: '#result',
|
||||
beforeSubmit: showRequest,
|
||||
success: showResponse,
|
||||
type: 'post',
|
||||
resetForm: false
|
||||
};
|
||||
$('#form').ajaxForm(options);
|
||||
$('#save_button').attr('disabled', '');
|
||||
});
|
||||
|
||||
function selectDownloadOptionAtStart() {
|
||||
var checked = $('UseBlackHole').val();
|
||||
var $radios = $('input[name="UseBlackhole"]');
|
||||
$radios.filter('[value=' + checked + ']').attr('checked', true);
|
||||
selectDownloadOption();
|
||||
}
|
||||
|
||||
function selectDownloadOption() {
|
||||
var selected = $("input[name='UseBlackhole']:checked").val();
|
||||
|
||||
if (selected == "True") {
|
||||
$('#UseBlackHole').attr('checked', true);
|
||||
document.getElementById('blackhole').style.display = 'block';
|
||||
document.getElementById('sab').style.display = 'none';
|
||||
}
|
||||
|
||||
else {
|
||||
$('#UseBlackHole').attr('checked', false);
|
||||
document.getElementById('sab').style.display = 'block';
|
||||
document.getElementById('blackhole').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function showRequest(formData, jqForm, options) {
|
||||
$("#result").empty().html('Saving...');
|
||||
$("#form :input").attr("disabled", true);
|
||||
}
|
||||
|
||||
function showResponse(responseText, statusText, xhr, $form) {
|
||||
$("#result").empty().html(responseText);
|
||||
$("#form :input").attr("disabled", false);
|
||||
}
|
||||
|
||||
$(".blackhole_radio").live("change", function () {
|
||||
selectDownloadOption(); //Load either SAB or Blackhole div
|
||||
});
|
||||
</script>
|
||||
|
||||
@using (Html.BeginForm("SaveDownloads", "Settings", FormMethod.Post, new { id = "form", name = "form" }))
|
||||
{
|
||||
<fieldset>
|
||||
<legend>Download Settings</legend>
|
||||
|
||||
<fieldset class="sub-field">
|
||||
<legend>Usenet Variables</legend>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SyncFrequency)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SyncFrequency)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SyncFrequency)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SyncFrequency)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.DownloadPropers)</div>
|
||||
<div class="config-value">@Html.CheckBoxFor(m => m.DownloadPropers, new { @class = "config-checkbox" })</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.DownloadPropers)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.DownloadPropers)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.Retention)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.Retention)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.Retention)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.Retention)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<b>@Html.LabelFor(m => m.UseBlackHole)</b>
|
||||
@Html.CheckBoxFor(m => m.UseBlackHole, new { style="display:none" })
|
||||
</div>
|
||||
<div>
|
||||
@Html.RadioButton("UseBlackhole", true, new { @class="blackhole_radio" })Blackhole
|
||||
</div>
|
||||
<div>
|
||||
@Html.RadioButton("UseBlackhole", false, new { @class="blackhole_radio" })SABnzbd
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sab" style="display:none">
|
||||
<fieldset class="sub-field">
|
||||
<legend>SABnzbd</legend>
|
||||
|
||||
<button type="button" onclick="autoConfigureSab()">Auto-Configure</button>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabHost)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabHost)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabHost)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabHost)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabPort)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabPort)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabPort)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabPort)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabApiKey)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabApiKey)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabApiKey)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabApiKey)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabUsername)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabUsername)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabUsername)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabUsername)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabPassword)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabPassword)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabPassword)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabPassword)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabTvCategory)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabTvCategory)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabTvCategory)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabTvCategory)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabTvPriority)</div>
|
||||
<div class="config-value">@Html.DropDownListFor(m => m.SabTvPriority, Model.PrioritySelectList)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabTvPriority)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabTvPriority)</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="blackhole" style="display:none">
|
||||
<fieldset class="sub-field">
|
||||
<legend>Blackhole</legend>
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.BlackholeDirectory)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.BlackholeDirectory)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.BlackholeDirectory)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.BlackholeDirectory)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<input type="submit" id="save_button" value="Save" disabled="disabled" />
|
||||
|
||||
|
||||
</fieldset>
|
||||
}
|
||||
<div id="result" class="hiddenResult"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var autoConfigureSabUrl = '@Url.Action("AutoConfigureSab", "Settings")';
|
||||
|
||||
function autoConfigureSab() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: autoConfigureSabUrl,
|
||||
//data: jQuery.param({ username: $('#SabUsername').val(), password: $('#SabPassword').val() }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could not autoconfigure SABnzbd for you");
|
||||
},
|
||||
success: autoConfigureSuccess
|
||||
});
|
||||
|
||||
function autoConfigureSuccess(data) {
|
||||
$('#SabHost').val(data.Host);
|
||||
$('#SabPort').val(data.Port);
|
||||
$('#SabApiKey').val(data.ApiKey);
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,4 +1,5 @@
|
||||
@model NzbDrone.Web.Models.QualityModel
|
||||
@using NzbDrone.Web.Helpers;
|
||||
@model NzbDrone.Web.Models.QualityModel
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
@ -22,6 +23,23 @@
|
||||
$("#result").empty().html(responseText);
|
||||
$("#form :input").attr("disabled", false);
|
||||
}
|
||||
|
||||
function addOption(text, value) {
|
||||
var myCombo = $('#DefaultQualityProfileId');
|
||||
|
||||
var exists = $("#DefaultQualityProfileId option[value='" + value + "']");
|
||||
|
||||
if (exists.length == 0)
|
||||
myCombo.append($('\<option\> \</option\>').val(value).html(text));
|
||||
}
|
||||
|
||||
function removeOption(value) {
|
||||
$("#DefaultQualityProfileId option[value='" + value + "']").remove();
|
||||
}
|
||||
|
||||
function renameOption(text, value) {
|
||||
$("#DefaultQualityProfileId option[value='" + value + "']").html(text);
|
||||
}
|
||||
</script>
|
||||
|
||||
@using (Html.BeginForm("SaveQuality", "Settings", FormMethod.Post, new {id = "form", name = "form"}))
|
||||
@ -30,12 +48,25 @@
|
||||
<legend>Quality</legend>
|
||||
|
||||
<div class="rightSide" style="float: right; width: 65%;">
|
||||
<div id="defaultQualityDiv" style="float: left; margin: 30px;">
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.DownloadPropers)</div>
|
||||
<div class="config-value">@Html.CheckBoxFor(m => m.DownloadPropers)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.DownloadPropers)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.DownloadPropers)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-group" style="width: 250px; margin-bottom: 5px; margin-left: 5px;">
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.DefaultQualityProfileId)</div>
|
||||
<div class="config-value">@Html.DropDownListFor(m => m.DefaultQualityProfileId, Model.SelectList)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.DefaultQualityProfileId)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.DefaultQualityProfileId)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -71,7 +102,10 @@
|
||||
$.ajax({
|
||||
url: this.href,
|
||||
cache: false,
|
||||
success: function (html) { $("#user-profiles").prepend(html); }
|
||||
success: function (html) {
|
||||
$("#user-profiles").prepend(html);
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
@ -81,6 +115,7 @@
|
||||
function deleteProfile(id) {
|
||||
sendToServer(id);
|
||||
$("#div_" + id).remove();
|
||||
removeOption(id);
|
||||
}
|
||||
|
||||
function sendToServer(id) {
|
||||
|
137
NzbDrone.Web/Views/Settings/Sabnzbd.cshtml
Normal file
137
NzbDrone.Web/Views/Settings/Sabnzbd.cshtml
Normal file
@ -0,0 +1,137 @@
|
||||
@using NzbDrone.Web.Helpers;
|
||||
@model NzbDrone.Web.Models.SabnzbdSettingsModel
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
var options = {
|
||||
target: '#result',
|
||||
beforeSubmit: showRequest,
|
||||
success: showResponse,
|
||||
type: 'post',
|
||||
resetForm: false
|
||||
};
|
||||
$('#form').ajaxForm(options);
|
||||
$('#save_button').attr('disabled', '');
|
||||
});
|
||||
|
||||
function showRequest(formData, jqForm, options) {
|
||||
$("#result").empty().html('Saving...');
|
||||
$("#form :input").attr("disabled", true);
|
||||
}
|
||||
|
||||
function showResponse(responseText, statusText, xhr, $form) {
|
||||
$("#result").empty().html(responseText);
|
||||
$("#form :input").attr("disabled", false);
|
||||
}
|
||||
</script>
|
||||
|
||||
@using (Html.BeginForm("SaveSabnzbd", "Settings", FormMethod.Post, new { id = "form", name = "form" }))
|
||||
{
|
||||
<fieldset>
|
||||
<legend>SABnzbd</legend>
|
||||
|
||||
<button type="button" onclick="autoConfigureSab()">Auto-Configure</button>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabHost)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabHost)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabHost)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabHost)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabPort)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabPort)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabPort)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabPort)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabApiKey)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabApiKey)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabApiKey)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabApiKey)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabUsername)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabUsername)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabUsername)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabUsername)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabPassword)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabPassword)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabPassword)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabPassword)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabTvCategory)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(m => m.SabTvCategory)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabTvCategory)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabTvCategory)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-section">
|
||||
<div class="config-group">
|
||||
<div class="config-title">@Html.LabelFor(m => m.SabTvPriority)</div>
|
||||
<div class="config-value">@Html.DropDownListFor(m => m.SabTvPriority, Model.PrioritySelectList)</div>
|
||||
</div>
|
||||
<div class="config-group2">
|
||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.SabTvPriority)</div>
|
||||
<div class="config-description">@Html.DescriptionFor(m => m.SabTvPriority)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" id="save_button" value="Save" disabled="disabled" />
|
||||
</fieldset>
|
||||
}
|
||||
<div id="result" class="hiddenResult"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var autoConfigureSabUrl = '@Url.Action("AutoConfigureSab", "Settings")';
|
||||
|
||||
function autoConfigureSab() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: autoConfigureSabUrl,
|
||||
//data: jQuery.param({ username: $('#SabUsername').val(), password: $('#SabPassword').val() }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could not autoconfigure SABnzbd for you");
|
||||
},
|
||||
success: autoConfigureSuccess
|
||||
});
|
||||
|
||||
function autoConfigureSuccess(data) {
|
||||
$('#SabHost').val(data.Host);
|
||||
$('#SabPort').val(data.Port);
|
||||
$('#SabApiKey').val(data.ApiKey);
|
||||
}
|
||||
}
|
||||
</script>
|
@ -2,7 +2,7 @@
|
||||
{
|
||||
items.Add().Text("General").Action("General", "Settings");
|
||||
items.Add().Text("Indexers").Action("Indexers", "Settings");
|
||||
items.Add().Text("Downloads").Action("Downloads", "Settings");
|
||||
items.Add().Text("SABnzbd").Action("Sabnzbd", "Settings");
|
||||
items.Add().Text("Quality").Action("Quality", "Settings");
|
||||
items.Add().Text("Episode Sorting").Action("EpisodeSorting",
|
||||
"Settings");
|
||||
|
@ -6,9 +6,14 @@
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
addOption('@Model.Name', '@ViewData["ProfileId"]');
|
||||
});
|
||||
</script>
|
||||
|
||||
@using (Html.BeginCollectionItem("UserProfiles"))
|
||||
{
|
||||
|
||||
var idClean = ViewData.TemplateInfo.HtmlFieldPrefix.Replace('[', '_').Replace(']', '_');
|
||||
var ugly = ViewData.TemplateInfo.HtmlFieldPrefix;
|
||||
|
||||
@ -61,17 +66,17 @@
|
||||
|
||||
<div class="userProfileSectionEditor" id="div_@(ViewData["ProfileId"])">
|
||||
|
||||
<fieldset style="width:285px; margin:5px; margin-top: 0px; border-color:#CCCCCD">
|
||||
<fieldset style="width:285px; max-width:285px; margin:5px; margin-top: 0px; border-color:#CCCCCD">
|
||||
<div id="tester"></div>
|
||||
|
||||
<div id="qualityHeader" style="padding-bottom: 5px; margin: 0px;">
|
||||
<h2 style="display:inline; padding-right: 4px; margin-left: 4px;" id="@title">@{Html.DisplayTextFor(m => m.Name);}</h2>
|
||||
<a href="#" id="@Model.QualityProfileId" class="deleteRow" onclick="deleteProfile('@ViewData["ProfileId"]')"><img src="../../Content/Images/X.png" alt="Delete" /></a>
|
||||
<a href="#" id="@Model.QualityProfileId" class="deleteRow" onclick="deleteProfile('@ViewData["ProfileId"]')" style="float:right; padding-top:15px;"><img src="../../Content/Images/X.png" alt="Delete"/></a>
|
||||
</div>
|
||||
|
||||
<div class="config-group" style="width: 250px; margin-bottom: 5px; margin-left: 5px;">
|
||||
<div class="config-group" style="width: 270px; margin-bottom: 5px; margin-left: 5px;">
|
||||
<div class="config-title">@Html.LabelFor(x => x.Name)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(x => x.Name)</div>
|
||||
<div class="config-value">@Html.TextBoxFor(x => x.Name, new { maxlength = 16})</div>
|
||||
<div class="config-validation">@Html.ValidationMessageFor(x => x.Name)</div>
|
||||
</div>
|
||||
|
||||
@ -137,6 +142,7 @@
|
||||
$("#@nameBox").keyup(function () {
|
||||
var value = $(this).val();
|
||||
$("#@title").text(value);
|
||||
renameOption(value, '@ViewData["ProfileId"]');
|
||||
}).keyup();
|
||||
</script>
|
||||
}
|
Loading…
Reference in New Issue
Block a user