[llvm-commits] [LNT] r166147 - in /lnt/trunk/lnt/server: reporting/dailyreport.py ui/templates/reporting/daily_report.html ui/views.py

Daniel Dunbar daniel at zuster.org
Wed Oct 17 16:18:44 PDT 2012


Author: ddunbar
Date: Wed Oct 17 18:18:43 2012
New Revision: 166147

URL: http://llvm.org/viewvc/llvm-project?rev=166147&view=rev
Log:
dailyreport: Accept num_days HTML parameter.

Modified:
    lnt/trunk/lnt/server/reporting/dailyreport.py
    lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
    lnt/trunk/lnt/server/ui/views.py

Modified: lnt/trunk/lnt/server/reporting/dailyreport.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/reporting/dailyreport.py?rev=166147&r1=166146&r2=166147&view=diff
==============================================================================
--- lnt/trunk/lnt/server/reporting/dailyreport.py (original)
+++ lnt/trunk/lnt/server/reporting/dailyreport.py Wed Oct 17 18:18:43 2012
@@ -18,7 +18,7 @@
         self.fields = list(ts.Sample.get_primary_fields())
         self.day_start_offset = datetime.timedelta(hours=day_start_offset_hours)
         self.num_comparison_runs = 10
-        self.for_mail = True
+        self.for_mail = for_mail
 
         # Computed values.
         self.next_day = None

Modified: lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html?rev=166147&r1=166146&r2=166147&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html Wed Oct 17 18:18:43 2012
@@ -59,25 +59,26 @@
 {% endmacro %}
 
 {# Generate the table showing the raw sample data. #}
-{% for field,field_results in report.result_table|reverse %}
-<h3>Result Table ({{ field.name }})</h3>
 
 {# If the report is for mail, we put the table header on each test. This is
    ugly, however it makes it much easier to inline comments in replies to the
    email. Given that is the primary purpose of the email, we trade off wasted
    space for convenience. #}
 {% macro result_header() %}
-<table border="1" style="{{ styles.table }}; width: 800px;">
+<table border="1" style="{{ styles.table }}; width: {{
+                            400 + report.num_prior_days_to_include*80}}px;">
   <thead>
     <tr>
       <th style="{{ styles.th }}; width: 100px;">Test Name</th>
-      <th style="{{ styles.th }}; width: 350px;">Machine Name</th>
+      <th style="{{ styles.th }}; width: 300px;">Machine Name</th>
 {% for i in range(report.num_prior_days_to_include)|reverse %}
       <th style="{{ styles.th }}">Day - {{i}}</th>
 {% endfor %}
   </thead>
 {% endmacro %}
 
+{% for field,field_results in report.result_table|reverse %}
+<h3>Result Table ({{ field.name }})</h3>
 {{ result_header() if not report.for_mail }}
 {% for test,visible_results in field_results %}
 {{ result_header() if report.for_mail }}
@@ -101,8 +102,8 @@
 {%   endfor %}
 {{ "</table><p>" if report.for_mail }}
 {% endfor %}
-{% endfor %}
 {{ "</table>" if not report.for_mail }}
+{% endfor %}
 
 {% if not only_html_body %}
 </body>

Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=166147&r1=166146&r2=166147&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Wed Oct 17 18:18:43 2012
@@ -803,10 +803,17 @@
 
 @v4_route("/daily_report/<int:year>/<int:month>/<int:day>")
 def v4_daily_report(year, month, day):
+    num_days_str = request.args.get('num_days')
+    if num_days_str is not None:
+        num_days = int(num_days_str)
+    else:
+        num_days = 3
+
     ts = request.get_testsuite()
 
     # Create the report object.
-    report = lnt.server.reporting.dailyreport.DailyReport(ts, year, month, day)
+    report = lnt.server.reporting.dailyreport.DailyReport(
+        ts, year, month, day, num_days)
 
     # Build the report.
     report.build()





More information about the llvm-commits mailing list