Added function to report generation page to change the selection of tests based on the benchmark wanted to compare

This commit is contained in:
Gregory Ballantine 2024-06-03 13:18:38 -04:00
parent cedad0e48d
commit b4bd116367

View File

@ -1,2 +1,19 @@
$ -> $ ->
console.log('ready.') console.log('ready.')
$('#report-benchmarks').on('change', ->
url = '/api/benchmark/' + $('#report-benchmarks').val() + '/tests'
$.get(url, (data) ->
# clear old contents from the selector
$('#report-tests').empty()
# add new elements to the selector
addOption(test) for test in data
)
)
addOption = (test) ->
$('#report-tests').append(
$('<option/>')
.attr('value', test.id)
.text(test.title)
)