blob: e07b0efc1f83202d7b36a1d6d349d4978ceb3347 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#
2# BitBake Toaster Implementation
3#
Brad Bishopd7bf8c12018-02-25 22:55:05 -05004# Copyright (C) 2013-2017 Intel Corporation
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005#
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
Brad Bishopd7bf8c12018-02-25 22:55:05 -050019from django.conf.urls import include, url
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020from 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
Brad Bishopd7bf8c12018-02-25 22:55:05 -050028from toastergui import views
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029
Brad Bishopd7bf8c12018-02-25 22:55:05 -050030urlpatterns = [
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031 # landing page
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032 url(r'^landing/$', views.landing, name='landing'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050034 url(r'^builds/$',
35 tables.AllBuildsTable.as_view(template_name="builds-toastertable.html"),
36 name='all-builds'),
37
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038 # build info navigation
Brad Bishopd7bf8c12018-02-25 22:55:05 -050039 url(r'^build/(?P<build_id>\d+)$', views.builddashboard, name="builddashboard"),
Patrick Williamsc0f7c042017-02-23 20:41:17 -060040 url(r'^build/(?P<build_id>\d+)/tasks/$',
41 buildtables.BuildTasksTable.as_view(
42 template_name="buildinfo-toastertable.html"),
43 name='tasks'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044
Brad Bishopd7bf8c12018-02-25 22:55:05 -050045 url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', views.task, name='task'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046
Patrick Williamsc0f7c042017-02-23 20:41:17 -060047 url(r'^build/(?P<build_id>\d+)/recipes/$',
48 buildtables.BuiltRecipesTable.as_view(
49 template_name="buildinfo-toastertable.html"),
50 name='recipes'),
51
Brad Bishopd7bf8c12018-02-25 22:55:05 -050052 url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)/active_tab/(?P<active_tab>\d{1})$', views.recipe, name='recipe'),
Patrick Williamsc0f7c042017-02-23 20:41:17 -060053
Brad Bishopd7bf8c12018-02-25 22:55:05 -050054 url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', views.recipe, name='recipe'),
55 url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', views.recipe_packages, name='recipe_packages'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056
Patrick Williamsc0f7c042017-02-23 20:41:17 -060057 url(r'^build/(?P<build_id>\d+)/packages/$',
58 buildtables.BuiltPackagesTable.as_view(
59 template_name="buildinfo-toastertable.html"),
60 name='packages'),
61
Brad Bishopd7bf8c12018-02-25 22:55:05 -050062 url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', views.package_built_detail,
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063 name='package_built_detail'),
64 url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$',
Brad Bishopd7bf8c12018-02-25 22:55:05 -050065 views.package_built_dependencies, name='package_built_dependencies'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066 url(r'^build/(?P<build_id>\d+)/package_included_detail/(?P<target_id>\d+)/(?P<package_id>\d+)$',
Brad Bishopd7bf8c12018-02-25 22:55:05 -050067 views.package_included_detail, name='package_included_detail'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068 url(r'^build/(?P<build_id>\d+)/package_included_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
Brad Bishopd7bf8c12018-02-25 22:55:05 -050069 views.package_included_dependencies, name='package_included_dependencies'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070 url(r'^build/(?P<build_id>\d+)/package_included_reverse_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
Brad Bishopd7bf8c12018-02-25 22:55:05 -050071 views.package_included_reverse_dependencies, name='package_included_reverse_dependencies'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072
Patrick Williamsc0f7c042017-02-23 20:41:17 -060073 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$',
74 buildtables.InstalledPackagesTable.as_view(
75 template_name="target.html"),
76 name='target'),
77
78
Brad Bishopd7bf8c12018-02-25 22:55:05 -050079 url(r'^dentries/build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', views.xhr_dirinfo, name='dirinfo_ajax'),
80 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo$', views.dirinfo, name='dirinfo'),
81 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo_filepath/_(?P<file_path>(?:/[^/\n]+)*)$', views.dirinfo, name='dirinfo_filepath'),
82 url(r'^build/(?P<build_id>\d+)/configuration$', views.configuration, name='configuration'),
83 url(r'^build/(?P<build_id>\d+)/configvars$', views.configvars, name='configvars'),
Patrick Williamsc0f7c042017-02-23 20:41:17 -060084 url(r'^build/(?P<build_id>\d+)/buildtime$',
85 buildtables.BuildTimeTable.as_view(
86 template_name="buildinfo-toastertable.html"),
87 name='buildtime'),
88
89 url(r'^build/(?P<build_id>\d+)/cputime$',
90 buildtables.BuildCPUTimeTable.as_view(
91 template_name="buildinfo-toastertable.html"),
92 name='cputime'),
93
94 url(r'^build/(?P<build_id>\d+)/diskio$',
95 buildtables.BuildIOTable.as_view(
96 template_name="buildinfo-toastertable.html"),
97 name='diskio'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -050098
99 # image information dir
100 url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packagefile/(?P<packagefile_id>\d+)$',
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500101 views.image_information_dir, name='image_information_dir'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102
103 # build download artifact
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500104 url(r'^build/(?P<build_id>\d+)/artifact/(?P<artifact_type>\w+)/id/(?P<artifact_id>\w+)', views.build_artifact, name="build_artifact"),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105
106 # project URLs
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500107 url(r'^newproject/$', views.newproject, name='newproject'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500109 url(r'^projects/$',
110 tables.ProjectsTable.as_view(template_name="projects-toastertable.html"),
111 name='all-projects'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500113 url(r'^project/(?P<pid>\d+)/$', views.project, name='project'),
114 url(r'^project/(?P<pid>\d+)/configuration$', views.projectconf, name='projectconf'),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500115 url(r'^project/(?P<pid>\d+)/builds/$',
116 tables.ProjectBuildsTable.as_view(template_name="projectbuilds-toastertable.html"),
117 name='projectbuilds'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500118
119 # the import layer is a project-specific functionality;
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500120 url(r'^project/(?P<pid>\d+)/importlayer$', views.importlayer, name='importlayer'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500121
122 # the table pages that have been converted to ToasterTable widget
123 url(r'^project/(?P<pid>\d+)/machines/$',
124 tables.MachinesTable.as_view(template_name="generic-toastertable-page.html"),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500125 name="projectmachines"),
126
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500127 url(r'^project/(?P<pid>\d+)/softwarerecipes/$',
128 tables.SoftwareRecipesTable.as_view(template_name="generic-toastertable-page.html"),
129 name="projectsoftwarerecipes"),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500130
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500131 url(r'^project/(?P<pid>\d+)/images/$',
132 tables.ImageRecipesTable.as_view(template_name="generic-toastertable-page.html"), name="projectimagerecipes"),
133
134 url(r'^project/(?P<pid>\d+)/customimages/$',
135 tables.CustomImagesTable.as_view(template_name="generic-toastertable-page.html"), name="projectcustomimages"),
136
137 url(r'^project/(?P<pid>\d+)/newcustomimage/$',
138 tables.NewCustomImagesTable.as_view(template_name="newcustomimage.html"),
139 name="newcustomimage"),
140
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500141 url(r'^project/(?P<pid>\d+)/layers/$',
142 tables.LayersTable.as_view(template_name="generic-toastertable-page.html"),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500143 name="projectlayers"),
144
145 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)$',
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500146 views.layerdetails, name='layerdetails'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500147
148 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/recipes/$',
149 tables.LayerRecipesTable.as_view(template_name="generic-toastertable-page.html"),
150 { 'table_name': tables.LayerRecipesTable.__name__.lower(),
151 'title' : 'All recipes in layer' },
152 name=tables.LayerRecipesTable.__name__.lower()),
153
154 url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/machines/$',
155 tables.LayerMachinesTable.as_view(template_name="generic-toastertable-page.html"),
156 { 'table_name': tables.LayerMachinesTable.__name__.lower(),
157 'title' : 'All machines in layer' },
158 name=tables.LayerMachinesTable.__name__.lower()),
159
160
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500161 url(r'^project/(?P<pid>\d+)/distros/$',
162 tables.DistrosTable.as_view(template_name="generic-toastertable-page.html"),
163 name="projectdistros"),
164
165
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500166 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)/selectpackages/$',
167 tables.SelectPackagesTable.as_view(), name="recipeselectpackages"),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500168
169
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500170 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)$',
171 tables.SelectPackagesTable.as_view(template_name="customrecipe.html"),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500172 name="customrecipe"),
173
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500174 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipe_id>\d+)/download$',
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500175 views.customrecipe_download,
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500176 name="customrecipedownload"),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500177
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500178 url(r'^project/(?P<pid>\d+)/recipe/(?P<recipe_id>\d+)$',
179 tables.PackagesTable.as_view(template_name="recipedetails.html"),
180 name="recipedetails"),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500181
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500182 # typeahead api end points
183 url(r'^xhr_typeahead/(?P<pid>\d+)/layers$',
184 typeaheads.LayersTypeAhead.as_view(), name='xhr_layerstypeahead'),
185 url(r'^xhr_typeahead/(?P<pid>\d+)/machines$',
186 typeaheads.MachinesTypeAhead.as_view(), name='xhr_machinestypeahead'),
187 url(r'^xhr_typeahead/(?P<pid>\d+)/recipes$',
188 typeaheads.RecipesTypeAhead.as_view(), name='xhr_recipestypeahead'),
189 url(r'^xhr_typeahead/projects$',
190 typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'),
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500191 url(r'^xhr_typeahead/gitrev$',
192 typeaheads.GitRevisionTypeAhead.as_view(),
193 name='xhr_gitrevtypeahead'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500194
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500195 url(r'^xhr_typeahead/(?P<pid>\d+)/distros$',
196 typeaheads.DistrosTypeAhead.as_view(), name='xhr_distrostypeahead'),
197
198 url(r'^xhr_testreleasechange/(?P<pid>\d+)$', views.xhr_testreleasechange,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500199 name='xhr_testreleasechange'),
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500200 url(r'^xhr_configvaredit/(?P<pid>\d+)$', views.xhr_configvaredit,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500201 name='xhr_configvaredit'),
202
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600203 url(r'^xhr_layer/(?P<pid>\d+)/(?P<layerversion_id>\d+)$',
204 api.XhrLayer.as_view(),
205 name='xhr_layer'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500206
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500207 url(r'^xhr_layer/(?P<pid>\d+)$',
208 api.XhrLayer.as_view(),
209 name='xhr_layer'),
210
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500211 # JS Unit tests
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500212 url(r'^js-unit-tests/$', views.jsunittests, name='js-unit-tests'),
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500213
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500214 # image customisation functionality
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600215 url(r'^xhr_customrecipe/(?P<recipe_id>\d+)'
216 '/packages/(?P<package_id>\d+|)$',
217 api.XhrCustomRecipePackages.as_view(),
218 name='xhr_customrecipe_packages'),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500219
220 url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/$',
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600221 api.XhrCustomRecipePackages.as_view(),
222 name='xhr_customrecipe_packages'),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500223
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600224 url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$',
225 api.XhrCustomRecipeId.as_view(),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500226 name='xhr_customrecipe_id'),
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600227
228 url(r'^xhr_customrecipe/',
229 api.XhrCustomRecipe.as_view(),
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500230 name='xhr_customrecipe'),
231
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500232 url(r'^xhr_buildrequest/project/(?P<pid>\d+)$',
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600233 api.XhrBuildRequest.as_view(),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500234 name='xhr_buildrequest'),
235
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600236 url(r'xhr_project/(?P<project_id>\d+)$',
237 api.XhrProject.as_view(),
238 name='xhr_project'),
239
240 url(r'xhr_build/(?P<build_id>\d+)$',
241 api.XhrBuild.as_view(),
242 name='xhr_build'),
243
244 url(r'^mostrecentbuilds$', widgets.MostRecentBuildsView.as_view(),
245 name='most_recent_builds'),
246
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500247 # JSON data for aggregators
248 url(r'^api/builds$', views.json_builds, name='json_builds'),
249 url(r'^api/building$', views.json_building, name='json_building'),
250 url(r'^api/build/(?P<build_id>\d+)$', views.json_build, name='json_build'),
251
252 # default redirection
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500253 url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500254]