Skip to content

Commit

Permalink
Merge pull request #1997 from tyge68/issue/#1994
Browse files Browse the repository at this point in the history
#1994 Fixing to fallback in case of local execution
  • Loading branch information
cyberw authored Feb 4, 2022
2 parents b5c5226 + 6b4b3a7 commit b14464c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions locust/static/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ function _getTasks_div(root, title) {
return taskDiv
}

function renderTasks(data) {
var tasks = $('#tasks .tasks');
tasks.empty();
tasks.append(_getTasks_div(data.per_class, 'Ratio per User class'));
tasks.append(_getTasks_div(data.total, 'Total ratio'));
}

function updateTasks() {
$.get('/tasks', function (data) {
var tasks = $('#tasks .tasks');
tasks.empty();
tasks.append(_getTasks_div(data.per_class, 'Ratio per User class'));
tasks.append(_getTasks_div(data.total, 'Total ratio'));
renderTasks(data);
}).fail(function() {
// fallback issue #1994
renderTasks($('#tasks .tasks').data('tasks'));
});
}
updateTasks();

0 comments on commit b14464c

Please sign in to comment.