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

ui.static.acls-js.deletePrincipal.js Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
$(document).ready(function () {
    $("#delete-principal-btn").click(deletePrincipalAcls);
});

function deletePrincipalAcls() {
    let principal = $(this).attr("data-principal");
    doDeletePrincipalAcls(principal);
}

function doDeletePrincipalAcls(principal) {
    let deleteMessage = $("#delete-message").val();
    if (deleteMessage.trim() === "") {
        showOpError("Please specify delete reason");
        return;
    }
    showOpProgress("Deleting topic...");
    $
        .ajax("api/acls?principal=" + encodeURI(principal) + "&message=" + encodeURI(deleteMessage) + "&" + targetBranchUriParam(), {
            method: "DELETE"
        })
        .done(function () {
            showOpSuccess("Principal is successfully deleted from registry");
        })
        .fail(function (error) {
            let errorMsg = extractErrMsg(error);
            showOpError("Deletion failed: " + errorMsg);
        });
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy