Merge lp:lava-dashboard/next into lp:lava-dashboard
- next
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Linaro Validation Team | Pending | ||
Review via email: mp+79399@code.launchpad.net |
Commit message
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 : | # |
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
1 | === modified file 'dashboard_app/extension.py' | |||
2 | --- dashboard_app/extension.py 2011-09-30 13:43:50 +0000 | |||
3 | +++ dashboard_app/extension.py 2011-10-14 12:58:30 +0000 | |||
4 | @@ -39,6 +39,12 @@ | |||
5 | 39 | def front_page_template(self): | 39 | def front_page_template(self): |
6 | 40 | return "dashboard_app/front_page_snippet.html" | 40 | return "dashboard_app/front_page_snippet.html" |
7 | 41 | 41 | ||
8 | 42 | def get_front_page_context(self): | ||
9 | 43 | from dashboard_app.models import DataReport | ||
10 | 44 | return { | ||
11 | 45 | 'report_list': DataReport.repository.filter(front_page=True) | ||
12 | 46 | } | ||
13 | 47 | |||
14 | 42 | @property | 48 | @property |
15 | 43 | def description(self): | 49 | def description(self): |
16 | 44 | return "Validation Dashboard" | 50 | return "Validation Dashboard" |
17 | @@ -56,10 +62,7 @@ | |||
18 | 56 | 62 | ||
19 | 57 | def contribute_to_settings(self, settings_module): | 63 | def contribute_to_settings(self, settings_module): |
20 | 58 | super(DashboardExtension, self).contribute_to_settings(settings_module) | 64 | super(DashboardExtension, self).contribute_to_settings(settings_module) |
25 | 59 | settings_module['INSTALLED_APPS'].extend([ | 65 | settings_module['INSTALLED_APPS'].append("linaro_django_pagination") |
22 | 60 | "linaro_django_pagination", | ||
23 | 61 | "south", | ||
24 | 62 | ]) | ||
26 | 63 | settings_module['MIDDLEWARE_CLASSES'].append( | 66 | settings_module['MIDDLEWARE_CLASSES'].append( |
27 | 64 | 'linaro_django_pagination.middleware.PaginationMiddleware') | 67 | 'linaro_django_pagination.middleware.PaginationMiddleware') |
28 | 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__), "..")) |
29 | 66 | 69 | ||
30 | === modified file 'dashboard_app/models.py' | |||
31 | --- dashboard_app/models.py 2011-09-28 02:35:22 +0000 | |||
32 | +++ dashboard_app/models.py 2011-10-14 12:58:30 +0000 | |||
33 | @@ -1276,6 +1276,10 @@ | |||
34 | 1276 | def author(self): | 1276 | def author(self): |
35 | 1277 | return self._data.get('author') | 1277 | return self._data.get('author') |
36 | 1278 | 1278 | ||
37 | 1279 | @property | ||
38 | 1280 | def front_page(self): | ||
39 | 1281 | return self._data['front_page'] | ||
40 | 1282 | |||
41 | 1279 | 1283 | ||
42 | 1280 | class ImageHealth(object): | 1284 | class ImageHealth(object): |
43 | 1281 | 1285 | ||
44 | @@ -1332,6 +1336,10 @@ | |||
45 | 1332 | since = until - datetime.timedelta(days=last_n_days) | 1336 | since = until - datetime.timedelta(days=last_n_days) |
46 | 1333 | return self.get_test_runs( | 1337 | return self.get_test_runs( |
47 | 1334 | ).select_related( | 1338 | ).select_related( |
48 | 1339 | 'denormalization', | ||
49 | 1340 | 'bundle', | ||
50 | 1341 | 'bundle__bundle_stream', | ||
51 | 1342 | 'test', | ||
52 | 1335 | ).filter( | 1343 | ).filter( |
53 | 1336 | analyzer_assigned_date__range=(since, until) | 1344 | analyzer_assigned_date__range=(since, until) |
54 | 1337 | ).order_by('-analyzer_assigned_date') | 1345 | ).order_by('-analyzer_assigned_date') |
55 | 1338 | 1346 | ||
56 | === modified file 'dashboard_app/repositories/__init__.py' | |||
57 | --- dashboard_app/repositories/__init__.py 2011-07-22 00:04:21 +0000 | |||
58 | +++ dashboard_app/repositories/__init__.py 2011-10-14 12:58:30 +0000 | |||
59 | @@ -16,9 +16,13 @@ | |||
60 | 16 | # You should have received a copy of the GNU Affero General Public License | 16 | # You should have received a copy of the GNU Affero General Public License |
61 | 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/>. |
62 | 18 | 18 | ||
63 | 19 | |||
64 | 20 | from __future__ import with_statement | ||
65 | 21 | |||
66 | 19 | import abc | 22 | import abc |
67 | 20 | import logging | 23 | import logging |
68 | 21 | import os | 24 | import os |
69 | 25 | import thread | ||
70 | 22 | 26 | ||
71 | 23 | from django.conf import settings | 27 | from django.conf import settings |
72 | 24 | 28 | ||
73 | @@ -126,19 +130,23 @@ | |||
74 | 126 | 130 | ||
75 | 127 | __metaclass__ = abc.ABCMeta | 131 | __metaclass__ = abc.ABCMeta |
76 | 128 | 132 | ||
77 | 133 | loader_lock = thread.allocate_lock() | ||
78 | 134 | |||
79 | 129 | def __init__(self): | 135 | def __init__(self): |
80 | 130 | self.item_cls = None # later patched by RepositoryItemMeta | 136 | self.item_cls = None # later patched by RepositoryItemMeta |
81 | 131 | self._items = [] | 137 | self._items = [] |
82 | 132 | self._did_load = False | 138 | self._did_load = False |
83 | 133 | 139 | ||
84 | 134 | def _queryset(self): | 140 | def _queryset(self): |
92 | 135 | # In development mode always reload repository items | 141 | # HOT FIX: use a lock while loading the stuff from disk |
93 | 136 | if getattr(settings, "DEBUG", False) is True: | 142 | with self.loader_lock: |
94 | 137 | self._did_load = False | 143 | # In development mode always reload repository items |
95 | 138 | if not self._did_load: | 144 | if getattr(settings, "DEBUG", False) is True: |
96 | 139 | self._items = [] | 145 | self._did_load = False |
97 | 140 | self._load_default() | 146 | if not self._did_load: |
98 | 141 | self._did_load = True | 147 | self._items = [] |
99 | 148 | self._load_default() | ||
100 | 149 | self._did_load = True | ||
101 | 142 | return RepositoryQuerySet(self.item_cls, self._items) | 150 | return RepositoryQuerySet(self.item_cls, self._items) |
102 | 143 | 151 | ||
103 | 144 | def all(self): | 152 | def all(self): |
104 | 145 | 153 | ||
105 | === modified file 'dashboard_app/repositories/data_report.py' | |||
106 | --- dashboard_app/repositories/data_report.py 2011-07-22 00:07:21 +0000 | |||
107 | +++ dashboard_app/repositories/data_report.py 2011-10-14 12:58:30 +0000 | |||
108 | @@ -47,6 +47,7 @@ | |||
109 | 47 | if "name" not in attrs: | 47 | if "name" not in attrs: |
110 | 48 | raise ValueError("Data report without a name") | 48 | raise ValueError("Data report without a name") |
111 | 49 | self.obj.name = attrs["name"] | 49 | self.obj.name = attrs["name"] |
112 | 50 | self.obj.front_page = attrs.get('front_page') == "yes" | ||
113 | 50 | elif name == "title" or name == "path": | 51 | elif name == "title" or name == "path": |
114 | 51 | self._start_text() | 52 | self._start_text() |
115 | 52 | 53 | ||
116 | @@ -69,7 +70,8 @@ | |||
117 | 69 | return self.item_cls( | 70 | return self.item_cls( |
118 | 70 | name=handler.obj.name, | 71 | name=handler.obj.name, |
119 | 71 | title=handler.obj.title, | 72 | title=handler.obj.title, |
121 | 72 | path=handler.obj.path) | 73 | path=handler.obj.path, |
122 | 74 | front_page=handler.obj.front_page) | ||
123 | 73 | 75 | ||
124 | 74 | 76 | ||
125 | 75 | __all__ = [ | 77 | __all__ = [ |
126 | 76 | 78 | ||
127 | === added file 'dashboard_app/static/css/dashboard.css' | |||
128 | --- dashboard_app/static/css/dashboard.css 1970-01-01 00:00:00 +0000 | |||
129 | +++ dashboard_app/static/css/dashboard.css 2011-10-14 12:58:30 +0000 | |||
130 | @@ -0,0 +1,6 @@ | |||
131 | 1 | .lava-chart { | ||
132 | 2 | width: 600px; | ||
133 | 3 | height: 250px; | ||
134 | 4 | margin: 1em auto; | ||
135 | 5 | padding: 1em; | ||
136 | 6 | } | ||
137 | 0 | 7 | ||
138 | === modified file 'dashboard_app/templates/dashboard_app/_extrahead.html' | |||
139 | --- dashboard_app/templates/dashboard_app/_extrahead.html 2011-07-13 11:07:18 +0000 | |||
140 | +++ dashboard_app/templates/dashboard_app/_extrahead.html 2011-10-14 12:58:30 +0000 | |||
141 | @@ -1,3 +1,4 @@ | |||
142 | 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"/> |
143 | 2 | <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}dashboard_app/css/dashboard.css"/> | ||
144 | 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> |
145 | 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> |
146 | 4 | 5 | ||
147 | === modified file 'dashboard_app/templates/dashboard_app/front_page_snippet.html' | |||
148 | --- dashboard_app/templates/dashboard_app/front_page_snippet.html 2011-09-19 11:20:07 +0000 | |||
149 | +++ dashboard_app/templates/dashboard_app/front_page_snippet.html 2011-10-14 12:58:30 +0000 | |||
150 | @@ -1,29 +1,13 @@ | |||
168 | 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]--> |
169 | 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> |
170 | 3 | {% for rootfs in rootfs_list %} | 3 | <script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/jquery.flot.min.js"></script> |
171 | 4 | <style type="text/css"> | 4 | <script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/jquery.dashboard.js"></script> |
172 | 5 | .column { | 5 | {% include "dashboard_app/_extrahead.html" %} |
156 | 6 | float: left; | ||
157 | 7 | width: 25em; | ||
158 | 8 | padding: 2pt; | ||
159 | 9 | } | ||
160 | 10 | .column h4 { | ||
161 | 11 | margin: 0; | ||
162 | 12 | } | ||
163 | 13 | .column ul { | ||
164 | 14 | padding: 0; | ||
165 | 15 | margin: 0 0 0 1em; | ||
166 | 16 | list-style-position: inside; | ||
167 | 17 | } | ||
173 | 18 | 6 | ||
185 | 19 | </style> | 7 | {% for report in report_list %} |
186 | 20 | <div class="column"> | 8 | <h4>{{ report }}</h4> |
187 | 21 | <h4>{{ rootfs.grouper|capfirst }}</h4> | 9 | {{ report.get_html|safe }} |
188 | 22 | <ul> | 10 | {% empty %} |
189 | 23 | {% for image_health in rootfs.list %} | 11 | <p>Currently no reports are configured for |
190 | 24 | <li><a href="{{ image_health.get_absolute_url }}">{{ image_health.rootfs_type }} + {{ image_health.hwpack_type }}</a></li> | 12 | display on the front page</p> |
191 | 25 | {% endfor %} | 13 | {% endfor %} |
181 | 26 | </ul> | ||
182 | 27 | </div> | ||
183 | 28 | {% endfor %} | ||
184 | 29 | <div style="clear:both;"></div> | ||
192 | 30 | 14 | ||
193 | === modified file 'dashboard_app/templates/dashboard_app/image_status_detail.html' | |||
194 | --- dashboard_app/templates/dashboard_app/image_status_detail.html 2011-08-19 04:06:47 +0000 | |||
195 | +++ dashboard_app/templates/dashboard_app/image_status_detail.html 2011-10-14 12:58:30 +0000 | |||
196 | @@ -110,58 +110,70 @@ | |||
197 | 110 | }); | 110 | }); |
198 | 111 | </script> | 111 | </script> |
199 | 112 | <style type="text/css"> | 112 | <style type="text/css"> |
201 | 113 | .result_0 { | 113 | .result_pass { |
202 | 114 | background-color: #3aad3a; | 114 | background-color: #3aad3a; |
203 | 115 | } | 115 | } |
204 | 116 | 116 | ||
206 | 117 | .result_1 { | 117 | .result_fail { |
207 | 118 | background-color: #ff3800; | 118 | background-color: #ff3800; |
208 | 119 | } | 119 | } |
209 | 120 | 120 | ||
211 | 121 | .result_2 { | 121 | .result_skip { |
212 | 122 | background-color: yellow; | 122 | background-color: yellow; |
213 | 123 | } | 123 | } |
214 | 124 | 124 | ||
216 | 125 | .result_3 { | 125 | .result_unknown { |
217 | 126 | background-color: #aaad9c; | 126 | background-color: #aaad9c; |
218 | 127 | } | 127 | } |
220 | 128 | 128 | ||
221 | 129 | .helper { | 129 | .helper { |
222 | 130 | float: left; | 130 | float: left; |
223 | 131 | height: 1em; | 131 | height: 1em; |
224 | 132 | margin-left: 1px; | 132 | margin-left: 1px; |
225 | 133 | } | 133 | } |
226 | 134 | |||
227 | 135 | table.special { | ||
228 | 136 | border-collapse: collapse; | ||
229 | 137 | width: 100%; | ||
230 | 138 | } | ||
231 | 139 | |||
232 | 140 | table.special th { | ||
233 | 141 | text-align: left; | ||
234 | 142 | border-bottom: 1px solid #333; | ||
235 | 143 | padding: 2pt; | ||
236 | 144 | } | ||
237 | 134 | </style> | 145 | </style> |
239 | 135 | <table style="width: 100%"> | 146 | <table class="special"> |
240 | 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 %} |
241 | 137 | {% for test_run_cluster in test_run_cluster_list %} | 148 | {% for test_run_cluster in test_run_cluster_list %} |
242 | 138 | <tr> | 149 | <tr> |
245 | 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> |
246 | 140 | >Tests ran on {{ test_run_cluster.grouper }}</th> | 151 | <th>Pass</th> |
247 | 152 | <th>Fail</th> | ||
248 | 153 | <th>Skip</th> | ||
249 | 154 | <th>Unknown</th> | ||
250 | 141 | </tr> | 155 | </tr> |
251 | 142 | {% for test_run in test_run_cluster.list %} | 156 | {% for test_run in test_run_cluster.list %} |
252 | 143 | <tr> | 157 | <tr> |
253 | 144 | {% with test_run.test_results.all.order_by as all_results %} | ||
254 | 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> |
256 | 146 | <td>{{ all_results.count }}</td> | 159 | {% with test_run.denormalization as denormalization %} |
257 | 147 | <td> | 160 | <td> |
258 | 148 | {% spaceless %} | 161 | {% spaceless %} |
272 | 149 | {% regroup all_results|dictsort:"result" by result as result_group_list %} | 162 | <div class="result_pass helper" |
273 | 150 | {% for result_group in result_group_list %} | 163 | style="width: {% widthratio denormalization.count_pass denormalization.count_all 500 %}px;"></div> |
274 | 151 | {% if result_group.list|length > 300 %} | 164 | <div class="result_fail helper" |
275 | 152 | <div class="result_{{ result_group.grouper }} helper" | 165 | style="width: {% widthratio denormalization.count_fail denormalization.count_all 500 %}px;"></div> |
276 | 153 | style="width: {% widthratio result_group.list|length all_results.count 190 %}px;"></div> | 166 | <div class="result_skip helper" |
277 | 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> |
278 | 155 | <div class="result_{{ result_group.grouper }} helper" | 168 | <div class="result_unknown helper" |
279 | 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> |
267 | 157 | {% else %} | ||
268 | 158 | <div class="result_{{ result_group.grouper }} helper" | ||
269 | 159 | style="width: {% widthratio result_group.list|length all_results.count all_results.count %}px;"></div> | ||
270 | 160 | {% endif %} | ||
271 | 161 | {% endfor %} | ||
280 | 162 | {% endspaceless %} | 170 | {% endspaceless %} |
281 | 163 | {% endwith %} | ||
282 | 164 | </td> | 171 | </td> |
283 | 172 | <td>{{ denormalization.count_pass }}</td> | ||
284 | 173 | <td>{{ denormalization.count_fail }}</td> | ||
285 | 174 | <td>{{ denormalization.count_skip }}</td> | ||
286 | 175 | <td>{{ denormalization.count_unknown }}</td> | ||
287 | 176 | {% endwith %} | ||
288 | 165 | </tr> | 177 | </tr> |
289 | 166 | {% endfor %} | 178 | {% endfor %} |
290 | 167 | {% endfor %} | 179 | {% endfor %} |
I noticed that revision 273 got here by accident. Still it's worth having :)