<commit_before>var tabIdx=0;
var connects = null;

function load_connections()
{
    ajax_post('/app/adapters', {}, null, null, function(data) {
        var adapters = data.adapters;
        for(var i=0; i<adapters.length; ++i)
            $('#adapter_list').append($('<option>', {
                value: adapters[i].id,
                text : adapters[i].fullName 
            }));
    });

    ajax_post('/app/connects', null, null, null, function(data) {
        connects = data.connects;
        $('#connection_list').html('');
        for(var name in connects)
            $('#connection_list').append($('<option>', {
                value: name,
                text : name 
            }));
        set_owner_list($("#adapter_list").val());
    });

    $('#adapter_list').change(function() {
        set_owner_list($("#adapter_list").val());
    });

    $('#owners_list').change(function() {
        set_conns_list($("#adapter_list").val(), $("#owners_list").val());
    });

    $('#connection_list').change(function() {
        var selectedName = $("#connection_list").val();
        document.title = pageTitlePrefix + selectedName;
        load_login_form(selectedName);
    });
}

function set_owner_list(adapter)
{
    var owners = new Object();

    $('#owners_list').empty();
    $('#owners_list').jecKill();
    set_conns_list(adapter, '');
    for(var name in connects)
        if(connects[name].adapter == adapter)
            owners[connects[name].owner] = true;
    for(var owner in owners)
        $('#owners_list').append($('<option>', {
            value: owner,
            text : owner 
        }));
    for(var name in connects)
        if(connects[name].adapter == adapter) {
            $('#owners_list option[value="'+connects[name].owner+'"]').attr("selected","selected"); 
            set_conns_list(adapter, connects[name].owner);
            break;
        }
    $('#owners_list').jec();
}

function set_conns_list(adapter, owner)
{
    $('#connection_list').empty();
    $('#connection_list').jecKill();
    for(var name in connects)
        if(connects[name].adapter == adapter && connects[name].owner == owner)
            $('#connection_list').append($('<option>', {
                value: name,<commit_msg>fix: connect box rendering issue<commit_after>var tabIdx=0;
var connects = null;

function load_connections()
{
    ajax_post('/app/adapters', {}, null, null, function(data) {
        var adapters = data.adapters;
        for(var i=0; i<adapters.length; ++i)
            $('#adapter_list').append($('<option>', {
                value: adapters[i].id,
                text : adapters[i].fullName 
            }));
        setTimeout(function() {
            ajax_post('/app/connects', null, null, null, function(data) {
                connects = data.connects;
                $('#connection_list').html('');
                for(var name in connects)
                    $('#connection_list').append($('<option>', {
                        value: name,
                        text : name 
                    }));
                set_owner_list($("#adapter_list").val());
            });
        }, 1);
    });


    $('#adapter_list').change(function() {
        set_owner_list($("#adapter_list").val());
    });

    $('#owners_list').change(function() {
        set_conns_list($("#adapter_list").val(), $("#owners_list").val());
    });

    $('#connection_list').change(function() {
        var selectedName = $("#connection_list").val();
        document.title = pageTitlePrefix + selectedName;
        load_login_form(selectedName);
    });
}

function set_owner_list(adapter)
{
    var owners = new Object();

    $('#owners_list').empty();
    $('#owners_list').jecKill();
    //set_conns_list(adapter, '');
    for(var name in connects)
        if(connects[name].adapter == adapter)
            owners[connects[name].owner] = true;
    for(var owner in owners)
        $('#owners_list').append($('<option>', {
            value: owner,
            text : owner 
        }));
    for(var name in connects)
        if(connects[name].adapter == adapter) {
            $('#owners_list option[value="'+connects[name].owner+'"]').attr("selected","selected"); 
            set_conns_list(adapter, connects[name].owner);
            break;
        }
    $('#owners_list').jec();
}

function set_conns_list(adapter, owner)
{
    $('#connection_list').empty();
    $('#connection_list').jecKill();
    for(var name in connects)
        if(connects[name].adapter == adapter && connects[name].owner == owner)
            $('#connection_list').append($('<option>', {
                value: name,
{'fraction_non_alphanumeric': 0.18305304010349288, 'fraction_numerical': 0.0010780508840017248, 'mean_word_length': 2.3985347985347985, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '725034', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1333, 'n_words': 221}