blob: d92f190aed89b00ced60b7d973f207eace52dc94 [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
Patrick Williamsc0f7c042017-02-23 20:41:17 -060024from toastergui import buildtables
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025from toastergui import typeaheads
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026from toastergui import api
Patrick Williamsc0f7c042017-02-23 20:41:17 -060027from toastergui import widgets
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028
29urlpatterns = patterns('toastergui.views',
30 # landing page
31 url(r'^landing/$', 'landing', name='landing'),
32
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050033 url(r'^builds/$',
34 tables.AllBuildsTable.as_view(template_name="builds-toastertable.html"),
35 name='all-builds'),
36
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037 # build info navigation
38 url(r'^build/(?P<build_id>\d+)$', 'builddashboard', name="builddashboard"),
Patrick Williamsc0f7c042017-02-23 20:41:17 -060039 url(r'^build/(?P<build_id>\d+)/tasks/$',
40 buildtables.BuildTasksTable.as_view(
41 template_name="buildinfo-toastertable.html"),
42 name='tasks'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044 url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', 'task', name='task'),
45
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046 url(r'^build/(?P<build_id>\d+)/recipes/$',
47 buildtables.BuiltRecipesTable.as_view(
48 template_name="buildinfo-toastertable.html"),
49 name='recipes'),
50
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051 url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)/active_tab/(?P<active_tab>\d{1})$', 'recipe', name='recipe'),
Patrick Williamsc0f7c042017-02-23 20:41:17 -060052
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', 'recipe', name='recipe'),
54 url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', 'recipe_packages', name='recipe_packages'),
55
Patrick Williamsc0f7c042017-02-23 20:41:17 -060056 url(r'^build/(?P<build_id>\d+)/packages/$',
57 buildtables.BuiltPackagesTable.as_view(
58 template_name="buildinfo-toastertable.html"),
59 name='packages'),
60
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061 url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', 'package_built_detail',
62 name='package_built_detail'),
63 url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$',
64 'package_built_dependencies', name='package_built_dependencies'),
65 url(r'^build/(?P<build_id>\d+)/package_included_detail/(?P<target_id>\d+)/(?P<package_id>\d+)$',
66 'package_included_detail', name='package_included_detail'),
67 url(r'^build/(?P<build_id>\d+)/package_included_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
68 'package_included_dependencies', name='package_included_dependencies'),
69 url(r'^build/(?P<build_id>\d+)/package_included_reverse_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
70 'package_included_reverse_dependencies', name='package_included_reverse_dependencies'),
71
Patrick Williamsc0f7c042017-02-23 20:41:17 -060072 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$',
73 buildtables.InstalledPackagesTable.as_view(
74 template_name="target.html"),
75 name='target'),
76
77
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 url(r'^dentries/build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', 'xhr_dirinfo', name='dirinfo_ajax'),
79 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo$', 'dirinfo', name='dirinfo'),
80 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo_filepath/_(?P<file_path>(?:/[^/\n]+)*)$', 'dirinfo', name='dirinfo_filepath'),
81 url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'),
82 url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'),
Patrick Williamsc0f7c042017-02-23 20:41:17 -060083 url(r'^build/(?P<build_id>\d+)/buildtime$',
84 buildtables.BuildTimeTable.as_view(
85 template_name="buildinfo-toastertable.html"),
86 name='buildtime'),
87
88 url(r'^build/(?P<build_id>\d+)/cputime$',
89 buildtables.BuildCPUTimeTable.as_view(
90 template_name="buildinfo-toastertable.html"),
91 name='cputime'),
92
93 url(r'^build/(?P<build_id>\d+)/diskio$',
94 buildtables.BuildIOTable.as_view(
95 template_name="buildinfo-toastertable.html"),
96 name='diskio'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097
98 # image information dir
99 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packagefile/(?P<packagefile_id>\d+)$',
100 'image_information_dir', name='image_information_dir'),
101
102 # build download artifact
103 url(r'^build/(?P<build_id>\d+)/artifact/(?P<artifact_type>\w+)/id/(?P<artifact_id>\w+)', 'build_artifact', name="build_artifact"),
104
105 # project URLs
106 url(r'^newproject/$', 'newproject', name='newproject'),
107
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500108 url(r'^projects/$',
109 tables.ProjectsTable.as_view(template_name="projects-toastertable.html"),
110 name='all-projects'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111
112 url(r'^project/(?P<pid>\d+)/$', 'project', name='project'),
113 url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500114 url(r'^project/(?P<pid>\d+)/builds/$',
115 tables.ProjectBuildsTable.as_view(template_name="projectbuilds-toastertable.html"),
116 name='projectbuilds'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500117
118 # the import layer is a project-specific functionality;
119 url(r'^project/(?P<pid>\d+)/importlayer$', 'importlayer', name='importlayer'),
120
121 # the table pages that have been converted to ToasterTable widget
122 url(r'^project/(?P<pid>\d+)/machines/$',
123 tables.MachinesTable.as_view(template_name="generic-toastertable-page.html"),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500124 name="projectmachines"),
125
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500126 url(r'^project/(?P<pid>\d+)/softwarerecipes/$',
127 tables.SoftwareRecipesTable.as_view(template_name="generic-toastertable-page.html"),
128 name="projectsoftwarerecipes"),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500129
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500130 url(r'^project/(?P<pid>\d+)/images/$',
131 tables.ImageRecipesTable.as_view(template_name="generic-toastertable-page.html"), name="projectimagerecipes"),
132
133 url(r'^project/(?P<pid>\d+)/customimages/$',
134 tables.CustomImagesTable.as_view(template_name="generic-toastertable-page.html"), name="projectcustomimages"),
135
136 url(r'^project/(?P<pid>\d+)/newcustomimage/$',
137 tables.NewCustomImagesTable.as_view(template_name="newcustomimage.html"),
138 name="newcustomimage"),
139
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500140 url(r'^project/(?P<pid>\d+)/layers/$',
141 tables.LayersTable.as_view(template_name="generic-toastertable-page.html"),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500142 name="projectlayers"),
143
144 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)$',
145 'layerdetails', name='layerdetails'),
146
147 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/recipes/$',
148 tables.LayerRecipesTable.as_view(template_name="generic-toastertable-page.html"),
149 { 'table_name': tables.LayerRecipesTable.__name__.lower(),
150 'title' : 'All recipes in layer' },
151 name=tables.LayerRecipesTable.__name__.lower()),
152
153 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/machines/$',
154 tables.LayerMachinesTable.as_view(template_name="generic-toastertable-page.html"),
155 { 'table_name': tables.LayerMachinesTable.__name__.lower(),
156 'title' : 'All machines in layer' },
157 name=tables.LayerMachinesTable.__name__.lower()),
158
159
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500160 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)/selectpackages/$',
161 tables.SelectPackagesTable.as_view(), name="recipeselectpackages"),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500162
163
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500164 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)$',
165 tables.SelectPackagesTable.as_view(template_name="customrecipe.html"),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500166 name="customrecipe"),
167
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500168 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipe_id>\d+)/download$',
169 'customrecipe_download',
170 name="customrecipedownload"),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500171
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500172 url(r'^project/(?P<pid>\d+)/recipe/(?P<recipe_id>\d+)$',
173 tables.PackagesTable.as_view(template_name="recipedetails.html"),
174 name="recipedetails"),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500175
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500176 # typeahead api end points
177 url(r'^xhr_typeahead/(?P<pid>\d+)/layers$',
178 typeaheads.LayersTypeAhead.as_view(), name='xhr_layerstypeahead'),
179 url(r'^xhr_typeahead/(?P<pid>\d+)/machines$',
180 typeaheads.MachinesTypeAhead.as_view(), name='xhr_machinestypeahead'),
181 url(r'^xhr_typeahead/(?P<pid>\d+)/recipes$',
182 typeaheads.RecipesTypeAhead.as_view(), name='xhr_recipestypeahead'),
183 url(r'^xhr_typeahead/projects$',
184 typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'),
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500185 url(r'^xhr_typeahead/gitrev$',
186 typeaheads.GitRevisionTypeAhead.as_view(),
187 name='xhr_gitrevtypeahead'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500188
189 url(r'^xhr_testreleasechange/(?P<pid>\d+)$', 'xhr_testreleasechange',
190 name='xhr_testreleasechange'),
191 url(r'^xhr_configvaredit/(?P<pid>\d+)$', 'xhr_configvaredit',
192 name='xhr_configvaredit'),
193
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600194 url(r'^xhr_layer/(?P<pid>\d+)/(?P<layerversion_id>\d+)$',
195 api.XhrLayer.as_view(),
196 name='xhr_layer'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500197
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500198 url(r'^xhr_layer/(?P<pid>\d+)$',
199 api.XhrLayer.as_view(),
200 name='xhr_layer'),
201
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500202 # JS Unit tests
203 url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'),
204
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500205 # image customisation functionality
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600206 url(r'^xhr_customrecipe/(?P<recipe_id>\d+)'
207 '/packages/(?P<package_id>\d+|)$',
208 api.XhrCustomRecipePackages.as_view(),
209 name='xhr_customrecipe_packages'),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500210
211 url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/$',
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600212 api.XhrCustomRecipePackages.as_view(),
213 name='xhr_customrecipe_packages'),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500214
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600215 url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$',
216 api.XhrCustomRecipeId.as_view(),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500217 name='xhr_customrecipe_id'),
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600218
219 url(r'^xhr_customrecipe/',
220 api.XhrCustomRecipe.as_view(),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500221 name='xhr_customrecipe'),
222
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500223 url(r'^xhr_buildrequest/project/(?P<pid>\d+)$',
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600224 api.XhrBuildRequest.as_view(),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500225 name='xhr_buildrequest'),
226
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600227 url(r'xhr_project/(?P<project_id>\d+)$',
228 api.XhrProject.as_view(),
229 name='xhr_project'),
230
231 url(r'xhr_build/(?P<build_id>\d+)$',
232 api.XhrBuild.as_view(),
233 name='xhr_build'),
234
235 url(r'^mostrecentbuilds$', widgets.MostRecentBuildsView.as_view(),
236 name='most_recent_builds'),
237
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500238 # default redirection
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500239 url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500240)