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 |
| 24 | from toastergui import typeaheads |
| 25 | |
| 26 | urlpatterns = 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"), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | name="projectmachines"), |
| 91 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 92 | url(r'^project/(?P<pid>\d+)/softwarerecipes/$', |
| 93 | tables.SoftwareRecipesTable.as_view(template_name="generic-toastertable-page.html"), |
| 94 | name="projectsoftwarerecipes"), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 95 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 96 | url(r'^project/(?P<pid>\d+)/images/$', |
| 97 | tables.ImageRecipesTable.as_view(template_name="generic-toastertable-page.html"), name="projectimagerecipes"), |
| 98 | |
| 99 | url(r'^project/(?P<pid>\d+)/customimages/$', |
| 100 | tables.CustomImagesTable.as_view(template_name="generic-toastertable-page.html"), name="projectcustomimages"), |
| 101 | |
| 102 | url(r'^project/(?P<pid>\d+)/newcustomimage/$', |
| 103 | tables.NewCustomImagesTable.as_view(template_name="newcustomimage.html"), |
| 104 | name="newcustomimage"), |
| 105 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 106 | |
| 107 | url(r'^project/(?P<pid>\d+)/layers/$', |
| 108 | tables.LayersTable.as_view(template_name="generic-toastertable-page.html"), |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | name="projectlayers"), |
| 110 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 111 | |
| 112 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 113 | url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)$', |
| 114 | 'layerdetails', name='layerdetails'), |
| 115 | |
| 116 | url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/recipes/$', |
| 117 | tables.LayerRecipesTable.as_view(template_name="generic-toastertable-page.html"), |
| 118 | { 'table_name': tables.LayerRecipesTable.__name__.lower(), |
| 119 | 'title' : 'All recipes in layer' }, |
| 120 | name=tables.LayerRecipesTable.__name__.lower()), |
| 121 | |
| 122 | url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/machines/$', |
| 123 | tables.LayerMachinesTable.as_view(template_name="generic-toastertable-page.html"), |
| 124 | { 'table_name': tables.LayerMachinesTable.__name__.lower(), |
| 125 | 'title' : 'All machines in layer' }, |
| 126 | name=tables.LayerMachinesTable.__name__.lower()), |
| 127 | |
| 128 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 129 | url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipeid>\d+)/selectpackages/$', |
| 130 | tables.SelectPackagesTable.as_view(template_name="generic-toastertable-page.html"), name="recipeselectpackages"), |
| 131 | |
| 132 | |
| 133 | url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipe_id>\d+)$', |
| 134 | 'customrecipe', |
| 135 | name="customrecipe"), |
| 136 | |
| 137 | |
| 138 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 139 | # typeahead api end points |
| 140 | url(r'^xhr_typeahead/(?P<pid>\d+)/layers$', |
| 141 | typeaheads.LayersTypeAhead.as_view(), name='xhr_layerstypeahead'), |
| 142 | url(r'^xhr_typeahead/(?P<pid>\d+)/machines$', |
| 143 | typeaheads.MachinesTypeAhead.as_view(), name='xhr_machinestypeahead'), |
| 144 | url(r'^xhr_typeahead/(?P<pid>\d+)/recipes$', |
| 145 | typeaheads.RecipesTypeAhead.as_view(), name='xhr_recipestypeahead'), |
| 146 | url(r'^xhr_typeahead/projects$', |
| 147 | typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'), |
| 148 | |
| 149 | |
| 150 | |
| 151 | url(r'^xhr_testreleasechange/(?P<pid>\d+)$', 'xhr_testreleasechange', |
| 152 | name='xhr_testreleasechange'), |
| 153 | url(r'^xhr_configvaredit/(?P<pid>\d+)$', 'xhr_configvaredit', |
| 154 | name='xhr_configvaredit'), |
| 155 | |
| 156 | url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'), |
| 157 | url(r'^xhr_updatelayer/$', 'xhr_updatelayer', name='xhr_updatelayer'), |
| 158 | |
| 159 | # JS Unit tests |
| 160 | url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'), |
| 161 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 162 | # image customisation functionality |
| 163 | url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/(?P<package_id>\d+|)$', |
| 164 | 'xhr_customrecipe_packages', name='xhr_customrecipe_packages'), |
| 165 | url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$', 'xhr_customrecipe_id', |
| 166 | name='xhr_customrecipe_id'), |
| 167 | url(r'^xhr_customrecipe/', 'xhr_customrecipe', |
| 168 | name='xhr_customrecipe'), |
| 169 | |
| 170 | # default redirection |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 171 | url(r'^$', RedirectView.as_view( url= 'landing')), |
| 172 | ) |