Skip to content

Commit 0f54556

Browse files
committed
Added indicator for stale trigger updates
1 parent a8a8227 commit 0f54556

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

components/emo/js/daqcontrol.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,13 +778,17 @@ function GetHealth(pctarray, static_dir, update_time){
778778

779779
var now = new Date();
780780
var timeDiff=0;
781-
console.log("HERE!!!");
782-
console.log(update_time);
783781
if (! isNaN( update_time.getTime() ) )
784782
timeDiff = Math.abs(now.getTime() - update_time.getTime())/1000.;
785783
if(isNaN( update_time.getTime() ) || timeDiff > 300){
786784
health = health="<strong style='color:red'>Trigger not responding</strong>";
787785
image="<img src='"+static_dir+"/doom_faces/dead.png' style='width:50px' class='center-block'>";
788786
}
787+
if(timeDiff >= 30){
788+
document.getElementById("stale_header").innerHTML =
789+
"<span class='bg-danger' style='width:100%;'>Warning, values more than 1 minute old. This may or may not be an issue.</span>";
790+
}
791+
if(timeDiff < 60)
792+
document.getElementById("stale_header").innerHTML = "";
789793
return {"text": health, "image": image};
790794
}

control/templates/control/controlPanelNew.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ <h4 style="padding:3px;margin:0">
104104
<div class="grid-stack-item-content gridbox" id="triggerwindowgs">
105105
<div class="window-handle"></div>
106106
<div class="window-content" style="overflow-y:hidden">
107+
<div id="stale_header" style="width:100%"></div>
107108
<!--<div class="window-title" id="trigger_title"
108109
style="padding-top:0px;min-height:26px;height:26px;">
109110
<h4 style="padding:3px;margin:0">
@@ -164,7 +165,7 @@ <h4 style="padding:3px;margin:0">
164165
<strong>Mongodb Buffers</strong>
165166
<hr style="margin:0;padding:0;margin-bottom:5px;">
166167
<div class="row">
167-
<div class="col-xs-2"><strong>Updated:</strong></div>
168+
<div class="col-xs-2"><strong>Updated: </strong></div>
168169
<div class="col-xs-10" id="mongo_update_time"></div>
169170
<div class="col-xs-2"><strong>eb0</strong></div>
170171
<div class="col-xs-10 progress" style="margin-bottom:5px;padding:0"
@@ -518,11 +519,11 @@ <h3>Muon Veto</h3>
518519
document.getElementById("trigger_event_rate").innerHTML=parseFloat(data['rate']).toFixed(2);
519520
document.getElementById("trigger_last_collection").innerHTML=data['rname']+"("+data['rnumber']+")";
520521
var tdate = new Date(1000*(parseFloat(data['eventbuilder_info']['time'])));
521-
var ttime = tdate.getFullYear()+"."+('0'+tdate.getMonth()).slice(-2)+"."+('0'+tdate.getDate()).slice(-2)+
522+
var ttime = tdate.getFullYear()+"."+('0'+(1+tdate.getMonth())).slice(-2)+"."+('0'+tdate.getDate()).slice(-2)+
522523
" at "+('0'+tdate.getHours()).slice(-2)+":"+('0'+tdate.getMinutes()).slice(-2);
523524
document.getElementById("trigger_time").innerHTML=ttime;
524525
var docdate = new Date(1000*(parseFloat(data['time'])));
525-
var doctime = docdate.getFullYear()+"."+('0'+docdate.getMonth()).slice(-2)+"."+
526+
var doctime = docdate.getFullYear()+"."+('0'+(1+docdate.getMonth())).slice(-2)+"."+
526527
('0'+docdate.getDate()).slice(-2)+
527528
" at "+('0'+docdate.getHours()).slice(-2)+":"+
528529
('0'+docdate.getMinutes()).slice(-2);

0 commit comments

Comments
 (0)