@@ -248,8 +248,10 @@ function DrawDetailWindow(url, params, header_template, header_div,
248248function GetColor ( string ) {
249249 if ( string == "transferred" || string == "processing" )
250250 return "#36bc98" ;
251- if ( string == "transferring" || string == "checking" || string == "verifying" )
251+ if ( string == "transferring" )
252252 return "#f9a100" ;
253+ if ( string == "checking" || string == "verifying" )
254+ return "#8f58f1" ;
253255 else
254256 return "#ec2c35" ;
255257}
@@ -260,13 +262,15 @@ function DrawCommentsWindow(data, comment_template, comments_template){
260262 Mustache . parse ( commenttemplate ) ;
261263
262264 var comments = "" ;
263- for ( i = 0 ; i < data [ 'comments' ] . length ; i += 1 ) {
264- pars = {
265- "user" : data [ 'comments' ] [ i ] [ 'user' ] ,
266- "date" : DateToString ( data [ 'comments' ] [ i ] [ 'date' ] ) ,
267- "text" : data [ 'comments' ] [ i ] [ 'text' ]
265+ if ( 'comments' in data ) {
266+ for ( i = 0 ; i < data [ 'comments' ] . length ; i += 1 ) {
267+ pars = {
268+ "user" : data [ 'comments' ] [ i ] [ 'user' ] ,
269+ "date" : DateToString ( data [ 'comments' ] [ i ] [ 'date' ] ) ,
270+ "text" : data [ 'comments' ] [ i ] [ 'text' ]
271+ }
272+ comments += ( Mustache . render ( commenttemplate , pars ) ) ;
268273 }
269- comments += ( Mustache . render ( commenttemplate , pars ) ) ;
270274 }
271275
272276 pars2 = {
@@ -355,14 +359,21 @@ function DrawTagWindow(data, tag_template, tagbutton_template){
355359 if ( "tags" in data ) {
356360 buttonhtml = "<br style='margin:1px'><div style='width:100%'>" ;
357361 for ( var i = 0 ; i < data [ 'tags' ] . length ; i += 1 ) {
362+ user = "autotagger" ;
363+ if ( 'user' in data [ 'tags' ] [ i ] && data [ 'tags' ] [ i ] [ 'user' ] != "" &&
364+ data [ 'tags' ] [ i ] [ 'user' ] != null )
365+ user = data [ 'tags' ] [ i ] [ 'user' ] ;
358366 bargs = {
359367 "tagname" : data [ 'tags' ] [ i ] [ 'name' ] ,
360368 'oid' : data [ '_id' ] [ '$oid' ] ,
361369 'detector' : data [ 'detector' ] ,
362370 'name' : data [ 'name' ] ,
371+ 'user' : user ,
363372 'hideifnotme' : 'style="display:none"'
364373 } ;
365- if ( document . whoami == data [ 'tags' ] [ i ] [ 'user' ] )
374+ console . log ( document . whoami ) ;
375+ if ( document . whoami == data [ 'tags' ] [ i ] [ 'user' ] ||
376+ document . whoami == "coderre" )
366377 bargs [ 'hideifnotme' ] = "style='display:inline;'" ;
367378 buttonhtml += Mustache . render ( tagbuttontemplate , bargs ) ;
368379 }
@@ -400,38 +411,42 @@ function GetDataState(data){
400411 for ( i = 0 ; i < data . length ; i += 1 ) {
401412 if ( ! ( data [ i ] [ 'host' ] in hosts ) )
402413 continue ;
403- if ( data [ i ] [ 'status' ] == 'error' || hosts [ data [ i ] [ 'host' ] ] == 5 )
404- hosts [ data [ i ] [ 'host' ] ] = 5 ;
414+ if ( data [ i ] [ 'status' ] == 'error' || hosts [ data [ i ] [ 'host' ] ] == 6 )
415+ hosts [ data [ i ] [ 'host' ] ] = 6 ;
405416 else if ( data [ i ] [ 'type' ] == 'raw' || data [ i ] [ 'type' ] == 'untriggered' ) {
406417 if ( ( data [ i ] [ 'status' ] == 'transferring' ||
407418 data [ i ] [ 'status' ] == 'verifying' )
408- && hosts [ data [ i ] [ 'host' ] ] == 0 )
409- hosts [ data [ i ] [ 'host' ] ] = 1 ;
419+ && hosts [ data [ i ] [ 'host' ] ] == 0 ) {
420+ if ( data [ i ] [ 'status' ] == 'verifying' )
421+ hosts [ data [ i ] [ 'host' ] ] = 2 ;
422+ else
423+ hosts [ data [ i ] [ 'host' ] ] = 1 ;
424+ }
410425 else if ( data [ i ] [ 'status' ] == 'transferred' &&
411- ( hosts [ data [ i ] [ 'host' ] ] < 2 ) )
412- hosts [ data [ i ] [ 'host' ] ] = 2 ;
426+ ( hosts [ data [ i ] [ 'host' ] ] < 3 ) )
427+ hosts [ data [ i ] [ 'host' ] ] = 3 ;
413428 }
414429 else if ( data [ i ] [ 'type' ] == 'processed' ) {
415430 if ( data [ i ] [ 'status' ] == 'transferring' ||
416431 data [ i ] [ 'status' ] == 'verifying' )
417- hosts [ data [ i ] [ 'host' ] ] = 3 ;
418- else if ( data [ i ] [ 'status' ] == 'transferred' )
419432 hosts [ data [ i ] [ 'host' ] ] = 4 ;
433+ else if ( data [ i ] [ 'status' ] == 'transferred' )
434+ hosts [ data [ i ] [ 'host' ] ] = 5 ;
420435 }
421436 } // end for
422437 // Adjust DAQ
423- if ( hosts [ 'xe1t-datamanager' ] == 2 ||
438+ if ( hosts [ 'xe1t-datamanager' ] == 3 ||
424439 ( hosts [ 'xe1t-datamanager' ] == 1 && hosts [ 'reader' ] == 0 ) )
425- hosts [ 'reader' ] = 2 ;
440+ hosts [ 'reader' ] = 3 ;
426441
427442 // Now create the html glyphicon glyphicon-stop
428443 html = "" ;
429- colors = [ "#ff0000" , "#ffcc00" , "#006600" , "#000099" ,
430- "#3399ff" , "#ff6600" ] ;
431- genstatus = [ "No data" , "Transferring" , "Transferred" ,
432- "Processing" , "Processed" , "Error" ] ;
433- daqstatus = [ "Untriggered" , "Triggering" , "Triggered" ,
434- "Processing" , "Processed" , "Error" ] ;
444+ colors = [ "#ff0000" , "#ffcc00" , "#9652f1" , "# 006600", "#000099" ,
445+ "#3399ff" , "#ff6600" , "#9652F1" ] ;
446+ genstatus = [ "No data" , "Transferring" , "Verifying" , " Transferred",
447+ "Processing" , "Processed" , "Error" , "Verifying" ] ;
448+ daqstatus = [ "Untriggered" , "Triggering" , "Triggered" , "Verified" ,
449+ "Processing" , "Processed" , "Error" , "Verifying" ] ;
435450 for ( host in hosts ) {
436451 status = genstatus [ hosts [ host ] ] ;
437452 type = "glyphicon-stop" ;
0 commit comments