Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion frontend/js/helpers/metric-boxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,20 @@ class PhaseMetrics extends HTMLElement {
</div>
`;

$(this).find('.menu .item').tab();
const $tabs = $(this).find('.menu .item');

$tabs.tab({
context: $(this),
onVisible: (tab) => {
localStorage.setItem('activeMetricTab', tab);
}
});

const activeTab = localStorage.getItem('activeMetricTab');

if (activeTab) {
$tabs.tab('change tab', activeTab);
}
}
}

Expand Down
16 changes: 16 additions & 0 deletions frontend/js/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,22 @@ const fetchAndFillPhaseStatsData = async (url_params) => {
})
);

document.querySelectorAll('#runtime-sub-phases .item').forEach(node => { node.addEventListener('click', event => {
const activeTab = localStorage.getItem('activeMetricTab');

const tabName = node.getAttribute('data-tab');
const segment = document.querySelector('.ui.bottom.attached.tab.segment[data-tab="' + tabName + '"]');

if (!segment) return;

const tabs = $(segment).find('#unit-tabs .item');

if (activeTab) {
tabs.tab('change tab', activeTab);
}
});
});

renderCompareChartsForPhase(phase_stats.data, getAndShowPhase());
displayTotalChart(...buildTotalChartData(phase_stats.data));

Expand Down