Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | # |
| 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 | |
| 19 | from django.conf.urls import patterns, include, url |
| 20 | from django.views.generic import RedirectView, TemplateView |
| 21 | |
| 22 | from django.http import HttpResponseBadRequest |
| 23 | from toastergui import tables |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 24 | from toastergui import buildtables |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | from toastergui import typeaheads |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | from toastergui import api |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 27 | from toastergui import widgets |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | |
| 29 | urlpatterns = patterns('toastergui.views', |
| 30 | # landing page |
| 31 | url(r'^landing/$', 'landing', name='landing'), |
| 32 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 33 | url(r'^builds/$', |
| 34 | tables.AllBuildsTable.as_view(template_name="builds-toastertable.html"), |
| 35 | name='all-builds'), |
| 36 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | # build info navigation |
| 38 | url(r'^build/(?P<build_id>\d+)$', 'builddashboard', name="builddashboard"), |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 39 | url(r'^build/(?P<build_id>\d+)/tasks/$', |
| 40 | buildtables.BuildTasksTable.as_view( |
| 41 | template_name="buildinfo-toastertable.html"), |
| 42 | name='tasks'), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 43 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', 'task', name='task'), |
| 45 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 46 | url(r'^build/(?P<build_id>\d+)/recipes/$', |
| 47 | buildtables.BuiltRecipesTable.as_view( |
| 48 | template_name="buildinfo-toastertable.html"), |
| 49 | name='recipes'), |
| 50 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)/active_tab/(?P<active_tab>\d{1})$', 'recipe', name='recipe'), |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 52 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 56 | url(r'^build/(?P<build_id>\d+)/packages/$', |
| 57 | buildtables.BuiltPackagesTable.as_view( |
| 58 | template_name="buildinfo-toastertable.html"), |
| 59 | name='packages'), |
| 60 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 61 | 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 72 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 78 | 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 83 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 97 | |
| 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 108 | url(r'^projects/$', |
| 109 | tables.ProjectsTable.as_view(template_name="projects-toastertable.html"), |
| 110 | name='all-projects'), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 111 | |
| 112 | url(r'^project/(?P<pid>\d+)/$', 'project', name='project'), |
| 113 | url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'), |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 114 | url(r'^project/(?P<pid>\d+)/builds/$', |
| 115 | tables.ProjectBuildsTable.as_view(template_name="projectbuilds-toastertable.html"), |
| 116 | name='projectbuilds'), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 117 | |
| 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 124 | name="projectmachines"), |
| 125 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 126 | url(r'^project/(?P<pid>\d+)/softwarerecipes/$', |
| 127 | tables.SoftwareRecipesTable.as_view(template_name="generic-toastertable-page.html"), |
| 128 | name="projectsoftwarerecipes"), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 129 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 130 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 140 | url(r'^project/(?P<pid>\d+)/layers/$', |
| 141 | tables.LayersTable.as_view(template_name="generic-toastertable-page.html"), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 142 | 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 160 | url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)/selectpackages/$', |
| 161 | tables.SelectPackagesTable.as_view(), name="recipeselectpackages"), |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 162 | |
| 163 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 164 | url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)$', |
| 165 | tables.SelectPackagesTable.as_view(template_name="customrecipe.html"), |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 166 | name="customrecipe"), |
| 167 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 168 | url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipe_id>\d+)/download$', |
| 169 | 'customrecipe_download', |
| 170 | name="customrecipedownload"), |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 171 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 172 | url(r'^project/(?P<pid>\d+)/recipe/(?P<recipe_id>\d+)$', |
| 173 | tables.PackagesTable.as_view(template_name="recipedetails.html"), |
| 174 | name="recipedetails"), |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 175 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 176 | # 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 185 | url(r'^xhr_typeahead/gitrev$', |
| 186 | typeaheads.GitRevisionTypeAhead.as_view(), |
| 187 | name='xhr_gitrevtypeahead'), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 188 | |
| 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 194 | url(r'^xhr_layer/(?P<pid>\d+)/(?P<layerversion_id>\d+)$', |
| 195 | api.XhrLayer.as_view(), |
| 196 | name='xhr_layer'), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 197 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 198 | url(r'^xhr_layer/(?P<pid>\d+)$', |
| 199 | api.XhrLayer.as_view(), |
| 200 | name='xhr_layer'), |
| 201 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 202 | # JS Unit tests |
| 203 | url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'), |
| 204 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 205 | # image customisation functionality |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 206 | 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 210 | |
| 211 | url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/$', |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 212 | api.XhrCustomRecipePackages.as_view(), |
| 213 | name='xhr_customrecipe_packages'), |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 214 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 215 | url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$', |
| 216 | api.XhrCustomRecipeId.as_view(), |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 217 | name='xhr_customrecipe_id'), |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 218 | |
| 219 | url(r'^xhr_customrecipe/', |
| 220 | api.XhrCustomRecipe.as_view(), |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 221 | name='xhr_customrecipe'), |
| 222 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 223 | url(r'^xhr_buildrequest/project/(?P<pid>\d+)$', |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 224 | api.XhrBuildRequest.as_view(), |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 225 | name='xhr_buildrequest'), |
| 226 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 227 | 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 Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 238 | # default redirection |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 239 | url(r'^$', RedirectView.as_view(url='landing', permanent=True)), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 240 | ) |