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.
Ombi/PlexRequests.UI/Views/UserLogin/Index.cshtml

64 lines
2.1 KiB

<div class="home">
<h1>Login</h1>
<div>
<p>
Want to watch a movie or tv show but it's not currently on Plex?
Login below with your Plex.tv username and password! <span title="Your login details are only used to authenticate your Plex account."><i class="fa fa-question-circle"></i></span>
</p>
</div>
<form method="POST" id="loginForm">
<div>
<div>
<label>Plex.tv Username </label>
</div>
<div>
<input class="form-control form-control-custom" style="width: 50%" type="text" name="Username" placeholder="Username" />
</div>
</div>
<br />
@if (Model.UsePassword)
{
<div>
<div>
<label> Password </label>
</div>
<div>
<input class="form-control form-control-custom" style="width: 50%" name="Password" type="password" placeholder="Password" />
</div>
</div>
}
<br />
<button id="loginBtn" class="btn btn-success-outline" type="submit"><i class="fa fa-user fa-fw"></i> Sign In</button>
</form>
</div>
<script>
$(function () {
$('#loginBtn').click(function (e) {
e.preventDefault();
var $form = $("#loginForm");
$.ajax({
type: $form.prop("method"),
url: $form.prop("action"),
data: $form.serialize(),
dataType: "json",
success: function (response) {
console.log(response);
if (response.result === true) {
window.location.replace("/search");
} else {
generateNotify(response.message, "warning");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
});
</script>