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

io.gatling.charts.assets.js.menu.js Maven / Gradle / Ivy

There is a newer version: 3.12.0
Show newest version
function getItemLink(item){
	return item.pathFormatted + '.html';
}

function setDetailsLinkUrl(){
    $.each(stats.contents, function (name, data) {
        $('#details_link').attr('href', getItemLink(data));
        return false;
    });
}

function menuItem(item, level, parent, group) {
    if (parent) {
      var dataParent = ' data-parent="' + ((level == 0) ? 'ROOT' : ("menu-" + parent)) + '"';
    } else {
      var dataParent = '';
    }

    if (group)
        var expandButton = ' ';
    else
        var expandButton = '';

    return '' + expandButton + '' + ellipsedLabel({ name: item.name, parentClass: "nav-tooltip", childClass: "nav-label" }) + '';
}

function menuItemsForGroup(group, level, parent) {
    var items = '';

    if (level > 0)
        items += menuItem(group, level - 1, parent, true);

    $.each(group.contents, function (contentName, content) {
        if (content.type == 'GROUP')
            items += menuItemsForGroup(content, level + 1, group.pathFormatted);
        else if (content.type == 'REQUEST')
            items += menuItem(content, level, group.pathFormatted);
    });

    return items;
}

function setDetailsMenu(){
    $('.nav ul').append(menuItemsForGroup(stats, 0));
    $('.nav').expandable();
    $('.nav-tooltip').popover({trigger:'hover'});
}

function setGlobalMenu(){
    $('.nav ul')
      .append('
  • Ranges
  • ') .append('
  • Stats
  • ') .append('
  • Active Users
  • ') .append('
  • Requests / sec
  • ') .append('
  • Responses / sec
  • '); } function getLink(link){ var a = link.split('/'); return (a.length<=1)? link : a[a.length-1]; } function expandUp(li) { const parentId = li.attr("data-parent"); if (parentId != "ROOT") { const span = $('#' + parentId); const parentLi = span.parents('li').first(); span.expand(parentLi, false); expandUp(parentLi); } } function setActiveMenu(){ $('.nav a').each(function() { const navA = $(this) if(!navA.hasClass('expand-button') && navA.attr('href') == getLink(window.location.pathname)) { const li = $(this).parents('li').first(); li.addClass('on'); expandUp(li); return false; } }); }




    © 2015 - 2024 Weber Informatics LLC | Privacy Policy