mirror of https://github.com/Ombi-app/Ombi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
198 lines
7.3 KiB
198 lines
7.3 KiB
9 years ago
|
@Html.Partial("/Admin/_Sidebar")
|
||
|
@{
|
||
9 years ago
|
int port;
|
||
9 years ago
|
var authToken = string.Empty;
|
||
9 years ago
|
if (Model.Port == 0)
|
||
9 years ago
|
{
|
||
|
port = 3579;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
port = Model.Port;
|
||
|
}
|
||
|
|
||
9 years ago
|
}
|
||
|
<div class="col-sm-8">
|
||
9 years ago
|
<form class="form-horizontal" method="POST" action="/admin/couchpotato" id="mainForm">
|
||
9 years ago
|
<fieldset>
|
||
|
<legend>Request Plex Settings</legend>
|
||
|
<div class="form-group">
|
||
|
<label for="portNumber" class="col-lg-2 control-label">Port</label>
|
||
9 years ago
|
|
||
9 years ago
|
<div class="col-lg-10">
|
||
9 years ago
|
<input type="text" class="form-control" id="portNumber" name="Port" placeholder="Port Number" value="@port">
|
||
9 years ago
|
</div>
|
||
|
</div>
|
||
9 years ago
|
<small class="col-lg-10 col-lg-offset-2">You will have to restart after changing the port.</small>
|
||
|
<div class="form-group">
|
||
|
<label for="SearchForMovies" class="col-lg-2 control-label">Search for Movies</label>
|
||
|
<div class="col-lg-10 checkbox">
|
||
|
<label>
|
||
|
@if (Model.SearchForMovies)
|
||
|
{
|
||
|
<input type="checkbox" id="SearchForMovies" name="SearchForMovies" checked="checked">
|
||
|
}
|
||
|
else
|
||
|
{
|
||
9 years ago
|
<input type="checkbox" id="SearchForMovies" name="SearchForMovies">
|
||
9 years ago
|
}
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="form-group">
|
||
|
<label for="SearchForTvShows" class="col-lg-2 control-label">Search for TV Shows</label>
|
||
|
<div class="col-lg-10 checkbox">
|
||
|
<label>
|
||
|
@if (Model.SearchForTvShows)
|
||
|
{
|
||
|
<input type="checkbox" id="SearchForTvShows" name="SearchForTvShows" checked="checked">
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<input type="checkbox" id="SearchForTvShows" name="SearchForTvShows">
|
||
|
}
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="form-group">
|
||
|
<label for="WeeklyRequestLimit" class="col-lg-2 control-label">Weekly Request Limit</label>
|
||
|
<div class="col-lg-10 checkbox">
|
||
|
<label>
|
||
|
<input type="number" id="WeeklyRequestLimit" name="WeeklyRequestLimit" value="@Model.WeeklyRequestLimit">
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
9 years ago
|
|
||
|
<div class="form-group">
|
||
|
<label for="authToken" class="col-lg-2 control-label">Plex Authorization Token</label>
|
||
|
<div class="col-lg-10">
|
||
9 years ago
|
<input type="text" class="form-control" id="authToken" name="PlexAuthToken" placeholder="Plex Auth Token" value="@Model.PlexAuthToken">
|
||
9 years ago
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="form-group">
|
||
9 years ago
|
<label for="username" class="col-lg-2 control-label">Username and Password</label>
|
||
9 years ago
|
<div class="col-lg-4">
|
||
9 years ago
|
<input type="text" class="form-control" id="username" name="Username" placeholder="Username">
|
||
9 years ago
|
</div>
|
||
|
<div class="col-lg-4 col-lg-push-1">
|
||
9 years ago
|
<input type="password" class="form-control" id="password" name="Password" placeholder="Password">
|
||
9 years ago
|
</div>
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
|
<div class="col-lg-10 col-lg-offset-2">
|
||
|
<button id="requestToken" class="btn btn-primary">Request Token</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
9 years ago
|
<div class="form-group">
|
||
|
<label for="userAuth" class="col-lg-2 control-label">Enable User Authentication</label>
|
||
9 years ago
|
<div class="col-lg-4 checkbox">
|
||
|
<label>
|
||
|
@if (Model.UserAuthentication)
|
||
|
{
|
||
|
<input type="checkbox" id="userAuth" name="UserAuthentication" checked="checked">
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<input type="checkbox" id="userAuth" name="UserAuthentication">
|
||
|
}
|
||
|
</label>
|
||
9 years ago
|
</div>
|
||
|
</div>
|
||
9 years ago
|
<br />
|
||
|
<br />
|
||
|
<small class="col-lg-offset-2">Current users that are allowed to authenticate: </small>
|
||
|
<br />
|
||
|
<br />
|
||
9 years ago
|
<div class="form-group">
|
||
9 years ago
|
<select id="users" multiple="" class="col-lg-10 col-lg-offset-2"></select>
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
|
<br />
|
||
|
<br />
|
||
9 years ago
|
<div class="col-lg-10 col-lg-offset-2">
|
||
|
<button id="refreshUsers" class="btn btn-primary">Refresh Users</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
9 years ago
|
<br />
|
||
|
<br />
|
||
|
<br />
|
||
|
<br />
|
||
9 years ago
|
<div>
|
||
|
</div>
|
||
9 years ago
|
<div class="form-group">
|
||
|
<div class="col-lg-10 col-lg-offset-2">
|
||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</fieldset>
|
||
|
</form>
|
||
|
</div>
|
||
|
|
||
|
|
||
9 years ago
|
<script>
|
||
|
$(function () {
|
||
|
|
||
9 years ago
|
if ($('#PlexAuthToken')) {
|
||
9 years ago
|
loadUserList();
|
||
9 years ago
|
}
|
||
9 years ago
|
|
||
9 years ago
|
$('#refreshUsers').click(function () {
|
||
9 years ago
|
loadUserList();
|
||
|
});
|
||
|
|
||
9 years ago
|
$('#requestToken').click(function (e) {
|
||
9 years ago
|
e.preventDefault();
|
||
9 years ago
|
var $form = $("#mainForm");
|
||
|
$.ajax({
|
||
|
type: $form.prop("method"),
|
||
|
url: "admin/requestauth",
|
||
|
data: $form.serialize(),
|
||
|
dataType: "json",
|
||
|
success: function (response) {
|
||
|
console.log(response);
|
||
9 years ago
|
if (response.result === true) {
|
||
9 years ago
|
generateNotify("Success!", "success");
|
||
|
$('#authToken').val(response.authToken);
|
||
|
} else {
|
||
9 years ago
|
generateNotify(response.message, "warning");
|
||
9 years ago
|
}
|
||
|
},
|
||
|
error: function (e) {
|
||
|
console.log(e);
|
||
|
generateNotify("Something went wrong!", "danger");
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
9 years ago
|
|
||
|
|
||
|
function loadUserList() {
|
||
|
$.ajax({
|
||
|
type: "Get",
|
||
|
url: "admin/getusers",
|
||
|
dataType: "json",
|
||
|
success: function (response) {
|
||
9 years ago
|
if (response.length > 1) {
|
||
|
response.each(function(user) {
|
||
|
$('#users').append("<option>" + user + "</option>");
|
||
|
});
|
||
|
} else {
|
||
|
$('#users').append("<option>No Users!</option>");
|
||
|
}
|
||
9 years ago
|
},
|
||
|
error: function (e) {
|
||
|
console.log(e);
|
||
|
generateNotify("Something went wrong!", "danger");
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
9 years ago
|
});
|
||
|
</script>
|