highlight when integrated_gate data is out of date

Change-Id: I2f37ddf7612f3771e34a287dd061c67a4008e680
This commit is contained in:
Sean Dague 2016-08-24 10:49:18 -04:00
parent d0bcc8fa75
commit a5192cf8c4
2 changed files with 17 additions and 0 deletions

View File

@ -55,6 +55,20 @@ function update_critical_dates(data) {
}
}
function alert_old_generated_date() {
var now = new Date();
var generated_date = Date.parse($('#generated-date').text());
var delta_hours = (now - generated_date) / 60 / 60 / 1000;
if (delta_hours > 0) {
var div = $('#generated-date');
div.css('color', 'red');
div.css('font-weight', 'bold');
var old_text = $('#generated-date').text;
div.text("Data is old: " + old_text);
}
}
function update_health(data) {
var health = $('#health');
health.text(data['status']);

View File

@ -118,3 +118,6 @@ Overall Categorization Rate: {{ rate['overall'] }}%
{% endfor %}
{% endblock %}
</div>
<script type="text/javascript">
alert_old_generated_date();
</script>