Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show task progress in visualizer workers tab. #2932

Merged
merged 2 commits into from
May 19, 2020
Merged
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
12 changes: 11 additions & 1 deletion luigi/static/visualiser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ <h3 class="box-title">{{name}}</h3>
<th>Name</th>
<th>Priority</th>
<th>Resources</th>
<th>Progress</th>
<th>Time</th>
<th>Actions</th>
</thead>
Expand All @@ -223,8 +224,17 @@ <h3 class="box-title">{{name}}</h3>
<td>{{displayName}}</td>
<td>{{priority}}</td>
<td>{{resources}}</td>
<td>
{{#progressPercentage}}
<div class="progress">
<div class="progress-bar taskProgressBar" role="progressbar" data-task-id="{{taskId}}" style="width: {{progressPercentage}}%" aria-valuenow="{{progressPercentage}}" aria-valuemin="0" aria-valuemax="100">{{progressPercentage}}%</div>
</div>
{{/progressPercentage}}
{{^progressPercentage}}-{{/progressPercentage}}
</td>
<td>{{displayTime}}</td>
<td><a href="#tab=graph&taskId={{encodedTaskId}}" class="btn btn-info btn-xs" title="View graph" data-toggle="tooltip" data-action="drawGraph"><i class="fa fa-sitemap"/></a>
<td>
<a href="#tab=graph&taskId={{encodedTaskId}}" class="btn btn-info btn-xs" title="View graph" data-toggle="tooltip" data-action="drawGraph"><i class="fa fa-sitemap"/></a>
{{#trackingUrl}}<a target="_blank" href="{{trackingUrl}}" class="btn btn-primary btn-xs" title="Track Progress" data-toggle="tooltip"><i class="fa fa-eye"></i></a>{{/trackingUrl}}
{{#statusMessage}}<button class="btn btn-primary btn-xs statusMessage" title="Status message" data-toggle="tooltip" data-task-id="{{taskId}}" data-display-name="{{displayName}}"><i class="fa fa-comment"></i></button>{{/statusMessage}}
{{^statusMessage}}
Expand Down
19 changes: 10 additions & 9 deletions luigi/static/visualiser/js/visualiserApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,16 @@ function visualiserApp(luigi) {
}
});
luigi.getTaskProgressPercentage(data.taskId, function(data) {
if (data.progressPercentage === null)
$("#statusMessageModal .progress").hide();
else {
$("#statusMessageModal .progress").show();
$("#statusMessageModal .progress-bar")
.attr('aria-valuenow', data.progressPercentage)
.text(data.progressPercentage + '%')
.css({'width': data.progressPercentage + '%'});
}
// show or hide the progress bar container in the message modal
$("#statusMessageModal .progress").toggle(data.progressPercentage !== null);

// adjust the status of both progress bars (message modal and worker list)
var value = data.progressPercentage || 0;
var progressBars = $('#statusMessageModal .progress-bar, ' +
'.worker-table tbody .taskProgressBar[data-task-id="' + data.taskId + '"]');
progressBars.attr('aria-valuenow', value)
.text(value + '%')
.css({'width': value + '%'});
});
}
},
Expand Down