File tree Expand file tree Collapse file tree 4 files changed +43
-11
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 4 files changed +43
-11
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,24 @@ qx.Class.define("osparc.data.Resources", {
319319 }
320320 }
321321 } ,
322+ "jobs" : {
323+ useCache : false , // handled in osparc.store.Jobs
324+ endpoints : {
325+ getPage : {
326+ method : "GET" ,
327+ url : statics . API + "/computations/-/iterations/latest?offset={offset}&limit={limit}&order_by={orderBy}"
328+ } ,
329+ }
330+ } ,
331+ "subJobs" : {
332+ useCache : false , // handled in osparc.store.Jobs
333+ endpoints : {
334+ getPage : {
335+ method : "GET" ,
336+ url : statics . API + "/computations/{studyId}/iterations/latest/tasks?offset={offset}&limit={limit}&order_by={orderBy}"
337+ } ,
338+ }
339+ } ,
322340 "folders" : {
323341 useCache : true ,
324342 idField : "uuid" ,
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ qx.Class.define("osparc.jobs.JobInfo", {
2525 this . _setLayout ( new qx . ui . layout . VBox ( ) ) ;
2626
2727 const jobInfoViewer = this . getChildControl ( "job-info-viewer" ) ;
28- osparc . store . Jobs . getInstance ( ) . fetchJobInfo ( jobId )
28+ osparc . store . Jobs . getInstance ( ) . fetchSubJobs ( jobId )
2929 . then ( info => {
3030 jobInfoViewer . setJson ( info ) ;
3131 } ) ;
Original file line number Diff line number Diff line change @@ -33,8 +33,16 @@ qx.Class.define("osparc.store.Jobs", {
3333 } ,
3434
3535 members : {
36- fetchJobs : function ( ) {
37- return osparc . utils . Utils . fetchJSON ( "/resource/osparc/mock_jobs.json" )
36+ fetchJobs : function ( orderBy = {
37+ field : "submitted_at" ,
38+ direction : "desc"
39+ } ) {
40+ const params = {
41+ url : {
42+ orderBy : JSON . stringify ( orderBy ) ,
43+ }
44+ } ;
45+ return osparc . data . Resources . getInstance ( ) . getAllPages ( "jobs" , params )
3846 . then ( jobsData => {
3947 if ( "jobs" in jobsData ) {
4048 jobsData [ "jobs" ] . forEach ( jobData => {
@@ -46,11 +54,20 @@ qx.Class.define("osparc.store.Jobs", {
4654 . catch ( err => console . error ( err ) ) ;
4755 } ,
4856
49- fetchJobInfo : function ( jobId ) {
50- return osparc . utils . Utils . fetchJSON ( "/resource/osparc/mock_jobs.json" )
57+ fetchSubJobs : function ( studyId , orderBy = {
58+ field : "submitted_at" ,
59+ direction : "desc"
60+ } ) {
61+ const params = {
62+ url : {
63+ studyId,
64+ orderBy : JSON . stringify ( orderBy ) ,
65+ }
66+ } ;
67+ return osparc . data . Resources . getInstance ( ) . getAllPages ( "subJobs" , params )
5168 . then ( jobsData => {
52- if ( "jobs_info" in jobsData && jobId in jobsData [ "jobs_info" ] ) {
53- return jobsData [ "jobs_info" ] [ jobId ] ;
69+ if ( "jobs_info" in jobsData && studyId in jobsData [ "jobs_info" ] ) {
70+ return jobsData [ "jobs_info" ] [ studyId ] ;
5471 }
5572 return null ;
5673 } )
Original file line number Diff line number Diff line change @@ -61,10 +61,7 @@ qx.Class.define("osparc.utils.DisabledPlugins", {
6161 } ,
6262
6363 isJobsEnabled : function ( ) {
64- if ( osparc . store . StaticInfo . getInstance ( ) . isDevFeaturesEnabled ( ) && osparc . product . Utils . isS4LProduct ( ) ) {
65- return true ;
66- }
67- return false ;
64+ return osparc . store . StaticInfo . getInstance ( ) . isDevFeaturesEnabled ( ) ;
6865 } ,
6966
7067 isHypertoolsEnabled : function ( ) {
You can’t perform that action at this time.
0 commit comments