Added test sonarr button #9

This commit is contained in:
tidusjar 2016-03-15 13:12:47 +00:00
commit c582b3eb6c
7 changed files with 118 additions and 10 deletions

View file

@ -85,10 +85,6 @@
}
});
});
});
</script>

View file

@ -74,6 +74,12 @@
</label>
</div>
</div>
<div class="form-group">
<div>
<button id="testSonarr" type="submit" class="btn btn-primary-outline">Test Connectivity</button>
</div>
</div>
<div class="form-group">
<div>
@ -183,6 +189,31 @@
});
});
$('#testSonarr').click(function (e) {
e.preventDefault();
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
url: "/test/sonarr",
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>