The move!

This commit is contained in:
Jamie.Rees 2017-05-16 08:31:44 +01:00
commit 25526cc4d9
1147 changed files with 85 additions and 8524 deletions

View file

@ -0,0 +1,219 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.UI.Models.AboutAdminViewModel>
@Html.Partial("Shared/Partial/_Sidebar")
@Html.LoadAsset("/Content/helpers/bootbox.min.js", true)
<div id="lightbox" style="display:none"></div>
<div class="col-sm-8 col-sm-push-1">
<fieldset>
<legend>About</legend>
<hr />
<table class="table table-condensed">
<tr>
<td>
Application Version:
</td>
<td>
@Model.ApplicationVersion
</td>
</tr>
<tr>
<td>
OS:
</td>
<td>
@Model.Os
</td>
</tr>
<tr>
<td>
System Version:
</td>
<td>
@Model.SystemVersion
</td>
</tr>
<tr>
<td>
Branch:
</td>
<td>
@Model.Branch
</td>
</tr>
<tr>
<td>
Log Level:
</td>
<td>
@Model.LogLevel
</td>
</tr>
<tr>
<td>
Database Location:
</td>
<td>
@Model.DbLocation
</td>
</tr>
<tr>
<td>
Running Directory:
</td>
<td>
@Model.RunningDir
</td>
</tr>
</table>
<hr />
<table class="table table-condensed">
<tr>
<td>
Github
</td>
<td>
<a href="https://github.com/tidusjar/Ombi" target="_blank">https://github.com/tidusjar/Ombi</a>
</td>
</tr>
<tr>
<td>
Wiki
</td>
<td>
<a href="https://github.com/tidusjar/Ombi/wiki" target="_blank">https://github.com/tidusjar/Ombi/wiki</a>
</td>
</tr>
<tr>
<td>
Issues
</td>
<td>
<a href="https://github.com/tidusjar/Ombi/issues" target="_blank">https://github.com/tidusjar/Ombi/issues</a>
</td>
</tr>
<tr>
<td>
Chat
</td>
<td>
<a href="https://gitter.im/tidusjar/Ombi" target="_blank">https://gitter.im/tidusjar/Ombi</a>
</td>
</tr>
<tr>
<td>
Feature Requests
</td>
<td>
<a href="https://feathub.com/tidusjar/Ombi" target="_blank">https://feathub.com/tidusjar/Ombi</a>
</td>
</tr>
</table>
<hr />
@if (Model.OAuthEnabled)
{
<div class="form-group">
<div>
<button id="save" type="submit" class="btn btn-danger-outline">Report a bug</button>
</div>
</div>
}
else
{
<div class="form-group">
<div>
<button id="oAuth" type="submit" class="btn btn-primary-outline">Log in via Github to Report an Issue</button>
</div>
</div>
}
</fieldset>
</div>
<script>
var issueTitle = "";
var baseUrl = '@Html.GetBaseUrl()';
$('#save').click(function () {
startBug();
});
$('#oAuth').click(function () {
var url = "/admin/oauth";
url = createBaseUrl(baseUrl, url);
$.ajax({
type: "get",
url: url,
dataType: "json",
success: function (response) {
window.location.href = response.uri;
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
function startBug() {
bootbox.prompt({
size: "small",
title: "What is the title of the issue?",
inputType: 'textarea',
callback: mainContent
});
}
function mainContent(userTitle) {
if (!userTitle) {
generateNotify("Please provide a valid title", "danger");
return startBug();
}
issueTitle = userTitle;
bootbox.prompt({
title: "Please provide details of the issue including any logs and reproduction steps",
inputType: 'textarea',
callback: reportBug
});
}
function reportBug(additionalInfo) {
if (!additionalInfo) {
generateNotify("Please provide some information", "danger");
return mainContent();
}
var url = "/admin/about";
url = createBaseUrl(baseUrl, url);
$.ajax({
type: "post",
url: url,
data: { title: issueTitle, body: additionalInfo },
dataType: "json",
success: function (response) {
if (response && response.result) {
generateNotify("Issue Reported, see here: " + response.url);
} else {
if (response.message) {
generateNotify(response.message, "danger");
}
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
}
</script>

View file

@ -0,0 +1,83 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.AuthenticationSettings>
@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>
@Html.Checkbox(Model.UserAuthentication, "UserAuthentication", "Enable User Authentication", "If enabled we will check the login name against a user in your local users list or Plex/Emby users.")
@Html.Checkbox(Model.UsePassword, "UsePassword", "Require users to login with their passwords", "If enabled, users must provide a valid password to log into Ombi")
<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.
@Html.ToolTip("This is a 'blacklist', if you have users that you do not want to log in, enter them here!")</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()';
$('.customTooltip').tooltipster({
contentCloning: true
});
changeDisabledStatus($('#UsePassword'), @Model.UserAuthentication.ToString().ToLower(), $('#passLabel'));
$('#mainForm').on('click', '#userAuth', function () {
var checked = this.checked;
changeDisabledStatus($('#UsePassword'), checked, $('#passLabel'));
});
function changeDisabledStatus($element, checked, $label) {
if (checked) {
$element.removeAttr("disabled");
$label.css("color", "");
} else {
$('#UsePassword').prop('checked', false);
$element.attr("disabled", "disabled");
$label.css("color", "grey");
}
}
});
</script>

View 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>

View file

@ -0,0 +1,99 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.DiscordNotificationSettings>
@Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Discord Notifications</legend>
@Html.Checkbox(Model.Enabled, "Enabled", "Enabled")
<div class="form-group">
<label for="WebhookUrl" class="control-label">Webhook Url</label>
<small class="control-label">This is the full webhook url.</small>
<small class="control-label"> Discord > Edit Channel > Webhooks > Create Webook > Copy the Webhook Url > Press Save</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="Username" class="control-label">Username Override</label>
<small class="control-label">You can override the default username</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="testDiscord" 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");
}
});
});
$('#testDiscord').click(function (e) {
e.preventDefault();
var url = createBaseUrl(base, '/admin/testdiscordnotification');
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>

View file

@ -0,0 +1,248 @@
@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.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>
<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>
<small>The sender is who the email will be sent from, this can be for any email including user notification emails (if that is enabled).</small>
<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>
<small>The recipient email is used for emails going to the administrator.</small>
<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>

View file

@ -0,0 +1,150 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.EmbySettings>
@Html.Partial("Shared/Partial/_Sidebar")
@{
int port;
if (Model.Port == 0)
{
port = 8096;
}
else
{
port = Model.Port;
}
}
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Emby Settings</legend>
@Html.Checkbox(Model.Enable, "Enable", "Enabled")
<div class="form-group">
<label for="Ip" class="control-label">Emby 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>
@Html.Checkbox(Model.EnableEpisodeSearching, "EnableEpisodeSearching", "Enable Episode Searching")
@Html.ToolTip("This will allow Ombi to search through all of the episodes stored on Emby")
<div class="form-group">
<label for="SubDir" class="control-label">Emby 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="ApiKey" class="control-label">Emby Api Key</label>
<div class="">
<input type="text" class="form-control-custom form-control" id="ApiKey" name="ApiKey" placeholder="Api Key" value="@Model.ApiKey">
</div>
</div>
<div class="form-group">
<div>
<button id="testEmby" 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()';
$('#testEmby').click(function (e) {
e.preventDefault();
var url = createBaseUrl(base, '/test/emby');
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");
}
});
});
$('#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>

View 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>

View 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. The server 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 + "&noticeStart=" + start + "&noticeEnd=" + 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>

View 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>

View file

@ -0,0 +1,105 @@
@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 id="massemail" class="form-horizontal">
<fieldset>
<legend>Mass Email</legend>
<!-- Mass Email Section -->
<div style="padding:10px">
<div class="form-group">
<small>Note: This will require you to setup your email notifications</small>
</div>
<div class="form-group">
<label for="massEmailSubject" class="control-label">Subject</label>
<div>
<input type="text" class="form-control form-control-custom " placeholder="A Message from the Admin" id="massEmailSubject" name="massEmailSubject" value="">
</div>
</div>
<div class="form-group">
<label for="massEmailBody" class="control-label">Body</label>
<textarea id="massEmailBody" class="form-control" rows="5"></textarea>
<small>Supports HTML</small>
</div>
<div class="form-group">
<div>
<button id="testSendMassEmailBtn" class="btn btn-primary-outline">Send Test to Admin<div id="testSendMassEmailSpinner"></div></button>
</div>
</div>
<div class="form-group">
<div>
<button id="sendMassEmailBtn" class="btn btn-primary-outline">Send To All Users<div id="sendMassEmailSpinner"></div></button>
</div>
</div>
</div>
<!-- Mass Email Section -->
</fieldset>
</form>
</div>
<script>
$(function () {
$('#testSendMassEmailBtn').click(function (e) {
e.preventDefault();
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/testmassadminemail');
$('#testSendMassEmailSpinner').attr("class", "fa fa-spinner fa-spin");
var data = { "Users": "", "Body": $("#massEmailBody").val(), "Subject": $("#massEmailSubject").val() };
$.ajax({
type: "post",
url: url,
data: data,
dataType: "json",
success: function (response) {
if (response.result) {
generateNotify(response.message, "success");
$('#testSendMassEmailSpinner').attr("class", "fa fa-check");
} else {
generateNotify(response.message, "danger");
$('#testSendMassEmailSpinner').attr("class", "fa fa-times");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
$('#testSendMassEmailSpinner').attr("class", "fa fa-times");
}
});
});
$('#sendMassEmailBtn').click(function (e) {
e.preventDefault();
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/sendmassemail');
$('#sendMassEmailSpinner').attr("class", "fa fa-spinner fa-spin");
var data = { "Users": "", "Body": $("#massEmailBody").val(), "Subject": $("#massEmailSubject").val() };
$.ajax({
type: "post",
url: url,
data: data,
dataType: "json",
success: function (response) {
if (response.result) {
generateNotify(response.message, "success");
$('#sendMassEmailSpinner').attr("class", "fa fa-check");
} else {
generateNotify(response.message, "danger");
$('#sendMassEmailSpinner').attr("class", "fa fa-times");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
$('#sendMassEmailSpinner').attr("class", "fa fa-times");
}
});
});
});
</script>

View file

@ -0,0 +1,117 @@
@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>
<div style="padding:10px">
<!-- Newsletter Section -->
<div class="form-group">
<div class="checkbox">
<small>Note: This will require you to setup your email notifications
</small><span class="customTooltip" title="It also requires users to have the Newsletter feature"><i class="fa fa-info-circle"></i></span>
<br />
<br />
@Html.Checkbox(Model.SendRecentlyAddedEmail, "SendRecentlyAddedEmail", "Enable newsletter")
</div>
</div>
<div class="form-group">
<br>
<label for="CustomUsers" class="control-label">Email Addresses to Send to (For users that are not in your User Management section)</label>
<small>You can add multiple email addresses 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 @Html.ToolTip("Note: If there is nothing new when testing this, we will just grab some random titles. If there are new items, then we will show those new items. Testing will not mark the content as 'Previously Sent'")
<div id="testEmailSpinner"></div></button>
</div>
</div>
<br />
<br />
<div class="form-group">
<div>
<button type="submit" id="save" class="btn btn-primary-outline">Save</button>
</div>
</div>
</div>
<!-- Newsletter Section -->
</fieldset>
</form>
</div>
<script>
$(function () {
$('.customTooltip').tooltipster({
contentCloning: true
});
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();
generateNotify("This could take some time depending on if you have episode searching enabled and also how many new items have been added!", "info");
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/testnewsletteradminemail');
$('#testEmailSpinner').attr("class", "fa fa-spinner fa-spin");
$.ajax({
type: "post",
url: url,
dataType: "json",
success: function (response) {
if (response) {
generateNotify(response.message, "success");
$('#testEmailSpinner').attr("class", "fa fa-check");
} else {
generateNotify(response.message, "danger");
$('#testEmailSpinner').attr("class", "fa fa-times");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
$('#testSendMassEmailSpinner').attr("class", "fa fa-times");
}
});
});
});
</script>

View 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>

View file

@ -0,0 +1,266 @@
@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*@
@Html.Checkbox(Model.Enable, "Enable", "Enable")
<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);
$('#MachineIdentifier').val(response.identifier);
} 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>

View 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>

View file

@ -0,0 +1,99 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.PushoverNotificationSettings>
@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>
@Html.Checkbox(Model.Enabled, "Enabled", "Enabled")
<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>

View file

@ -0,0 +1,223 @@
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.UI.Models.ScheduledJobsViewModel>
@Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1">
<table class="table table-striped table-hover table-responsive table-condensed">
<thead>
<tr>
<td>Job Name</td>
<td>Last Run</td>
<td></td>
</tr>
</thead>
<tbody>
@foreach (var record in Model.JobRecorder)
{
<tr>
<td>
@record.Key
</td>
<td>
@record.Value.ToString("R")
</td>
<td class="refresh" id="@record.Key"><i class="fa fa-refresh"></i></td>
</tr>
}
</tbody>
</table>
<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>
@if (Model.Plex)
{
<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>
<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>
}
@if (Model.Emby)
{
<div class="form-group">
<label for="EmbyAvailabilityChecker" class="control-label">Emby Availability Checker (min)</label>
<input type="text" class="form-control form-control-custom " id="EmbyAvailabilityChecker" name="EmbyAvailabilityChecker" value="@Model.EmbyAvailabilityChecker">
</div>
<div class="form-group">
<label for="EmbyContentCacher" class="control-label">Emby Content Cacher (min)</label>
<input type="text" class="form-control form-control-custom " id="EmbyContentCacher" name="EmbyContentCacher" value="@Model.EmbyContentCacher">
</div>
<div class="form-group">
<label for="EmbyUserChecker" class="control-label">Emby User Checker (hours)</label>
<input type="text" class="form-control form-control-custom " id="EmbyUserChecker" name="EmbyUserChecker" value="@Model.EmbyUserChecker">
</div>
<div class="form-group">
<label for="EmbyEpisodeCacher" class="control-label">Emby Episode Cacher (hours)</label>
<input type="text" class="form-control form-control-custom " id="EmbyEpisodeCacher" name="EmbyEpisodeCacher" value="@Model.EmbyEpisodeCacher">
</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>
<div class="form-group">
<label for="WatcherCacher" class="control-label">Watcher Cacher (min)</label>
<input type="text" class="form-control form-control-custom " id="WatcherCacher" name="WatcherCacher" value="@Model.WatcherCacher">
</div>
<div class="form-group">
<label for="RadarrCacher" class="control-label">Radarr Cacher (min)</label>
<input type="text" class="form-control form-control-custom " id="RadarrCacher" name="RadarrCacher" value="@Model.RadarrCacher">
</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);
});
$('.refresh').click(function(e) {
var id = e.currentTarget.id;
var ev = $(e.currentTarget.children[0]);
ev.addClass("fa-spin");
var url = createLocalUrl("/admin/schedulerun");
$.ajax({
type: 'POST',
data: {key:id},
url: url,
dataType: "json",
success: function (response) {
if (response.result === true) {
generateNotify("Success!", "success");
ev.removeClass("fa-spin");
ev.addClass("fa-check");
} else {
generateNotify(response.message, "warning");
ev.removeClass("fa-spin");
ev.addClass("fa-times");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
ev.removeClass("fa-spin");
ev.addClass("fa-times");
}
});
});
$('#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>

View file

@ -0,0 +1,255 @@
@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>Ombi Configuration</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 @Html.ToolTip("This will make Ombi run with a base url, usually used in reverse proxy scenarios")</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 base url.</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")
@Html.Checkbox(Model.SearchForActors,"SearchForActors","Search for Movies by Actor")
@Html.Checkbox(Model.SearchForTvShows, "SearchForTvShows", "Search for TV Shows")
@Html.Checkbox(Model.SearchForMusic, "SearchForMusic", "Search for Music")
<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 () {
$('.customTooltip').tooltipster({
contentCloning: true
});
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>

View 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>

View 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 (Ombi) 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>

View file

@ -0,0 +1,371 @@
 @using Ombi.UI.Helpers
@Html.Partial("Shared/Partial/_Sidebar")
@{
int port;
if (Model.Port == 0)
{
port = 8989;
}
else
{
port = Model.Port;
}
var rootFolder = string.Empty;
if (!string.IsNullOrEmpty(Model.RootPath))
{
rootFolder = Model.RootPath.Replace("/", "//");
rootFolder = rootFolder.Replace(@"\", @"\\");
}
}
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Sonarr Settings</legend>
<input hidden="hidden" name="FullRootPath" id="fullRootPath" value="@Model.FullRootPath"/>
<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">
<div>
<button type="submit" id="getRootFolders" class="btn btn-primary-outline">Get Root Folders <div id="getRootFolderSpinner" /></button>
</div>
</div>
<div class="form-group">
<label for="selectRootFolder" class="control-label">Default Root Folders</label>
<div id="rootFolders">
<select class="form-control form-control-custom" id="selectRootFolder"></select>
</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>
}
@if (!string.IsNullOrEmpty(Model.RootPath))
{
<text>
console.log('Hit root folders..');
var rootFolderSelected = '@rootFolder';
if (!rootFolderSelected) {
return;
}
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
data: $form.serialize(),
url: "sonarrrootfolders",
dataType: "json",
success: function(response) {
response.forEach(function(result) {
$('#selectedRootFolder').html("");
if (result.id == rootFolderSelected) {
$("#selectRootFolder").append("<option selected='selected' value='" + result.id + "'>" + result.path + "</option>");
} else {
$("#selectRootFolder").append("<option value='" + result.id + "'>" + result.path + "</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 rootFolder = $("#rootFolders option:selected").val();
var rootFolderPath = $('#rootFolders option:selected').text();
$('#fullRootPath').val(rootFolderPath);
var $form = $("#mainForm");
var data = $form.serialize();
data = data + "&qualityProfile=" + qualityProfile + "&rootPath=" + rootFolder;
$.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");
}
});
});
$('#getRootFolders').click(function (e) {
$('#getRootFolderSpinner').attr("class", "fa fa-spinner fa-spin");
e.preventDefault();
if (!$('#Ip').val()) {
generateNotify("Please enter a valid IP/Hostname.", "warning");
$('#getRootFolderSpinner').attr("class", "fa fa-times");
return;
}
if (!$('#portNumber').val()) {
generateNotify("Please enter a valid Port Number.", "warning");
$('#getRootFolderSpinner').attr("class", "fa fa-times");
return;
}
if (!$('#ApiKey').val()) {
generateNotify("Please enter a valid ApiKey.", "warning");
$('#getRootFolderSpinner').attr("class", "fa fa-times");
return;
}
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
data: $form.serialize(),
url: "sonarrrootfolders",
dataType: "json",
success: function (response) {
response.forEach(function (result) {
$('#getRootFolderSpinner').attr("class", "fa fa-check");
$("#selectRootFolder").append("<option value='" + result.id + "'>" + result.path + "</option>");
});
},
error: function (e) {
console.log(e);
$('#getRootFolderSpinner').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>

View file

@ -0,0 +1,124 @@

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link href='Content/swagger/typography.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='Content/swagger/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='Content/swagger/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='Content/swagger/reset.css' media='print' rel='stylesheet' type='text/css'/>
<link href='Content/swagger/print.css' media='print' rel='stylesheet' type='text/css'/>
<script src='Content/swagger/jquery-1.8.0.min.js' type='text/javascript'></script>
<script src='Content/swagger/jquery.slideto.min.js' type='text/javascript'></script>
<script src='Content/swagger/jquery.wiggle.min.js' type='text/javascript'></script>
<script src='Content/swagger/jquery.ba-bbq.min.js' type='text/javascript'></script>
<script src='Content/swagger/handlebars-2.0.0.js' type='text/javascript'></script>
<script src='Content/swagger/underscore-min.js' type='text/javascript'></script>
<script src='Content/swagger/backbone-min.js' type='text/javascript'></script>
<script src='Content/swagger/swagger-ui.js' type='text/javascript'></script>
<script src='Content/swagger/highlight.7.3.pack.js' type='text/javascript'></script>
<script src='Content/swagger/jsoneditor.min.js' type='text/javascript'></script>
<script src='Content/swagger/marked.js' type='text/javascript'></script>
<script src='Content/swagger/swagger-oauth.js' type='text/javascript'></script>
<!-- Some basic translations -->
<!-- <script src='lang/translator.js' type='text/javascript'></script> -->
<!-- <script src='lang/ru.js' type='text/javascript'></script> -->
<!-- <script src='lang/en.js' type='text/javascript'></script> -->
<script type="text/javascript">
$(function () {
var url = window.location.search.match(/url=([^&]+)/);
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
} else {
url = "http://localhost:3579/api-docs";
}
// Pre load translate...
if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
window.swaggerUi = new SwaggerUi({
url: url,
dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
onComplete: function(swaggerApi, swaggerUi){
if(typeof initOAuth == "function") {
initOAuth({
clientId: "your-client-id",
clientSecret: "your-client-secret-if-required",
realm: "your-realms",
appName: "your-app-name",
scopeSeparator: ",",
additionalQueryStringParams: {}
});
}
if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
$('pre code').each(function(i, e) {
hljs.highlightBlock(e)
});
addApiKeyAuthorization();
},
onFailure: function(data) {
log("Unable to Load SwaggerUI");
},
docExpansion: "none",
jsonEditor: false,
apisSorter: "alpha",
defaultModelRendering: 'schema',
showRequestHeaders: false
});
function addApiKeyAuthorization(){
var key = encodeURIComponent($('#input_apiKey')[0].value);
if(key && key.trim() != "") {
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
log("added key " + key);
}
}
$('#input_apiKey').change(addApiKeyAuthorization);
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
/*
var apiKey = "myApiKeyXXXX123456789";
$('#input_apiKey').val(apiKey);
*/
window.swaggerUi.load();
function log() {
if ('console' in window) {
console.log.apply(console, arguments);
}
}
});
</script>
</head>
<body class="swagger-section">
<div id='header'>
<div class="swagger-ui-wrap">
<a id="logo" href="http://swagger.io">swagger</a>
<form id='api_selector'>
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
<div class='input'><a id="explore" href="#" data-sw-translate>Explore</a></div>
</form>
</div>
</div>
<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
</html>

View file

@ -0,0 +1,20 @@
<script>
var qp = null;
if(window.location.hash) {
qp = location.hash.substring(1);
}
else {
qp = location.search.substring(1);
}
qp = qp ? JSON.parse('{"' + qp.replace(/&/g, '","').replace(/=/g,'":"') + '"}',
function(key, value) {
return key===""?value:decodeURIComponent(value) }
):{}
if (window.opener.swaggerUi.tokenUrl)
window.opener.processOAuthCode(qp);
else
window.opener.onOAuthComplete(qp);
window.close();
</script>

View file

@ -0,0 +1,167 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.UI.Models.Admin.CustomizationViewModel>
@Html.Partial("Shared/Partial/_Sidebar")
@{
var plexTheme = string.Empty;
var originalTheme = string.Empty;
if (!string.IsNullOrEmpty(Model.Settings.ThemeName))
{
plexTheme = Model.Settings.ThemeName.Equals(Themes.PlexTheme) ? "selected=\"selected\"" : string.Empty;
originalTheme = Model.Settings.ThemeName.Equals(Themes.OriginalTheme) ? "selected=\"selected\"" : string.Empty;
}
else
{
plexTheme = "selected=\"selected\"";
}
}
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Customization Settings</legend>
<div class="form-group">
<label for="ApplicationName" class="control-label">Application Name @Html.ToolTip("Change the name of the application :( I quite like the name Ombi...")</label>
<div>
<input type="text" class="form-control form-control-custom " id="ApplicationName" name="ApplicationName" placeholder="Application Name" value="@Model.Settings.ApplicationName">
</div>
</div>
<div class="form-group">
<label for="select" class="control-label">Theme</label>
<div id="themes">
<select class="form-control form-control-custom" id="select">
<option @plexTheme class="form-control form-control-custom" value="@Themes.PlexTheme">Dark</option>
<option @originalTheme class="form-control form-control-custom" value="@Themes.OriginalTheme">Original Blue</option>
</select>
</div>
</div>
<div class="form-group">
<label for="lang" class="control-label">Default Language</label>
<div id="langSelect">
<select class="form-control form-control-custom" id="lang">
@foreach (var l in Model.LanguageDropdown)
{
var enumVal = (int)l.Value;
if (l.Selected)
{
<option selected="selected" class="form-control form-control-custom" value="@enumVal">@l.Name</option>
}
else
{
<option class="form-control form-control-custom" value="@enumVal">@l.Name</option>
}
}
</select>
</div>
</div>
<div class="form-group">
<label for="sort" class="control-label">Default Admin Sort Order</label>
<div id="sortSelect">
<select class="form-control form-control-custom" id="sort">
@foreach (var l in Model.SortOptions)
{
var enumVal = (int) l.Value;
if (l.Selected)
{
<option selected="selected" class="form-control form-control-custom" value="@enumVal">@l.Name</option>
}
else
{
<option class="form-control form-control-custom" value="@enumVal">@l.Name</option>
}
}
</select>
</div>
</div>
<div class="form-group">
<label for="filter" class="control-label">Default Admin Filter</label>
<div id="filterSelect">
<select class="form-control form-control-custom" id="filter">
@foreach (var l in Model.FilterOptions)
{
var enumVal = (int)l.Value;
if (l.Selected)
{
<option selected="selected" class="form-control form-control-custom" value="@enumVal">@l.Name</option>
}
else
{
<option class="form-control form-control-custom" value="@enumVal">@l.Name</option>
}
}
</select>
</div>
</div>
@*@Html.Checkbox(Model.Settings.NewSearch, "NewSearch", "Use New Search")*@
@Html.Checkbox(Model.Settings.EnableIssues, "EnableIssues", "Enable Issues")
@Html.Checkbox(Model.Settings.EnableNetflixResults, "EnableNetflixResults", "Enable Netflix results to be shown in the search")
<div class="form-group">
<div>
<button type="submit" id="save" class="btn btn-primary-outline">Submit</button>
</div>
</div>
</fieldset>
</form>
</div>
<script>
$(function () {
$('.customTooltip').tooltipster({
contentCloning: true
});
$('#save').click(function (e) {
e.preventDefault();
var theme = $("#themes option:selected").val();
var lang = $('#langSelect option:selected').val();
var sort = $('#sortSelect option:selected').val();
var filter = $('#filterSelect option:selected').val();
var $form = $("#mainForm");
var data = $form.serialize();
data = data +
"&themeName=" + theme +
"&DefaultLang=" + lang +
"&DefaultSort=" + sort +
"&DefaultFilter=" + filter;
$.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>

View file

@ -0,0 +1,97 @@
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<IEnumerable<Ombi.UI.Models.FaultedRequestsViewModel>>
@Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1">
<fieldset>
<legend>Request Fault Queue</legend>
<table class="table table-striped table-hover table-responsive table-condensed">
<thead>
<tr>
<th>
Request Title
</th>
<th>
Type
</th>
<th>
Fault Type
</th>
<th>
LastRetry
</th>
<th>
Error Description
</th>
<th>
Delete
</th>
</tr>
</thead>
<tbody>
@foreach (var m in Model)
{
<tr>
<td>
@m.Title
</td>
<td>
@m.Type
</td>
<td>
@m.FaultType
</td>
<td>
@m.LastRetry
</td>
<td>
@m.Message
</td>
<td class="delete" id="@m.Id"><i class="fa fa-times"></i></td>
</tr>
}
</tbody>
</table>
</fieldset>
</div>
<script>
$(function () {
$('.refresh').click(function (e) {
var id = e.currentTarget.id;
var ev = $(e.currentTarget.children[0]);
ev.addClass("fa-spin");
var url = createLocalUrl("/admin/deleteFault");
$.ajax({
type: 'POST',
data: { key: id },
url: url,
dataType: "json",
success: function (response) {
if (response.result === true) {
generateNotify("Success!", "success");
ev.removeClass("fa-spin");
ev.addClass("fa-check");
} else {
generateNotify(response.message, "warning");
ev.removeClass("fa-spin");
ev.addClass("fa-exclamation");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
ev.removeClass("fa-spin");
ev.addClass("fa-exclamation");
}
});
});
});
</script>

View file

@ -0,0 +1,336 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.RadarrSettings>
@Html.Partial("Shared/Partial/_Sidebar")
@{
int port;
if (Model.Port == 0)
{
port = 7878;
}
else
{
port = Model.Port;
}
var rootFolder = string.Empty;
if (!string.IsNullOrEmpty(Model.RootPath))
{
rootFolder = Model.RootPath.Replace("/", "//");
rootFolder = rootFolder.Replace(@"\", @"\\");
}
}
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Radarr Settings</legend>
<input hidden="hidden" name="FullRootPath" id="fullRootPath" value="@Model.FullRootPath" />
@Html.Checkbox(Model.Enabled, "Enabled", "Enabled")
<div class="form-group">
<label for="Ip" class="control-label">Radarr 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">Radarr API Key</label>
<div>
<input type="text" class="form-control form-control-custom " id="ApiKey" name="ApiKey" value="@Model.ApiKey">
</div>
</div>
@Html.Checkbox(Model.Ssl, "Ssl", "Ssl")
<div class="form-group">
<label for="SubDir" class="control-label">Radarr 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">
<div>
<button type="submit" id="getRootFolders" class="btn btn-primary-outline">Get Root Folders <div id="getRootFolderSpinner" /></button>
</div>
</div>
<div class="form-group">
<label for="selectRootFolder" class="control-label">Default Root Folders</label>
<div id="rootFolders">
<select class="form-control form-control-custom" id="selectRootFolder"></select>
</div>
</div>
<div class="form-group">
<div>
<button id="testRadarr" type="button" 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: "radarrprofiles",
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>
}
@if (!string.IsNullOrEmpty(Model.RootPath))
{
<text>
console.log('Hit root folders..');
var rootFolderSelected = '@rootFolder';
if (!rootFolderSelected) {
return;
}
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
data: $form.serialize(),
url: "sonarrrootfolders",
dataType: "json",
success: function(response) {
response.forEach(function(result) {
$('#selectedRootFolder').html("");
if (result.id == rootFolderSelected) {
$("#selectRootFolder").append("<option selected='selected' value='" + result.id + "'>" + result.path + "</option>");
} else {
$("#selectRootFolder").append("<option value='" + result.id + "'>" + result.path + "</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 rootFolder = $("#rootFolders option:selected").val();
var rootFolderPath = $('#rootFolders option:selected').text();
$('#fullRootPath').val(rootFolderPath);
var $form = $("#mainForm");
var data = $form.serialize();
data = data + "&qualityProfile=" + qualityProfile + "&rootPath=" + rootFolder;
$.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: "radarrprofiles",
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");
}
});
});
$('#getRootFolders').click(function (e) {
$('#getRootFolderSpinner').attr("class", "fa fa-spinner fa-spin");
e.preventDefault();
if (!$('#Ip').val()) {
generateNotify("Please enter a valid IP/Hostname.", "warning");
$('#getRootFolderSpinner').attr("class", "fa fa-times");
return;
}
if (!$('#portNumber').val()) {
generateNotify("Please enter a valid Port Number.", "warning");
$('#getRootFolderSpinner').attr("class", "fa fa-times");
return;
}
if (!$('#ApiKey').val()) {
generateNotify("Please enter a valid ApiKey.", "warning");
$('#getRootFolderSpinner').attr("class", "fa fa-times");
return;
}
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
data: $form.serialize(),
url: "radarrrootfolders",
dataType: "json",
success: function (response) {
response.forEach(function (result) {
$('#getRootFolderSpinner').attr("class", "fa fa-check");
$("#selectRootFolder").append("<option value='" + result.id + "'>" + result.path + "</option>");
});
},
error: function (e) {
console.log(e);
$('#getRootFolderSpinner').attr("class", "fa fa-times");
generateNotify("Something went wrong!", "danger");
}
});
});
var base = '@Html.GetBaseUrl()';
$('#testRadarr').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/radarr');
$.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>

View file

@ -0,0 +1,133 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.WatcherSettings>
@Html.Partial("Shared/Partial/_Sidebar")
@{
int port;
if (Model.Port == 0)
{
port = 9090;
}
else
{
port = Model.Port;
}
}
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Watcher Settings</legend>
<small>Please note, this is still in beta and may stop working at anytime as Watcher is still very much in development and is constantly changing.</small>
@Html.Checkbox(Model.Enabled, "Enabled", "Enabled")
<div class="form-group">
<label for="Ip" class="control-label">Watcher 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">Watcher API Key</label>
<div>
<input type="text" class="form-control form-control-custom " id="ApiKey" name="ApiKey" value="@Model.ApiKey">
</div>
</div>
@Html.Checkbox(Model.Ssl, "Ssl", "SSL")
<div class="form-group">
<label for="SubDir" class="control-label">Watcher Base Url</label>
<div>
<input type="text" class="form-control form-control-custom " id="SubDir" name="SubDir" value="@Model.SubDir">
</div>
</div>
<br />
<div class="form-group">
<div>
<button id="testWatcher" 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()';
$('#testWatcher').click(function (e) {
e.preventDefault();
var $form = $("#mainForm");
var url = createBaseUrl(baseUrl, "/test/watcher");
$('#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");
} 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 $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>

View file

@ -0,0 +1,103 @@
@using System.Linq
@using Ombi.Core.Models
@using Ombi.Helpers
@using Ombi.Helpers.Permissions
@using Ombi.UI.Helpers
@{
var baseUrl = Html.GetBaseUrl();
var formAction = string.Empty;
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
formAction = "/" + baseUrl.ToHtmlString();
}
var isAdmin = Html.HasAnyPermission(true, Permissions.Administrator, Permissions.ManageRequests);
}
<h1>Details</h1>
<div class="row">
<div class="col-md-3">
<img src="@Model.PosterUrl" />
</div>
<div class="col-md-9">
<h4>Issues For "@Model.Title"</h4>
</div>
@if (isAdmin)
{
<div class="col-md-1">
@if (Model.IssueStatus == IssueStatus.PendingIssue)
{
<form action="@formAction/issues/resolvedUpdate" method="post">
<input id="issueId" name="issueId" value="@Model.Id" hidden="hidden" />
<button type="submit" id="@Model.Id" class="btn btn-sm btn-success-outline dropdown-toggle resolve">Resolve</button>
</form>
}
@if (Model.IssueStatus == IssueStatus.ResolvedIssue)
{
<form action="@formAction/issues/remove" method="post" id="removeForm">
<input id="issueId" name="issueId" value="@Model.Id" hidden="hidden" />
<button type="submit" id="@Model.Id" class="btn btn-sm btn-danger-outline dropdown-toggle delete">Remove</button>
</form>
}
</div>
}
<br />
</div>
<hr />
@foreach (var issue in Model.Issues)
{
<div class="row">
<div class="col-sm-11">
<div><strong>Type:</strong> @StringHelper.ToCamelCaseWords(issue.Issue.ToString())</div>
<div><strong>User Reported:</strong> @issue.UserReported</div>
<div><strong>User Note:</strong> @issue.UserNote</div>
<div><strong>Admin Note:</strong> @issue.AdminNote</div>
</div>
@if (isAdmin)
{
<div class="col-sm-1">
<form action="@formAction/issues/clear" method="post">
<input name="issueId" value="@Model.Id" hidden="hidden" />
<input name="issue" value="@((int) issue.Issue)" hidden="hidden" />
<button type="submit" id="@Model.Id" class="btn btn-sm btn-info-outline dropdown-toggle">Clear</button>
</form>
</div>
<div class="col-sm-1">
<button id="@Model.Id" issue-select="4" class="note btn btn-sm btn-primary-outline dropdown-toggle" data-identifier="@Model.Id" data-issue="@((int) issue.Issue)" href="#" data-toggle="modal" data-target="#noteModal">Add Note</button>
</div>
}
</div>
<br />
<hr />
}
<div class="modal fade" id="noteModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
<h4 class="modal-title">Add a note</h4>
</div>
<form method="POST" action="@formAction/issues/addnote" id="noteForm">
<div class="modal-body">
<input name="requestId" class="noteId" type="text" hidden="hidden" value="" />
<input name="issue" class="issue" type="text" hidden="hidden" value="" />
<textarea class="form-control form-control-custom" rows="3" id="noteArea" name="noteArea"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger-outline" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary-outline theNoteSaveButton" data-dismiss="modal">Save changes</button>
</div>
</form>
</div>
</div>
</div>
@Html.LoadIssueDetailsAssets()

View file

@ -0,0 +1,98 @@
@using Ombi.UI.Helpers
@{
var baseUrl = Html.GetBaseUrl();
var formAction = string.Empty;
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
formAction = "/" + baseUrl.ToHtmlString();
}
}
<h1>Issues</h1>
<h4>Below you can see yours and all your current issues and their state.</h4>
<br />
<br />
<ul id="nav-tabs" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#pendingTab" aria-controls="home" role="tab" data-toggle="tab">Pending <span id="pendingCount"></span></a></li>
<li role="presentation"><a href="#resolvedTab" aria-controls="profile" role="tab" data-toggle="tab">Resolved <span id="resolvedCount"></span></a></li>
</ul>
<br/>
<div class="row">
<div class="col-md-3">
<h4>Title</h4>
</div>
<div class="col-md-2">
<h4>Type</h4>
</div>
<div class="col-md-4">
<h4>Issues</h4>
</div>
<div class="col-md-2">
<h4>Requested</h4>
</div>
<div class="col-sm-1">
</div>
</div>
<hr />
<div id="myTabContent" class="tab-content">
<!-- Pending tab -->
<div role="tabpanel" class="tab-pane active" id="pendingTab">
<br />
<br />
<!-- Movie content -->
<div id="pendingIssues">
</div>
</div>
<!-- Resolved -->
<div role="tabpanel" class="tab-pane" id="resolvedTab">
<br />
<br />
<!-- resolved content -->
<div id="resolvedIssues">
</div>
</div>
</div>
<script id="issue-template" type="text/x-handlebars-template">
<div id="{{id}}Template">
<div class="row">
<div class="col-md-3">
<div id="title">{{title}}</div>
</div>
<div class="col-md-2">
<div id="type">{{type}}</div>
</div>
<div class="col-md-4">
<small>{{issues}}</small>
</div>
<div class="col-md-2">
{{#if requestId}}
<div><i class="fa fa-check"></i></div>
{{else}}
<div><i class="fa fa-times"></i></div>
{{/if}}
</div>
<div class="col-sm-1">
<a href="" id="{{id}}link" class="btn btn-sm btn-info-outline approve"><i class="fa fa-info"></i> Details</a>
<br />
{{#if admin}}
<form action="@formAction/issues/remove" method="post" id="delete{{id}}">
<input id="issueId" name="issueId" value="{{id}}" hidden="hidden" />
<button type="submit" id="{{id}}" class="btn btn-sm btn-danger-outline dropdown-toggle delete">Remove</button>
</form>
{{/if}}
</div>
</div>
</div>
<hr />
</script>
@Html.LoadIssueAssets()

View file

@ -0,0 +1,84 @@
@using Ombi.UI.Helpers
@inherits Ombi.UI.Helpers.EmptyViewBase<Ombi.UI.Models.LandingPageViewModel>
@{
var baseUrl = Html.GetBaseUrl();
var formAction = string.Empty;
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
formAction = "/" + baseUrl.ToHtmlString();
}
}
<img class="landing-header" src="@formAction/Content/images/logo.png" width="300" />
<div id="area" class="landing-block">
@if (Model.NoticeEnable && (!Model.EnabledNoticeTime || Model.NoticeActive))
{
<div class="media">
<div class="media-left media-middle">
<i class="fa fa-bell"></i>
</div>
<div class="media-body">
<h4 class="media-heading landing-title">Notice</h4>
@Html.Raw(Model.NoticeMessage)<br />
@if (Model.EnabledNoticeTime)
{
<strong><span id="startDate"></span> <span id="endDate"></span></strong>
}
</div>
</div>
}
<div class="media">
<div class="media-left media-middle">
<i id="statusIcon" class="fa fa-spinner fa-spin fa-fw"></i>
</div>
<div class="media-body">
<h4 class="media-heading landing-title" id="statusTitle">Checking...</h4>
The Media server is <strong><span id="statusText">Loading...</span></strong> (check this page for continuous status updates)
</div>
</div>
</div>
<div style="text-align: center; margin-top: 20px">
<a href="@Model.ContinueUrl?landing=false" class="btn btn-primary-outline">Continue</a>
</div>
<script>
$(function () {
@if (Model.NoticeEnable && (!Model.EnabledNoticeTime || Model.NoticeActive))
{
<text>
var start = moment("@Model.NoticeStart.ToString("O")");
var end = moment("@Model.NoticeEnd.ToString("O")");
var text = "for " + start.to(end, true);
$('#startDate').html(start.toString());
$('#endDate').html(text);
</text>
}
var base = "@Html.GetBaseUrl()";
var url = createBaseUrl(base, "landing/status");
$.ajax({
type: "GET",
url: url,
dataType: "json",
success: function (response) {
$('#statusIcon').removeClass("fa-spinner fa-spin fa-fw");
if (response === true) {
//fa fa-check-circle fa-5x
$('#statusIcon').addClass("fa-check-circle");
$('#statusText').text("currently online");
$('#statusTitle').text("Currently Online");
} else {
$('#statusIcon').addClass("fa-times-circle");
$('#statusText').text("currently offline");
$('#statusTitle').text("Currently Offline");
}
},
error: function (e) {
console.log(e);
$('#statusIcon').addClass("fa-times-circle");
}
});
});
</script>

View file

@ -0,0 +1,37 @@
<form method="POST" id="mainForm">
<br />
Old Password <input class="form-control form-control-custom" name="OldPassword" type="password" /><br />
New Password <input class="form-control form-control-custom" name="NewPassword" type="password" /><br />
New Password again <input class="form-control form-control-custom" name="NewPasswordAgain" type="password" />
<br />
<br />
<input class="btn btn-success-outline" id="save" type="submit" value="Change Password" />
</form>
<script>
$(function () {
$('#save').click(function (e) {
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");
} else {
generateNotify(response.message, "warning");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
});
</script>

View file

@ -0,0 +1,39 @@
@using Ombi.UI.Helpers
@{
var baseUrl = Html.GetBaseUrl().ToHtmlString();
var url = string.Empty;
if (!string.IsNullOrEmpty(baseUrl))
{
url = "/" + baseUrl;
}
}
<form method="POST">
Username <input class="form-control form-control-custom" type="text" name="Username" />
<br />
Password <input class="form-control form-control-custom" name="Password" type="password" />
<div class="checkbox">
<input name="RememberMe" id="RememberMe" type="checkbox" checked="checked" />
<label for="RememberMe">Remember Me</label>
</div>
<input class="btn btn-success-outline" type="submit" value="Login" />
<input type="hidden" id="DateTimeOffset" name="DateTimeOffset" />
<input type="hidden" id="redirect" name="redirect" value="@Model.Redirect" />
</form>
@if (!Model.AdminExists)
{
<div>If you have not yet created an Admin account you can do here: <a href="@url/register">Register</a></div>
}
@if (Model.Errored)
{
<div class="alert alert-dismissible alert-danger">
<button type="button" class="close" data-dismiss="alert"><i class="fa fa-times"></i></button>
Invalid Username or Password!
</div>
}
<script>
$(function () {
var dtOffset = new Date().getTimezoneOffset();
$('#DateTimeOffset').val(dtOffset);
});
</script>

View file

@ -0,0 +1,15 @@
<form method="POST">
Username <input class="form-control form-control-custom" type="text" name="Username" />
<br />
Password <input class="form-control form-control-custom" name="Password" type="password" />
<br />
<br />
<input class="btn btn-success-outline" type="submit" value="Create User" />
</form>
@if (Model.Errored)
{
<div class="alert alert-dismissible alert-danger">
<button type="button" class="close" data-dismiss="alert"><i class="fa fa-times"></i></button>
An admin account already exists!
</div>
}

View file

@ -0,0 +1,520 @@
@using Nancy.Security
@using Nancy.Security
@using Ombi.Helpers
@using Ombi.Helpers.Permissions
@using Ombi.UI.Helpers
@using Ombi.UI.Models.Admin
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.UI.Models.Requests.RequestsIndexViewModel>
@{
var baseUrl = Html.GetBaseUrl();
var formAction = string.Empty;
var isAdmin = Html.HasAnyPermission(true, Permissions.Administrator, Permissions.ManageRequests);
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
formAction = "/" + baseUrl.ToHtmlString();
}
var sortText = EnumHelper<SortOptions>.GetDisplayDescription((SortOptions) Model.CustomizationSettings.DefaultSort);
var filterText = EnumHelper<FilterOptions>.GetDisplayDescription((FilterOptions) Model.CustomizationSettings.DefaultFilter);
var defaultFilter = EnumHelper<FilterOptions>.GetDisplayValue((FilterOptions) Model.CustomizationSettings.DefaultFilter);
var defaultSort = EnumHelper<SortOptions>.GetDisplayValue((SortOptions) Model.CustomizationSettings.DefaultSort);
}
<div>
<div hidden="hidden" id="isAdmin">@isAdmin</div>
<div hidden="hidden" id="adminFilter">@defaultFilter</div>
<div hidden="hidden" id="adminFilterText">@filterText</div>
<div hidden="hidden" id="adminSort">@defaultSort</div>
<div hidden="hidden" id="adminSortText">@sortText</div>
<div hidden="hidden" id="defaultSortText">@UI.Requests_Order_LatestRequests</div>
<div hidden="hidden" id="defaultFilterText">@UI.Requests_Filter_All</div>
<h1>@UI.Requests_Title</h1>
<h4>@UI.Requests_Paragraph</h4>
<br />
<!-- Nav tabs -->
<ul id="nav-tabs" class="nav nav-tabs" role="tablist">
@if (Model.PlexRequestSettings.SearchForMovies)
{
<li role="presentation" class="active"><a href="#MoviesTab" aria-controls="home" role="tab" data-toggle="tab"><i class="fa fa-film"></i> @UI.Requests_MoviesTabTitle</a></li>
}
@if (Model.PlexRequestSettings.SearchForTvShows)
{
<li role="presentation"><a href="#TvShowTab" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-television"></i>@UI.Requests_TvShowTabTitle</a></li>
}
@if (Model.PlexRequestSettings.SearchForMusic)
{
<li role="presentation"><a href="#MusicTab" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-music"></i> @UI.Requests_AlbumsTabTitle</a></li>
}
</ul>
<br />
<!-- Tab panes -->
<div class="tab-content contentList">
<div class="row">
<div class="col-sm-12">
<div class="pull-right">
<div class="btn-group btn-group-separated">
@if (isAdmin)
{
@if (Model.PlexRequestSettings.SearchForMovies)
{
<button id="deleteMovies" class="btn btn-warning-outline delete-category" type="submit"><i class="fa fa-trash"></i> @UI.Requests_DeleteMovies</button>
<button id="approveMovies" class="btn btn-success-outline approve-category" type="submit"><i class="fa fa-plus"></i> @UI.Requests_ApproveMovies</button>
}
@if (Model.PlexRequestSettings.SearchForTvShows)
{
<button id="deleteTVShows" class="btn btn-warning-outline delete-category" type="submit" style="display: none;"><i class="fa fa-trash"></i> @UI.Requests_DeleteTVShows</button>
<button id="approveTVShows" class="btn btn-success-outline approve-category" type="submit" style="display: none;"><i class="fa fa-plus"></i> @UI.Requests_ApproveTvShows</button>
}
@if (Model.PlexRequestSettings.SearchForMusic)
{
<button id="deleteMusic" class="btn btn-warning-outline delete-category" type="submit" style="display: none;"><i class="fa fa-trash"></i> @UI.Requests_DeleteMusic</button>
<button id="approveMusic" class="btn btn-success-outline approve-category" type="submit" style="display: none;"><i class="fa fa-plus"></i> @UI.Requests_ApproveMusic</button>
}
}
</div>
<div class="btn-group">
<a href="#" class="btn btn-primary-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span id="filterText">@UI.Requests_Filter_All</span>
<i class="fa fa-filter"></i>
</a>
<ul class="dropdown-menu">
<li><a href="#" class="filter" data-filter="all"><i class="fa fa-check-square"></i> @UI.Requests_Filter_All</a></li>
<li><a href="#" class="filter" data-filter=".approved-true"><i class="fa fa-square-o"></i> @UI.Requests_Filter_Approved</a></li>
<li><a href="#" class="filter" data-filter=".approved-false"><i class="fa fa-square-o"></i> @UI.Requests_Filter_NotApproved</a></li>
<li><a href="#" class="filter" data-filter=".available-true"><i class="fa fa-square-o"></i> @UI.Requests_Filter_Available</a></li>
<li><a href="#" class="filter" data-filter=".available-false"><i class="fa fa-square-o"></i> @UI.Requests_Filter_NotAvailable</a></li>
<li><a href="#" class="filter" data-filter=".released-true"><i class="fa fa-square-o"></i> @UI.Requests_Filter_Released</a></li>
<li><a href="#" class="filter" data-filter=".released-false"><i class="fa fa-square-o"></i> @UI.Requests_Filter_NotReleased</a></li>
</ul>
</div>
<div class="btn-group">
<a href="#" class="btn btn-primary-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span id="sortText">@UI.Requests_Order</span>
<i class="fa fa-sort"></i>
</a>
<ul class="dropdown-menu">
<li><a href="#" class="sort" data-sort="requestorder:desc"><i class="fa fa-check-square"></i> @UI.Requests_Order_LatestRequests</a></li>
<li><a href="#" class="sort" data-sort="requestorder:asc"><i class="fa fa-square-o"></i> @UI.Requests_Order_OldestRequests</a></li>
<li><a href="#" class="sort" data-sort="releaseorder:desc"><i class="fa fa-square-o"></i> @UI.Requests_Order_LatestReleases</a></li>
<li><a href="#" class="sort" data-sort="releaseorder:asc"><i class="fa fa-square-o"></i> @UI.Requests_Order_OldestReleases</a></li>
</ul>
</div>
</div>
</div>
</div>
@if (Model.PlexRequestSettings.SearchForMovies)
{
<!-- Movie tab -->
<div role="tabpanel" class="tab-pane active" id="MoviesTab">
<br />
<br />
<!-- Movie content -->
<div id="movieList">
</div>
</div>
}
@if (Model.PlexRequestSettings.SearchForTvShows)
{
<!-- TV tab -->
<div role="tabpanel" class="tab-pane" id="TvShowTab">
<br />
<br />
<!-- TV content -->
<div id="tvList">
</div>
</div>
}
@if (Model.PlexRequestSettings.SearchForMusic)
{
<!-- Music tab -->
<div role="tabpanel" class="tab-pane" id="MusicTab">
<br />
<br />
<!-- TV content -->
<div id="musicList">
</div>
</div>
}
</div>
</div>
<script id="search-template" type="text/x-handlebars-template">
<div hidden="hidden">
@*http://iamceege.github.io/tooltipster/#methods*@
{{#if episodes}}
<div id="{{requestId}}toolTipContent">
{{#each episodes}}
Season: {{this.seasonNumber}}
<br />
Episodes Requested:
{{#each this.episodes}}
{{this}}
{{/each}}
<hr />
{{/each}}
</div>
{{/if}}
</div>
<div id="{{requestId}}Template" class="mix available-{{available}} approved-{{approved}} released-{{released}}" data-requestorder="{{requestedDateTicks}}" data-releaseorder="{{releaseDateTicks}}">
<div class="row">
<div class="col-sm-2">
{{#if_eq type "movie"}}
{{#if posterPath}}
<img class="img-responsive" src="https://image.tmdb.org/t/p/w150/{{posterPath}}" alt="poster">
{{/if}}
{{/if_eq}}
{{#if_eq type "tv"}}
{{#if posterPath}}
<img class="img-responsive" width="150" src="{{posterPath}}" alt="poster">
{{/if}}
{{/if_eq}}
</div>
<div class="col-sm-5 ">
<div>
<a href="http://www.imdb.com/title/{{imdb}}/" target="_blank">
<h4 class="request-title">{{title}} ({{year}})</h4>
</a>
</div>
<br />
<div>
{{#if_eq type "tv"}}
<span>@UI.Search_TV_Show_Status: </span>
{{else}}
<span>@UI.Search_Movie_Status: </span>
{{/if_eq}}
<span class="label label-success">{{status}}</span>
</div>
<div>
<span>Request status: </span>
{{#if available}}
<span class="label label-success">@UI.Requests_Available</span>
{{else}}
{{#if approved}}
<span class="label label-info">@UI.Search_Processing_Request</span>
{{else if denied}}
<span class="label label-danger">@UI.Search_Request_denied</span>
{{#if deniedReason}}
<span class="customTooltip" title="{{deniedReason}}"><i class="fa fa-info-circle"></i></span>
{{/if}}
{{else}}
<span class="label label-warning">@UI.Search_Pending_approval</span>
{{/if}}
{{/if}}
</div>
{{#if denied}}
<div>
Denied: <i style="color:red;" class="fa fa-check"></i>
</div>
{{/if}}
{{#if_eq releaseDate "01/01/0001 00:00:00"}} <!--TheTVDB didn't provide any premier info-->
<div>@UI.Requests_ReleaseDate: {{releaseDate}}</div>
{{else}}
<div>@UI.Requests_ReleaseDate: {{releaseDate}}</div>
{{/if_eq}}
<br/>
{{#if_eq type "tv"}}
{{#if episodes}}
Episodes: <span class="customTooltip" data-tooltip-content="#{{requestId}}toolTipContent"><i class="fa fa-info-circle"></i></span>
{{else}}
<div>@UI.Requests_SeasonsRequested: {{seriesRequested}}</div>
{{/if}}
{{/if_eq}}
{{#if requestedUsers}}
<div>@UI.Requests_RequestedBy: {{requestedUsers}}</div>
{{/if}}
<div>@UI.Requests_RequestedDate: {{requestedDate}}</div>
{{#if admin}}
{{#if currentRootPath}}
<div class="{{requestId}}rootPathMain">Root Path: <span id="{{requestId}}currentRootPath">{{currentRootPath}}</span></div>
{{/if}}
{{/if}}
<div>
{{#if_eq issueId 0}}
@*Nothing*@
{{else}}
@UI.Issues_Issue: <a href="@formAction/issues/{{issueId}}"><i class="fa fa-check"></i></a>
{{/if_eq}}
</div>
</div>
<div class="col-sm-3 col-sm-push-3">
{{#if_eq admin true}}
{{#if_eq approved false}}
<form method="POST" action="@formAction/approval/approve" id="approve{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
{{#if_eq hasQualities true}}
<div class="btn-group btn-split">
<button type="button" class="btn btn-sm btn-success-outline approve" id="{{requestId}}" custom-button="{{requestId}}"><i class="fa fa-plus"></i> @UI.Common_Approve</button>
<button type="button" class="btn btn-success-outline dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">@UI.Requests_ToggleDropdown</span>
</button>
<ul class="dropdown-menu">
{{#each qualities}}
<li><a href="#" class="approve-with-quality" id="{{id}}">{{name}}</a></li>
{{/each}}
</ul>
</div>
{{else}}
<button id="{{requestId}}" custom-button="{{requestId}}" style="text-align: right" class="btn btn-sm btn-success-outline approve" type="submit"><i class="fa fa-plus"></i> @UI.Common_Approve</button>
{{/if_eq}}
</form>
<form method="POST" action="@formAction/requests/changeRootFolder{{#if_eq type "tv"}}tv{{else}}movie{{/if_eq}}" id="changeFolder{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
{{#if_eq hasRootFolders true}}
<div class="btn-group btn-split">
<button type="button" class="btn btn-sm btn-success-outline" id="changeRootFolderBtn{{requestId}}" custom-button="{{requestId}}">@*<i class="fa fa-plus"></i>*@ Change Root Folder</button>
<button type="button" class="btn btn-success-outline dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">@UI.Requests_ToggleDropdown</span>
</button>
<ul class="dropdown-menu">
{{#each rootFolders}}
<li><a href="#" class="change-root-folder" id="{{id}}" requestId="{{requestId}}">{{path}}</a></li>
{{/each}}
</ul>
</div>
{{/if_eq}}
</form>
{{#unless denied}}
<form method="POST" action="@formAction/approval/deny" id="deny{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
<input name="reason" type="text" hidden="hidden" />
<div class="btn-group btn-split">
<button type="button" class="btn btn-sm btn-danger-outline deny" id="{{requestId}}deny" custom-button="{{requestId}}"><i class="fa fa-times"></i> Deny</button>
<button type="button" class="btn btn-danger-outline dropdown-toggle" id="{{requestId}}denyToggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">@UI.Requests_ToggleDropdown</span>
</button>
<ul class="dropdown-menu">
<li><a class="deny-with-reason" id="denyReason{{requestId}}" href="#" data-toggle="modal" data-identifier="{{requestId}}" data-target="#denyReasonModal">Deny with a reason</a></li>
</ul>
</div>
</form>
{{/unless}}
{{/if_eq}}
<form method="POST" action="@formAction/requests/delete" id="delete{{requestId}}">
<input name="Id" type="text" value="{{requestId}}" hidden="hidden" />
<button id="{{requestId}}" style="text-align: right" class="btn btn-sm btn-danger-outline delete" type="submit"><i class="fa fa-minus"></i> @UI.Common_Remove</button>
</form>
<form method="POST" action="@formAction/requests/changeavailability" id="change{{requestId}}">
<input name="Id" type="text" value="{{requestId}}" hidden="hidden" />
{{#if_eq available true}}
<button id="{{requestId}}" custom-availibility="{{requestId}}" style="text-align: right" value="false" class="btn btn-sm btn-info-outline change" type="submit"><i class="fa fa-minus"></i> @UI.Requests_MarkUnavailable</button>
{{else}}
<button id="{{requestId}}" custom-availibility="{{requestId}}" style="text-align: right" value="true" class="btn btn-sm btn-success-outline change" type="submit"><i class="fa fa-plus"></i> @UI.Requests_MarkAvailable</button>
{{/if_eq}}
</form>
{{/if_eq}}
<form method="POST" action="@formAction/issues/issue/" id="report{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
<div class="dropdown">
<button id="{{requestId}}" class="btn btn-sm btn-primary-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-plus"></i> @UI.Search_ReportIssue
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a id="{{requestId}}" issue-select="0" class="dropdownIssue" href="#">@UI.Issues_WrongAudio</a></li>
<li><a id="{{requestId}}" issue-select="1" class="dropdownIssue" href="#">@UI.Issues_NoSubs</a></li>
<li><a id="{{requestId}}" issue-select="2" class="dropdownIssue" href="#">@UI.Issues_WrongContent</a></li>
<li><a id="{{requestId}}" issue-select="3" class="dropdownIssue" href="#">@UI.Issues_Playback</a></li>
<li><a id="{{requestId}}" issue-select="4" class="dropdownIssue" data-identifier="{{requestId}}" href="#" data-toggle="modal" data-target="#myModal">@UI.Issues_Other</a></li>
</ul>
</div>
</form>
</div>
</div>
<hr />
</div>
</script>
<script id="album-template" type="text/x-handlebars-template">
<div id="{{requestId}}Template" class="mix available-{{available}} approved-{{approved}}" data-requestorder="{{requestedDateTicks}}" data-releaseorder="{{releaseDateTicks}}">
<div class="row">
<div class="col-sm-2">
{{#if posterPath}}
<img class="img-responsive" src="{{posterPath}}" width="150" alt="poster">
{{/if}}
</div>
<div class="col-sm-5 ">
<div>
<a href="https://musicbrainz.org/release/{{musicBrainzId}}" target="_blank">
<h4>
{{artist}} - {{title}}
{{#if year}}
({{year}})
{{/if}}
</h4>
</a>
<span class="label label-success">{{status}}</span>
</div>
<br />
<div>@UI.Requests_ReleaseDate {{releaseDate}}</div>
<div>
@UI.Common_Approved:
{{#if_eq approved false}}
<i id="{{requestId}}notapproved" class="fa fa-times"></i>
{{/if_eq}}
{{#if_eq approved true}}
<i class="fa fa-check"></i>
{{/if_eq}}
</div>
<div>
@UI.Requests_Available
{{#if_eq available false}}
<i id="availableIcon{{requestId}}" class="fa fa-times"></i>
{{/if_eq}}
{{#if_eq available true}}
<i id="availableIcon{{requestId}}" class="fa fa-check"></i>
{{/if_eq}}
</div>
{{#if requestedUsers}}
<div>@UI.Requests_RequestedBy: {{requestedUsers}}</div>
{{/if}}
<div>@UI.Requests_RequestedDate: {{requestedDate}}</div>
{{#if denied}}
<div>Denied: <i class="fa fa-times"></i></div>
{{#if deniedReason}}
<div>Reason: {{deniedReason}}</div>
{{/if}}
{{/if}}
</div>
<div class="col-sm-2 col-sm-push-3">
{{#if_eq admin true}}
{{#if_eq approved false}}
<form method="POST" action="@formAction/approval/approve" id="approve{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
<button id="{{requestId}}" custom-button="{{requestId}}" style="text-align: right" class="btn btn-sm btn-success-outline approve" type="submit"><i class="fa fa-plus"></i> @UI.Common_Approve</button>
</form>
<form method="POST" action="@formAction/approval/deny" id="deny{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
<input name="reason" type="text" hidden="hidden" />
<div class="btn-group btn-split">
<button type="button" class="btn btn-sm btn-danger-outline deny" id="{{requestId}}deny" custom-button="{{requestId}}"><i class="fa fa-times"></i> Deny</button>
<button type="button" class="btn btn-danger-outline dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">@UI.Requests_ToggleDropdown</span>
</button>
<ul class="dropdown-menu">
<li><a class="deny-with-reason" id="denyReason{{requestId}}" href="#" data-toggle="modal" data-identifier="{{requestId}}" data-target="#denyReasonModal">Deny with a reason</a></li>
</ul>
</div>
</form>
{{/if_eq}}
<form method="POST" action="@formAction/requests/delete" id="delete{{requestId}}">
<input name="Id" type="text" value="{{requestId}}" hidden="hidden" />
<button id="{{requestId}}" style="text-align: right" class="btn btn-sm btn-danger-outline delete" type="submit"><i class="fa fa-minus"></i> @UI.Common_Remove</button>
</form>
<form method="POST" action="@formAction/requests/changeavailability" id="change{{requestId}}">
<input name="Id" type="text" value="{{requestId}}" hidden="hidden" />
{{#if_eq available true}}
<button id="{{requestId}}" custom-availibility="{{requestId}}" style="text-align: right" value="false" class="btn btn-sm btn-info-outline change" type="submit"><i class="fa fa-minus"></i> @UI.Requests_MarkUnavailable</button>
{{else}}
<button id="{{requestId}}" custom-availibility="{{requestId}}" style="text-align: right" value="true" class="btn btn-sm btn-success-outline change" type="submit"><i class="fa fa-plus"></i> @UI.Requests_MarkAvailable</button>
{{/if_eq}}
</form>
{{/if_eq}}
<form method="POST" action="@formAction/issues/issue/" id="report{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
<div class="dropdown">
<button id="{{requestId}}" class="btn btn-sm btn-primary-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-plus"></i> @UI.Search_ReportIssue
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a id="{{requestId}}" issue-select="0" class="dropdownIssue" href="#">@UI.Issues_WrongAudio</a></li>
<li><a id="{{requestId}}" issue-select="1" class="dropdownIssue" href="#">@UI.Issues_NoSubs</a></li>
<li><a id="{{requestId}}" issue-select="2" class="dropdownIssue" href="#">@UI.Issues_WrongContent</a></li>
<li><a id="{{requestId}}" issue-select="3" class="dropdownIssue" href="#">@UI.Issues_Playback</a></li>
<li><a id="{{requestId}}" issue-select="4" class="dropdownIssue" data-identifier="{{requestId}}" href="#" data-toggle="modal" data-target="#myModal">@UI.Issues_Other</a></li>
</ul>
</div>
</form>
</div>
</div>
<hr />
</div>
</script>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
<h4 class="modal-title">@UI.Issues_Modal_Title</h4>
</div>
<form method="POST" action="@formAction/issues/issuecomment" id="commentForm">
<div class="modal-body">
<input name="providerId" class="providerId" type="text" hidden="hidden" value="" />
<textarea class="form-control form-control-custom" rows="3" id="commentArea" name="commentArea"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger-outline" data-dismiss="modal">@UI.Common_Close</button>
<button type="button" class="btn btn-primary-outline theSaveButton" data-dismiss="modal">@UI.Common_Save</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="denyReasonModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
<h4 class="modal-title">Deny with a reason</h4>
</div>
<form method="POST" action="@formAction/approval/deny" id="denyReasonForm">
<div class="modal-body">
<input name="requestId" class="requestId" type="text" hidden="hidden" value="" />
<textarea class="form-control form-control-custom" rows="3" id="denyReason" name="denyReason"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger-outline" data-dismiss="modal">@UI.Common_Close</button>
<button type="button" class="btn btn-primary-outline denySaveReason" data-dismiss="modal">@UI.Common_Save</button>
</div>
</form>
</div>
</div>
</div>
@Html.LoadRequestAssets()

View file

@ -0,0 +1,614 @@
@using Ombi.UI.Helpers
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.UI.Models.SearchLoadViewModel>
@{
var baseUrl = Html.GetBaseUrl();
var url = string.Empty;
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
url = "/" + baseUrl.ToHtmlString();
}
}
<div>
<div hidden="hidden" id="useNewSearch">@Model.CustomizationSettings.NewSearch</div>
<div hidden="hidden" id="enableNetflix">@Model.CustomizationSettings.EnableNetflixResults</div>
<h1 id="searchTitle">@UI.Search_Title</h1>
<h4>@string.Format(UI.Search_Paragraph, Model.Emby ? "Emby" : "Plex")</h4>
<br />
<!-- Nav tabs -->
<ul id="nav-tabs" class="nav nav-tabs" role="tablist">
@if (Model.Settings.SearchForMovies)
{
<li role="presentation" class="active">
<a id="movieTabButton" href="#MoviesTab" aria-controls="home" role="tab" data-toggle="tab"><i class="fa fa-film"></i> @UI.Search_Movies</a>
</li>
@if (Model.Settings.SearchForActors)
{
<li role="presentation">
<a id="actorTabButton" href="#ActorsTab" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-users"></i> @UI.Search_Actors</a>
</li>
}
}
@if (Model.Settings.SearchForTvShows)
{
<li role="presentation">
<a id="tvTabButton" href="#TvShowTab" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-television"></i> @UI.Search_TvShows</a>
</li>
}
@if (Model.Settings.SearchForMusic)
{
<li role="presentation">
<a href="#MusicTab" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-music"></i>@UI.Search_Albums</a>
</li>
}
</ul>
<!-- Tab panes -->
<div class="tab-content">
@if (Model.Settings.SearchForMovies)
{
<!-- Movie tab -->
<div role="tabpanel" class="tab-pane active" id="MoviesTab">
<div class="input-group">
<input id="movieSearchContent" type="text" class="form-control form-control-custom form-control-search form-control-withbuttons">
<div class="input-group-addon">
<div class="btn-group">
<a href="#" class="btn btn-sm btn-primary-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
@UI.Search_Suggestions
<i class="fa fa-chevron-down"></i>
</a>
<ul class="dropdown-menu">
<li><a id="moviesComingSoon" href="#">@UI.Search_ComingSoon</a></li>
<li><a id="moviesInTheaters" href="#">@UI.Search_InTheaters</a></li>
</ul>
</div>
<i id="movieSearchButton" class="fa fa-search"></i>
</div>
</div>
<br />
<br />
<!-- Movie content -->
<div id="movieList">
</div>
</div>
@if (Model.Settings.SearchForActors)
{
<!-- Actors tab -->
<div role="tabpanel" class="tab-pane" id="ActorsTab">
<div class="input-group">
<input id="actorSearchContent" type="text" class="form-control form-control-custom form-control-search form-control-withbuttons">
<div class="input-group-addon">
<i id="actorSearchButton" class="fa fa-search"></i>
</div>
</div>
<div class="checkbox">
<input type="checkbox" id="actorsSearchNew" name="actorsSearchNew"><label for="actorsSearchNew">@UI.Search_NewOnly</label>
</div>
<br />
<br />
<!-- Movie content -->
<div id="actorMovieList">
</div>
</div>
}
}
@if (Model.Settings.SearchForTvShows)
{
<!-- TV tab -->
<div role="tabpanel" class="tab-pane" id="TvShowTab">
<div class="input-group">
<input id="tvSearchContent" type="text" class="form-control form-control-custom form-control-search form-control-withbuttons">
<div class="input-group-addon">
<div class="btn-group">
<a href="#" class="btn btn-sm btn-primary-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
@UI.Search_Suggestions
<i class="fa fa-chevron-down"></i>
</a>
<ul class="dropdown-menu">
<li><a id="popularShows" href="#">Popular Shows</a></li>
<li><a id="trendingShows" href="#">Trending Shows</a></li>
<li><a id="mostWatchedShows" href="#">Most Watched Shows</a></li>
<li><a id="anticipatedShows" href="#">Most Anticipated Shows</a></li>
</ul>
</div><i id="tvSearchButton" class="fa fa-search"></i>
</div>
</div>
<br />
<br />
<!-- TV content -->
<div id="tvList">
</div>
</div>
}
@if (Model.Settings.SearchForMusic)
{
<!-- Music tab -->
<div role="tabpanel" class="tab-pane" id="MusicTab">
<div class="input-group">
<input id="musicSearchContent" type="text" class="form-control form-control-custom form-control-search">
<div class="input-group-addon">
<i id="musicSearchButton" class="fa fa-search"></i>
</div>
</div>
<br />
<br />
<!-- Music content -->
<div id="musicList">
</div>
</div>
}
<script id="search-templateNew" type="text/x-handlebars-template">
<div class="row">
<div id="{{id}}imgDiv" class="col-sm-2">
{{#if_eq type "movie"}}
{{#if posterPath}}
<img class="img-responsive" src="https://image.tmdb.org/t/p/w150/{{posterPath}}" alt="poster">
{{/if}}
{{/if_eq}}
{{#if_eq type "tv"}}
{{#if posterPath}}
<img class="img-responsive" width="150" src="{{posterPath}}" alt="poster">
{{/if}}
{{/if_eq}}
</div>
<div class="col-sm-10">
<div>
<h4>
{{#if_eq type "movie"}}
<a href="https://www.themoviedb.org/movie/{{id}}/" target="_blank">
{{else}}
<a href="http://www.imdb.com/title/{{imdb}}/" target="_blank">
{{/if_eq}}
{{title}} ({{year}})
{{#if status}}
<span class="label label-primary" style="font-size:60%" target="_blank">{{status}}</span>
{{/if}}
</h4>
</a>
<div class="row">
<div class="col-md-7 col-xs-7">
{{#if available}}
<span class="label label-success">@UI.Search_Available</span>
{{else}}
{{#if approved}}
<span class="label label-info">@UI.Search_Processing_Request</span>
{{else if requested}}
<span class="label label-warning">@UI.Search_Pending_approval</span>
{{else}}
<span class="label label-danger">@UI.Search_Not_Requested_Yet</span>
{{/if}}
{{/if}}
{{#if firstAired}}
<span class="label label-info" target="_blank">Air Date: {{firstAired}}</span>
{{/if}}
{{#if releaseDate}}
<span class="label label-info" target="_blank">Release Date: {{releaseDate}}</span>
{{/if}}
<span id="{{id}}netflixTab"></span>
</div>
<!--Info Labels-->
<div class="col-md-5 col-xs-5" style="text-align:right;">
{{#if homepage}}
<a href="{{homepage}}" target="_blank"><span class="label label-info">HomePage</span></a>
{{/if}}
{{#if trailer}}
<a href="{{trailer}}" target="_blank"><span class="label label-info">Trailer</span></a>
{{/if}}
</div>
</div>
<div class="row">
<!-- Description -->
<p style="font-size:0.9rem !important">{{overview}}</p>
<br />
<br />
</div>
<form method="POST" action="@url/search/request/{{type}}" id="form{{id}}">
<input name="{{type}}Id" type="text" value="{{id}}" hidden="hidden" />
{{#if_eq type "movie"}}
{{#if_eq available true}}
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button>
<br />
<br />
{{#if url}}
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{url}}" target="_blank"><i class="fa fa-eye"></i> @UI.Search_ViewInPlex</a>
{{/if}}
{{else}}
{{#if_eq requested true}}
<button style="text-align: right" class="btn btn-primary-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Requested</button>
{{else}}
<button id="{{id}}" style="text-align: right" class="btn btn-primary-outline requestMovie" type="submit"><i class="fa fa-plus"></i> @UI.Search_Request</button>
{{/if_eq}}
{{/if_eq}}
{{/if_eq}}
{{#if_eq type "tv"}}
{{#if_eq tvFullyAvailable true}}
@*//TODO Not used yet*@
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button><br />
{{else}}
{{#if_eq enableTvRequestsForOnlySeries true}}
<button id="{{id}}" style="text-align: right" class="btn {{#if available}}btn-success-outline{{else}}btn-primary-outline{{/if}} btn-primary-outline dropdownTv" season-select="0" type="button"><i class="fa fa-plus"></i> @UI.Search_Request</button>
{{else}}
<div class="dropdown">
<button id="{{id}}" class="btn {{#if available}}btn-success-outline{{else}}btn-primary-outline{{/if}} dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-plus"></i> {{#if available}}@UI.Search_Available{{else}}@UI.Search_Request {{/if}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a id="{{id}}" season-select="0" class="dropdownTv " href="#">@UI.Search_AllSeasons</a></li>
{{#if_eq disableTvRequestsBySeason false}}
<li><a id="{{id}}" season-select="1" class="dropdownTv" href="#">@UI.Search_FirstSeason</a></li>
<li><a id="{{id}}" season-select="2" class="dropdownTv" href="#">@UI.Search_LatestSeason</a></li>
<li><a id="SeasonSelect" data-identifier="{{id}}" data-toggle="modal" data-target="#seasonsModal" href="#">@UI.Search_SelectSeason...</a></li>
{{/if_eq}}
{{#if_eq disableTvRequestsByEpisode false}}
<li><a id="EpisodeSelect" data-identifier="{{id}}" data-toggle="modal" data-target="#episodesModal" href="#">@UI.Search_SelectEpisode...</a></li>
{{/if_eq}}
</ul>
</div>
{{/if_eq}}
{{#if available}}
<br />
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{url}}" target="_blank"><i class="fa fa-eye"></i> @UI.Search_ViewInPlex</a>
{{/if}}
{{/if_eq}}
{{/if_eq}}
<br />
</form>
{{#if_eq available true}}
<form method="POST" action="@url/issues/nonrequestissue/" id="report{{id}}">
<input name="providerId" type="text" value="{{id}}" hidden="hidden" />
<input name="type" type="text" value="{{type}}" hidden="hidden" />
<div class="dropdown">
<button id="{{id}}" class="btn btn-sm btn-danger-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-exclamation"></i> @UI.Search_ReportIssue
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a id="{{id}}" issue-select="0" class="dropdownIssue" href="#">@UI.Issues_WrongAudio</a></li>
<li><a id="{{id}}" issue-select="1" class="dropdownIssue" href="#">@UI.Issues_NoSubs</a></li>
<li><a id="{{id}}" issue-select="2" class="dropdownIssue" href="#">@UI.Issues_WrongContent</a></li>
<li><a id="{{id}}" issue-select="3" class="dropdownIssue" href="#">@UI.Issues_Playback</a></li>
<li><a id="{{id}}" issue-select="4" class="dropdownIssue" data-identifier="{{id}}" data-type="{{type}}" href="#" data-toggle="modal" data-target="#issuesModal">@UI.Issues_Other</a></li>
</ul>
</div>
</form>
{{/if_eq}}
</div>
</div>
<div class="col-sm-12">
</div>
</div>
<hr />
</script>
<!-- Movie and TV Results template -->
<script id="search-template" type="text/x-handlebars-template">
<div class="row">
<div id="{{id}}imgDiv" class="col-sm-2">
{{#if_eq type "movie"}}
{{#if posterPath}}
<img class="img-responsive" src="https://image.tmdb.org/t/p/w150/{{posterPath}}" alt="poster">
{{/if}}
{{/if_eq}}
{{#if_eq type "tv"}}
{{#if posterPath}}
<img class="img-responsive" width="150" src="{{posterPath}}" alt="poster">
{{/if}}
{{/if_eq}}
</div>
<div class="col-sm-8">
<div>
{{#if_eq type "movie"}}
<a href="https://www.themoviedb.org/movie/{{id}}/" target="_blank">
<h4>{{title}} ({{year}})</h4>
</a>
{{else}}
<h4>
<a href="http://www.imdb.com/title/{{imdb}}/" target="_blank">
{{title}} ({{year}})
</a>{{#if status}}<span class="label label-primary" style="font-size:60%" target="_blank">{{status}}</span>{{/if}}
</h4>
{{/if_eq}}
{{#if firstAired}}
<span class="label label-info" target="_blank">Air Date: {{firstAired}}</span>
{{/if}}
{{#if releaseDate}}
<span class="label label-info" target="_blank">Release Date: {{releaseDate}}</span>
{{/if}}
{{#if available}}
<span class="label label-success">@UI.Search_Available</span>
{{else}}
{{#if approved}}
<span class="label label-info">@UI.Search_Processing_Request</span>
{{else if requested}}
<span class="label label-warning">@UI.Search_Pending_approval</span>
{{else}}
<span class="label label-danger">@UI.Search_Not_Requested_Yet</span>
{{/if}}
{{/if}}
<span id="{{id}}netflixTab"></span>
{{#if homepage}}
<a href="{{homepage}}" target="_blank"><span class="label label-info">HomePage</span></a>
{{/if}}
{{#if trailer}}
<a href="{{trailer}}" target="_blank"><span class="label label-info">Trailer</span></a>
{{/if}}
<br />
<br />
</div>
<p style="font-size:0.9rem !important">{{overview}}</p>
</div>
<div class="col-sm-2">
<form method="POST" action="@url/search/request/{{type}}" id="form{{id}}">
<input name="{{type}}Id" type="text" value="{{id}}" hidden="hidden" />
{{#if_eq type "movie"}}
{{#if_eq available true}}
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button>
{{#if url}}
<br />
<br />
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{url}}" target="_blank"><i class="fa fa-eye"></i> @UI.Search_ViewInPlex</a>
{{/if}}
{{else}}
{{#if_eq requested true}}
<button style="text-align: right" class="btn btn-primary-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Requested</button>
{{else}}
<button id="{{id}}" style="text-align: right" class="btn btn-primary-outline requestMovie" type="submit"><i class="fa fa-plus"></i> @UI.Search_Request</button>
{{/if_eq}}
{{/if_eq}}
{{/if_eq}}
{{#if_eq type "tv"}}
{{#if_eq tvFullyAvailable true}}
@*//TODO Not used yet*@
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button><br />
{{else}}
{{#if_eq enableTvRequestsForOnlySeries true}}
<button id="{{id}}" style="text-align: right" class="btn {{#if available}}btn-success-outline{{else}}btn-primary-outline dropdownTv{{/if}} btn-primary-outline" season-select="0" type="button" {{#if available}}disabled{{/if}}><i class="fa fa-plus"></i> {{#if available}}@UI.Search_Available{{else}}@UI.Search_Request{{/if}}</button>
{{else}}
<div class="dropdown">
<button id="{{id}}" class="btn {{#if available}}btn-success-outline{{else}}btn-primary-outline{{/if}} dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-plus"></i> {{#if available}}@UI.Search_Available{{else}}@UI.Search_Request {{/if}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a id="{{id}}" season-select="0" class="dropdownTv " href="#">@UI.Search_AllSeasons</a></li>
{{#if_eq disableTvRequestsBySeason false}}
<li><a id="{{id}}" season-select="1" class="dropdownTv" href="#">@UI.Search_FirstSeason</a></li>
<li><a id="{{id}}" season-select="2" class="dropdownTv" href="#">@UI.Search_LatestSeason</a></li>
<li><a id="SeasonSelect" data-identifier="{{id}}" data-toggle="modal" data-target="#seasonsModal" href="#">@UI.Search_SelectSeason...</a></li>
{{/if_eq}}
{{#if_eq disableTvRequestsByEpisode false}}
<li><a id="EpisodeSelect" data-identifier="{{id}}" data-toggle="modal" data-target="#episodesModal" href="#">@UI.Search_SelectEpisode...</a></li>
{{/if_eq}}
</ul>
</div>
{{/if_eq}}
{{#if available}}
{{#if url}}
<br />
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{url}}" target="_blank"><i class="fa fa-eye"></i> @UI.Search_ViewInPlex</a>
{{/if}}
{{/if}}
{{/if_eq}}
{{/if_eq}}
<br />
</form>
{{#if_eq available true}}
<form method="POST" action="@url/issues/nonrequestissue/" id="report{{id}}">
<input name="providerId" type="text" value="{{id}}" hidden="hidden" />
<input name="type" type="text" value="{{type}}" hidden="hidden" />
<div class="dropdown">
<button id="{{id}}" class="btn btn-sm btn-danger-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-exclamation"></i> @UI.Search_ReportIssue
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a id="{{id}}" issue-select="0" class="dropdownIssue" href="#">@UI.Issues_WrongAudio</a></li>
<li><a id="{{id}}" issue-select="1" class="dropdownIssue" href="#">@UI.Issues_NoSubs</a></li>
<li><a id="{{id}}" issue-select="2" class="dropdownIssue" href="#">@UI.Issues_WrongContent</a></li>
<li><a id="{{id}}" issue-select="3" class="dropdownIssue" href="#">@UI.Issues_Playback</a></li>
<li><a id="{{id}}" issue-select="4" class="dropdownIssue" data-identifier="{{id}}" data-type="{{type}}" href="#" data-toggle="modal" data-target="#issuesModal">@UI.Issues_Other</a></li>
</ul>
</div>
</form>
{{/if_eq}}
</div>
</div>
<hr />
</script>
<!-- Music Results template -->
<script id="music-template" type="text/x-handlebars-template">
<div class="row">
<div id="{{id}}imageDiv" class="col-sm-2">
{{#if coverArtUrl}}
<img id="{{id}}cover" class="img-responsive" src="{{coverArtUrl}}" width="150" alt="poster">
{{/if}}
</div>
<div class="col-sm-5 ">
<div>
<a href="https://musicbrainz.org/release/{{id}}" target="_blank">
<h4>
{{artist}} - {{title}}
{{#if year}}
({{year}})
{{/if}}
</h4>
</a>
</div>
<p>{{overview}}</p>
</div>
<div class="col-sm-2 col-sm-push-3">
<form method="POST" action="@url/search/request/{{type}}" id="form{{id}}">
<input name="{{type}}Id" type="text" value="{{id}}" hidden="hidden" />
{{#if_eq available true}}
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button><br />
{{#if url}}
<a style="text-align: right" class="btn btn-sm btn-primary-outline" href="{{url}}" target="_blank"><i class="fa fa-eye"></i> @UI.Search_ViewInPlex</a>
{{/if}}
{{else}}
{{#if_eq requested true}}
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Requested</button>
{{else}}
<button id="{{id}}" style="text-align: right" class="btn btn-primary-outline requestAlbum" type="submit"><i class="fa fa-plus"></i> @UI.Search_Request</button>
{{/if_eq}}
{{/if_eq}}
<br />
<small class="row">@UI.Search_TrackCount: {{trackCount}}</small>
<small class="row">@UI.Search_Country: {{country}}</small>
</form>
</div>
</div>
<hr />
</script>
<div class="modal fade" id="seasonsModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">@UI.Search_Modal_SeasonsTitle</h4>
</div>
<div class="modal-body" id="seasonsBody">
</div>
<div hidden="hidden" id="selectedSeasonsId"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@UI.Common_Close</button>
<button type="button" id="seasonsRequest" class="btn btn-primary">@UI.Search_Request</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="episodesModal">
<div class="modal-dialog modal-lg">
<div class="modal-content col-md-12">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">@UI.Search_Modal_SeasonsTitle</h4>
</div>
<div class="text-center" id="episodeModalLoading"><i class="fa fa-5x fa-spinner fa-spin"></i></div>
<div class="modal-body" id="episodesBody">
</div>
<div hidden="hidden" id="selectedEpisodeId"></div>
<div hidden="hidden" id="episodeTvID"></div>
<div class="modal-footer col-md-12">
<button type="button" class="btn btn-default btn-default-outline" data-dismiss="modal">@UI.Common_Close</button>
<button type="button" id="episodesRequest" class="btn btn-primary">@UI.Search_Request</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="issuesModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
<h4 class="modal-title">@UI.Issues_Modal_Title</h4>
</div>
<form method="POST" action="@url/issues/nonrequestissuecomment" id="commentForm">
<div class="modal-body">
<input id="providerIdModal" name="providerId" class="providerId" type="text" hidden="hidden" value="" />
<input name="issue" class="issue" type="text" hidden="hidden" value="" />
<input id="typeModal" name="type" class="type" type="text" hidden="hidden" value="" />
<textarea class="form-control form-control-custom" rows="3" id="commentArea" name="commentArea"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger-outline" data-dismiss="modal">@UI.Common_Close</button>
<button type="button" class="btn btn-primary-outline theSaveButton" data-dismiss="modal">@UI.Issues_Modal_Save</button>
</div>
</form>
</div>
</div>
</div>
<script id="seasons-template" type="text/x-handlebars-template">
<div class="form-group">
<div class="checkbox">
<input type="checkbox" class="selectedSeasons" id="{{id}}" name="{{id}}"><label for="{{id}}">@UI.Search_Season {{id}}</label>
</div>
</div>
</script>
<script id="seasonNumber-template" type="text/x-handlebars-template">
<div id="seasonNumber{{seasonNumber}}" class="col-md-12">
<strong>@UI.Search_Season {{seasonNumber}}</strong>
</div>
</script>
<script id="episode-template" type="text/x-handlebars-template">
<div class="form-group col-md-6">
<div class="checkbox" style="margin-bottom:0px; margin-top:0px;">
{{#if_eq requested true}}
<input type="checkbox" checked="checked" disabled="disabled" class="selectedEpisodes" id="{{episodeId}}" epNumber="{{number}}" epSeason="{{season}}" name="{{episodeId}}"><label for="{{episodeId}}">{{number}}. {{name}}</label>
{{else}}
<input type="checkbox" class="selectedEpisodes" id="{{episodeId}}" epNumber="{{number}}" epSeason="{{season}}" name="{{episodeId}}"><label for="{{episodeId}}">{{number}}. {{name}}</label>
{{/if_eq}}
</div>
</div>
</script>
@Html.LoadSearchAssets()

View file

@ -0,0 +1,29 @@
@using Nancy.Security
@using Nancy.Session
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
@{
var baseUrl = Html.GetBaseUrl();
var url = string.Empty;
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
url = "/" + baseUrl.ToHtmlString();
}
}
<html>
<div hidden="hidden" id="baseUrl">@baseUrl.ToHtmlString()</div>
<head>
<title>Ombi</title>
<!-- Styles -->
<meta name="viewport" content="width=device-width, initial-scale=1">
@Html.LoadAnalytics()
@Html.LoadAssets()
</head>
<body>
@RenderBody()
</body>
</html>

View file

@ -0,0 +1,35 @@
@using Nancy.Security
@using Nancy.Session
@using Ombi.UI.Helpers
@using Ombi.UI.Resources
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
@{
var baseUrl = Html.GetBaseUrl();
var url = string.Empty;
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
url = "/" + baseUrl.ToHtmlString();
}
var title = UI.Layout_Title;
var customName = Html.GetApplicationName().ToHtmlString();
if (!string.IsNullOrEmpty(customName))
{
title = customName;
}
}
<div hidden="hidden" id="baseUrl">@baseUrl.ToHtmlString()</div>
<head>
<title>@title</title>
<meta charset="utf-8">
<!-- Styles -->
<meta name="viewport" content="width=device-width, initial-scale=1">
@Html.LoadFavIcon()
@Html.LoadAnalytics()
@Html.LoadAssets()
</head>

View file

@ -0,0 +1,118 @@
@using Nancy.Security
@using Nancy.Session
@using Ombi.UI.Helpers
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
<script>
var urlBase = '@Html.GetBaseUrl()';
$(function () {
// Check for update
var url = createBaseUrl(urlBase, '/layout');
$.ajax({
type: "GET",
url: url,
dataType: "json",
success: function (response) {
if (response.updateAvailable) {
var status = createBaseUrl(urlBase, '/admin/status');
$('#updateAvailable').html("<i class='fa fa-cloud-download' aria-hidden='true'></i> @UI.Layout_UpdateAvailablePart1 <a style='color: white' href='" + status + "'>@UI.Layout_UpdateAvailablePart2</a>");
$('#updateAvailable').removeAttr("hidden");
//$('body').addClass('update-available');
}
},
error: function (e) {
console.log(e);
}
});
var gravatarUrl = createBaseUrl(base, 'layout/gravatar');
$.ajax({
url: gravatarUrl,
success: function (result) {
if (result.result) {
$('#gravatarImg').html("<img src=\"" + result.message + "\" class=\"gravatar\" width=\"30\" height=\"30\" alt=\"\">");
}
},
error: function (xhr, status, error) {
console.log("error " + error);
}
});
// End Check for update
checkCacheInProgress();
// Scroller
$(document).on('scroll', function () {
if ($(window).scrollTop() > 100) {
$('.scroll-top-wrapper').addClass('show');
} else {
$('.scroll-top-wrapper').removeClass('show');
}
});
$('.scroll-top-wrapper').on('click', scrollToTop);
// End Scroller
// Get Issue count
var issueUrl = createBaseUrl(urlBase, '/issues/issuecount');
$.ajax({
type: "GET",
url: issueUrl,
dataType: "json",
success: function (response) {
if (response) {
if (response > 0)
$('#issueCount').addClass("badge");
$('#issueCount').html(+response);
}
},
error: function (e) {
console.log(e);
}
});
// End issue count
$('#donate').click(function () {
ga('send', 'event', 'Navbar', 'Donate', 'Donate Clicked');
});
});
function scrollToTop() {
verticalOffset = typeof (verticalOffset) != 'undefined' ? verticalOffset : 0;
element = $('body');
offset = element.offset();
offsetTop = offset.top;
$('html, body').animate({ scrollTop: offsetTop }, 500, 'linear');
}
function checkCacheInProgress() {
var url = createBaseUrl(urlBase, '/layout/cacher');
$.ajax({
type: "GET",
url: url,
dataType: "json",
success: function (response) {
if (response.currentlyRunning) {
$('#cacherRunning').html("@UI.Layout_CacherRunning");
$('#cacherRunning').removeAttr("hidden");
}
},
error: function (e) {
console.log(e);
}
});
}
</script>

View file

@ -0,0 +1,151 @@
@using Nancy.Security
@using Nancy.Session
@using Nancy;
@using Ombi.Helpers
@using Ombi.UI.Helpers
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase
@{
var baseUrl = Html.GetBaseUrl();
var url = string.Empty;
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
url = "/" + baseUrl.ToHtmlString();
}
var title = UI.Layout_Title;
var customName = Html.GetApplicationName().ToHtmlString();
if (!string.IsNullOrEmpty(customName))
{
title = customName;
}
var isAdmin = Html.IsAdmin();
}
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="@url/search">@title</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
@Html.GetNavbarUrl(Context, "/search", UI.Layout_Search, "search")
@Html.GetNavbarUrl(Context, "/requests", UI.Layout_Requests, "plus-circle")
@Html.GetNavbarUrl(Context, "/issues", UI.Layout_Issues, "exclamation", "<span id=\"issueCount\"></span>")
@if (isAdmin)
{
@Html.GetNavbarUrl(Context, "/usermanagement", UI.Layout_Usermanagement, "users")
}
@if (isAdmin)
{
<li><a id="donate" href="https://www.paypal.me/PlexRequestsNet" target="_blank"><i class="fa fa-heart" style="color: red"></i> @UI.Layout_Donate</a></li>
}
<li id="customDonate" style="display: none"><a id="customDonateHref" href="https://www.paypal.me/PlexRequestsNet" target="_blank"><i class="fa fa-heart" style="color: yellow;"></i> <span id="donationText">@UI.Custom_Donation_Default</span></a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<a id="gravatarImg" class="navbar-brand" href="#">
</a>
@if (isAdmin)
{
<li><a>@UI.Layout_Welcome @Context.CurrentUser.UserName</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> @UI.Layout_Admin <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="@url/admin/about"><i class="fa fa-cog"></i> @UI.Layout_Settings</a></li>
<li><a href="@url/changepassword"><i class="fa fa-key"></i> @UI.Layout_ChangePassword</a></li>
<li class="divider"></li>
<li><a href="@url/logout"><i class="fa fa-sign-out"></i> @UI.Layout_Logout</a></li>
</ul>
</li>
}
else if (Html.IsNormalUser()) // Logged in but not admin
{
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> @UI.Layout_Welcome @Context.CurrentUser.UserName <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="@url/changepassword"><i class="fa fa-key"></i> @UI.Layout_ChangePassword</a></li>
<li><a href="@url/logout"><i class="fa fa-sign-out"></i> @UI.Layout_Logout</a></li>
</ul>
</li>
}
else if (Html.IsExternalUser()) // Logged in but not admin
{
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> @UI.Layout_Welcome @Context.CurrentUser.UserName <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="@url/logout"><i class="fa fa-sign-out"></i> @UI.Layout_Logout</a></li>
</ul>
</li>
}
else if (Html.IsLoggedIn(Context)) // Logged in but not admin but not a real user
{
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> @UI.Layout_Welcome @Context.Request.Session[SessionKeys.UsernameKey] <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="@url/logout"><i class="fa fa-sign-out"></i> @UI.Layout_Logout</a></li>
</ul>
</li>
}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-language" aria-hidden="true"><span class="caret"></span></i></a>
<ul class="dropdown-menu" role="menu">
<li><a href="@url/culture?l=en&u=@Context.Request.Path">@UI.Layout_English</a></li>
<li><a href="@url/culture?l=fr&u=@Context.Request.Path">@UI.Layout_French</a></li>
<li><a href="@url/culture?l=nl&u=@Context.Request.Path">@UI.Layout_Dutch</a></li>
<li><a href="@url/culture?l=es&u=@Context.Request.Path">@UI.Layout_Spanish</a></li>
<li><a href="@url/culture?l=de&u=@Context.Request.Path">@UI.Layout_German</a></li>
<li><a href="@url/culture?l=da&u=@Context.Request.Path">@UI.Layout_Danish</a></li>
<li><a href="@url/culture?l=pt&u=@Context.Request.Path">@UI.Layout_Portuguese</a></li>
<li><a href="@url/culture?l=sv&u=@Context.Request.Path">@UI.Layout_Swedish</a></li>
<li><a href="@url/culture?l=it&u=@Context.Request.Path">@UI.Layout_Italian</a></li>
</ul>
<li/>
</ul>
</div>
</div>
<script>
var base = '@baseUrl';
var url = createBaseUrl(base, '/customDonation');
$.ajax({
url: url,
success: function (result) {
if (result.url && result.url != "donationLinkError") {
$("#customDonate").show();
var donateLink = $("#customDonateHref");
var donationText = $("#donationText");
donateLink.attr("href", result.url);
if (result.message) {
donationText.text(result.message);
}
}
},
error: function (xhr, status, error) {
console.log("error " + error);
$("#customDonate").hide();
}
});
</script>
<div id="updateAvailable" hidden="hidden"></div>
<div id="cacherRunning" hidden="hidden"></div>
</nav>

View file

@ -0,0 +1,69 @@
@using Ombi.UI.Helpers
@Html.LoadSettingsAssets()
<div class="col-lg-3 col-md-3 col-sm-4">
<div class="list-group table-of-contents">
@Html.GetSidebarUrl(Context, "/admin/about", "About", "glyphicon glyphicon-info-sign")
@Html.GetSidebarUrl(Context, "/admin", "Ombi Configuration", "glyphicon glyphicon-ok-sign")
@Html.GetSidebarUrl(Context, "/admin/customization", "Customization", "glyphicon glyphicon-tasks")
@Html.GetSidebarUrl(Context, "/admin/landingpage", "Landing Page", "glyphicon glyphicon-dashboard")
@Html.GetSidebarUrl(Context, "/admin/authentication", "Authentication", "glyphicon glyphicon-lock")
@Html.GetSidebarUrl(Context, "/admin/usermanagementsettings", "User Management Settings", "glyphicon glyphicon-user")
@Html.GetSidebarUrl(Context, "/admin/plex", "Plex", "glyphicon glyphicon-play-circle")
@Html.GetSidebarUrl(Context, "/admin/emby", "Emby", "glyphicon glyphicon-play-circle")
@Html.GetSidebarUrl(Context, "/admin/couchpotato", "CouchPotato", "glyphicon glyphicon-film")
@Html.GetSidebarUrl(Context, "/admin/watcher", "Watcher (beta)", "glyphicon glyphicon-film")
@Html.GetSidebarUrl(Context, "/admin/radarr", "Radarr (beta)", "glyphicon glyphicon-film")
@Html.GetSidebarUrl(Context, "/admin/sonarr", "Sonarr", "fa fa-tv")
@Html.GetSidebarUrl(Context, "/admin/sickrage", "SickRage", "fa fa-tv")
@Html.GetSidebarUrl(Context, "/admin/headphones", "Headphones (beta)", "glyphicon glyphicon-headphones")
@Html.GetSidebarUrl(Context, "/admin/newsletter", "Newsletter Settings", "fa fa-newspaper-o")
@Html.GetSidebarUrl(Context, "/admin/massemail", "Mass Email", "fa fa-reply-all")
<div id="sidebar" >
<a href="#notifications" class="list-group-item" data-parent="#sidebar">
Notifications <span class="caret"></span><span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-envelope"></span>
</a>
<div id="notifications" class="list-group subitem collapse">
@Html.GetSidebarUrl(Context, "/admin/emailnotification", "Email Notifications")
@Html.GetSidebarUrl(Context, "/admin/pushbulletnotification", "Pushbullet Notifications","fa fa-bell-o")
@Html.GetSidebarUrl(Context, "/admin/pushovernotification", "Pushover Notifications", "fa fa-bell-o")
@Html.GetSidebarUrl(Context, "/admin/slacknotification", "Slack Notifications", "fa fa-slack")
@Html.GetSidebarUrl(Context, "/admin/discordnotification", "Discord Notifications", "fa fa-bell-o")
</div>
</div>
@Html.GetSidebarUrl(Context, "/admin/logs", "Logs", "fa fa-edit")
@Html.GetSidebarUrl(Context, "/admin/status", "Updates", "fa fa-dashboard")
@Html.GetSidebarUrl(Context, "/admin/scheduledjobs", "Scheduled Jobs", "fa fa-hand-spock-o")
@Html.GetSidebarUrl(Context, "/admin/faultqueue", "Request Fault Queue", "fa fa-history")
</div>
</div>
<script>
$('#sidebar > a').on('click', function (e) {
e.preventDefault();
$('.customTooltip').tooltipster({
contentCloning: true
});
if (!$(this).hasClass("active")) {
var lastActive = $(this).closest("#sidebar").children(".active");
lastActive.removeClass("active");
lastActive.next('div').collapse('hide');
$(this).addClass("active");
$(this).next('div').collapse('show');
}
});
</script>

View file

@ -0,0 +1,23 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase
<html ng-app="PlexRequests">
@Html.Partial("Shared/Partial/_Head")
<body>@Html.LoadAngularAssets()
@Html.Partial("Shared/Partial/_Navbar")
<div class="container">
@RenderBody()
</div>
<div class="scroll-top-wrapper ">
<span class="scroll-top-inner">
<i class="fa fa-2x fa-arrow-circle-up"></i>
</span>
</div>
</body>
@Html.GetInformationalVersion()
</html>
@Html.Partial("Shared/Partial/_LayoutScripts")

View file

@ -0,0 +1,24 @@
@*@using StackExchange.Profiling*@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase
<html id="htmlId">
@Html.Partial("Shared/Partial/_Head")
<body>
@Html.Partial("Shared/Partial/_Navbar")
<div class="container" style="padding-top: 5%">
@RenderBody()
</div>
<div class="scroll-top-wrapper ">
<span class="scroll-top-inner">
<i class="fa fa-2x fa-arrow-circle-up"></i>
</span>
</div>
</body>
@Html.GetInformationalVersion()
</html>
@Html.Partial("Shared/Partial/_LayoutScripts")

View file

@ -0,0 +1,210 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.SystemSettings>
@Html.Partial("Shared/Partial/_Sidebar")
<div id="lightbox" style="display:none"></div>
<div class="col-sm-8 col-sm-push-1">
<fieldset>
<legend>Updates</legend>
<ul class="nav nav-tabs">
<li class="active"><a href="#status" data-toggle="tab" aria-expanded="true">Status</a></li>
<li id="changesTab" class=""><a href="#changes" data-toggle="tab" aria-expanded="false">Recent Changes</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="status">
<br />
<div class="form-group">
<label class="control-label">Current Version: </label>
<label class="control-label">@Model.Status.CurrentVersion</label>
</div>
@if (Model.Status.UpdateAvailable)
{
<div class="form-group">
<label class="control-label">New Version: </label>
<label class="control-label">@Model.Status.NewVersion</label>
</div>
}
<hr />
<form id="mainForm" method="post" action="save">
<div class="form-group">
<label for="select" class="control-label">Code Branch</label>
<div id="branches">
<select class="form-control form-control-custom" id="select">
@foreach (var b in Model.BranchDropdown)
{
if (b.Selected)
{
<option selected='selected' value='@b.Value'>@b.Name</option>
}
else
{
<option value='@b.Value'>@b.Name</option>
}
}
</select>
</div>
</div>
<button id="saveSettings" class="btn btn-success-outline">Save</button>
</form>
<hr />
<div class="form-group">
<label class="control-label">Update Available: </label>
@if (Model.Status.UpdateAvailable)
{
<label class="control-label"><a href="@Model.Status.UpdateUri" target="_blank"><i class="fa fa-check"></i></a> @Html.ToolTip("Click the 'tick' to manually go to the page")</label>
<br />
<br />
@*<label class="control-label">Launch Arguments</label>
@Html.ToolTip("This is if you run Ombi outside of a regular install e.g. you are launching with a custom port. This field will be used after we have updated to launch the application.")
<input id="args" class="form-control form-control-custom " placeholder="/etc/mono /opt/Ombi.exe">
<br />
<button id="autoUpdate" class="btn btn-success-outline">Automatic Update (beta) <i class="fa fa-download"></i></button>*@
}
else
{
<label class="control-label"><i class="fa fa-times"></i></label>
}
</div>
<hr />
@if (Model.Status.UpdateAvailable)
{
<h2>
<a href="@Model.Status.DownloadUri">@Model.Status.ReleaseTitle</a>
</h2>
<hr />
<label>Release Notes:</label>
@Html.Raw(Model.Status.ReleaseNotes)
}
</div>
<div class="tab-pane fade" id="changes">
<br />
<div id="changesArea"></div>
</div>
</div>
</fieldset>
</div>
<script id="changes-template" type="text/x-handlebars-template">
<fieldset>
<div class="col-md-12">
<h4 class="col-md-2">
{{version}}
</h4>
<h5 class="col-md-4">
<span class="date">
- <span title="" data-original-title="Sunday, March 12 2017 10:30am">{{date}}</span>
</span>
</h5>
<h6 class="col-md-6">
<span class="status">
<span class="label label-default">{{branch}}</span>
{{#if installed}}
<span class="label label-success">Installed</span>
{{/if}}
</span>
</h6>
</div><hr />
<div class="col-md-12">
{{message}}
</div>
</fieldset>
<br />
<br />
</script>
<script>
$('.customTooltip').tooltipster({
contentCloning: true
});
var base = '@Html.GetBaseUrl()';
$('#autoUpdate')
.click(function (e) {
e.preventDefault();
$('body').append("<i class=\"fa fa-spinner fa-spin fa-5x fa-fw\" style=\"position: absolute; top: 20%; left: 50%;\"></i>");
$('#autoUpdate').prop("disabled", "disabled");
document.getElementById("lightbox").style.display = "";
var count = 0;
setInterval(function () {
count++;
var dots = new Array(count % 10).join('.');
document.getElementById('autoUpdate').innerHTML = "Updating" + dots;
}, 1000);
$.ajax({
type: "Post",
url: "autoupdate",
data: {
url: "@Model.Status.DownloadUri",
args: $('#args').val()
},
dataType: "json",
error: function () {
setTimeout(
function () {
location.reload();
}, 30000);
}
});
});
$('#saveSettings').click(function (e) {
e.preventDefault();
var $form = $("#mainForm");
var branches = $("#branches option:selected").val();
var data = $form.serialize();
data = data + "&branch=" + branches;
$.ajax({
type: $form.prop("method"),
url: $form.prop("action"),
data: data,
dataType: "json",
success: function (response) {
if (response.result === true) {
generateNotify(response.message, "success");
} else {
generateNotify(response.message, "warning");
}
}
});
});
var changesSource = $("#changes-template").html();
var changesTemplate = Handlebars.compile(changesSource);
var changesLoaded = false;
$('#changesTab').click(function (e) {
e.preventDefault();
if (changesLoaded) return;
var url = createBaseUrl(base, "/admin/changes");
$area = $('#changesArea');
$.ajax({
type: 'GET',
url: url,
dataType: "json",
success: function (response) {
$(response).each(function (index, item) {
item.date = moment.utc(item.date).local().format('lll');
var html = changesTemplate(item);
$area.append(html);
});
changesLoaded = true;
return;
}
});
});
</script>

View file

@ -0,0 +1,59 @@
@using Ombi.UI.Resources
@{
var nullableError = Context.ViewBag.TempMessage ?? string.Empty;
var error = false;
if (!string.IsNullOrEmpty(nullableError))
{
error = true;
}
}
<div class="home">
<h1>@UI.UserLogin_Title</h1>
<div>
<p>
@UI.UserLogin_Paragraph <span title="@UI.UserLogin_Paragraph_SpanHover"><i class="fa fa-question-circle"></i></span>
</p>
</div>
<form method="POST" id="loginForm">
<input id="dateTimeOffset" name="DateTimeOffset" hidden="hidden" />
<div>
<div>
<label>@UI.UserLogin_Username</label>
</div>
<div>
<input id="username" class="form-control form-control-custom" type="text" name="Username" placeholder="@UI.UserLogin_Username_Placeholder" />
</div>
</div>
<br />
@if (Model.UsePassword)
{
<div>
<div>
<label> @UI.UserLogin_Password </label>
</div>
<div>
<input id="password" class="form-control form-control-custom" name="Password" type="password" placeholder="@UI.UserLogin_Password" />
</div>
</div>
<br />
}
<button id="loginBtn" class="btn btn-success-outline" type="submit"><i class="fa fa-user fa-fw"></i> @UI.UserLogin_SignIn</button>
</form>
</div>
<script>
$(function () {
$('#dateTimeOffset').val(new Date().getTimezoneOffset());
@if (error)
{
<text>
generateNotify('@nullableError', "warning");
</text>
}
});
</script>

View file

@ -0,0 +1,16 @@
 <form method="POST" id="passwordForm">
<div>
<div>
<label> Password </label>
</div>
<div>
<input id="password" class="form-control form-control-custom" name="Password" type="password" placeholder="Password" />
</div>
</div>
<br />
<button id="passwordBtn" class="btn btn-success-outline" type="submit"><i class="fa fa-user fa-fw"></i> Sign In</button>
</form>

View file

@ -0,0 +1,119 @@
@using Ombi.UI.Helpers
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.AuthenticationSettings>
<div class="home">
<h1>@UI.UserLogin_Title</h1>
<div>
<p>
@string.Format(UI.UserLogin_Paragraph, Html.GetMediaServerName().ToHtmlString()).ToString()
</p>
</div>
<div id="contentBody">
<form method="POST" id="usernameForm">
<input id="dateTimeOffset" name="DateTimeOffset" hidden="hidden" />
<div>
<div>
<label>Username</label>
</div>
<div>
<input id="username" class="form-control form-control-custom" type="text" name="Username" placeholder="Username" />
</div>
</div>
<br />
<button id="loginBtn" class="btn btn-success-outline" type="submit"><i class="fa fa-user fa-fw"></i> @UI.UserLogin_SignIn</button>
</form>
</div>
<div id="contentBody2"></div>
</div>
<script>
$(function () {
$('#contentBody').on('click', '#loginBtn', function (e) {
e.preventDefault();
var url = createLocalUrl('/userlogin/login');
var $form = $('#usernameForm');
$.ajax({
type: 'POST',
url: url,
data: $form.serialize(),
dataType: "json",
success: function (response) {
if (response.result === true) {
if (response.usePassword) {
loadArea(response.html);
return $('#dateTimeOffset').val(new Date().getTimezoneOffset());
} else {
return window.location.replace(response.url); // This is probably not uses, it probably goes into the error callback
}
} else if (response.responseText) {
return $('#htmlId').html(response.responseText);
}
else {
return generateNotify(response.message, "warning");
}
},
error: function (e) {
// This is for the CustomModuleExtensions.LoginAndRedirect
// Since it's not a valid JSON return but we are logged in.
// It's a bit hacky, but i've now documented it, so that's okay right?
if (e.status === 200) {
return window.location.reload();
}
console.log(e);
}
});
});
$('#contentBody, #contentBody2').on('click', '#passwordBtn', function (e) {
e.preventDefault();
var url = createBaseUrl(base, '/userlogin/password');
var $form = $('#passwordForm');
$.ajax({
type: 'POST',
url: url,
data: $form.serialize(),
dataType: "json",
success: function (response) {
if (response.result === true) {
window.location.replace(response.url);
} else {
generateNotify(response.message, "warning");
}
},
error: function (e) {
// This is for the CustomModuleExtensions.LoginAndRedirect
// Since it's not a valid JSON return but we are logged in.
// It's a bit hacky, but i've now documented it, so that's okay right?
if (e.status === 200) {
return window.location.reload();
}
console.log(e);
}
});
});
function loadArea(html) {
var $body = $('#contentBody');
var $body2 = $('#contentBody2');
$body2.slideUp();
// Do some sliding?
$body.fadeOut();
$body2.html(html);
$body2.fadeIn();
$body.html("");
}
$('#dateTimeOffset').val(new Date().getTimezoneOffset());
});
</script>

View file

@ -0,0 +1,32 @@
@using Ombi.UI.Helpers
@inherits Ombi.UI.Helpers.AngularViewBase
@Html.LoadUserManagementAssets()
<div id="wrapper" class="toggled" ng-controller="userManagementController" ng-init="init()" ng-cloak>
<span us-spinner="{radius:30, width:8, length: 16, color: '#ffffff' }"></span>
<sidebar></sidebar>
<div>
<div class="container-fluid">
<div>
<br />
<br />
<br />
<div class="col-md-12">
<br />
<br />
<br />
<add-User></add-User>
<table-Component></table-Component>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,75 @@
@using Ombi.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.UserManagementSettings>
@Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>User Management Settings</legend>
<span>Here you can manage the default permissions and features that your users get</span>
<small>
Note: This will not update your users that are currently there, this is to set the default settings to any users added outside of Ombi e.g. You share your Server with a new user, they will be added into Ombi
automatically and will take the permissions and features you have selected below.
</small>
<h3>Permissions</h3>
@Html.Checkbox(Model.RequestMovies, "RequestMovies", "Request Movies")
@Html.Checkbox(Model.RequestTvShows, "RequestTvShows", "Request TV Shows")
@Html.Checkbox(Model.RequestMusic, "RequestMusic", "Request Music")
@Html.Checkbox(Model.AutoApproveMovies, "AutoApproveMovies", "Auto Approve Movie Requests")
@Html.Checkbox(Model.AutoApproveTvShows, "AutoApproveTvShows", "Auto Approve TV Show Requests")
@Html.Checkbox(Model.AutoApproveMusic, "AutoApproveMusic", "Auto Approve Music Requests")
@Html.Checkbox(Model.ReportIssues, "ReportIssues", "Report Issues")
@Html.Checkbox(Model.UsersCanViewOnlyOwnIssues, "UsersCanViewOnlyOwnIssues", "Users can only view their own issues")
@Html.Checkbox(Model.UsersCanViewOnlyOwnRequests, "UsersCanViewOnlyOwnRequests", "Users can only view their own requests")
@Html.Checkbox(Model.BypassRequestLimit, "BypassRequestLimit", "Bypass the request limit")
@Html.Checkbox(Model.ViewUsers, "ViewUsers", "User can see who made requests")
<h3>Features</h3>
@Html.Checkbox(Model.RecentlyAddedNewsletter, "RecentlyAddedNewsletter", "Recently Added Newsletter")
@Html.Checkbox(Model.RecentlyAddedNotification, "RecentlyAddedNotification", "Recently Added Notifications")
<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 () {
$('#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>

View file

@ -0,0 +1,212 @@
@using Ombi.UI.Helpers
@inherits Ombi.UI.Helpers.EmptyViewBase<Ombi.UI.Models.LandingPageViewModel>
@{
var baseUrl = Html.GetBaseUrl();
var formAction = string.Empty;
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
formAction = "/" + baseUrl.ToHtmlString();
}
}
@Html.LoadWizardAssets()
<img class="landing-header" src="/images/logo.png" width="300" />
<div id="area" class="landing-block shadow">
<div class="media">
<div id="contentBody" class="media-body">
<h4 class="media-heading landing-title" id="statusTitle">Welcome to Ombi</h4>
<div class="form-group">
<small>we are just going to run though the initial Ombi setup!</small>
<div style="text-align: center; margin-top: 20px">
<a href="#" id="firstNext" class="btn btn-primary-outline">Next</a>
</div>
</div>
</div>
</div>
</div>
<!--Templates-->
<script id="mediaApplicationChoice" type="text/html">
<div>
<h4 class="media-heading landing-title wizard-heading" id="statusTitle">Please choose your media server</h4>
<div class="form-group">
<div class="row">
<a href="#" id="embyImg">
<img class="wizard-img" src="@formAction/Content/images/emby-logo-dark.jpg" />
</a>
</div>
<div class="row">
<a href="#" id="plexImg">
<img class="wizard-img" src="@formAction/Content/images/plex-logo-reversed.png" />
</a>
</div>
</div>
</div>
</script>
<script id="embyApiKey" type="text/html">
<form method="post" action="@formAction/wizard/embyAuth" id="embyAuthForm">
<h4 class="media-heading landing-title">Emby Authentication</h4>
<div class="form-group">
<label for="Ip" class="control-label">Emby Hostname or IP Address</label>
<div>
<input type="text" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="192.168.1.1">
</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="8096">
</div>
</div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
</div>
</div>
<div class="form-group">
<label for="username" class="control-label">Api Key</label>
<div>
<input type="text" class="form-control form-control-custom" id="apiKey" name="ApiKey" placeholder="ApiKey">
</div>
</div>
<div style="text-align: center; margin-top: 20px">
<a href="#" id="embyApiKeySave" class="btn btn-primary-outline">Next <div id="spinner"></div></a>
</div>
</form>
</script>
<script id="plexAuthArea" type="text/html">
<form method="post" action="@formAction/wizard/plexAuth" id="plexAuthForm">
<h4 class="media-heading landing-title">Plex Authentication</h4>
<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>
<small>Please note we do not store this information, we only store your Plex Authorization Token that will allow Ombi to view your media and friends</small>
<div class="form-group">
<div style="text-align: center; margin-top: 20px">
<button href="#" id="requestToken" class="btn btn-primary-outline">Request Token <i class="fa fa-key"></i></button>
</div>
</div>
</form>
</script>
<script id="plexArea" type="text/html">
<form method="post" action="@formAction/wizard/plex" id="plexForm">
<h4 class="media-heading landing-title">Plex Settings</h4>
<div class="form-group">
<label for="Ip" class="control-label">Plex Hostname or IP Address</label>
<div>
<input type="text" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="192.168.1.1">
</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="32400">
</div>
</div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="Ssl" name="Ssl"><label for="Ssl">SSL</label>
</div>
</div>
<div class="form-group">
<div style="text-align: center; margin-top: 20px">
<a href="#" id="submitPlex" class="btn btn-primary-outline">Next</a>
</div>
</div>
</form>
</script>
<script id="plexRequestArea" type="text/html">
<form method="post" action="@formAction/wizard/plexrequest" id="plexRequestForm">
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="SearchForMovies" name="SearchForMovies"><label id="SearchForMoviesLabel" for="SearchForMovies">Allow searching for Movies</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="SearchForTvShows" name="SearchForTvShows"><label id="SearchForTvShowsLabel" for="SearchForTvShows">Allow searching for TV Shows</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="SearchForMusic" name="SearchForMusic"><label id="SearchForMusicLabel" for="SearchForMusic">Allow searching for Music</label>
</div>
</div>
<div class="form-group">
<div style="text-align: center; margin-top: 20px">
<a href="#" id="submitPlexRequest" class="btn btn-primary-outline">Next</a>
</div>
</div>
</form>
</script>
<script id="authArea" type="text/html">
<form method="post" action="@formAction/wizard/auth" id="authForm">
<div class="form-group">
<div class="checkbox userAuthTooltip" title="This will only allow the users that are your friends on Plex to log into Ombi. Note: They only need to enter their username, unless the below option is selected.">
<input type="checkbox" id="userAuth" name="UserAuthentication">
<label for="userAuth">Enable User Authentication</label>
</div>
</div>
<div class="form-group">
<div class="checkbox passwordAuthTooltip" title="When a user logs in, they are required to enter their Plex.tv username and Plex.tv password to authenticate. Note: They still need to be in your Plex Friends">
<input type="checkbox" id="UsePassword" name="UsePassword">
<label for="UsePassword">Require users to login with their passwords</label>
</div>
</div>
<div class="form-group">
<div style="text-align: center; margin-top: 20px">
<a href="#" id="submitAuth" class="btn btn-primary-outline">Next</a>
</div>
</div>
</form>
</script>
<script id="adminArea" type="text/html">
<form method="post" action="@formAction/wizard/createuser" id="adminForm">
<h4 class="media-heading landing-title">Create the Admin account</h4>
<small>This account will be used to configure your settings and also manage all of the requests. Note: this should not be the same as your Plex/Emby account (you can change this later in the User Management Settings)</small>
<div class="form-group">
<div>
<label for="adminUsername">Username</label><input type="text" class="form-control form-control-custom" id="adminUsername" name="Username" placeholder="Username">
</div>
<br />
<div>
<label for="adminPassword">Password</label><input type="password" class="form-control form-control-custom" id="adminPassword" name="Password" placeholder="Password">
</div>
</div>
<div class="form-group">
<div style="text-align: center; margin-top: 20px">
<button id="submitAdmin" type="submit" class="btn btn-success-outline">Finish</button>
</div>
</div>
</form>
</script>

View file

@ -0,0 +1,3 @@
@{
Layout = "Shared/_Layout.cshtml";
}