Skip to content

Commit

Permalink
#1994 Fixing to fallback in case of local execution
Browse files Browse the repository at this point in the history
  • Loading branch information
tyge68 committed Feb 4, 2022
1 parent b5c5226 commit 6b4b3a7
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 6b4b3a7

Please sign in to comment.