mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
All Sln changes
This commit is contained in:
parent
b5855f2644
commit
796f0fc188
615 changed files with 68 additions and 747 deletions
135
Ombi.UI/Views/Admin/Authentication.cshtml
Normal file
135
Ombi.UI/Views/Admin/Authentication.cshtml
Normal file
|
@ -0,0 +1,135 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
|
||||
@{
|
||||
var baseUrl = Html.GetBaseUrl();
|
||||
var formAction = "/admin/authentication";
|
||||
|
||||
var usermanagement = "/usermanagement";
|
||||
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
|
||||
{
|
||||
formAction = "/" + baseUrl.ToHtmlString() + formAction;
|
||||
usermanagement = "/" + baseUrl.ToHtmlString() + usermanagement;
|
||||
}
|
||||
|
||||
}
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" action="@formAction" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Authentication Settings</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.UserAuthentication)
|
||||
{
|
||||
<input type="checkbox" id="userAuth" name="UserAuthentication" checked="checked">
|
||||
<label for="userAuth">Enable User Authentication</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="userAuth" name="UserAuthentication">
|
||||
<label for="userAuth">Enable User Authentication</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.UsePassword)
|
||||
{
|
||||
<input type="checkbox" id="UsePassword" name="UsePassword" checked="checked">
|
||||
<label for="UsePassword">Require users to login with their passwords</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="UsePassword" name="UsePassword">
|
||||
<label for="UsePassword">Require users to login with their passwords</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br />
|
||||
<a href="@usermanagement" class="btn btn-info-outline">User Management</a>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
||||
<p class="form-group">A comma separated list of users that you do not want to login.</p>
|
||||
<div class="form-group">
|
||||
<label for="DeniedUsers" class="control-label">Denied Users</label>
|
||||
<div >
|
||||
<input type="text" class="form-control-custom form-control " id="DeniedUsers" name="DeniedUsers" placeholder="e.g. John, Bobby" value="@Model.DeniedUsers">
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
|
||||
if ($('#PlexAuthToken')) {
|
||||
loadUserList();
|
||||
}
|
||||
|
||||
$('#refreshUsers').click(function (e) {
|
||||
e.preventDefault();
|
||||
loadUserList();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function loadUserList() {
|
||||
$('#users').html("");
|
||||
var url = "getusers";
|
||||
$.ajax({
|
||||
type: "Get",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
|
||||
$('#users').html("");
|
||||
if(!response.result){
|
||||
generateNotify(response.message,"danger");
|
||||
$('#users').append("<option>Error!</option>");
|
||||
return;
|
||||
}
|
||||
if (response.users.length > 0) {
|
||||
$(response.users).each(function () {
|
||||
$('#users').append("<option>" + this + "</option>");
|
||||
});
|
||||
} else {
|
||||
$('#users').append("<option>No Users, Please refresh!</option>");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#users').html("");
|
||||
$('#users').append("<option>Error!</option>");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script>
|
272
Ombi.UI/Views/Admin/CouchPotato.cshtml
Normal file
272
Ombi.UI/Views/Admin/CouchPotato.cshtml
Normal file
|
@ -0,0 +1,272 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.CouchPotatoSettings>
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@{
|
||||
int port;
|
||||
if (Model.Port == 0)
|
||||
{
|
||||
port = 5050;
|
||||
}
|
||||
else
|
||||
{
|
||||
port = Model.Port;
|
||||
}
|
||||
}
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>CouchPotato Settings</legend>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="Ip" class="control-label">CouchPotato Hostname or IP</label>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="localhost" value="@Model.Ip">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="portNumber" class="control-label">Port</label>
|
||||
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="portNumber" name="Port" placeholder="Port Number" value="@port">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ApiKey" class="control-label">CouchPotato API Key</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="ApiKey" name="ApiKey" value="@Model.ApiKey">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="username" class="control-label">Username and Password</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom" id="username" name="Username" placeholder="username">
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<input type="password" class="form-control form-control-custom" id="password" name="Password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="">
|
||||
<button id="requestToken" class="btn btn-primary-outline">Request Api Key <i class="fa fa-key"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Ssl)
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl" checked="checked"><label for="Ssl">SSL</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="SubDir" class="control-label">CouchPotato Base Url</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="SubDir" name="SubDir" value="@Model.SubDir">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button type="submit" id="getProfiles" class="btn btn-primary-outline">Get Quality Profiles</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="select" class="control-label">Quality Profiles</label>
|
||||
<div id="profiles">
|
||||
<select class="form-control form-control-custom" id="select"></select>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testCp" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"> </div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
var baseUrl = '@Html.GetBaseUrl()';
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ProfileId))
|
||||
{
|
||||
<text>
|
||||
var qualitySelected = '@Model.ProfileId';
|
||||
var $form = $("#mainForm");
|
||||
var url = '/admin/cpprofiles';
|
||||
url = createBaseUrl(baseUrl, url);
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
response.list.forEach(function(result) {
|
||||
if (result._id == qualitySelected) {
|
||||
|
||||
$("#select").append("<option selected='selected' value='" + result._id + "'>" + result.label + "</option>");
|
||||
} else {
|
||||
$("#select").append("<option value='" + result._id + "'>" + result.label + "</option>");
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
</text>
|
||||
}
|
||||
|
||||
$('#requestToken').click(function (e) {
|
||||
e.preventDefault();
|
||||
debugger;
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: "cpapikey",
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.apiKey) {
|
||||
generateNotify("Success!", "success");
|
||||
$('#ApiKey').val(response.apiKey);
|
||||
} else {
|
||||
generateNotify("Could not automatically get the API key", "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#getProfiles').click(function (e) {
|
||||
e.preventDefault();
|
||||
var $form = $("#mainForm");
|
||||
var url = createBaseUrl(baseUrl, "/admin/cpprofiles");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.message) {
|
||||
generateNotify(response.message, "warning");
|
||||
return;
|
||||
}
|
||||
response.list.forEach(function (result) {
|
||||
$("#select").append("<option value='" + result._id + "'>" + result.label + "</option>");
|
||||
});
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#testCp').click(function (e) {
|
||||
e.preventDefault();
|
||||
var $form = $("#mainForm");
|
||||
var url = createBaseUrl(baseUrl,"/test/cp");
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: url,
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
generateNotify(response.message, "success");
|
||||
$('#authToken').val(response.authToken);
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
var port = $('#portNumber').val();
|
||||
if (isNaN(port)) {
|
||||
generateNotify("You must specify a Port.", "warning");
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
var data = $form.serialize();
|
||||
data = data + "&profileId=" + qualityProfile;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
258
Ombi.UI/Views/Admin/EmailNotifications.cshtml
Normal file
258
Ombi.UI/Views/Admin/EmailNotifications.cshtml
Normal file
|
@ -0,0 +1,258 @@
|
|||
@using System.Linq
|
||||
@using Ombi.UI.Helpers
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.EmailNotificationSettings>
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@{
|
||||
int port;
|
||||
if (Model.EmailPort == 0)
|
||||
{
|
||||
port = 25;
|
||||
}
|
||||
else
|
||||
{
|
||||
port = Model.EmailPort;
|
||||
}
|
||||
}
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Email Notifications</legend>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.EnableUserEmailNotifications)
|
||||
{
|
||||
<input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications" checked="checked"><label for="EnableUserEmailNotifications">Enable user email notifications</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications"><label for="EnableUserEmailNotifications">Enable user email notifications</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Authentication)
|
||||
{
|
||||
<input type="checkbox" id="Authentication" name="Authentication" checked="checked"><label for="Authentication">Enable SMTP Authentication</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Authentication" name="Authentication"><label for="Authentication">Enable SMTP Authentication</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<small>Please note that if user notifications is enabled, the email will get sent with the SMTP set-up below.</small>
|
||||
<div class="form-group">
|
||||
<label for="EmailHost" class="control-label">SMTP Host name or IP</label>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="EmailHost" name="EmailHost" placeholder="localhost" value="@Model.EmailHost">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="EmailPort" class="control-label">SMTP Port</label>
|
||||
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="EmailPort" name="EmailPort" placeholder="Port Number" value="@port">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="EmailSender" class="control-label">Email Sender</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="EmailSender" name="EmailSender" value="@Model.EmailSender">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="RecipientEmail" class="control-label">Email Recipient</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="RecipientEmail" name="RecipientEmail" value="@Model.RecipientEmail">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="EmailUsername" class="control-label">Username</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="EmailUsername" name="EmailUsername" value="@Model.EmailUsername">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="EmailPassword" class="control-label">Password</label>
|
||||
<div>
|
||||
<input type="password" class="form-control form-control-custom " id="EmailPassword" name="EmailPassword" value="@Model.EmailPassword">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* <!--Accordion Item-->
|
||||
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
|
||||
@for (var i = 0; i < Model.Message.Count; i++)
|
||||
{
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" role="tab" id="@(i)headingOne">
|
||||
<h4 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#@(i)collapseOne" aria-controls="@(i)collapseOne">
|
||||
@Model.Message[i].NotificationType.ToString()
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="@(i)collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="@(i)headingOne">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label for="@(Model.Message[i])" class="control-label"> @Model.Message[i].NotificationType.ToString() Subject</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="@(Model.Message[i].Subject)" name="Message[@(i)].Subject" value="@(Model.Message[i].Subject)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="@(Model.Message[i].Body)" class="control-label">@Model.Message[i].NotificationType.ToString() Body</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="@(Model.Message[i].Body)" name="Message[@(i)].Body" value="@(Model.Message[i].Body)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>*@
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testEmail" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
var auth = $('#Authentication').prop('checked');
|
||||
changeUsernameAndPassword(auth);
|
||||
|
||||
|
||||
$("#Authentication")
|
||||
.change(function () {
|
||||
auth = $('#Authentication').prop('checked');
|
||||
changeUsernameAndPassword(auth);
|
||||
});
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
var port = $('#EmailPort').val();
|
||||
if (isNaN(port)) {
|
||||
generateNotify("You must specify a valid Port.", "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
var $form = $("#mainForm");
|
||||
var data = $form.serialize();
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#testEmail').click(function (e) {
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
|
||||
var url = createBaseUrl(base, '/admin/testemailnotification');
|
||||
e.preventDefault();
|
||||
var port = $('#EmailPort').val();
|
||||
if (isNaN(port)) {
|
||||
generateNotify("You must specify a valid Port.", "warning");
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
function changeUsernameAndPassword(checked) {
|
||||
var $userName = $('#EmailUsername');
|
||||
var $password = $('#EmailPassword');
|
||||
if (!checked) {
|
||||
disableElement($userName);
|
||||
disableElement($password);
|
||||
} else {
|
||||
enableElement($userName);
|
||||
enableElement($password);
|
||||
}
|
||||
};
|
||||
|
||||
function disableElement(element) {
|
||||
element.attr('disabled', 'disabled');
|
||||
element.removeClass('form-control-custom');
|
||||
element.addClass('form-control-custom-disabled');
|
||||
}
|
||||
|
||||
function enableElement(element) {
|
||||
element.removeAttr('disabled', 'disabled');
|
||||
element.addClass('form-control-custom');
|
||||
element.removeClass('form-control-custom-disabled');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script>
|
159
Ombi.UI/Views/Admin/Headphones.cshtml
Normal file
159
Ombi.UI/Views/Admin/Headphones.cshtml
Normal file
|
@ -0,0 +1,159 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@{
|
||||
int port;
|
||||
if (Model.Port == 0)
|
||||
{
|
||||
port = 8181;
|
||||
}
|
||||
else
|
||||
{
|
||||
port = Model.Port;
|
||||
}
|
||||
}
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Headphones Settings</legend>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Ssl)
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl" checked="checked"><label for="Ssl">SSL</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="Ip" class="control-label">Headphones Hostname or IP</label>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="localhost" value="@Model.Ip">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="portNumber" class="control-label">Port</label>
|
||||
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="portNumber" name="Port" placeholder="Port Number" value="@port">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ApiKey" class="control-label">Headphones API Key</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="ApiKey" name="ApiKey" value="@Model.ApiKey">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="SubDir" class="control-label">Headphones Base Url</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="SubDir" name="SubDir" value="@Model.SubDir">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testHeadphones" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#testHeadphones').click(function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
var $form = $("#mainForm");
|
||||
var url = createBaseUrl(base, '/test/headphones');
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: url,
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
var port = $('#portNumber').val();
|
||||
if (isNaN(port)) {
|
||||
generateNotify("You must specify a Port.", "warning");
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
var data = $form.serialize();
|
||||
data = data + "&profileId=" + qualityProfile;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
160
Ombi.UI/Views/Admin/LandingPage.cshtml
Normal file
160
Ombi.UI/Views/Admin/LandingPage.cshtml
Normal file
|
@ -0,0 +1,160 @@
|
|||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@using Ombi.UI.Helpers
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.LandingPageSettings>
|
||||
@Html.LoadDateTimePickerAsset()
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Landing Page Settings</legend>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
</div>
|
||||
<small>If enabled then all users will be redirected to the landing page instead of the login page.</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
@if (Model.BeforeLogin)
|
||||
{
|
||||
<input type="checkbox" id="BeforeLogin" name="BeforeLogin" checked="checked"><label for="BeforeLogin">Show before the login</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="BeforeLogin" name="BeforeLogin"><label for="BeforeLogin">Show before the login</label>
|
||||
}
|
||||
</div>
|
||||
<small>If enabled then this will show the landing page before the login page, if this is disabled the user will log in first and then see the landing page.</small>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.NoticeEnable)
|
||||
{
|
||||
<input type="checkbox" id="NoticeEnable" name="NoticeEnable" checked="checked"><label for="NoticeEnable">Enable a notice</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="NoticeEnable" name="NoticeEnable"><label for="NoticeEnable">Enable a notice</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="form-group">Notice Message</p>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<textarea rows="4" type="text" class="form-control-custom form-control " id="NoticeMessage" name="NoticeMessage" placeholder="e.g. Plex will be down for maintaince (HTML is allowed)" value="@Model.NoticeMessage">@Model.NoticeMessage</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.EnabledNoticeTime)
|
||||
{
|
||||
<input type="checkbox" id="EnabledNoticeTime" name="EnabledNoticeTime" checked="checked"><label for="EnabledNoticeTime">Enable a time limit for the notices</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="EnabledNoticeTime" name="EnabledNoticeTime"><label for="EnabledNoticeTime">Enable a time limit for the notices</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class='input-group date' id='startDate'>
|
||||
<input type='text' class="form-control" value="@Model.NoticeStart"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class='input-group date' id='endDate'>
|
||||
<input type='text' class="form-control" value="@Model.NoticeEnd"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button type="submit" id="save" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var $startDate = $('#startDate').datetimepicker();
|
||||
var $endDate = $('#endDate').datetimepicker({
|
||||
useCurrent: false //Important! See issue #1075
|
||||
});
|
||||
$("#startDate").on("dp.change", function (e) {
|
||||
$('#endDate').data("DateTimePicker").minDate(e.date);
|
||||
});
|
||||
$("#endDate").on("dp.change", function (e) {
|
||||
$('#startDate').data("DateTimePicker").maxDate(e.date);
|
||||
});
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var start = '';
|
||||
var end = '';
|
||||
if ($startDate.data("DateTimePicker").date()) {
|
||||
start = $startDate.data("DateTimePicker").date().toISOString();
|
||||
}
|
||||
if ($endDate.data("DateTimePicker").date()) {
|
||||
end = $endDate.data("DateTimePicker").date().toISOString();
|
||||
}
|
||||
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
data = data + "¬iceStart=" + start + "¬iceEnd=" + end;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
154
Ombi.UI/Views/Admin/Logs.cshtml
Normal file
154
Ombi.UI/Views/Admin/Logs.cshtml
Normal file
|
@ -0,0 +1,154 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@Html.LoadTableAssets()
|
||||
|
||||
@{
|
||||
var baseUrl = Html.GetBaseUrl();
|
||||
var formAction = "/admin/loglevel";
|
||||
var clearAction = "/admin/clearlogs";
|
||||
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
|
||||
{
|
||||
formAction = "/" + baseUrl.ToHtmlString() + formAction;
|
||||
clearAction = "/" + baseUrl.ToHtmlString() + clearAction;
|
||||
}
|
||||
}
|
||||
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<fieldset>
|
||||
<legend>Logs</legend>
|
||||
<form method="post" id="mainForm" action="@formAction">
|
||||
<div class="form-group">
|
||||
<label for="logLevel" class="control-label">Log Level</label>
|
||||
<div id="logLevel">
|
||||
<select class="form-control" id="selected">
|
||||
<option id="Trace" value="0">Trace (ONLY USE FOR DEVELOPMENT)</option>
|
||||
<option id="Debug" value="1">Debug</option>
|
||||
<option id="Info" value="2">Info</option>
|
||||
<option id="Warn" value="3">Warn</option>
|
||||
<option id="Error" value="4">Error</option>
|
||||
<option id="Fatal" value="5">Fatal</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline ">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form method="post" id="clearForm" action="@clearAction">
|
||||
<button id="clearLogs" type="submit" class="btn btn-danger-outline ">Clear Logs</button>
|
||||
</form>
|
||||
|
||||
<table id="logDatatable" class="table table-striped table-hover table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Message</th>
|
||||
<th>Area</th>
|
||||
<th>Log Level</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var baseUrl = '@Html.GetBaseUrl()';
|
||||
|
||||
var logsUrl = "/admin/loadlogs";
|
||||
var url = createBaseUrl(baseUrl, logsUrl);
|
||||
$('#logDatatable').DataTable({
|
||||
"ajax": url,
|
||||
"columns": [
|
||||
{ "data": "message" },
|
||||
{ "data": "logger" },
|
||||
{ "data": "level" },
|
||||
{ "data": "dateString" }
|
||||
],
|
||||
"order": [[3, "desc"]]
|
||||
});
|
||||
|
||||
|
||||
var logUrl = "/admin/loglevel";
|
||||
logUrl = createBaseUrl(baseUrl, logUrl);
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: logUrl,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response && response.length > 0) {
|
||||
$("#selected > option").each(function (level) {
|
||||
var $opt = $(this);
|
||||
if (response[0].ordinal == level) {
|
||||
$opt.prop("selected", "selected");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var logLevel = $("#logLevel option:selected").val();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
var data = "level=" + logLevel;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#clearLogs').click(function(e) {
|
||||
e.preventDefault();
|
||||
var $form = $("#clearForm");
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('body .dropdown-toggle').dropdown();
|
||||
|
||||
|
||||
});
|
||||
</script>
|
133
Ombi.UI/Views/Admin/NewsletterSettings.cshtml
Normal file
133
Ombi.UI/Views/Admin/NewsletterSettings.cshtml
Normal file
|
@ -0,0 +1,133 @@
|
|||
@using System.Linq
|
||||
@using Ombi.UI.Helpers
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.NewletterSettings>
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Newsletter Settings</legend>
|
||||
|
||||
<!-- Email Nofication Section -->
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
<small>Note: This will require you to setup your email notifications</small>
|
||||
<br />
|
||||
@if (Model.SendRecentlyAddedEmail)
|
||||
{
|
||||
<input type="checkbox" id="SendRecentlyAddedEmail" name="SendRecentlyAddedEmail" checked="checked"><label for="SendRecentlyAddedEmail">Enable the newsletter of recently added content</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="SendRecentlyAddedEmail" name="SendRecentlyAddedEmail"><label for="SendRecentlyAddedEmail">Enable the newsletter of recently added content</label>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
@if (Model.SendToPlexUsers)
|
||||
{
|
||||
<input type="checkbox" id="SendToPlexUsers" name="SendToPlexUsers" checked="checked"><label for="SendToPlexUsers">Send to all of your Plex 'Friends'</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="SendToPlexUsers" name="SendToPlexUsers"><label for="SendToPlexUsers">Send to all of your Plex 'Friends'</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<label for="CustomUsers" class="control-label">Email Addresses to Send to (For users that are not in your Plex Friends)</label>
|
||||
<small>You can add multiple email address by using the ; delimiter</small>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " placeholder="first@address.com;second@address.com" id="CustomUsers" name="CustomUsers" value="@Model.CustomUsers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="recentlyAddedBtn" class="btn btn-primary-outline">Send test email to Admin <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button type="submit" id="save" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Email Nofication Section -->
|
||||
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
var data = $form.serialize();
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#recentlyAddedBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
var url = createBaseUrl(base, '/admin/recentlyAddedTest');
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
|
||||
generateNotify(response.message, "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
83
Ombi.UI/Views/Admin/NotificationSettings.cshtml
Normal file
83
Ombi.UI/Views/Admin/NotificationSettings.cshtml
Normal file
|
@ -0,0 +1,83 @@
|
|||
@using System.Linq
|
||||
@using Ombi.UI.Helpers
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.NotificationSettingsV2>
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Notification Settings</legend>
|
||||
|
||||
<!--Accordion Item-->
|
||||
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" role="tab" id="0headingOne">
|
||||
<h4 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#0collapseOne" aria-controls="0collapseOne">
|
||||
New Request
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="0collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="0headingOne">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label for="EmailNotification[0].Subject" class="control-label">Subject</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="EmailNotification[0].Subject" name="EmailNotification0.Subject" value="@(Model.EmailNotification[0].Subject)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="EmailNotification[0].Body" class="control-label">Body</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="EmailNotification[0].Body" name="EmailNotification0.Body" value="@(Model.EmailNotification[0].Body)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
var data = $form.serialize();
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
263
Ombi.UI/Views/Admin/Plex.cshtml
Normal file
263
Ombi.UI/Views/Admin/Plex.cshtml
Normal file
|
@ -0,0 +1,263 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.PlexSettings>
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@{
|
||||
int port;
|
||||
if (Model.Port == 0)
|
||||
{
|
||||
port = 32400;
|
||||
}
|
||||
else
|
||||
{
|
||||
port = Model.Port;
|
||||
}
|
||||
}
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Plex Settings</legend>
|
||||
@*<input id="advancedToggle" type="checkbox"/>*@ @*TODO*@
|
||||
<div class="form-group">
|
||||
<label for="Ip" class="control-label">Plex Hostname or IP</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="localhost" value="@Model.Ip">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="portNumber" class="control-label">Port</label>
|
||||
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="portNumber" name="Port" placeholder="Port Number" value="@port">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Ssl)
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl" checked="checked"><label for="Ssl">SSL</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.AdvancedSearch)
|
||||
{
|
||||
<input type="checkbox" id="AdvancedSearch" name="AdvancedSearch" checked="checked"><label for="AdvancedSearch">Use Advanced Search</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="AdvancedSearch" name="AdvancedSearch"><label for="AdvancedSearch">Use Advanced Search</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
<small>If enabled we will be able to have a 100% accurate match, but we will be querying Plex for every single item in your library. So if you have a big library then this could take some time.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.EnableTvEpisodeSearching)
|
||||
{
|
||||
<input type="checkbox" id="EnableTvEpisodeSearching" name="EnableTvEpisodeSearching" checked="checked"><label for="EnableTvEpisodeSearching">Enable Episode Searching</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="EnableTvEpisodeSearching" name="EnableTvEpisodeSearching"><label for="EnableTvEpisodeSearching">Enable Episode Searching</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
<small>
|
||||
If enabled then we will lookup all episodes on your Plex server and store them in the local database. This will stop episode requests that already exist on Plex (that might not be in Sonarr).
|
||||
Please be aware that this is a very resource intensive process and while the Plex Episode Cacher job is running the application may appear slow (Depending on the size of your Plex library).
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="SubDir" class="control-label">Plex Base Url</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="SubDir" name="SubDir" value="@Model.SubDir">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="authToken" class="control-label">Plex Authorization Token</label>
|
||||
<div class="">
|
||||
<input type="text" class="form-control-custom form-control" id="authToken" name="PlexAuthToken" placeholder="Plex Auth Token" value="@Model.PlexAuthToken">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="MachineIdentifier" class="control-label">Machine Identifier</label>
|
||||
<div class="">
|
||||
<input type="text" class="form-control-custom form-control" id="MachineIdentifier" name="MachineIdentifier" value="@Model.MachineIdentifier">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="username" class="control-label">Username and Password</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom" id="username" name="Username" placeholder="username">
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<input type="password" class="form-control form-control-custom" id="password" name="Password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="">
|
||||
<button id="requestToken" class="btn btn-primary-outline">Request Token <i class="fa fa-key"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testPlex" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$("#advancedToggle").bootstrapSwitch();
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
|
||||
$('#testPlex').click(function (e) {
|
||||
e.preventDefault();
|
||||
var url = createBaseUrl(base, '/test/plex');
|
||||
var $form = $("#mainForm");
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: url,
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
$('#spinner').attr("class", "");
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#dbTest').click(function (e) {
|
||||
e.preventDefault();
|
||||
var url = createBaseUrl(base, '/test/plexdb');
|
||||
var $form = $("#mainForm");
|
||||
|
||||
$('#dbSpinner').attr("class", "fa fa-spinner fa-spin");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: url,
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
$('#dbSpinner').attr("class", "");
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
|
||||
$('#dbSpinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#dbSpinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#requestToken').click(function (e) {
|
||||
e.preventDefault();
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: "requestauth",
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
$('#authToken').val(response.authToken);
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
var port = $('#portNumber').val();
|
||||
if (isNaN(port)) {
|
||||
generateNotify("You must specify a Port.", "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
110
Ombi.UI/Views/Admin/PushbulletNotifications.cshtml
Normal file
110
Ombi.UI/Views/Admin/PushbulletNotifications.cshtml
Normal file
|
@ -0,0 +1,110 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Pushbullet Notifications</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="AccessToken" class="control-label">Access Token</label>
|
||||
<small class="control-label">You can get this by navigating to <a href="https://www.pushbullet.com/#settings">Pushbullet</a></small>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="AccessToken" name="AccessToken" value="@Model.AccessToken">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="DeviceIdentifier" class="control-label">Device Identifier</label>
|
||||
<small class="control-label">This is optional, if left blank we will send a Push notification to all devices.</small>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="DeviceIdentifier" name="DeviceIdentifier" value="@Model.DeviceIdentifier">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testPushbullet" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#save').click(function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#testPushbullet').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var url = createBaseUrl(base, '/admin/testpushbulletnotification');
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
110
Ombi.UI/Views/Admin/PushoverNotifications.cshtml
Normal file
110
Ombi.UI/Views/Admin/PushoverNotifications.cshtml
Normal file
|
@ -0,0 +1,110 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Pushover Notifications</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="AccessToken" class="control-label">API Key</label>
|
||||
<small class="control-label">Enter your API Key from Pushover.</small>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="AccessToken" name="AccessToken" value="@Model.AccessToken">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="UserToken" class="control-label">User Token</label>
|
||||
<small class="control-label">Your user or group key from Pushover.</small>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="UserToken" name="UserToken" value="@Model.UserToken">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testPushover" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#testPushover').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var url = createBaseUrl(base, '/admin/testpushovernotification');
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
144
Ombi.UI/Views/Admin/SchedulerSettings.cshtml
Normal file
144
Ombi.UI/Views/Admin/SchedulerSettings.cshtml
Normal file
|
@ -0,0 +1,144 @@
|
|||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.UI.Models.ScheduledJobsViewModel>
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4"><strong>Job Name</strong>
|
||||
</div>
|
||||
<div class="col-md-6 col-md-push-3"><strong>Last Run</strong>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="margin-top: 4px; margin-bottom: 4px"/>
|
||||
@foreach (var record in Model.JobRecorder)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-md-4">@record.Key</div>
|
||||
<div class="col-md-5 col-md-push-3 date">@record.Value.ToString("R")</div>
|
||||
</div>
|
||||
<hr style="margin-top: 4px; margin-bottom: 4px"/>
|
||||
}
|
||||
<br/>
|
||||
<br/>
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Scheduler Settings</legend>
|
||||
<small>Please note, you will need to restart for these settings to take effect</small>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="PlexAvailabilityChecker" class="control-label">Plex Availability Checker (min)</label>
|
||||
<input type="text" class="form-control form-control-custom " id="PlexAvailabilityChecker" name="PlexAvailabilityChecker" value="@Model.PlexAvailabilityChecker">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="PlexContentCacher" class="control-label">Plex Content Cacher (min)</label>
|
||||
<input type="text" class="form-control form-control-custom " id="PlexContentCacher" name="PlexContentCacher" value="@Model.PlexContentCacher">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="PlexUserChecker" class="control-label">Plex User Checker (hours)</label>
|
||||
<input type="text" class="form-control form-control-custom " id="PlexUserChecker" name="PlexUserChecker" value="@Model.PlexUserChecker">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="CouchPotatoCacher" class="control-label">Couch Potato Cacher (min)</label>
|
||||
<input type="text" class="form-control form-control-custom " id="CouchPotatoCacher" name="CouchPotatoCacher" value="@Model.CouchPotatoCacher">
|
||||
</div>
|
||||
|
||||
<small>Please note, the minimum time for this to run is 11 hours, if set below 11 then we will ignore that value. This is a very resource intensive job, the less we run it the better.</small>
|
||||
<div class="form-group">
|
||||
<label for="PlexEpisodeCacher" class="control-label">Plex Episode Cacher (hours)</label>
|
||||
<input type="text" class="form-control form-control-custom " id="PlexEpisodeCacher" name="PlexEpisodeCacher" value="@Model.PlexEpisodeCacher">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="SonarrCacher" class="control-label">Sonarr Cacher (min)</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="SonarrCacher" name="SonarrCacher" value="@Model.SonarrCacher">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="SickRageCacher" class="control-label">SickRage Cacher (min)</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="SickRageCacher" name="SickRageCacher" value="@Model.SickRageCacher">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="StoreBackup" class="control-label">Store Backup (hours)</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="StoreBackup" name="StoreBackup" value="@Model.StoreBackup">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="StoreCleanup" class="control-label">Store Cleanup (hours)</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="StoreCleanup" name="StoreCleanup" value="@Model.StoreCleanup">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<small>Please note, this will not reset the users request limit, it will just check every @Model.UserRequestLimitResetter hours to see if it needs to be reset.</small>
|
||||
<div class="form-group">
|
||||
<label for="UserRequestLimitResetter" class="control-label">User Request Limit Reset (hours)</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="UserRequestLimitResetter" name="UserRequestLimitResetter" value="@Model.UserRequestLimitResetter">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<small>Please note, this uses a Quartz CRON job, you can build a CRON <a href="http://www.cronmaker.com/">Here</a></small>
|
||||
<div class="form-group">
|
||||
<label for="RecentlyAddedCron" class="control-label">Recently Added Email (CRON)</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="RecentlyAddedCron" name="RecentlyAddedCron" value="@Model.RecentlyAddedCron">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline ">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('.date').each(function (i, obj) {
|
||||
var $obj = $(obj);
|
||||
var val = $obj.text();
|
||||
var newDate = utcToLocal(val);
|
||||
$obj.text(newDate);
|
||||
});
|
||||
|
||||
$('#save')
|
||||
.click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
275
Ombi.UI/Views/Admin/Settings.cshtml
Normal file
275
Ombi.UI/Views/Admin/Settings.cshtml
Normal file
|
@ -0,0 +1,275 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.PlexRequestSettings>
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@{
|
||||
int port;
|
||||
if (Model.Port == 0)
|
||||
{
|
||||
port = 3579;
|
||||
}
|
||||
else
|
||||
{
|
||||
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" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Plex Request Settings</legend>
|
||||
<div class="form-group">
|
||||
<label for="portNumber" class="control-label">Port</label>
|
||||
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="portNumber" name="Port" placeholder="Port Number" value="@port">
|
||||
</div>
|
||||
</div>
|
||||
<small class="control-label">You will have to restart after changing the port.</small>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="BaseUrl" class="control-label">Base Url</label>
|
||||
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="BaseUrl" name="BaseUrl" placeholder="Base Url" value="@Model.BaseUrl">
|
||||
</div>
|
||||
</div>
|
||||
<small class="control-label">You will have to restart after changing the url base.</small>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ApiKey" class="control-label">Api Key</label>
|
||||
<div class="input-group">
|
||||
<input type="text" readonly="readonly" class="form-control form-control-custom" id="ApiKey" name="ApiKey" value="@Model.ApiKey">
|
||||
|
||||
<div class="input-group-addon">
|
||||
<div id="refreshKey" class="fa fa-refresh" title="Reset API Key"></div>
|
||||
</div>
|
||||
|
||||
<div class="input-group-addon">
|
||||
<div class="fa fa-clipboard" data-clipboard-action="copy" data-clipboard-target="#ApiKey"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@Html.Checkbox(Model.SearchForMovies,"SearchForMovies","Search for Movies")
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.SearchForTvShows)
|
||||
{
|
||||
<input type="checkbox" id="SearchForTvShows" name="SearchForTvShows" checked="checked"><label for="SearchForTvShows">Search for TV Shows</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="SearchForTvShows" name="SearchForTvShows"><label for="SearchForTvShows">Search for TV Shows</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.SearchForMusic)
|
||||
{
|
||||
<input type="checkbox" id="SearchForMusic" name="SearchForMusic" checked="checked"><label for="SearchForMusic">Search for Music</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="SearchForMusic" name="SearchForMusic"><label for="SearchForMusic">Search for Music</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.DisableTvRequestsByEpisode)
|
||||
{
|
||||
<input type="checkbox" id="DisableTvRequestsByEpisode" name="DisableTvRequestsByEpisode" checked="checked">
|
||||
<label for="DisableTvRequestsByEpisode">Disable TV requests by episode</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="DisableTvRequestsByEpisode" name="DisableTvRequestsByEpisode"><label for="DisableTvRequestsByEpisode">Disable TV requests by episode</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.DisableTvRequestsBySeason)
|
||||
{
|
||||
<input type="checkbox" id="DisableTvRequestsBySeason" name="DisableTvRequestsBySeason" checked="checked">
|
||||
<label for="DisableTvRequestsBySeason">Disable TV requests by season</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="DisableTvRequestsBySeason" name="DisableTvRequestsBySeason"><label for="DisableTvRequestsBySeason">Disable TV requests by season</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.IgnoreNotifyForAutoApprovedRequests)
|
||||
{
|
||||
<input type="checkbox" id="IgnoreNotifyForAutoApprovedRequests" name="IgnoreNotifyForAutoApprovedRequests" checked="checked">
|
||||
<label for="IgnoreNotifyForAutoApprovedRequests">Do not send notifications for requests that don't require approval</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="IgnoreNotifyForAutoApprovedRequests" name="IgnoreNotifyForAutoApprovedRequests"><label for="IgnoreNotifyForAutoApprovedRequests">Do not send notifications for requests that don't require approval</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.CollectAnalyticData)
|
||||
{
|
||||
<input type="checkbox" id="CollectAnalyticData" name="CollectAnalyticData" checked="checked">
|
||||
<label for="CollectAnalyticData">Allow us to collect anonymous analytical data e.g. browser used</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="CollectAnalyticData" name="CollectAnalyticData"><label for="CollectAnalyticData">Allow us to collect anonymous analytical data e.g. browser</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.EnableCustomDonationUrl)
|
||||
{
|
||||
<input type="checkbox" id="EnableCustomDonationUrl" name="EnableCustomDonationUrl" checked="checked">
|
||||
<label for="EnableCustomDonationUrl">Enable custom donation link</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="EnableCustomDonationUrl" name="EnableCustomDonationUrl"><label for="EnableCustomDonationUrl">Enable custom donation link</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="CustomDonationUrl" class="control-label">Custom Donation URL</label>
|
||||
<div>
|
||||
<input type="text" class="form-control-custom form-control " id="CustomDonationUrl" name="CustomDonationUrl" placeholder="http://example.com" value="@Model.CustomDonationUrl">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="CustomDonationMessage" class="control-label">Donation Button Message</label>
|
||||
<div>
|
||||
<input type="text" class="form-control-custom form-control " id="CustomDonationMessage" name="CustomDonationMessage" placeholder="Donation button message" value="@Model.CustomDonationMessage">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="form-group">If the request limits are set to 0 then no request limit is applied.</p>
|
||||
<div class="form-group">
|
||||
<label for="MovieWeeklyRequestLimit" class="control-label">Movie Weekly Request Limit</label>
|
||||
<div>
|
||||
<label>
|
||||
<input type="number" id="MovieWeeklyRequestLimit" name="MovieWeeklyRequestLimit" class="form-control form-control-custom " value="@Model.MovieWeeklyRequestLimit">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="TvWeeklyRequestLimit" class="control-label">TV Show Weekly Request Limit</label>
|
||||
<div>
|
||||
<label>
|
||||
<input type="number" id="TvWeeklyRequestLimit" name="TvWeeklyRequestLimit" class="form-control form-control-custom " value="@Model.TvWeeklyRequestLimit">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="AlbumWeeklyRequestLimit" class="control-label">Album Weekly Request Limit</label>
|
||||
<div>
|
||||
<label>
|
||||
<input type="number" id="AlbumWeeklyRequestLimit" name="AlbumWeeklyRequestLimit" class="form-control form-control-custom " value="@Model.AlbumWeeklyRequestLimit">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button type="submit" id="save" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
|
||||
new Clipboard('.fa-clipboard');
|
||||
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var theme = $("#themes option:selected").val();
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
data = data + "&themeName=" + theme;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#refreshKey').click(function(e) {
|
||||
e.preventDefault();
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
var url = createBaseUrl(base, '/admin/createapikey');
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response) {
|
||||
generateNotify("Success!", "success");
|
||||
$('#ApiKey').val(response);
|
||||
}
|
||||
},
|
||||
error: function(e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
184
Ombi.UI/Views/Admin/Sickrage.cshtml
Normal file
184
Ombi.UI/Views/Admin/Sickrage.cshtml
Normal file
|
@ -0,0 +1,184 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@{
|
||||
int port;
|
||||
if (Model.Port == 0)
|
||||
{
|
||||
port = 8081;
|
||||
}
|
||||
else
|
||||
{
|
||||
port = Model.Port;
|
||||
}
|
||||
}
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>SickRage Settings</legend>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="Ip" class="control-label">SickRage Hostname or IP</label>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="localhost" value="@Model.Ip">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="portNumber" class="control-label">Port</label>
|
||||
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="portNumber" name="Port" placeholder="Port Number" value="@port">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ApiKey" class="control-label">SickRage API Key</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="ApiKey" name="ApiKey" value="@Model.ApiKey">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Ssl)
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl" checked="checked"><label for="Ssl">SSL</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="SubDir" class="control-label">SickRage Base Url</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="SubDir" name="SubDir" value="@Model.SubDir">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="profiles" class="control-label ">Quality Profiles</label>
|
||||
<div id="profiles">
|
||||
<select class="form-control form-control-custom" value="selected">
|
||||
@foreach (var quality in Model.Qualities)
|
||||
{
|
||||
<option id="@quality.Key" value="@quality.Key">@quality.Value</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testSickRage" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline ">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
@if (!string.IsNullOrEmpty(Model.QualityProfile))
|
||||
{
|
||||
<text>
|
||||
var qualitySelected = '@Model.QualityProfile';
|
||||
$('#' + qualitySelected).prop("selected", "selected");
|
||||
</text>
|
||||
}
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
var port = $('#portNumber').val();
|
||||
if (isNaN(port)) {
|
||||
generateNotify("You must specify a Port.", "warning");
|
||||
return;
|
||||
}
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
data = data + "&qualityProfile=" + qualityProfile;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#testSickRage').click(function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
data = data + "&qualityProfile=" + qualityProfile;
|
||||
|
||||
var url = createBaseUrl(base, '/test/sickrage');
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
})
|
||||
</script>
|
119
Ombi.UI/Views/Admin/SlackNotifications.cshtml
Normal file
119
Ombi.UI/Views/Admin/SlackNotifications.cshtml
Normal file
|
@ -0,0 +1,119 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Slack Notifications</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="WebhookUrl" class="control-label">Incoming Webhook Url</label>
|
||||
<small class="control-label">This is the full webhook url.</small>
|
||||
<small class="control-label"> Slack > Settings > Add app or integration > Build > Make a Custom Integration > Incoming Webhooks > Add Incoming Webhook. You will then have a Webhook Url</small>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="WebhookUrl" name="WebhookUrl" value="@Model.WebhookUrl">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="Channel" class="control-label">Channel Override</label>
|
||||
<small class="control-label">You can override the default channel here</small>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="Channel" name="Channel" value="@Model.Channel">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="Username" class="control-label">Username Override</label>
|
||||
<small class="control-label">You can override the default username (Plex Requests) here</small>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="Username" name="Username" value="@Model.Username">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testSlack" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#testSlack').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var url = createBaseUrl(base, '/admin/testslacknotification');
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
276
Ombi.UI/Views/Admin/Sonarr.cshtml
Normal file
276
Ombi.UI/Views/Admin/Sonarr.cshtml
Normal file
|
@ -0,0 +1,276 @@
|
|||
@using Ombi.UI.Helpers
|
||||
@Html.Partial("Shared/Partial/_Sidebar")
|
||||
@{
|
||||
int port;
|
||||
if (Model.Port == 0)
|
||||
{
|
||||
port = 8989;
|
||||
}
|
||||
else
|
||||
{
|
||||
port = Model.Port;
|
||||
}
|
||||
}
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<form class="form-horizontal" method="POST" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Sonarr Settings</legend>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
@if (Model.Enabled)
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="Ip" class="control-label">Sonarr Hostname or IP</label>
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="localhost" value="@Model.Ip">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="portNumber" class="control-label">Port</label>
|
||||
|
||||
<div class="">
|
||||
<input type="text" class="form-control form-control-custom " id="portNumber" name="Port" placeholder="Port Number" value="@port">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ApiKey" class="control-label">Sonarr API Key</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="ApiKey" name="ApiKey" value="@Model.ApiKey">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
@if (Model.Ssl)
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl" checked="checked"><label for="Ssl">SSL</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="SubDir" class="control-label">Sonarr Base Url</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " id="SubDir" name="SubDir" value="@Model.SubDir">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button type="submit" id="getProfiles" class="btn btn-primary-outline">Get Quality Profiles <div id="getSpinner"/></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="select" class="control-label">Quality Profiles</label>
|
||||
<div id="profiles">
|
||||
<select class="form-control form-control-custom" id="select"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="RootPath" class="control-label">Root save directory for TV shows</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " placeholder="C:\Media\Tv" id="RootPath" name="RootPath" value="@Model.RootPath">
|
||||
<label>Enter the root folder where tv shows are saved. For example <strong>C:\Media\TV</strong>.</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
||||
@if (Model.SeasonFolders)
|
||||
{
|
||||
<input type="checkbox" id="SeasonFolders" name="SeasonFolders" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="SeasonFolders" name="SeasonFolders">
|
||||
}
|
||||
<label for="SeasonFolders">Enable season folders</label>
|
||||
|
||||
</div>
|
||||
<label>Enabled Season Folders to organize seasons into individual folders within a show.</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testSonarr" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"/></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline ">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.QualityProfile))
|
||||
{
|
||||
|
||||
<text>
|
||||
|
||||
preLoad();
|
||||
|
||||
function preLoad() {
|
||||
var qualitySelected = @Model.QualityProfile;
|
||||
if (!qualitySelected) {
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: "sonarrprofiles",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
response.forEach(function(result) {
|
||||
if (result.id == qualitySelected) {
|
||||
|
||||
$("#select").append("<option selected='selected' value='" + result.id + "'>" + result.name + "</option>");
|
||||
} else {
|
||||
$("#select").append("<option value='" + result.id + "'>" + result.name + "</option>");
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
}
|
||||
</text>
|
||||
}
|
||||
|
||||
|
||||
$('#save').click(function(e) {
|
||||
e.preventDefault();
|
||||
var port = $('#portNumber').val();
|
||||
if (isNaN(port)) {
|
||||
generateNotify("You must specify a Port.", "warning");
|
||||
return;
|
||||
}
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
data = data + "&qualityProfile=" + qualityProfile;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#getProfiles').click(function (e) {
|
||||
|
||||
$('#getSpinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
if (!$('#Ip').val()) {
|
||||
generateNotify("Please enter a valid IP/Hostname.", "warning");
|
||||
$('#getSpinner').attr("class", "fa fa-times");
|
||||
return;
|
||||
}
|
||||
if (!$('#portNumber').val()) {
|
||||
generateNotify("Please enter a valid Port Number.", "warning");
|
||||
$('#getSpinner').attr("class", "fa fa-times");
|
||||
return;
|
||||
}
|
||||
if (!$('#ApiKey').val()) {
|
||||
generateNotify("Please enter a valid ApiKey.", "warning");
|
||||
$('#getSpinner').attr("class", "fa fa-times");
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: "sonarrprofiles",
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
response.forEach(function (result) {
|
||||
$('#getSpinner').attr("class", "fa fa-check");
|
||||
$("#select").append("<option value='" + result.id + "'>" + result.name + "</option>");
|
||||
});
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
$('#getSpinner').attr("class", "fa fa-times");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#testSonarr').click(function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
data = data + "&qualityProfile=" + qualityProfile;
|
||||
|
||||
var url = createBaseUrl(base, '/test/sonarr');
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
})
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue