Updated the reports page to use the new API endpoints
This commit is contained in:
@ -1,15 +1,19 @@
|
||||
$ ->
|
||||
console.log('ready.')
|
||||
|
||||
$('#report-benchmarks').on('change', ->
|
||||
url = '/api/benchmark/' + $('#report-benchmarks').val() + '/tests'
|
||||
$.get(url, (data) ->
|
||||
$('#report-benchmarks').on 'change', ->
|
||||
try
|
||||
benchmarkSearchParams = new URLSearchParams
|
||||
benchmark_id: $('#report-benchmarks').val()
|
||||
benchmarkRes = await fetch("/api/v1/benchmark/tests?#{benchmarkSearchParams}")
|
||||
benchmarkData = await benchmarkRes.json()
|
||||
|
||||
# clear old contents from the selector
|
||||
$('#report-tests').empty()
|
||||
# add new elements to the selector
|
||||
addOption(test) for test in data
|
||||
)
|
||||
)
|
||||
addOption(test) for test in benchmarkData
|
||||
catch error
|
||||
console.error 'An error occurred while fetching benchmark results.', error
|
||||
|
||||
addOption = (test) ->
|
||||
$('#report-tests').append(
|
||||
|
Reference in New Issue
Block a user