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

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

There is a newer version: 0.8.0
Show newest version
$(document).ready(function () {
    $("input[name=breakdown]").change(adjustBreakdownTypeVisibility);
    adjustBreakdownTypeVisibility.call($("input[name=breakdown]:checked").get());
    loadPrincipalAclsYaml();
});

function loadPrincipalAclsYaml() {
    let principalAclsYaml = $("#principal-yaml");
    let principal = principalAclsYaml.attr("data-principal");
    $.get("api/acls/single", {principal: principal})
        .done(function (principalAcls) {
            jsonToYaml(principalAcls, function (yaml) {
                $("#principal-filename").text("acls/" + principalAcls.principal.replace(/[^\w\-.]/, "_") + ".yaml");
                principalAclsYaml.text(yaml);
            });
        });
}

function adjustBreakdownTypeVisibility() {
    let selectedVal = $(this).val();
    if (selectedVal === "cluster-rules") {
        $("#rule-clusters").hide();
        $("#cluster-rules").show();
    } else {
        $("#cluster-rules").hide();
        $("#rule-clusters").show();
    }
    $(this).closest("div ").find("label.btn").removeClass("active");
    $(this).closest("label.btn").addClass("active");
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy