=== modified file 'dashboard_app/__init__.py'
@@ -20,4 +20,4 @@
Dashboard Application (package)
"""
-__version__ = (0, 6, 0, "beta", 1)
+__version__ = (0, 6, 0, "beta", 2)
=== modified file 'dashboard_app/models.py'
@@ -1026,8 +1026,10 @@
return Template(self._get_raw_html())
def _get_html_template_context(self):
+ from django.conf import settings
return Context({
- "API_URL": reverse("dashboard_app.views.dashboard_xml_rpc_handler")
+ "API_URL": reverse("dashboard_app.views.dashboard_xml_rpc_handler"),
+ "STATIC_URL": settings.STATIC_URL
})
def get_html(self):
=== removed file 'dashboard_app/static/css/demo_table_jui.css'
@@ -1,516 +0,0 @@
-/*
- * File: demo_table_jui.css
- * CVS: $Id$
- * Description: CSS descriptions for DataTables demo pages
- * Author: Allan Jardine
- * Created: Tue May 12 06:47:22 BST 2009
- * Modified: $Date$ by $Author$
- * Language: CSS
- * Project: DataTables
- *
- * Copyright 2009 Allan Jardine. All Rights Reserved.
- *
- * ***************************************************************************
- * DESCRIPTION
- *
- * The styles given here are suitable for the demos that are used with the standard DataTables
- * distribution (see www.datatables.net). You will most likely wish to modify these styles to
- * meet the layout requirements of your site.
- *
- * Common issues:
- * 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is
- * no conflict between the two pagination types. If you want to use full_numbers pagination
- * ensure that you either have "example_alt_pagination" as a body class name, or better yet,
- * modify that selector.
- * Note that the path used for Images is relative. All images are by default located in
- * ../images/ - relative to this CSS file.
- */
-
-
-/*
- * jQuery UI specific styling
- */
-
-.paging_two_button .ui-button {
- float: left;
- cursor: pointer;
- * cursor: hand;
-}
-
-.paging_full_numbers .ui-button {
- padding: 2px 6px;
- margin: 0;
- cursor: pointer;
- * cursor: hand;
-}
-
-.dataTables_paginate .ui-button {
- margin-right: -0.1em !important;
-}
-
-.paging_full_numbers {
- width: 350px !important;
-}
-
-.dataTables_wrapper .ui-toolbar {
- padding: 5px;
-}
-
-.dataTables_paginate {
- width: auto;
-}
-
-.dataTables_info {
- padding-top: 3px;
-}
-
-table.display thead th {
- padding: 3px 0px 3px 10px;
- cursor: pointer;
- * cursor: hand;
-}
-
-div.dataTables_wrapper .ui-widget-header {
- font-weight: normal;
-}
-
-
-/*
- * Sort arrow icon positioning
- */
-table.display thead th div.DataTables_sort_wrapper {
- position: relative;
- padding-right: 20px;
- padding-right: 20px;
-}
-
-table.display thead th div.DataTables_sort_wrapper span {
- position: absolute;
- top: 50%;
- margin-top: -8px;
- right: 0;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Everything below this line is the same as demo_table.css. This file is
- * required for 'cleanliness' of the markup
- *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables features
- */
-
-.dataTables_wrapper {
- position: relative;
- min-height: 302px;
- _height: 302px;
- clear: both;
-}
-
-.dataTables_processing {
- position: absolute;
- top: 0px;
- left: 50%;
- width: 250px;
- margin-left: -125px;
- border: 1px solid #ddd;
- text-align: center;
- color: #999;
- font-size: 11px;
- padding: 2px 0;
-}
-
-.dataTables_length {
- width: 40%;
- float: left;
-}
-
-.dataTables_filter {
- width: 50%;
- float: right;
- text-align: right;
-}
-
-.dataTables_info {
- width: 50%;
- float: left;
-}
-
-.dataTables_paginate {
- float: right;
- text-align: right;
-}
-
-/* Pagination nested */
-.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next {
- height: 19px;
- width: 19px;
- margin-left: 3px;
- float: left;
-}
-
-.paginate_disabled_previous {
- background-image: url('../images/back_disabled.jpg');
-}
-
-.paginate_enabled_previous {
- background-image: url('../images/back_enabled.jpg');
-}
-
-.paginate_disabled_next {
- background-image: url('../images/forward_disabled.jpg');
-}
-
-.paginate_enabled_next {
- background-image: url('../images/forward_enabled.jpg');
-}
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables display
- */
-table.display {
- margin: 0 auto;
- width: 100%;
- clear: both;
- border-collapse: collapse;
-}
-
-table.display tfoot th {
- padding: 3px 0px 3px 10px;
- font-weight: bold;
- font-weight: normal;
-}
-
-table.display tr.heading2 td {
- border-bottom: 1px solid #aaa;
-}
-
-table.display td {
- padding: 3px 10px;
-}
-
-table.display td.center {
- text-align: center;
-}
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables sorting
- */
-
-.sorting_asc {
- background: url('../images/sort_asc.png') no-repeat center right;
-}
-
-.sorting_desc {
- background: url('../images/sort_desc.png') no-repeat center right;
-}
-
-.sorting {
- background: url('../images/sort_both.png') no-repeat center right;
-}
-
-.sorting_asc_disabled {
- background: url('../images/sort_asc_disabled.png') no-repeat center right;
-}
-
-.sorting_desc_disabled {
- background: url('../images/sort_desc_disabled.png') no-repeat center right;
-}
-
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables row classes
- */
-table.display tr.odd.gradeA {
- background-color: #ddffdd;
-}
-
-table.display tr.even.gradeA {
- background-color: #eeffee;
-}
-
-
-
-
-table.display tr.odd.gradeA {
- background-color: #ddffdd;
-}
-
-table.display tr.even.gradeA {
- background-color: #eeffee;
-}
-
-table.display tr.odd.gradeC {
- background-color: #ddddff;
-}
-
-table.display tr.even.gradeC {
- background-color: #eeeeff;
-}
-
-table.display tr.odd.gradeX {
- background-color: #ffdddd;
-}
-
-table.display tr.even.gradeX {
- background-color: #ffeeee;
-}
-
-table.display tr.odd.gradeU {
- background-color: #ddd;
-}
-
-table.display tr.even.gradeU {
- background-color: #eee;
-}
-
-
-tr.odd {
- background-color: #E2E4FF;
-}
-
-tr.even {
- background-color: white;
-}
-
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Misc
- */
-.dataTables_scroll {
- clear: both;
-}
-
-.top, .bottom {
- padding: 15px;
- background-color: #F5F5F5;
- border: 1px solid #CCCCCC;
-}
-
-.top .dataTables_info {
- float: none;
-}
-
-.clear {
- clear: both;
-}
-
-.dataTables_empty {
- text-align: center;
-}
-
-tfoot input {
- margin: 0.5em 0;
- width: 100%;
- color: #444;
-}
-
-tfoot input.search_init {
- color: #999;
-}
-
-td.group {
- background-color: #d1cfd0;
- border-bottom: 2px solid #A19B9E;
- border-top: 2px solid #A19B9E;
-}
-
-td.details {
- background-color: #d1cfd0;
- border: 2px solid #A19B9E;
-}
-
-
-.example_alt_pagination div.dataTables_info {
- width: 40%;
-}
-
-.paging_full_numbers span.paginate_button,
- .paging_full_numbers span.paginate_active {
- border: 1px solid #aaa;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- padding: 2px 5px;
- margin: 0 3px;
- cursor: pointer;
- *cursor: hand;
-}
-
-.paging_full_numbers span.paginate_button {
- background-color: #ddd;
-}
-
-.paging_full_numbers span.paginate_button:hover {
- background-color: #ccc;
-}
-
-.paging_full_numbers span.paginate_active {
- background-color: #99B3FF;
-}
-
-table.display tr.even.row_selected td {
- background-color: #B0BED9;
-}
-
-table.display tr.odd.row_selected td {
- background-color: #9FAFD1;
-}
-
-
-/*
- * Sorting classes for columns
- */
-/* For the standard odd/even */
-tr.odd td.sorting_1 {
- background-color: #D3D6FF;
-}
-
-tr.odd td.sorting_2 {
- background-color: #DADCFF;
-}
-
-tr.odd td.sorting_3 {
- background-color: #E0E2FF;
-}
-
-tr.even td.sorting_1 {
- background-color: #EAEBFF;
-}
-
-tr.even td.sorting_2 {
- background-color: #F2F3FF;
-}
-
-tr.even td.sorting_3 {
- background-color: #F9F9FF;
-}
-
-
-/* For the Conditional-CSS grading rows */
-/*
- Colour calculations (based off the main row colours)
- Level 1:
- dd > c4
- ee > d5
- Level 2:
- dd > d1
- ee > e2
- */
-tr.odd.gradeA td.sorting_1 {
- background-color: #c4ffc4;
-}
-
-tr.odd.gradeA td.sorting_2 {
- background-color: #d1ffd1;
-}
-
-tr.odd.gradeA td.sorting_3 {
- background-color: #d1ffd1;
-}
-
-tr.even.gradeA td.sorting_1 {
- background-color: #d5ffd5;
-}
-
-tr.even.gradeA td.sorting_2 {
- background-color: #e2ffe2;
-}
-
-tr.even.gradeA td.sorting_3 {
- background-color: #e2ffe2;
-}
-
-tr.odd.gradeC td.sorting_1 {
- background-color: #c4c4ff;
-}
-
-tr.odd.gradeC td.sorting_2 {
- background-color: #d1d1ff;
-}
-
-tr.odd.gradeC td.sorting_3 {
- background-color: #d1d1ff;
-}
-
-tr.even.gradeC td.sorting_1 {
- background-color: #d5d5ff;
-}
-
-tr.even.gradeC td.sorting_2 {
- background-color: #e2e2ff;
-}
-
-tr.even.gradeC td.sorting_3 {
- background-color: #e2e2ff;
-}
-
-tr.odd.gradeX td.sorting_1 {
- background-color: #ffc4c4;
-}
-
-tr.odd.gradeX td.sorting_2 {
- background-color: #ffd1d1;
-}
-
-tr.odd.gradeX td.sorting_3 {
- background-color: #ffd1d1;
-}
-
-tr.even.gradeX td.sorting_1 {
- background-color: #ffd5d5;
-}
-
-tr.even.gradeX td.sorting_2 {
- background-color: #ffe2e2;
-}
-
-tr.even.gradeX td.sorting_3 {
- background-color: #ffe2e2;
-}
-
-tr.odd.gradeU td.sorting_1 {
- background-color: #c4c4c4;
-}
-
-tr.odd.gradeU td.sorting_2 {
- background-color: #d1d1d1;
-}
-
-tr.odd.gradeU td.sorting_3 {
- background-color: #d1d1d1;
-}
-
-tr.even.gradeU td.sorting_1 {
- background-color: #d5d5d5;
-}
-
-tr.even.gradeU td.sorting_2 {
- background-color: #e2e2e2;
-}
-
-tr.even.gradeU td.sorting_3 {
- background-color: #e2e2e2;
-}
-
-/*
- * Row highlighting example
- */
-.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted {
- background-color: #ECFFB3;
-}
-
-.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted {
- background-color: #E6FF99;
-}
=== modified file 'dashboard_app/templates/dashboard_app/_extrahead.html'
@@ -1,3 +1,3 @@
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava/css/demo_table_jui.css"/>
-<script type="text/javascript" src="{{ STATIC_URL }}js/FixedHeader.min.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}lava/js/jquery.dataTables.min.js"></script>
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/>
+<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/FixedHeader.min.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery.dataTables.min.js"></script>
=== modified file 'dashboard_app/templates/dashboard_app/api.html'
@@ -4,43 +4,27 @@
{% block title %}
-{{ block.super }} | {% trans "XML-RPC API" %}
+{{ block.super }} | {% trans "Dashboard" %} | {% trans "API Help (deprecated)" %}
{% endblock %}
{% block extrahead %}
{{ block.super }}
-<script type="text/javascript" src="{{ STATIC_URL }}lava/js/jquery-1.5.1.min.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}lava/js/jquery-ui-1.8.12.custom.min.js"></script>
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava/css/Aristo/jquery-ui-1.8.7.custom.css"/>
+<script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery-1.5.1.min.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery-ui-1.8.12.custom.min.js"></script>
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/Aristo/jquery-ui-1.8.7.custom.css"/>
{% endblock %}
{% block breadcrumbs %}
-<li><a href="{% url dashboard_app.views.dashboard_xml_rpc_handler %}">{% trans "XML-RPC API" %}</a></li>
+<li><a href="{% url dashboard_app.views.index %}">{% trans "Dashboard" %}</a></li>
+<li><a href="{% url dashboard_app.views.dashboard_xml_rpc_handler %}">{% trans "API Help (deprecated)" %}</a></li>
{% endblock %}
{% block content %}
-<h2>About XML-RPC API</h2>
-<p>This URL is an XML-RPC server. You can interact with it using any XML-RPC
-client. For example, in python you can do this:</p>
-<pre>
-import xmlrpclib
-server = xmlrpclib.ServerProxy("{{ dashboard_url }}{% url dashboard_app.views.dashboard_xml_rpc_handler %}")
-print server.version()
-</pre>
-<p>The rest of this page is an automatically generated documentation of the
-available functions.</p>
-
-<h2>Available functions</h2>
-<div id="accordion">
- {% for method in methods %}
- <h3><a href="#{{method.name}}">{{ method.name }}</a></h3>
- <div>{{ method.help|restructuredtext }}</div>
- {% endfor %}
-</div>
-<script type="text/javascript">
- $(function(){ $('#accordion').accordion({ navigation: true, active: false, collapsible: true}) });
-</script>
+<h2>Depracation notice</h2>
+<p>Dashboard has a separate, deprecated, XML-RPC handler. You should refrain
+from using it. Instead please see the <a href="{% url lava.api_help %}"
+ >LAVA Server API Help</a> which provides API services to all services</p>
{% endblock %}
=== modified file 'dashboard_app/templates/dashboard_app/bundle_detail.html'
@@ -6,7 +6,7 @@
{% block extrahead %}
{{ block.super }}
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/pygments.css"/>
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}dashboard_app/css/pygments.css"/>
{% endblock %}
=== modified file 'dashboard_app/templates/dashboard_app/report_detail.html'
@@ -6,11 +6,11 @@
{% block extrahead %}
{{ block.super }}
-<!--[if IE]><script type="text/javascript" src="{{ STATIC_URL }}js/excanvas.min.js"></script><![endif]-->
-<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.rpc.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.flot.min.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.dashboard.js"></script>
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/pygments.css"/>
+<!--[if IE]><script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/excanvas.min.js"></script><![endif]-->
+<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/jquery.rpc.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/jquery.flot.min.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}dashboard_app/js/jquery.dashboard.js"></script>
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}dashboard_app/css/pygments.css"/>
{% endblock %}
=== modified file 'dashboard_app/templates/dashboard_app/test_run_hardware_context.html'
@@ -38,7 +38,7 @@
/* Insert a 'details' column to the table */
var nCloneTh = document.createElement('th');
var nCloneTd = document.createElement('td');
- nCloneTd.innerHTML = '<img src="{{ STATIC_URL }}images/details_open.png">';
+ nCloneTd.innerHTML = '<img src="{{ STATIC_URL }}dashboard_app/images/details_open.png">';
nCloneTd.className = "center";
$('#hardware_devices thead tr').each( function () {
@@ -66,11 +66,11 @@
var nTr = this.parentNode.parentNode;
if (this.src.match('details_close')) {
/* This row is already open - close it */
- this.src = "{{ STATIC_URL }}images/details_open.png";
+ this.src = "{{ STATIC_URL }}dashboard_app/images/details_open.png";
oTable.fnClose(nTr);
} else {
/* Open this row */
- this.src = "{{ STATIC_URL }}images/details_close.png";
+ this.src = "{{ STATIC_URL }}dashboard_app/images/details_close.png";
oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'details');
}
});
=== modified file 'dashboard_app/tests/__init__.py'
@@ -29,7 +29,6 @@
'views.bundle_stream_list_view',
'views.test_run_detail_view',
'views.test_run_list_view',
- 'views.xml_rpc_handler',
]
def load_tests_from_submodules(_locals):
=== modified file 'dashboard_app/tests/other/csrf.py'
@@ -29,7 +29,6 @@
from django.template import Template, RequestContext
from dashboard_app.tests.utils import CSRFTestCase
-from dashboard_app.views import dashboard_xml_rpc_handler
from dashboard_app import urls
@@ -61,7 +60,7 @@
def test_csrf_not_protecting_xml_rpc_views(self):
"""call version and check that we didn't get 403"""
- endpoint_path = reverse(dashboard_xml_rpc_handler)
+ endpoint_path = reverse('dashboard_app.views.dashboard_xml_rpc_handler')
request_body = xmlrpclib.dumps((), methodname="version")
response = self.client.post(endpoint_path, request_body, "text/xml")
self.assertContains(response, "<methodResponse>", status_code=200)
=== removed file 'dashboard_app/tests/views/xml_rpc_handler.py'
@@ -1,34 +0,0 @@
-# Copyright (C) 2010 Linaro Limited
-#
-# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
-#
-# This file is part of Launch Control.
-#
-# Launch Control is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License version 3
-# as published by the Free Software Foundation
-#
-# Launch Control is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Launch Control. If not, see <http://www.gnu.org/licenses/>.
-
-"""
-Unit tests for dashboard_app.views.dashboard_xml_rpc_handler
-"""
-
-from django.core.urlresolvers import reverse
-from django.template import RequestContext
-from django_testscenarios.ubertest import TestCase
-
-
-class XMLRPCViewsTests(TestCase):
-
- def test_request_context_was_used(self):
- url = reverse("dashboard_app.views.dashboard_xml_rpc_handler")
- response = self.client.get(url)
- # This is ugly because response.context is a list
- self.assertTrue(any((isinstance(context, RequestContext) for context in response.context)))
=== modified file 'dashboard_app/urls.py'
@@ -21,6 +21,8 @@
"""
from django.conf.urls.defaults import *
+from dashboard_app.xmlrpc import legacy_mapper
+import linaro_django_xmlrpc.views
urlpatterns = patterns(
'dashboard_app.views',
@@ -33,7 +35,16 @@
url(r'^reports/(?P<name>[a-zA-Z0-9-_]+)/$', 'report_detail'),
url(r'^tests/$', 'test_list'),
url(r'^tests/(?P<test_id>[^/]+)/$', 'test_detail'),
- url(r'^xml-rpc/', 'dashboard_xml_rpc_handler'),
+ url(r'^xml-rpc/$', linaro_django_xmlrpc.views.handler,
+ name='dashboard_app.views.dashboard_xml_rpc_handler',
+ kwargs={
+ 'mapper': legacy_mapper,
+ 'help_view': 'dashboard_app.views.dashboard_xml_rpc_help'}),
+ url(r'^xml-rpc/help/$', linaro_django_xmlrpc.views.help,
+ name='dashboard_app.views.dashboard_xml_rpc_help',
+ kwargs={
+ 'mapper': legacy_mapper,
+ 'template_name': 'dashboard_app/api.html'}),
url(r'^streams/$', 'bundle_stream_list'),
url(r'^streams(?P<pathname>/[a-zA-Z0-9/_-]+)bundles/$', 'bundle_list'),
url(r'^streams(?P<pathname>/[a-zA-Z0-9/_-]+)bundles/(?P<content_sha1>[0-9a-z]+)/$', 'bundle_detail'),
=== modified file 'dashboard_app/views.py'
@@ -83,13 +83,6 @@
raise Http404('No %s matches the given query.' % queryset.model._meta.object_name)
-@csrf_exempt
-def dashboard_xml_rpc_handler(request):
- from dashboard_app.xmlrpc import legacy_mapper
- from linaro_django_xmlrpc.views import handler
- return handler(request, legacy_mapper)
-
-
@BreadCrumb("Dashboard")
def index(request):
return render_to_response(
=== modified file 'setup.py'
@@ -54,7 +54,7 @@
'lava-server >= 0.2.1',
'linaro-dashboard-bundle >= 1.5.2',
'linaro-django-pagination >= 2.0.2',
- 'linaro-django-xmlrpc >= 0.3.2',
+ 'linaro-django-xmlrpc >= 0.4',
'linaro-json >= 2.0.1', # TODO: use json-schema-validator
'pygments >= 1.2',
'south >= 0.7.3',