diff options
-rw-r--r-- | static/index.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/static/index.js b/static/index.js index c8dd759..d9840c1 100644 --- a/static/index.js +++ b/static/index.js @@ -1,5 +1,5 @@ YUI(Yconfig).use( - 'node', 'tabview', 'datatable', 'history', 'recordset-base', 'recordset-filter', 'io', 'json', 'linaro-trivia', + 'node', 'async-queue', 'tabview', 'datatable', 'history', 'recordset-base', 'recordset-filter', 'io', 'json', 'linaro-trivia', function (Y) { var history = new Y.HistoryHash(), esubteam_tabview = new Y.TabView({ srcNode: '#esubteams' }); @@ -550,16 +550,27 @@ YUI(Yconfig).use( return results; } + console.log("Fetching jobs"); + console.log(tables); Y.io( globalConfig.jenkinsURL + "/api/json?tree=" + treeExp, { method: "GET", on: { success: function (e, response) { + console.log("Fetched jobs"); var jobs = extractJobsFromResponse(response.responseText); + console.log("Parsed jobs"); + var q = new Y.AsyncQueue(); for (var i = 0; i < tables.length; i++) { - tables[i].datafilter.newData(jobs); + // Replaced synchronous table filling with async below + //tables[i].datafilter.newData(jobs); + q.add((function(i) { + return function() { tables[i].datafilter.newData(jobs); } + })(i)); } + q.run(); + console.log("Populated job tables"); } } } |