summaryrefslogtreecommitdiffstats
path: root/reports/brpt
diff options
context:
space:
mode:
authorJoey Hagedorn <hagedorn@mcs.anl.gov>2006-06-29 20:36:29 +0000
committerJoey Hagedorn <hagedorn@mcs.anl.gov>2006-06-29 20:36:29 +0000
commitb6abd64675d8debff887da53b623410466f552e1 (patch)
treeaa1f5bef88b5fbe509b4c5e4dc0fe1da3aff8249 /reports/brpt
parentb0c589fcf1902fbe330f433a1b60833286245fcc (diff)
downloadbcfg2-b6abd64675d8debff887da53b623410466f552e1.tar.gz
bcfg2-b6abd64675d8debff887da53b623410466f552e1.tar.bz2
bcfg2-b6abd64675d8debff887da53b623410466f552e1.zip
provided easy-calendar-selection for historical reporting
features in timing report; to be implemented in remaining reports git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1905 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'reports/brpt')
-rw-r--r--reports/brpt/reports/templates/base.html2
-rw-r--r--reports/brpt/reports/templates/displays/timing.html19
-rw-r--r--reports/brpt/reports/views.py29
-rw-r--r--reports/brpt/urls.py3
4 files changed, 30 insertions, 23 deletions
diff --git a/reports/brpt/reports/templates/base.html b/reports/brpt/reports/templates/base.html
index db242864e..5c2430c3a 100644
--- a/reports/brpt/reports/templates/base.html
+++ b/reports/brpt/reports/templates/base.html
@@ -15,7 +15,7 @@
<div id="branding">
<h1>Bcfg2 Reporting System</h1>
</div>
- <div id="user-tools">...Reporting into the future...</div>
+ <div id="user-tools">...Change is Coming...</div>
</div>
<div id="sidebar">
{% block sidebar %}
diff --git a/reports/brpt/reports/templates/displays/timing.html b/reports/brpt/reports/templates/displays/timing.html
index c3573851a..758eb4cc9 100644
--- a/reports/brpt/reports/templates/displays/timing.html
+++ b/reports/brpt/reports/templates/displays/timing.html
@@ -1,9 +1,10 @@
{% extends "base.html" %}
{% block extra_header_info %}
-<script type="text/javascript" src="/site_media/sorttable.js">
-</script>{% endblock%}
-{% comment %} THIS ABOVE PART MAY BE SITE DEPENDENT-- CHANGE {% endcomment %}
+<script type="text/javascript" src="/site_media/sorttable.js"></script>
+<script type="text/javascript" src="/site_media/CalendarPopup.js"></script>
+<script language="JavaScript">var cal = new CalendarPopup();</script>
+{% endblock%}
{% block title %}Display Index Listing{% endblock %}
{% block content %}
@@ -12,6 +13,18 @@
<span class="notebox">Report Run @ {% now "F j, Y P"%}</span>
</div>
<br/>
+<div>
+<span class="mini-date">
+<form name="timestamp-select">
+<input type="text" name="date1" value="{{timestamp_date}}" size=10>@
+<!--#If there is a timestamp-date and timestamp-time, set it to that, otherwise, now-->
+<input type="text" name="time" value="{{timestamp_time}}" size=8>
+<a href="" onClick="cal.select(document.forms['timestamp-select'].date1,'anchor1','yyyy-MM-dd'); return false;"
+ name="anchor1" ID="anchor1">Calendar</A>
+<input type="button" name="go" value="Go" onClick="location.href='/displays/timing/'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;" />
+ | <input type="button" name="now" value="Now" onClick="location.href='/displays/timing/';"/>
+</form>
+</span><br/><br/></div>
<center>
<table id="t1" class="sortable">
<tr>
diff --git a/reports/brpt/reports/views.py b/reports/brpt/reports/views.py
index 274a5cec9..695e91ab2 100644
--- a/reports/brpt/reports/views.py
+++ b/reports/brpt/reports/views.py
@@ -50,12 +50,13 @@ def display_timing(request, timestamp = None):
#+------+-------+----------------+-----------+---------+----------------+-------+
client_list = Client.objects.all().order_by('name')
stats_list = []
- #Try to parse timestamp, if it has an @ symbol, replace it with a space and pass it.
- #sanity check it too.
- #else, justcall it with nothing....
- #use a popup calendar !
- results = Performance.objects.performance_per_client('2006-07-07 00:00:00')
+ if not timestamp == None:
+ results = Performance.objects.performance_per_client(timestamp.replace("@"," "))
+ else:
+ results = Performance.objects.performance_per_client()
+ timestamp = datetime.now().isoformat('@')
+
for client in client_list:#Go explicitly to an interaction ID! (new item in dictionary)
try:
d = results[client.name]
@@ -92,21 +93,13 @@ def display_timing(request, timestamp = None):
except:
dict_unit["total"] = "n/a"
- #make sure all is formatted as such: #.##
stats_list.append(dict_unit)
-
-
- from django.db import connection
- for q in connection.queries:
- print q
-
-
-
-
-
-
- return render_to_response('displays/timing.html',{'client_list': client_list, 'stats_list': stats_list})
+ return render_to_response('displays/timing.html',{'client_list': client_list,
+ 'stats_list': stats_list,
+ 'timestamp' : timestamp,
+ 'timestamp_date' : timestamp[:10],
+ 'timestamp_time' : timestamp[11:19]})
def display_index(request):
return render_to_response('displays/index.html')
diff --git a/reports/brpt/urls.py b/reports/brpt/urls.py
index 3f284cc6c..9f6a42522 100644
--- a/reports/brpt/urls.py
+++ b/reports/brpt/urls.py
@@ -12,7 +12,8 @@ urlpatterns = patterns('',
(r'^displays/sys-view/$','brpt.reports.views.display_sys_view'),
(r'^displays/summary/$','brpt.reports.views.display_summary'),
- (r'^displays/timing/$','brpt.reports.views.display_timing'),
+ (r'^displays/timing/(?P<timestamp>(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])@([01][0-9]|2[0-3]):([0-5][0-9]|60):([0-5][0-9]|60))/$','brpt.reports.views.display_timing'),
+ (r'^displays/timing/$','brpt.reports.views.display_timing'),
(r'^displays/$','brpt.reports.views.display_index'),
# Uncomment this for admin: