Fix for YB6538
cover Fix for YB6538
The following changes since commit c1ee6cdfde5d1fe5f38a1e8eef5b7b0dd086df95:
README: add required version for django-nvd3 (2014-03-06 13:43:30 +0200)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib roxana/YB6538
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=roxana/YB6538
Roxana Ciobanu (1):
error page/search result page: Display submission date/time
information
Post/createStatistics.py | 4 ++++ Post/getInfo.py | 3 +++ Post/parser.py | 3 ++- templates/error-details.html | 2 ++ templates/home.html | 13 +++++++++++++ templates/search-details.html | 2 ++ 6 files changed, 26 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
PATCH 1/1 error page/search result page: Display submission date/time information
Show the submission date and time for an error in the search results page as a table column and in the the error page as a definition list item in the "Error details" section.
Signed-off-by Roxana Ciobanu <[email protected]>
--- Post/createStatistics.py | 4 ++++ Post/getInfo.py | 3 +++ Post/parser.py | 3 ++- templates/error-details.html | 2 ++ templates/home.html | 13 +++++++++++++ templates/search-details.html | 2 ++ 6 files changed, 26 insertions(+), 1 deletion(-)
Post/createStatistics.py +4 -0
@@ -39,6 +39,10 @@ class Statistics: def chart_statistics(self, string): startdate = datetime.now() enddate = startdate - timedelta(days=30) + if string == "DATE": + date = Build.objects.filter(DATE__range=[enddate, startdate]).values('DATE').annotate(dcount=Count('DATE')) + items = list(date) + return self.create_statistic(items, "DATE") if string == "MACHINE": machines = Build.objects.filter(DATE__range=[enddate, startdate]).values('MACHINE').annotate(dcount=Count('MACHINE')) items = list(machines)
Post/getInfo.py +3 -0
@@ -68,6 +68,9 @@ class Info: except: pass + if category == "DATE": + build = Build.objects.filter(DATE__icontains = string) + results.append(self.getBuildFailures(build)) if category == "MACHINE": build = Build.objects.filter(MACHINE__icontains = string) results.append(self.getBuildFailures(build))
Post/parser.py +2 -1
@@ -10,6 +10,7 @@ import sys, os, json, re from Post.models import Build, BuildFailure from django.conf import settings +from django.utils import timezone from datetime import datetime class Parser:
@@ -30,7 +31,7 @@ class Parser: NAME = str(jsondata['username']) EMAIL = str(jsondata['email']) g = re.match(r'(.*): (.*)', str(BRANCH_COMMIT)) - b=Build(DATE = datetime.now(), MACHINE = MACHINE_NAME, BRANCH = g.group(1), COMMIT = str(g.group(2)), TARGET = COMPONENT, DISTRO = DISTRO, NATIVELSBSTRING = NATIVELSBSTRING, BUILD_SYS = BUILD_SYS, TARGET_SYS = TARGET_SYS, NAME = NAME, EMAIL = EMAIL) + b=Build(DATE = timezone.now(), MACHINE = MACHINE_NAME, BRANCH = g.group(1), COMMIT = str(g.group(2)), TARGET = COMPONENT, DISTRO = DISTRO, NATIVELSBSTRING = NATIVELSBSTRING, BUILD_SYS = BUILD_SYS, TARGET_SYS = TARGET_SYS, NAME = NAME, EMAIL = EMAIL) b.save() failures = jsondata['failures'] for fail in failures:
templates/error-details.html +2 -0
@@ -21,6 +21,8 @@ <div class="well"> <h2>Error details</h2> <dl class="dl-vertical"> + <dt>Submitted on:</dt> + <dd>{{ detail.BUILD.DATE|date:"d/m/y H:i"}}</dd> <dt>Task:</dt> <dd>{{ detail.TASK }}</dd> <dt>Recipe:</dt>
templates/home.html +13 -0
@@ -25,6 +25,13 @@ {% include_container "r" %} </div> </li> + <li class="span6"> + <h2>By date</h2> + <div class="thumbnail"> + <p style="display:none">{% load_chart charttype chartdata "r"%}</p> + {% include_container "r" %} + </div> + </li> </ul> </div> <div class="row-fluid">
@@ -160,6 +167,12 @@ if ($("#m").text() == ""){ + $.get('{% url statistics "DATE" %}', function(data){ + draw = modify_chart(data, "By date", "m"); + $("#m").html(draw); + }) + } + if ($("#m").text() == ""){ $.get('{% url statistics "MACHINE" %}', function(data){ draw = modify_chart(data, "By machine", "m"); $("#m").html(draw);
templates/search-details.html +2 -0
@@ -16,6 +16,7 @@ <table class="table table-bordered table-hover"> <thead> <tr> + <th>Submitted on</th> <th>Recipe</th> <th>Recipe version</th> <th>Task</th>
@@ -31,6 +32,7 @@ <tbody> {%for detail in details %} <tr> + <td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.DATE|date:"d/m/y H:i"}}</a></td> <td><a href="{% url id detail.id details.number items d %}">{{ detail.RECIPE }}</a></td> <td><a href="{% url id detail.id details.number items d %}">{{ detail.RECIPE_VERSION }}</a></td> <td><a href="{% url id detail.id details.number items d %}">{{ detail.TASK }}</a></td>
Signature · 1 line
1.9.1