Skip to content

Commit

Permalink
fixed an issue with the progress bar update script being called every…
Browse files Browse the repository at this point in the history
… few seconds
  • Loading branch information
M-Wicenec committed Jul 15, 2021
1 parent de1af47 commit d563dcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions daliuge-engine/dlg/manager/web/session.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@

var status_update_handler = function(statuses)
{
console.log("status_counts");

var states = ['completed', 'finished',
'running', 'writing',
Expand Down
13 changes: 10 additions & 3 deletions daliuge-engine/dlg/manager/web/static/js/dm.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,24 +260,31 @@ function loadSessions(serverUrl, tbodyEl, refreshBtn, selectedNode, delay) {
//update status colours and hide cancel button if finished or cancelled
$(".status").each(function(){
var currentStatus = $(this).html()

if(currentStatus==="Cancelled"){
$(this).css("color","grey");
$(this).parent().find(".actions").find("button").hide();
$(this).parent().removeClass("progressRunning")
}else if(currentStatus==="Deploying"){
$(this).css("color","blue");
$(this).parent().removeClass("progressRunning")
}
else if (currentStatus==="Running") {
console.log("hi")
$(this).text("");
$(this).parent().find(".actions").find("button").show();
$(this).append("<svg>")
startStatusQuery(serverUrl, $(this).parent().find(".id").text(), selectedNode, graph_update_handler,
status_update_handler, 1000);
if(!$(this).parent().hasClass('progressRunning')){
startStatusQuery(serverUrl, $(this).parent().find(".id").text(), selectedNode, graph_update_handler,
status_update_handler, 1000);
$(this).parent().addClass("progressRunning")
}
}else if (currentStatus==="Finished"){
$(this).css("color","#00af28");
$(this).parent().find(".actions").find("button").hide();
$(this).parent().removeClass("progressRunning")
}else{
$(this).css("color","purple");
$(this).parent().removeClass("progressRunning")
}
})

Expand Down

0 comments on commit d563dcd

Please sign in to comment.