More changes for the urlbase #72

This commit is contained in:
tidusjar 2016-04-15 14:23:32 +01:00
commit 51f8e2a95c
10 changed files with 90 additions and 50 deletions

View file

@ -1,4 +1,5 @@
@Html.Partial("_Sidebar")
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
@{
int port;
if (Model.EmailPort == 0)
@ -106,6 +107,7 @@
<script>
$(function () {
var base = '@Html.GetBaseUrl()';
$('#save').click(function (e) {
e.preventDefault();
var port = $('#EmailPort').val();
@ -134,6 +136,8 @@
});
$('#testEmail').click(function (e) {
var url = createBaseUrl(base, '/admin/testemailnotification');
e.preventDefault();
var port = $('#EmailPort').val();
if (isNaN(port)) {
@ -144,7 +148,7 @@
$.ajax({
type: $form.prop("method"),
data: $form.serialize(),
url: '/admin/testemailnotification',
url: url,
dataType: "json",
success: function (response) {
if (response.result === true) {

View file

@ -1,4 +1,5 @@
@Html.Partial("_Sidebar")
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
@{
int port;
if (Model.Port == 0)
@ -93,13 +94,14 @@
<script>
$(function() {
var base = '@Html.GetBaseUrl()';
$('#testHeadphones').click(function (e) {
e.preventDefault();
var $form = $("#mainForm");
var url = createBaseUrl(base, '/test/headphones');
$.ajax({
type: $form.prop("method"),
url: "/test/headphones",
url: url,
data: $form.serialize(),
dataType: "json",
success: function (response) {

View file

@ -1,4 +1,5 @@
@Html.Partial("_Sidebar")
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
@{
int port;
if (Model.Port == 0)
@ -67,13 +68,14 @@
<script>
$(function () {
var base = '@Html.GetBaseUrl()';
$('#testPlex').click(function (e) {
e.preventDefault();
var url = createBaseUrl(base, '/test/plex');
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
url: "/test/plex",
url: url,
data: $form.serialize(),
dataType: "json",
success: function (response) {

View file

@ -1,4 +1,5 @@
@Html.Partial("_Sidebar")
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
@ -53,7 +54,7 @@
<script>
$(function () {
var base = '@Html.GetBaseUrl()';
$('#save').click(function (e) {
e.preventDefault();
@ -80,11 +81,12 @@
$('#testPushbullet').click(function (e) {
e.preventDefault();
var url = createBaseUrl(base, '/admin/testpushbulletnotification');
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
data: $form.serialize(),
url: '/admin/testpushbulletnotification',
url: url,
dataType: "json",
success: function (response) {
if (response.result === true) {

View file

@ -1,4 +1,5 @@
@Html.Partial("_Sidebar")
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
@ -54,6 +55,7 @@
<script>
$(function () {
var base = '@Html.GetBaseUrl()';
$('#save').click(function (e) {
e.preventDefault();
@ -80,11 +82,12 @@
$('#testPushover').click(function (e) {
e.preventDefault();
var url = createBaseUrl(base, '/admin/testpushovernotification');
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
data: $form.serialize(),
url: '/admin/testpushovernotification',
url: url,
dataType: "json",
success: function (response) {
if (response.result === true) {

View file

@ -1,4 +1,5 @@
@Html.Partial("_Sidebar")
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
@{
int port;
if (Model.Port == 0)
@ -10,9 +11,17 @@
port = Model.Port;
}
var baseUrl = Html.GetBaseUrl();
var formAction = "/admin";
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
formAction = "/" + baseUrl.ToHtmlString() + formAction;
}
}
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" action="/admin" id="mainForm">
<form class="form-horizontal" method="POST" action="@formAction" id="mainForm">
<fieldset>
<legend>Request Plex Settings</legend>
<div class="form-group">
@ -72,7 +81,7 @@
else
{
<input type="checkbox" id="SearchForMusic" name="SearchForMusic"><text>Search for Music</text>
}
}
</label>
</div>
</div>
@ -147,13 +156,13 @@
</div>
@*<div class="form-group">
<label for="WeeklyRequestLimit" class="control-label">Weekly Request Limit</label>
<div>
<label>
<input type="number" id="WeeklyRequestLimit" name="WeeklyRequestLimit" class="form-control form-control-custom " value="@Model.WeeklyRequestLimit">
</label>
</div>
</div> //TODO: Need to implement this*@
<label for="WeeklyRequestLimit" class="control-label">Weekly Request Limit</label>
<div>
<label>
<input type="number" id="WeeklyRequestLimit" name="WeeklyRequestLimit" class="form-control form-control-custom " value="@Model.WeeklyRequestLimit">
</label>
</div>
</div> //TODO: Need to implement this*@
<div>
</div>

View file

@ -1,4 +1,5 @@
@Html.Partial("_Sidebar")
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
@{
int port;
if (Model.Port == 0)
@ -103,7 +104,7 @@
<script>
$(function() {
var base = '@Html.GetBaseUrl()';
@if (!string.IsNullOrEmpty(Model.QualityProfile))
{
<text>
@ -148,9 +149,11 @@
$('#testSickRage').click(function (e) {
e.preventDefault();
var $form = $("#mainForm");
var url = createBaseUrl(base, '/test/sickrage');
$.ajax({
type: $form.prop("method"),
url: "/test/sickrage",
url: url,
data: $form.serialize(),
dataType: "json",
success: function (response) {

View file

@ -1,4 +1,5 @@
@Html.Partial("_Sidebar")
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
@{
int port;
if (Model.Port == 0)
@ -223,13 +224,15 @@
}
});
});
var base = '@Html.GetBaseUrl()';
$('#testSonarr').click(function (e) {
e.preventDefault();
var $form = $("#mainForm");
var url = createBaseUrl(base, '/test/sonarr');
$.ajax({
type: $form.prop("method"),
url: "/test/sonarr",
url: url,
data: $form.serialize(),
dataType: "json",
success: function (response) {