mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
Fixed: Settings tabs should load a lot faster.
This commit is contained in:
@@ -1,55 +1,52 @@
|
||||
@using NzbDrone.Web.Helpers
|
||||
@model NzbDrone.Web.Models.NotificationSettingsModel
|
||||
@{ Layout = "~/Views/Shared/_ReferenceLayout.cshtml"; }
|
||||
@section HeaderContent{
|
||||
@Html.IncludeCss("Settings.css")
|
||||
<style>
|
||||
.notifier
|
||||
{
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.notifier h4
|
||||
{
|
||||
font-weight: bold;
|
||||
margin-bottom: 0px;
|
||||
padding-left: 5px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
#save_button
|
||||
{
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#smtpTest
|
||||
{
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 220px;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@model NzbDrone.Web.Models.NotificationSettingsModel
|
||||
@{ Layout = null; }
|
||||
<style>
|
||||
.notifier
|
||||
{
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.notifier h4
|
||||
{
|
||||
font-weight: bold;
|
||||
margin-bottom: 0px;
|
||||
padding-left: 5px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
#save_button
|
||||
{
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#smtpTest
|
||||
{
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 220px;
|
||||
}
|
||||
</style>
|
||||
<div id="stylized">
|
||||
@using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new { id = "NotificationForm", name = "NotificationForm", @class = "settingsForm" }))
|
||||
{
|
||||
<div class="jquery-accordion">
|
||||
<h3><a href="#">XBMC</a></h3>
|
||||
<h3>
|
||||
<a href="#">XBMC</a></h3>
|
||||
@{Html.RenderPartial("Xbmc", Model);}
|
||||
|
||||
<h3><a href="#">SMTP</a></h3>
|
||||
<h3>
|
||||
<a href="#">SMTP</a></h3>
|
||||
@{Html.RenderPartial("Smtp", Model);}
|
||||
|
||||
<h3><a href="#">Twitter</a></h3>
|
||||
<h3>
|
||||
<a href="#">Twitter</a></h3>
|
||||
@{Html.RenderPartial("Twitter", Model);}
|
||||
|
||||
<h3><a href="#">Growl</a></h3>
|
||||
<h3>
|
||||
<a href="#">Growl</a></h3>
|
||||
@{Html.RenderPartial("Growl", Model);}
|
||||
|
||||
<h3><a href="#">Prowl</a></h3>
|
||||
<h3>
|
||||
<a href="#">Prowl</a></h3>
|
||||
@{Html.RenderPartial("Prowl", Model);}
|
||||
|
||||
<h3><a href="#">Plex</a></h3>
|
||||
<h3>
|
||||
<a href="#">Plex</a></h3>
|
||||
@{Html.RenderPartial("Plex", Model);}
|
||||
</div>
|
||||
|
||||
@@ -57,95 +54,93 @@
|
||||
Save</button>
|
||||
}
|
||||
</div>
|
||||
@section Scripts{
|
||||
<script type="text/javascript">
|
||||
//Twitter
|
||||
getAuthorizationUrl = '../Command/GetTwitterAuthorization';
|
||||
verifyAuthorizationUrl = '../Command/VerifyTwitterAuthorization';
|
||||
<script type="text/javascript">
|
||||
//Twitter
|
||||
getAuthorizationUrl = '../Command/GetTwitterAuthorization';
|
||||
verifyAuthorizationUrl = '../Command/VerifyTwitterAuthorization';
|
||||
|
||||
function requestTwitterAuthorization() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: getAuthorizationUrl,
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could get Twitter Authorization at this time. " + error);
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
if (data.IsMessage)
|
||||
return false;
|
||||
function requestTwitterAuthorization() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: getAuthorizationUrl,
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could get Twitter Authorization at this time. " + error);
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
if (data.IsMessage)
|
||||
return false;
|
||||
|
||||
$('#authorizationRequestToken').val(data.Token);
|
||||
window.open(data.Url);
|
||||
}
|
||||
});
|
||||
}
|
||||
$('#authorizationRequestToken').val(data.Token);
|
||||
window.open(data.Url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function verifyTwitterAuthorization() {
|
||||
var token = $('#authorizationRequestToken').val();
|
||||
var verifier = $('#twitterVerification').val();
|
||||
function verifyTwitterAuthorization() {
|
||||
var token = $('#authorizationRequestToken').val();
|
||||
var verifier = $('#twitterVerification').val();
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: verifyAuthorizationUrl,
|
||||
data: jQuery.param({ token: token, verifier: verifier }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could verify Twitter Authorization at this time. " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: verifyAuthorizationUrl,
|
||||
data: jQuery.param({ token: token, verifier: verifier }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could verify Twitter Authorization at this time. " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//SMTP
|
||||
function testSmtpSettings() {
|
||||
//Get the variables
|
||||
var server = $('#SmtpServer').val();
|
||||
var port = $('#SmtpPort').val();
|
||||
var ssl = $('#SmtpUseSsl').val();
|
||||
var username = $('#SmtpUsername').val();
|
||||
var password = $('#SmtpPassword').val();
|
||||
var fromAddress = $('#SmtpFromAddress').val();
|
||||
var toAddresses = $('#SmtpToAddresses').val();
|
||||
//SMTP
|
||||
function testSmtpSettings() {
|
||||
//Get the variables
|
||||
var server = $('#SmtpServer').val();
|
||||
var port = $('#SmtpPort').val();
|
||||
var ssl = $('#SmtpUseSsl').val();
|
||||
var username = $('#SmtpUsername').val();
|
||||
var password = $('#SmtpPassword').val();
|
||||
var fromAddress = $('#SmtpFromAddress').val();
|
||||
var toAddresses = $('#SmtpToAddresses').val();
|
||||
|
||||
//Send the data!
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '../Command/SendTestEmail',
|
||||
data: jQuery.param({
|
||||
server: server,
|
||||
port: port,
|
||||
ssl: ssl,
|
||||
username: username,
|
||||
password: password,
|
||||
fromAddress: fromAddress,
|
||||
toAddresses: toAddresses
|
||||
}),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could send a test email at this time. " + error);
|
||||
}
|
||||
});
|
||||
//Send the data!
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '../Command/SendTestEmail',
|
||||
data: jQuery.param({
|
||||
server: server,
|
||||
port: port,
|
||||
ssl: ssl,
|
||||
username: username,
|
||||
password: password,
|
||||
fromAddress: fromAddress,
|
||||
toAddresses: toAddresses
|
||||
}),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could send a test email at this time. " + error);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//Growl
|
||||
function registerGrowl() {
|
||||
//Get the variables
|
||||
var host = $('#GrowlHost').val();
|
||||
var password = $('#GrowlPassword').val();
|
||||
//Growl
|
||||
function registerGrowl() {
|
||||
//Get the variables
|
||||
var host = $('#GrowlHost').val();
|
||||
var password = $('#GrowlPassword').val();
|
||||
|
||||
//Send the data!
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '../Command/RegisterGrowl',
|
||||
data: jQuery.param({
|
||||
host: host,
|
||||
password: password
|
||||
}),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could send a test email at this time. " + error);
|
||||
}
|
||||
});
|
||||
//Send the data!
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '../Command/RegisterGrowl',
|
||||
data: jQuery.param({
|
||||
host: host,
|
||||
password: password
|
||||
}),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could send a test email at this time. " + error);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user