Commit 91fcd01f authored by Alexander Pace's avatar Alexander Pace
Browse files

clean up latest and reports pages

parent 17e89fe1
Pipeline #385932 passed with stages
in 18 minutes and 20 seconds
......@@ -5,26 +5,19 @@ from django.shortcuts import render
from django.conf import settings
from .models import Event, Group, Search, Pipeline
from .permission_utils import filter_events_for_user
from .permission_utils import internal_user_required
from ligoauth.decorators import internal_user_required
from django.db.models import Q
from django.urls import reverse
from django.utils.decorators import method_decorator
from .models import CoincInspiralEvent
from search.forms import SimpleSearchForm
from search.query.events import parseQuery
from django.db.models import Max, Min, Avg
from django.db.models.aggregates import StdDev
import numpy as np
import base64
import sys
from datetime import timedelta, datetime
from django.utils import timezone
import pytz
import json
from plotly.offline import plot
import plotly.graph_objects as go
......@@ -36,6 +29,8 @@ plt_title = plot_title + plot_sub_title
days_back = 7
@internal_user_required
#@method_decorator(internal_user_required(raise_exception=True),
# name='dispatch')
def histo(request):
fig = go.Figure()
......@@ -81,12 +76,16 @@ def histo(request):
aggregated_stats[-1].update({'min': pipeline_query.first().reporting_latency,
'max': pipeline_query.last().reporting_latency,
'min_gid': pipeline_query.first().graceid,
'max_gid': pipeline_query.last().graceid,})
'max_gid': pipeline_query.last().graceid,
'count': pipeline_query.count(),
})
else:
aggregated_stats[-1].update({'min': None,
'max':None,
'min_gid': None,
'max_gid': None,})
'max_gid': None,
'count': 0,
})
# The two histograms are drawn on top of another
......
{% extends "base.html" %}
{% load timeutil %}
{% load scientific %}
{% block title %}Latest{% endblock %}
{% block heading %}Latest as of {% now "j F Y H:i T" %}{% endblock %}
{% block pageid %}latest{% endblock %}
{% block jscript %}
{% if not error %}
<meta http-equiv="refresh" content="300;url={% url "eventlatest" %}/?query={{rawquery|urlencode}}">
{% endif %}
{# http/https depending on this pages' protocol #}
<script src="http{% if request.is_secure %}s{% endif %}://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js" type="text/javascript"></script>
<script type="text/javascript">
dojo.require("dojox.image.LightboxNano");
dojo.require("dojo.parser");
dojo.ready(function(){
dojo.parser.parse();
});
</script>
<style>
a:hover .dojoxEnlarge {
display: block !important;
}
.dojoxEnlarge {
/* background: url(images/enlarge.png) no-repeat 0 0; */
top: -5px;
left: -5px;
margin: 0 !important;
width: 16px;
height: 16px;
}
.dojoxLoading {
/* background: #333 url(images/loading-dark.gif) no-repeat center center; */
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: 2px solid #000;
height: 24px;
opacity: 0.8;
filter: alpha(opacity=80);
padding: 6px;
width: 24px;
}
</style>
<style>
.summary .graceid {
border-top: 1px solid #CBC9C7;
width: 100%;
font-size: 150%;
font-family: "Century Schoolbook L", "Georgia", serif;
font-weight: 700;
padding-top: 10px;
padding-bottom: 10px;
}
.summary .labels {
padding-bottom: 5px;
padding-left: 5px;
}
.summary .group {
font-weight: 500;
padding-top: 5px;
padding-bottom: 5px;
}
.summary {
clear: both;
padding: 20px;
}
.summary .skymap {
float: right;
}
.summary-data {
}
.timeselect form {
display: inline;
}
</style>
{% endblock %}
{% block content %}
<form method="POST">
<table>
{{ form.as_table }}
</table>
</form>
{% if objects %}
<table class="event">
{# {% if skyalert_authorized %} #}
<!-- <tr><td colspan="4">
<a href="{# {% url "skyalert" object.graceid %} #}"><button type="button">Submit to Skyalert</button></a>
</td></tr> -->
{# {% endif %} #}
<tr>
<th valign="top">UID</th>
<th>Labels</th>
<th>Group</th>
<th>Pipeline</th>
<th>Search</th>
<th>Instruments</th>
<th>
{{ "gps"|timeselect:"gps" }}
Event Time
</th>
<th>FAR (Hz)</th>
<th>Latency (sec)</th>
<th>
{{"created"|timeselect:"utc" }}
Created
</th>
<!-- <th></th> -->
</tr>
{% for object in objects %}
<tr class={% cycle 'odd' 'even' %}>
<td><a href="{% url "view" object.graceid %}">{{ object.graceid }}</a></td>
<td>
{% for labelling in object.labelling_set.all %}
<span title="{{labelling.creator.name}} {{labelling.created|utc}}" style="color: {{labelling.label.defaultColor}}">{{ labelling.label.name }}</span>
{% endfor %}
</td>
<td>{{ object.group.name }} </td>
<td>{{ object.pipeline.name }} </td>
<td>{{ object.search.name }} </td>
<td>{{ object.instruments }}</td>
<td>{% if object.gpstime%}
<!-- <span title="{{ object.gpstime|gpsdate }}">{{ object.gpstime }}</span> -->
{{ object.gpstime|multiTimeMicroSeconds:"gps" }}
{% endif %}</td>
<!-- this is a bug. The far should be floored for display purposes. -->
{% if user_is_external %}
{% if object.far and object.far < far_floor %}
<td>&lt; {{ far_floor|scientific }}</td>
{% else %}
<td>{{ object.far|scientific }}</td>
{% endif %}
{% else %}
<td>{{ object.far|scientific }}</td>
{% endif %}
<td style="text-align:center">{{ object.reporting_latency }}</td>
<td>{{ object.created|multiTime:"created" }}</td>
<!-- This causes browser-busting for large numbers of figures. Getting rid of it. -->
<!-- <td>
{# for log in object.eventlog_set.iterator #}
{# if log.hasImage #}
<div class="skymap">
<a href="{{ log.fileurl }}" dojoType="dojox.image.LightboxNano"><img height="50" src="{{ log.fileurl }}"></a>
</div>
{# endif #}
{# endfor #}
</td> -->
</tr>
{% endfor %}
</table>
{% else %} <!-- !objects -->
<h1>No events.</h1>
{% endif %} <!-- if objects -->
{% endblock %}
......@@ -15,10 +15,11 @@ Use for cross-checking and validation purposes only.
{% endautoescape %}
<div class="row my-3 justify-content-md-center">
<div class="col-md-6">
<div class="col-md-8">
<table class="table-hover table-condensed table-resp-gracedb shadow p-3 mb-5 rounded" style="text-align:center">
<thead>
<td> Pipeline </td>
<td> Uploads </td>
<td> Min. Latency (s) </td>
<td> Max Latency (s) </td>
<td> Avg. Latency (s) </td>
......@@ -26,7 +27,9 @@ Use for cross-checking and validation purposes only.
</thead>
{% for data in pipeline_stats %}
<tr>
<td style="font-family: monospace;"> {{data.name}} </td>
<!--<td style="font-family: monospace;"> {{data.name}} </td> -->
<td style="font-family: 'Courier New', Courier, monospace; font-size: 12px; white-space: pre;"> {{data.name}} </td>
<td> {{data.count}} </td>
<td> {% if data.min %} {{data.min|floatformat:3}}
(<a href="{% url "view" data.min_gid %}">{{ data.min_gid }}</a>)
{% endif %}
......
......@@ -18,23 +18,33 @@
{% block content %}
<h5>Latest as of {% now "j F Y H:i:s T" %} </h5> <hr>
<h3 style="font-weight:lighter; text-align:center;">Latest as of {% now "j F Y H:i:s T" %} </h3>
<hr style="width:50%;text-align:center;margin:auto;">
<p><h4 style="font-weight:lighter; text-align:center;"><span style="color:red;font-weight:bold;">New:</span> view the beta reports page located <a href="{% url "reports" %}">here</a></h4></p>
<br>
<div class="row justify-content-md-center">
<div class="col-md-6 justify-content-center">
<p>Test and MDC events and superevents are not included in the search results by default; see the <a href="/documentation/queries.html" target="_blank">query help</a> for information on how to search for events and superevents in those categories.</p>
<!-- Search form -->
<center>
<form method="GET" name="search_form">
<table>
{{ form.as_table }}
<td><center><input type="Submit" value="Search" class="btn btn-sm btn-primary"></center></td>
</table>
</form>
</center>
</div>
</div>
<br>
<div class="row my-3 justify-content-md-center">
<div class="col-md">
<h5 style="font-weight:lighter; text-align:center;"> Tap on entry for detailed information </h5>
{% if events %}
<h5> Tap on entry for detailed information </h5>
<table class="table-hover table-condensed table-resp-gracedb shadow p-3 mb-5 rounded">
<thead>
<tr>
......@@ -124,7 +134,6 @@
{% elif superevents %}
<!-- Superevent listing -->
<h5> Tap on entry for detailed information </h5>
<table class="table-hover table-condensed table-resp-gracedb shadow p-3 mb-5 rounded">
<thead>
<tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment