@ -168,7 +168,7 @@ function set_job_status(project, uuid, job, value) {
var div _job = $ ( '#' + id ) ;
if ( value ) {
console . debug ( job + ' found' ) ;
//console.debug(job + ' found');
div _job . addClass ( get _class _status ( "list-group-item-" , value . result ) ) ;
div _job . html ( '<a href="' + value . job _url + value . buildnumber
+ '">' + job + '</a>' ) ;
@ -208,7 +208,7 @@ function create_new_job_div(project, uuid, job) {
div _job . attr ( 'id' , id + '-' + job ) . html ( job ) ;
// put it on the proper place
div _job . appendTo ( '#' + id + '-list' ) ;
console . debug ( 'job ' + job + ' created for ' + project + ' uuid: ' + uuid ) ;
//console.debug('job ' + job + ' created for ' + project + ' uuid: ' + uuid);
}
/ * *
@ -281,15 +281,20 @@ function clean_uuids(release, project) {
}
}
function create _new _uuid ( release , project , uuid ) {
function create _new _uuid ( release , project , values ) {
var uuid = values . tag ;
if ( uuid == null || $ . release [ project ] . uuids . has ( uuid ) ) {
return ;
}
// no need to add to remove later
if ( ! values . latest &&
$ . release [ project ] . uuids . size > $ . release . max _uuids ) {
return ;
}
$ . release [ project ] . uuids . add ( uuid ) ;
$ . release [ project ] [ uuid ] = { failed : false , jobs : new Set ( ) , } ;
clean _uuids ( release , project ) ;
create _new _uuid _panel ( project , uuid ) ;
update _uuid _info ( release , project , uuid ) ;
set _project _status ( project , { created : true } ) ;
@ -336,53 +341,34 @@ function update_uuid_info(release, project, uuid) {
}
}
function get _latest _uuid _for _project ( release , project ) {
function showLatestUUID ( project , uuid ) {
var div _project = $ ( '#' + project ) ;
$ ( '.uuid-latest' , project ) . addClass ( 'hidden' ) ;
var div _uuid _name = $ ( '#' + project + '-' + uuid ) ;
$ ( '.uuid-latest' , div _uuid _name ) . removeClass ( 'hidden' ) ;
}
function showLatest ( project , uuid ) {
var div _project = $ ( '#' + project ) ;
$ ( '.uuid-latest' , project ) . addClass ( 'hidden' ) ;
var div _uuid _name = $ ( '#' + project + '-' + uuid ) ;
$ ( '.uuid-latest' , div _uuid _name ) . removeClass ( 'hidden' ) ;
}
function get _uuids _for _project ( release , project ) {
function successFunc ( data , textStatus , jqXHR ) {
$ ( data ) . each ( function ( ) {
if ( $ . release [ project ] . last _uuid != this . tag ) {
if ( this . latest && $ . release [ project ] . last _uuid != this . tag ) {
$ . release [ project ] . last _uuid = this . tag ;
console . debug ( project + ".latest_uuid:" + $ . release [ project ] . last _uuid ) ;
showLatest ( project , this . tag ) ;
}
} ) ;
}
function errorFunc ( jqXHR , status , error ) {
$ ( '#' + project + '-error' ) . html ( error ) ;
}
$ . ajax ( {
url : '/release/' + release + '/' + project + '/latest/?format=json' ,
method : 'GET' ,
contentType : "application/json; charset=utf-8" ,
dataType : "json" ,
success : successFunc ,
error : errorFunc
} ) ;
}
function get _uuids _for _project ( release , project ) {
function successFunc ( data , textStatus , jqXHR ) {
$ ( data ) . each ( function ( ) {
if ( ! $ . release [ project ] . uuids . has ( this . tag ) ) {
if ( ! $ . release [ project ] . removed _uuids . has ( this . tag ) ) {
create _new _uuid ( release , project , this . tag ) ;
get _latest _uuid _for _project ( release , project ) ;
}
if ( ! $ . release [ project ] . uuids . has ( this . tag ) &&
! $ . release [ project ] . removed _uuids . has ( this . tag ) )
{
create _new _uuid ( release , project , this ) ;
}
else if ( ! $ . release [ project ] [ this . tag ] . failed ) {
else if ( ! $ . release [ project ] [ this . tag ] . failed &&
! $ . release [ project ] . last _uuid == this . tag )
{
update _uuid _info ( release , project , this . tag ) ;
}
if ( this . latest ) showLatestUUID ( project , this . tag ) ;
} ) ;
clean _uuids ( release , project ) ;
}
function errorFunc ( jqXHR , status , error ) {