All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ui.static.consumer.consumerGroupDelete.js Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
$(document).ready(function () {
    $("#deleteConsumerGroupBtn").click(deleteConsumerGroup);
});

function deleteConsumerGroup() {
    let btn = $(this);
    if (!verifyDeleteConfirm()) {
        return;
    }
    let clusterIdentifier = btn.attr("data-clusterIdentifier");
    let consumerGroupId = btn.attr("data-consumerGroupId");

    showOpProgress("Deleting consumer group on cluster...");
    let urlPath = "api/consumers/clusters/" + clusterIdentifier + "/groups/" + consumerGroupId;
    $
        .ajax(urlPath, {
            method: "DELETE"
        })
        .done(function () {
            showOpSuccess("Deletion completed with success");
        })
        .fail(function (error) {
            let errorMsg = extractErrMsg(error);
            showOpError("Deletion failed: " + errorMsg);
        });
}

function verifyDeleteConfirm() {
    let text = $("#delete-confirm").val();
    if (text !== "DELETE") {
        showOpError("You did not confirm deletion by entering DELETE correctly");
        return false;
    } else {
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy