@@ -21,7 +21,7 @@ qx.Class.define("osparc.jobs.ActivityOverview", {
2121 construct : function ( projectData ) {
2222 this . base ( arguments ) ;
2323
24- this . _setLayout ( new qx . ui . layout . VBox ( 10 ) ) ;
24+ this . _setLayout ( new qx . ui . layout . VBox ( ) ) ;
2525
2626 this . __buildLayout ( projectData ) ;
2727 } ,
@@ -39,7 +39,42 @@ qx.Class.define("osparc.jobs.ActivityOverview", {
3939 } ,
4040
4141 members : {
42+ __runsTable : null ,
43+ __subRunsTable : null ,
44+
4245 __buildLayout : function ( projectData ) {
46+ const stack = new qx . ui . container . Stack ( ) ;
47+ this . _add ( stack , {
48+ flex : 1
49+ } ) ;
50+
51+ const runsHistoryLayout = this . __createRunsHistoryView ( projectData ) ;
52+ stack . add ( runsHistoryLayout ) ;
53+
54+ const tasksLayout = this . __createTasksView ( ) ;
55+ stack . add ( tasksLayout ) ;
56+
57+ this . __runsTable . addListener ( "runSelected" , e => {
58+ const project = e . getData ( ) ;
59+ if ( this . __subRunsTable ) {
60+ tasksLayout . remove ( this . __subRunsTable ) ;
61+ this . __subRunsTable = null ;
62+ }
63+ const subRunsTable = this . __subRunsTable = new osparc . jobs . SubRunsTable ( project [ "projectUuid" ] ) ;
64+ tasksLayout . add ( subRunsTable , {
65+ flex : 1
66+ } ) ;
67+ stack . setSelection ( [ tasksLayout ] ) ;
68+
69+ this . __subRunsTable . addListener ( "backToRuns" , e => {
70+ stack . setSelection ( [ runsHistoryLayout ] ) ;
71+ } ) ;
72+ } ) ;
73+ } ,
74+
75+ __createRunsHistoryView : function ( projectData ) {
76+ const runsHistoryLayout = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 10 ) ) ;
77+
4378 const runsHistoryTitleLayout = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 5 ) . set ( {
4479 alignY : "middle" ,
4580 } ) ) . set ( {
@@ -51,45 +86,41 @@ qx.Class.define("osparc.jobs.ActivityOverview", {
5186 runsHistoryTitleLayout . add ( runsHistoryTitle ) ;
5287 const runsHistoryTitleHelper = new osparc . ui . hint . InfoHint ( this . tr ( "In this table, the history of the project runs is shown." ) )
5388 runsHistoryTitleLayout . add ( runsHistoryTitleHelper ) ;
54- this . _add ( runsHistoryTitleLayout ) ;
89+ runsHistoryLayout . add ( runsHistoryTitleLayout ) ;
5590
5691 const projectUuid = projectData [ "uuid" ] ;
5792 const includeChildren = true ;
5893 const runningOnly = false ;
59- const runsTable = new osparc . jobs . RunsTable ( projectUuid , includeChildren , runningOnly ) ;
94+ const runsTable = this . __runsTable = new osparc . jobs . RunsTable ( projectUuid , includeChildren , runningOnly ) ;
6095 const columnModel = runsTable . getTableColumnModel ( ) ;
6196 // Hide project name column
6297 columnModel . setColumnVisible ( osparc . jobs . RunsTable . COLS . PROJECT_NAME . column , false ) ;
6398 // Hide cancel column
6499 columnModel . setColumnVisible ( osparc . jobs . RunsTable . COLS . ACTION_CANCEL . column , false ) ;
65- runsTable . set ( {
66- maxHeight : 250 ,
67- } )
68- this . _add ( runsTable , {
100+ runsHistoryLayout . add ( runsTable , {
69101 flex : 1
70102 } ) ;
71103
104+ return runsHistoryLayout ;
105+ } ,
106+
107+ __createTasksView : function ( ) {
108+ const tasksLayout = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 10 ) ) ;
72109
73110 const latestTasksTitleLayout = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 5 ) . set ( {
74111 alignY : "middle" ,
75112 } ) ) . set ( {
76113 paddingLeft : 10 ,
77114 } ) ;
78- const latestTasksTitle = new qx . ui . basic . Label ( this . tr ( "Latest Tasks" ) ) . set ( {
115+ const latestTasksTitle = new qx . ui . basic . Label ( this . tr ( "Tasks" ) ) . set ( {
79116 font : "text-14"
80117 } ) ;
81118 latestTasksTitleLayout . add ( latestTasksTitle ) ;
82- const latestTasksTitleHelper = new osparc . ui . hint . InfoHint ( this . tr ( "In this table, only the latest tasks or simulations are shown. If available, the logs can be downloaded." ) )
119+ const latestTasksTitleHelper = new osparc . ui . hint . InfoHint ( this . tr ( "In this table, the latest tasks or simulations of the selected run are shown. If available, the logs can be downloaded." ) )
83120 latestTasksTitleLayout . add ( latestTasksTitleHelper ) ;
84- this . _add ( latestTasksTitleLayout ) ;
85-
86- const subRunsTable = new osparc . jobs . SubRunsTable ( projectUuid , includeChildren ) ;
87- subRunsTable . set ( {
88- maxHeight : 250 ,
89- } )
90- this . _add ( subRunsTable , {
91- flex : 1 ,
92- } ) ;
121+ tasksLayout . add ( latestTasksTitleLayout ) ;
122+
123+ return tasksLayout ;
93124 } ,
94125 }
95126} ) ;
0 commit comments