|
|
@ -9,25 +9,52 @@ function generateHtmlRow(repoData) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function createOrgTable(orgName, tableContainer) |
|
|
|
var repos = []; |
|
|
|
|
|
|
|
function fetchAllRepositories(orgName, page) |
|
|
|
{ |
|
|
|
var html = ""; |
|
|
|
return new Promise(function(resolve, reject) |
|
|
|
{ |
|
|
|
queryAPIByOrg(API_REPOSITORIES + "?page=" + page, orgName, |
|
|
|
function(data) |
|
|
|
{ |
|
|
|
repos.push(...data); |
|
|
|
|
|
|
|
queryAPIByOrg(API_REPOSITORIES, orgName, |
|
|
|
function(data) |
|
|
|
{ |
|
|
|
for(var i=0; i < data.length; i++) |
|
|
|
if (data.length === 30) |
|
|
|
{ |
|
|
|
fetchAllRepositories(orgName, page + 1).then(function () |
|
|
|
{ |
|
|
|
resolve(); |
|
|
|
}) |
|
|
|
} |
|
|
|
else { |
|
|
|
resolve(); |
|
|
|
} |
|
|
|
}, |
|
|
|
function(error) |
|
|
|
{ |
|
|
|
html += generateHtmlRow(data[i]); |
|
|
|
} |
|
|
|
//console.log("Unable to load table data");
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function createOrgTable(orgName, tableContainer) |
|
|
|
{ |
|
|
|
var html = ""; |
|
|
|
|
|
|
|
$("#" + tableContainer).html(html); |
|
|
|
$('#dataTable').DataTable(); |
|
|
|
|
|
|
|
}, |
|
|
|
function(error) |
|
|
|
fetchAllRepositories(orgName, 1).then(function() |
|
|
|
{ |
|
|
|
for(var i=0; i < repos.length; i++) |
|
|
|
{ |
|
|
|
console.log("Unable to load table data"); |
|
|
|
}); |
|
|
|
html += generateHtmlRow(repos[i]); |
|
|
|
} |
|
|
|
|
|
|
|
$("#" + tableContainer).html(html); |
|
|
|
$('#dataTable').DataTable(); |
|
|
|
}).catch(function(error) |
|
|
|
{ |
|
|
|
//console.log("Unable to create table");
|
|
|
|
}); |
|
|
|
} |