mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -07:00
Added test button to Plex. That's fixed #9
This commit is contained in:
parent
fd36df091d
commit
d0bfe95402
9 changed files with 185 additions and 6 deletions
|
@ -29,6 +29,11 @@
|
|||
<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>
|
||||
<button id="testPlex" type="submit" class="btn btn-primary-outline">Test Connectivity</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
|
@ -40,3 +45,32 @@
|
|||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$('#testPlex').click(function (e) {
|
||||
e.preventDefault();
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: "/test/plex",
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#authToken').val(response.authToken);
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue