blob: 46e5761443ad9085d75b3d8e37a40b5b1e64a734 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#
2# BitBake Toaster Implementation
3#
4# Copyright (C) 2013 Intel Corporation
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License version 2 as
8# published by the Free Software Foundation.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19from django.conf.urls import patterns, include, url
20from django.views.generic import RedirectView, TemplateView
21
22from django.http import HttpResponseBadRequest
23from toastergui import tables
24from toastergui import typeaheads
25
26urlpatterns = patterns('toastergui.views',
27 # landing page
28 url(r'^landing/$', 'landing', name='landing'),
29
30 url(r'^builds/$', 'builds', name='all-builds'),
31 # build info navigation
32 url(r'^build/(?P<build_id>\d+)$', 'builddashboard', name="builddashboard"),
33
34 url(r'^build/(?P<build_id>\d+)/tasks/$', 'tasks', name='tasks'),
35 url(r'^build/(?P<build_id>\d+)/tasks/(?P<task_id>\d+)/$', 'tasks_task', name='tasks_task'),
36 url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', 'task', name='task'),
37
38 url(r'^build/(?P<build_id>\d+)/recipes/$', 'recipes', name='recipes'),
39 url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)/active_tab/(?P<active_tab>\d{1})$', 'recipe', name='recipe'),
40 url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', 'recipe', name='recipe'),
41 url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', 'recipe_packages', name='recipe_packages'),
42
43 url(r'^build/(?P<build_id>\d+)/packages/$', 'bpackage', name='packages'),
44 url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', 'package_built_detail',
45 name='package_built_detail'),
46 url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$',
47 'package_built_dependencies', name='package_built_dependencies'),
48 url(r'^build/(?P<build_id>\d+)/package_included_detail/(?P<target_id>\d+)/(?P<package_id>\d+)$',
49 'package_included_detail', name='package_included_detail'),
50 url(r'^build/(?P<build_id>\d+)/package_included_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
51 'package_included_dependencies', name='package_included_dependencies'),
52 url(r'^build/(?P<build_id>\d+)/package_included_reverse_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
53 'package_included_reverse_dependencies', name='package_included_reverse_dependencies'),
54
55 # images are known as targets in the internal model
56 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', 'target', name='target'),
57 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/targetpkg$', 'targetpkg', name='targetpkg'),
58 url(r'^dentries/build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', 'xhr_dirinfo', name='dirinfo_ajax'),
59 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo$', 'dirinfo', name='dirinfo'),
60 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo_filepath/_(?P<file_path>(?:/[^/\n]+)*)$', 'dirinfo', name='dirinfo_filepath'),
61 url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'),
62 url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'),
63 url(r'^build/(?P<build_id>\d+)/buildtime$', 'buildtime', name='buildtime'),
64 url(r'^build/(?P<build_id>\d+)/cpuusage$', 'cpuusage', name='cpuusage'),
65 url(r'^build/(?P<build_id>\d+)/diskio$', 'diskio', name='diskio'),
66
67 # image information dir
68 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packagefile/(?P<packagefile_id>\d+)$',
69 'image_information_dir', name='image_information_dir'),
70
71 # build download artifact
72 url(r'^build/(?P<build_id>\d+)/artifact/(?P<artifact_type>\w+)/id/(?P<artifact_id>\w+)', 'build_artifact', name="build_artifact"),
73
74 # project URLs
75 url(r'^newproject/$', 'newproject', name='newproject'),
76
77
78 url(r'^projects/$', 'projects', name='all-projects'),
79
80 url(r'^project/(?P<pid>\d+)/$', 'project', name='project'),
81 url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'),
82 url(r'^project/(?P<pid>\d+)/builds/$', 'projectbuilds', name='projectbuilds'),
83
84 # the import layer is a project-specific functionality;
85 url(r'^project/(?P<pid>\d+)/importlayer$', 'importlayer', name='importlayer'),
86
87 # the table pages that have been converted to ToasterTable widget
88 url(r'^project/(?P<pid>\d+)/machines/$',
89 tables.MachinesTable.as_view(template_name="generic-toastertable-page.html"),
90 { 'table_name': tables.MachinesTable.__name__.lower(),
91 'title' : 'Compatible machines' },
92 name="projectmachines"),
93
94 url(r'^project/(?P<pid>\d+)/recipes/$',
95 tables.RecipesTable.as_view(template_name="generic-toastertable-page.html"),
96 { 'table_name': tables.RecipesTable.__name__.lower(),
97 'title' : 'Compatible recipes' },
98 name="projecttargets"),
99
100 url(r'^project/(?P<pid>\d+)/availablerecipes/$',
101 tables.ProjectLayersRecipesTable.as_view(template_name="generic-toastertable-page.html"),
102 { 'table_name': tables.ProjectLayersRecipesTable.__name__.lower(),
103 'title' : 'Recipes available for layers in the current project' },
104 name="projectavailabletargets"),
105
106 url(r'^project/(?P<pid>\d+)/layers/$',
107 tables.LayersTable.as_view(template_name="generic-toastertable-page.html"),
108 { 'table_name': tables.LayersTable.__name__.lower(),
109 'title' : 'Compatible layers' },
110 name="projectlayers"),
111
112 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)$',
113 'layerdetails', name='layerdetails'),
114
115 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/recipes/$',
116 tables.LayerRecipesTable.as_view(template_name="generic-toastertable-page.html"),
117 { 'table_name': tables.LayerRecipesTable.__name__.lower(),
118 'title' : 'All recipes in layer' },
119 name=tables.LayerRecipesTable.__name__.lower()),
120
121 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/machines/$',
122 tables.LayerMachinesTable.as_view(template_name="generic-toastertable-page.html"),
123 { 'table_name': tables.LayerMachinesTable.__name__.lower(),
124 'title' : 'All machines in layer' },
125 name=tables.LayerMachinesTable.__name__.lower()),
126
127
128 # typeahead api end points
129 url(r'^xhr_typeahead/(?P<pid>\d+)/layers$',
130 typeaheads.LayersTypeAhead.as_view(), name='xhr_layerstypeahead'),
131 url(r'^xhr_typeahead/(?P<pid>\d+)/machines$',
132 typeaheads.MachinesTypeAhead.as_view(), name='xhr_machinestypeahead'),
133 url(r'^xhr_typeahead/(?P<pid>\d+)/recipes$',
134 typeaheads.RecipesTypeAhead.as_view(), name='xhr_recipestypeahead'),
135 url(r'^xhr_typeahead/projects$',
136 typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'),
137
138
139
140 url(r'^xhr_testreleasechange/(?P<pid>\d+)$', 'xhr_testreleasechange',
141 name='xhr_testreleasechange'),
142 url(r'^xhr_configvaredit/(?P<pid>\d+)$', 'xhr_configvaredit',
143 name='xhr_configvaredit'),
144
145 url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'),
146 url(r'^xhr_updatelayer/$', 'xhr_updatelayer', name='xhr_updatelayer'),
147
148 # JS Unit tests
149 url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'),
150
151 # default redirection
152 url(r'^$', RedirectView.as_view( url= 'landing')),
153)