$(function() {
|
|
var placeholders = {
|
|
email: "[email protected]",
|
|
webhook: "http://",
|
|
slack: "https://hooks.slack.com/...",
|
|
pd: "service key"
|
|
}
|
|
|
|
$("#add-check-kind").change(function() {
|
|
$(".channels-add-help p").hide();
|
|
|
|
var v = $("#add-check-kind").val();
|
|
$(".channels-add-help p." + v).show();
|
|
|
|
$("#add-check-value").attr("placeholder", placeholders[v]);
|
|
});
|
|
|
|
$(".edit-checks").click(function() {
|
|
$("#checks-modal").modal("show");
|
|
var url = $(this).attr("href");
|
|
$.ajax(url).done(function(data) {
|
|
$("#checks-modal .modal-content").html(data);
|
|
|
|
})
|
|
|
|
|
|
return false;
|
|
});
|
|
|
|
var $cm = $("#checks-modal");
|
|
$cm.on("click", "#toggle-all", function() {
|
|
var value = $(this).prop("checked");
|
|
$cm.find(".toggle").prop("checked", value);
|
|
console.log("aaa", value);
|
|
|
|
});
|
|
|
|
$(".channel-remove").click(function() {
|
|
var $this = $(this);
|
|
|
|
$("#remove-channel-form").attr("action", $this.data("url"));
|
|
$(".remove-channel-name").text($this.data("name"));
|
|
$('#remove-channel-modal').modal("show");
|
|
|
|
return false;
|
|
});
|
|
|
|
|
|
});
|