Skip to content

Commit 6073c91

Browse files
authored
Merge pull request #319 from ICRAR/LIU-460
LIU-460: Fix black box zooming graph during Deploying state
2 parents 8059e41 + c9058cc commit 6073c91

File tree

1 file changed

+13
-5
lines changed
  • daliuge-engine/dlg/manager/web/static/js

1 file changed

+13
-5
lines changed

daliuge-engine/dlg/manager/web/static/js/dm.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -511,12 +511,12 @@ function drawGraphForDrops(g, drawGraph, oids, doSpecs) {
511511

512512
if (modified) {
513513
drawGraph();
514+
zoomFit();
514515
}
515516

516517
var time3 = new Date().getTime();
517518
console.log('Took %d [ms] to draw the hole thing', (time3 - time2))
518519

519-
zoomFit()
520520
}
521521

522522
function setStatusColor(status) {
@@ -580,11 +580,18 @@ function startStatusQuery(serverUrl, sessionId, selectedNode, graph_update_handl
580580
// to know when we go to RUNNING.
581581
// During RUNNING (or potentially FINISHED/CANCELLED, if the execution is
582582
// extremely fast) we need to start updating the status of the graph
583-
if (status == 3 || status == 4 || status == 5) {
583+
if (status === 3 || status === 4 || status === 5) {
584584
startGraphStatusUpdates(serverUrl, sessionId, selectedNode, delay,
585585
status_update_handler);
586586
}
587-
else if (status == 0 || status == 1 || status == 2 || status == -1) {
587+
else if (status === 0 || status === 1 || status === 2 || status === -1) {
588+
if (status === 2) {
589+
// Visualise the drops if we are trying to 'deploy' them.
590+
var keys = Object.keys(doSpecs);
591+
keys.sort();
592+
var statuses = keys.map(function (k) { return {"status": 0} });
593+
status_update_handler(statuses);
594+
}
588595
// schedule a new JSON request
589596
updateGraphDelayTimer = d3.timer(updateGraph, delay);
590597
updateGraphDelayTimerActive = true;
@@ -605,7 +612,9 @@ function startStatusQuery(serverUrl, sessionId, selectedNode, graph_update_handl
605612

606613
function _addNode(g, doSpec) {
607614

608-
if (g.hasNode(g)) {
615+
var oid = doSpec.oid;
616+
617+
if (g.hasNode(oid)) {
609618
return false;
610619
}
611620

@@ -627,7 +636,6 @@ function _addNode(g, doSpec) {
627636
notes += 'storage: ' + doSpec.storage;
628637
}
629638

630-
var oid = doSpec.oid;
631639
var html = '<div class="drop-label ' + typeShape + '" id="id_' + oid + '">';
632640
html += '<span class="notes">' + notes + '</span>';
633641
oid_date = doSpec.oid.split("_")[0];

0 commit comments

Comments
 (0)