File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
services/static-webserver/client/source/class/osparc/task Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,16 @@ qx.Class.define("osparc.task.TaskUI", {
9393 row : 1
9494 } ) ;
9595 break ;
96+ case "progress" :
97+ control = new qx . ui . basic . Label ( "" ) . set ( {
98+ alignY : "middle" ,
99+ } ) ;
100+ this . _add ( control , {
101+ column : 2 ,
102+ row : 0 ,
103+ rowSpan : 2
104+ } ) ;
105+ break ;
96106 case "stop" :
97107 control = new qx . ui . basic . Image ( "@MaterialIcons/close/16" ) . set ( {
98108 width : 25 ,
@@ -101,7 +111,7 @@ qx.Class.define("osparc.task.TaskUI", {
101111 alignY : "middle"
102112 } ) ;
103113 this . _add ( control , {
104- column : 2 ,
114+ column : 3 ,
105115 row : 0 ,
106116 rowSpan : 2
107117 } ) ;
@@ -111,6 +121,14 @@ qx.Class.define("osparc.task.TaskUI", {
111121 } ,
112122
113123 __applyTask : function ( task ) {
124+ task . addListener ( "updateReceived" , e => {
125+ const data = e . getData ( ) ;
126+ if ( data [ "task_progress" ] && "percent" in data [ "task_progress" ] ) {
127+ const progress = data [ "task_progress" ] [ "percent" ] ;
128+ this . getChildControl ( "progress" ) . setValue ( progress * 100 + "%" ) ;
129+ }
130+ } , this ) ;
131+
114132 const stopButton = this . getChildControl ( "stop" ) ;
115133 task . bind ( "abortHref" , stopButton , "visibility" , {
116134 converter : abortHref => abortHref ? "visible" : "excluded"
You can’t perform that action at this time.
0 commit comments