Merge lp:lava-dashboard/next into lp:lava-dashboard

Proposed by Zygmunt Krynicki
Status: Merged
Merged at revision: 274
Proposed branch: lp:lava-dashboard/next
Merge into: lp:lava-dashboard
Diff against target: 290 lines (+88/-64)
8 files modified
dashboard_app/extension.py (+7/-4)
dashboard_app/models.py (+8/-0)
dashboard_app/repositories/__init__.py (+15/-7)
dashboard_app/repositories/data_report.py (+3/-1)
dashboard_app/static/css/dashboard.css (+6/-0)
dashboard_app/templates/dashboard_app/_extrahead.html (+1/-0)
dashboard_app/templates/dashboard_app/front_page_snippet.html (+12/-28)
dashboard_app/templates/dashboard_app/image_status_detail.html (+36/-24)
To merge this branch: bzr merge lp:lava-dashboard/next
Reviewer Review Type Date Requested Status
Linaro Validation Team Pending
Review via email: mp+79399@code.launchpad.net

Description of the change

Allow placing reports on the front page easily.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I noticed that revision 273 got here by accident. Still it's worth having :)

lp:lava-dashboard/next updated
273. By Paul Larson

Fix setup-dev-env.sh so that it works again

274. By Zygmunt Krynicki

Merge next tree

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dashboard_app/extension.py'
--- dashboard_app/extension.py 2011-09-30 13:43:50 +0000
+++ dashboard_app/extension.py 2011-10-14 12:58:30 +0000
@@ -39,6 +39,12 @@
39 def front_page_template(self):39 def front_page_template(self):
40 return "dashboard_app/front_page_snippet.html"40 return "dashboard_app/front_page_snippet.html"
4141
42 def get_front_page_context(self):
43 from dashboard_app.models import DataReport
44 return {
45 'report_list': DataReport.repository.filter(front_page=True)
46 }
47
42 @property48 @property
43 def description(self):49 def description(self):
44 return "Validation Dashboard"50 return "Validation Dashboard"
@@ -56,10 +62,7 @@
5662
57 def contribute_to_settings(self, settings_module):63 def contribute_to_settings(self, settings_module):
58 super(DashboardExtension, self).contribute_to_settings(settings_module)64 super(DashboardExtension, self).contribute_to_settings(settings_module)
59 settings_module['INSTALLED_APPS'].extend([65 settings_module['INSTALLED_APPS'].append("linaro_django_pagination")
60 "linaro_django_pagination",
61 "south",
62 ])
63 settings_module['MIDDLEWARE_CLASSES'].append(66 settings_module['MIDDLEWARE_CLASSES'].append(
64 'linaro_django_pagination.middleware.PaginationMiddleware')67 'linaro_django_pagination.middleware.PaginationMiddleware')
65 root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))68 root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))
6669
=== modified file 'dashboard_app/models.py'
--- dashboard_app/models.py 2011-09-28 02:35:22 +0000
+++ dashboard_app/models.py 2011-10-14 12:58:30 +0000
@@ -1276,6 +1276,10 @@
1276 def author(self):1276 def author(self):
1277 return self._data.get('author')1277 return self._data.get('author')
12781278
1279 @property
1280 def front_page(self):
1281 return self._data['front_page']
1282
12791283
1280class ImageHealth(object):1284class ImageHealth(object):
12811285
@@ -1332,6 +1336,10 @@
1332 since = until - datetime.timedelta(days=last_n_days)1336 since = until - datetime.timedelta(days=last_n_days)
1333 return self.get_test_runs(1337 return self.get_test_runs(
1334 ).select_related(1338 ).select_related(
1339 'denormalization',
1340 'bundle',
1341 'bundle__bundle_stream',
1342 'test',
1335 ).filter(1343 ).filter(
1336 analyzer_assigned_date__range=(since, until)1344 analyzer_assigned_date__range=(since, until)
1337 ).order_by('-analyzer_assigned_date')1345 ).order_by('-analyzer_assigned_date')
13381346
=== modified file 'dashboard_app/repositories/__init__.py'
--- dashboard_app/repositories/__init__.py 2011-07-22 00:04:21 +0000
+++ dashboard_app/repositories/__init__.py 2011-10-14 12:58:30 +0000
@@ -16,9 +16,13 @@
16# You should have received a copy of the GNU Affero General Public License16# You should have received a copy of the GNU Affero General Public License
17# along with Launch Control. If not, see <http://www.gnu.org/licenses/>.17# along with Launch Control. If not, see <http://www.gnu.org/licenses/>.
1818
19
20from __future__ import with_statement
21
19import abc22import abc
20import logging23import logging
21import os24import os
25import thread
2226
23from django.conf import settings27from django.conf import settings
2428
@@ -126,19 +130,23 @@
126130
127 __metaclass__ = abc.ABCMeta131 __metaclass__ = abc.ABCMeta
128132
133 loader_lock = thread.allocate_lock()
134
129 def __init__(self):135 def __init__(self):
130 self.item_cls = None # later patched by RepositoryItemMeta136 self.item_cls = None # later patched by RepositoryItemMeta
131 self._items = []137 self._items = []
132 self._did_load = False138 self._did_load = False
133139
134 def _queryset(self):140 def _queryset(self):
135 # In development mode always reload repository items141 # HOT FIX: use a lock while loading the stuff from disk
136 if getattr(settings, "DEBUG", False) is True:142 with self.loader_lock:
137 self._did_load = False143 # In development mode always reload repository items
138 if not self._did_load:144 if getattr(settings, "DEBUG", False) is True:
139 self._items = []145 self._did_load = False
140 self._load_default()146 if not self._did_load:
141 self._did_load = True147 self._items = []
148 self._load_default()
149 self._did_load = True
142 return RepositoryQuerySet(self.item_cls, self._items)150 return RepositoryQuerySet(self.item_cls, self._items)
143151
144 def all(self):152 def all(self):
145153
=== modified file 'dashboard_app/repositories/data_report.py'
--- dashboard_app/repositories/data_report.py 2011-07-22 00:07:21 +0000
+++ dashboard_app/repositories/data_report.py 2011-10-14 12:58:30 +0000
@@ -47,6 +47,7 @@
47 if "name" not in attrs:47 if "name" not in attrs:
48 raise ValueError("Data report without a name")48 raise ValueError("Data report without a name")
49 self.obj.name = attrs["name"]49 self.obj.name = attrs["name"]
50 self.obj.front_page = attrs.get('front_page') == "yes"
50 elif name == "title" or name == "path":51 elif name == "title" or name == "path":
51 self._start_text()52 self._start_text()
52 53
@@ -69,7 +70,8 @@
69 return self.item_cls(70 return self.item_cls(
70 name=handler.obj.name,71 name=handler.obj.name,
71 title=handler.obj.title,72 title=handler.obj.title,
72 path=handler.obj.path)73 path=handler.obj.path,
74 front_page=handler.obj.front_page)
7375
7476
75__all__ = [77__all__ = [
7678
=== added file 'dashboard_app/static/css/dashboard.css'
--- dashboard_app/static/css/dashboard.css 1970-01-01 00:00:00 +0000
+++ dashboard_app/static/css/dashboard.css 2011-10-14 12:58:30 +0000
@@ -0,0 +1,6 @@
1.lava-chart {
2 width: 600px;
3 height: 250px;
4 margin: 1em auto;
5 padding: 1em;
6}
07
=== modified file 'dashboard_app/templates/dashboard_app/_extrahead.html'
--- dashboard_app/templates/dashboard_app/_extrahead.html 2011-07-13 11:07:18 +0000
+++ dashboard_app/templates/dashboard_app/_extrahead.html 2011-10-14 12:58:30 +0000
@@ -1,3 +1,4 @@
1<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/>1<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/>
2<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}dashboard_app/css/dashboard.css"/>
2<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/FixedHeader.min.js"></script> 3<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/FixedHeader.min.js"></script>
3<script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery.dataTables.min.js"></script> 4<script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery.dataTables.min.js"></script>
45
=== modified file 'dashboard_app/templates/dashboard_app/front_page_snippet.html'
--- dashboard_app/templates/dashboard_app/front_page_snippet.html 2011-09-19 11:20:07 +0000
+++ dashboard_app/templates/dashboard_app/front_page_snippet.html 2011-10-14 12:58:30 +0000
@@ -1,29 +1,13 @@
1<p>Click on image description to see automatic QA report</p>1<!--[if IE]><script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/excanvas.min.js"></script><![endif]-->
2{% regroup dashboard.interesting_images by rootfs_type as rootfs_list %}2<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/jquery.rpc.js"></script>
3{% for rootfs in rootfs_list %}3<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/jquery.flot.min.js"></script>
4<style type="text/css">4<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/jquery.dashboard.js"></script>
5 .column {5{% include "dashboard_app/_extrahead.html" %}
6 float: left;
7 width: 25em;
8 padding: 2pt;
9 }
10 .column h4 {
11 margin: 0;
12 }
13 .column ul {
14 padding: 0;
15 margin: 0 0 0 1em;
16 list-style-position: inside;
17 }
186
19</style>7{% for report in report_list %}
20<div class="column">8<h4>{{ report }}</h4>
21 <h4>{{ rootfs.grouper|capfirst }}</h4>9{{ report.get_html|safe }}
22 <ul>10{% empty %}
23 {% for image_health in rootfs.list %}11<p>Currently no reports are configured for
24 <li><a href="{{ image_health.get_absolute_url }}">{{ image_health.rootfs_type }} + {{ image_health.hwpack_type }}</a></li>12display on the front page</p>
25 {% endfor %}13{% endfor %}
26 </ul>
27</div>
28{% endfor %}
29<div style="clear:both;"></div>
3014
=== modified file 'dashboard_app/templates/dashboard_app/image_status_detail.html'
--- dashboard_app/templates/dashboard_app/image_status_detail.html 2011-08-19 04:06:47 +0000
+++ dashboard_app/templates/dashboard_app/image_status_detail.html 2011-10-14 12:58:30 +0000
@@ -110,58 +110,70 @@
110 }); 110 });
111</script>111</script>
112<style type="text/css">112<style type="text/css">
113 .result_0 {113 .result_pass {
114 background-color: #3aad3a;114 background-color: #3aad3a;
115 }115 }
116 116
117 .result_1 {117 .result_fail {
118 background-color: #ff3800;118 background-color: #ff3800;
119 }119 }
120 120
121 .result_2 {121 .result_skip {
122 background-color: yellow;122 background-color: yellow;
123 }123 }
124 124
125 .result_3 {125 .result_unknown {
126 background-color: #aaad9c;126 background-color: #aaad9c;
127 }127 }
128128
129 .helper {129 .helper {
130 float: left;130 float: left;
131 height: 1em;131 height: 1em;
132 margin-left: 1px;132 margin-left: 1px;
133 }133 }
134
135 table.special {
136 border-collapse: collapse;
137 width: 100%;
138 }
139
140 table.special th {
141 text-align: left;
142 border-bottom: 1px solid #333;
143 padding: 2pt;
144 }
134</style>145</style>
135<table style="width: 100%">146<table class="special">
136 {% regroup recent_test_run_list by analyzer_assigned_date|date:"Y-m-d" as test_run_cluster_list %}147 {% regroup recent_test_run_list by analyzer_assigned_date|date:"Y-m-d" as test_run_cluster_list %}
137 {% for test_run_cluster in test_run_cluster_list %}148 {% for test_run_cluster in test_run_cluster_list %}
138 <tr>149 <tr>
139 <th colspan="3" style="text-align: left; border-bottom: 1px solid #333;"150 <th colspan="2">Tests ran on {{ test_run_cluster.grouper }}</th>
140 >Tests ran on {{ test_run_cluster.grouper }}</th>151 <th>Pass</th>
152 <th>Fail</th>
153 <th>Skip</th>
154 <th>Unknown</th>
141 </tr>155 </tr>
142 {% for test_run in test_run_cluster.list %}156 {% for test_run in test_run_cluster.list %}
143 <tr>157 <tr>
144 {% with test_run.test_results.all.order_by as all_results %}
145 <td><a href="{{ test_run.get_absolute_url }}">{{ test_run.test }}</a></td>158 <td><a href="{{ test_run.get_absolute_url }}">{{ test_run.test }}</a></td>
146 <td>{{ all_results.count }}</td>159 {% with test_run.denormalization as denormalization %}
147 <td>160 <td>
148 {% spaceless %}161 {% spaceless %}
149 {% regroup all_results|dictsort:"result" by result as result_group_list %}162 <div class="result_pass helper"
150 {% for result_group in result_group_list %}163 style="width: {% widthratio denormalization.count_pass denormalization.count_all 500 %}px;"></div>
151 {% if result_group.list|length > 300 %}164 <div class="result_fail helper"
152 <div class="result_{{ result_group.grouper }} helper"165 style="width: {% widthratio denormalization.count_fail denormalization.count_all 500 %}px;"></div>
153 style="width: {% widthratio result_group.list|length all_results.count 190 %}px;"></div>166 <div class="result_skip helper"
154 <div style="float: left; width: 2:0px; text-align: center">...</div>167 style="width: {% widthratio denormalization.count_skip denormalization.count_all 500 %}px;"></div>
155 <div class="result_{{ result_group.grouper }} helper"168 <div class="result_unknown helper"
156 style="width: {% widthratio result_group.list|length all_results.count 190 %}px;"></div>169 style="width: {% widthratio denormalization.count_unknown denormalization.count_all 500 %}px;"></div>
157 {% else %}
158 <div class="result_{{ result_group.grouper }} helper"
159 style="width: {% widthratio result_group.list|length all_results.count all_results.count %}px;"></div>
160 {% endif %}
161 {% endfor %}
162 {% endspaceless %}170 {% endspaceless %}
163 {% endwith %}
164 </td>171 </td>
172 <td>{{ denormalization.count_pass }}</td>
173 <td>{{ denormalization.count_fail }}</td>
174 <td>{{ denormalization.count_skip }}</td>
175 <td>{{ denormalization.count_unknown }}</td>
176 {% endwith %}
165 </tr>177 </tr>
166 {% endfor %}178 {% endfor %}
167 {% endfor %}179 {% endfor %}

Subscribers

People subscribed via source and target branches