urls.py 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. #
  2. # BitBake Toaster Implementation
  3. #
  4. # Copyright (C) 2013-2017 Intel Corporation
  5. #
  6. # SPDX-License-Identifier: GPL-2.0-only
  7. #
  8. from django.urls import re_path as url
  9. from django.views.generic import RedirectView
  10. from toastergui import tables
  11. from toastergui import buildtables
  12. from toastergui import typeaheads
  13. from toastergui import api
  14. from toastergui import widgets
  15. from toastergui import views
  16. urlpatterns = [
  17. # landing page
  18. url(r'^landing/$', views.landing, name='landing'),
  19. url(r'^builds/$',
  20. tables.AllBuildsTable.as_view(template_name="builds-toastertable.html"),
  21. name='all-builds'),
  22. # build info navigation
  23. url(r'^build/(?P<build_id>\d+)$', views.builddashboard, name="builddashboard"),
  24. url(r'^build/(?P<build_id>\d+)/tasks/$',
  25. buildtables.BuildTasksTable.as_view(
  26. template_name="buildinfo-toastertable.html"),
  27. name='tasks'),
  28. url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', views.task, name='task'),
  29. url(r'^build/(?P<build_id>\d+)/recipes/$',
  30. buildtables.BuiltRecipesTable.as_view(
  31. template_name="buildinfo-toastertable.html"),
  32. name='recipes'),
  33. url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)/active_tab/(?P<active_tab>\d{1})$', views.recipe, name='recipe'),
  34. url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', views.recipe, name='recipe'),
  35. url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', views.recipe_packages, name='recipe_packages'),
  36. url(r'^build/(?P<build_id>\d+)/packages/$',
  37. buildtables.BuiltPackagesTable.as_view(
  38. template_name="buildinfo-toastertable.html"),
  39. name='packages'),
  40. url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', views.package_built_detail,
  41. name='package_built_detail'),
  42. url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$',
  43. views.package_built_dependencies, name='package_built_dependencies'),
  44. url(r'^build/(?P<build_id>\d+)/package_included_detail/(?P<target_id>\d+)/(?P<package_id>\d+)$',
  45. views.package_included_detail, name='package_included_detail'),
  46. url(r'^build/(?P<build_id>\d+)/package_included_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
  47. views.package_included_dependencies, name='package_included_dependencies'),
  48. url(r'^build/(?P<build_id>\d+)/package_included_reverse_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
  49. views.package_included_reverse_dependencies, name='package_included_reverse_dependencies'),
  50. url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$',
  51. buildtables.InstalledPackagesTable.as_view(
  52. template_name="target.html"),
  53. name='target'),
  54. url(r'^dentries/build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', views.xhr_dirinfo, name='dirinfo_ajax'),
  55. url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo$', views.dirinfo, name='dirinfo'),
  56. url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo_filepath/_(?P<file_path>(?:/[^/\n]+)*)$', views.dirinfo, name='dirinfo_filepath'),
  57. url(r'^build/(?P<build_id>\d+)/configuration$', views.configuration, name='configuration'),
  58. url(r'^build/(?P<build_id>\d+)/configvars$', views.configvars, name='configvars'),
  59. url(r'^build/(?P<build_id>\d+)/buildtime$',
  60. buildtables.BuildTimeTable.as_view(
  61. template_name="buildinfo-toastertable.html"),
  62. name='buildtime'),
  63. url(r'^build/(?P<build_id>\d+)/cputime$',
  64. buildtables.BuildCPUTimeTable.as_view(
  65. template_name="buildinfo-toastertable.html"),
  66. name='cputime'),
  67. url(r'^build/(?P<build_id>\d+)/diskio$',
  68. buildtables.BuildIOTable.as_view(
  69. template_name="buildinfo-toastertable.html"),
  70. name='diskio'),
  71. # image information dir
  72. url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packagefile/(?P<packagefile_id>\d+)$',
  73. views.image_information_dir, name='image_information_dir'),
  74. # build download artifact
  75. url(r'^build/(?P<build_id>\d+)/artifact/(?P<artifact_type>\w+)/id/(?P<artifact_id>\w+)', views.build_artifact, name="build_artifact"),
  76. # project URLs
  77. url(r'^newproject/$', views.newproject, name='newproject'),
  78. url(r'^projects/$',
  79. tables.ProjectsTable.as_view(template_name="projects-toastertable.html"),
  80. name='all-projects'),
  81. url(r'^project/(?P<pid>\d+)/$', views.project, name='project'),
  82. url(r'^project/(?P<pid>\d+)/configuration$', views.projectconf, name='projectconf'),
  83. url(r'^project/(?P<pid>\d+)/builds/$',
  84. tables.ProjectBuildsTable.as_view(template_name="projectbuilds-toastertable.html"),
  85. name='projectbuilds'),
  86. url(r'^newproject_specific/(?P<pid>\d+)/$', views.newproject_specific, name='newproject_specific'),
  87. url(r'^project_specific/(?P<pid>\d+)/$', views.project_specific, name='project_specific'),
  88. url(r'^landing_specific/(?P<pid>\d+)/$', views.landing_specific, name='landing_specific'),
  89. url(r'^landing_specific_cancel/(?P<pid>\d+)/$', views.landing_specific_cancel, name='landing_specific_cancel'),
  90. # the import layer is a project-specific functionality;
  91. url(r'^project/(?P<pid>\d+)/importlayer$', views.importlayer, name='importlayer'),
  92. # the table pages that have been converted to ToasterTable widget
  93. url(r'^project/(?P<pid>\d+)/machines/$',
  94. tables.MachinesTable.as_view(template_name="generic-toastertable-page.html"),
  95. name="projectmachines"),
  96. url(r'^project/(?P<pid>\d+)/softwarerecipes/$',
  97. tables.SoftwareRecipesTable.as_view(template_name="generic-toastertable-page.html"),
  98. name="projectsoftwarerecipes"),
  99. url(r'^project/(?P<pid>\d+)/images/$',
  100. tables.ImageRecipesTable.as_view(template_name="generic-toastertable-page.html"), name="projectimagerecipes"),
  101. url(r'^project/(?P<pid>\d+)/customimages/$',
  102. tables.CustomImagesTable.as_view(template_name="generic-toastertable-page.html"), name="projectcustomimages"),
  103. url(r'^project/(?P<pid>\d+)/newcustomimage/$',
  104. tables.NewCustomImagesTable.as_view(template_name="newcustomimage.html"),
  105. name="newcustomimage"),
  106. url(r'^project/(?P<pid>\d+)/layers/$',
  107. tables.LayersTable.as_view(template_name="generic-toastertable-page.html"),
  108. name="projectlayers"),
  109. url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)$',
  110. views.layerdetails, name='layerdetails'),
  111. url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/recipes/$',
  112. tables.LayerRecipesTable.as_view(template_name="generic-toastertable-page.html"),
  113. { 'table_name': tables.LayerRecipesTable.__name__.lower(),
  114. 'title' : 'All recipes in layer' },
  115. name=tables.LayerRecipesTable.__name__.lower()),
  116. url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/machines/$',
  117. tables.LayerMachinesTable.as_view(template_name="generic-toastertable-page.html"),
  118. { 'table_name': tables.LayerMachinesTable.__name__.lower(),
  119. 'title' : 'All machines in layer' },
  120. name=tables.LayerMachinesTable.__name__.lower()),
  121. url(r'^project/(?P<pid>\d+)/distros/$',
  122. tables.DistrosTable.as_view(template_name="generic-toastertable-page.html"),
  123. name="projectdistros"),
  124. url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)/selectpackages/$',
  125. tables.SelectPackagesTable.as_view(), name="recipeselectpackages"),
  126. url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)$',
  127. tables.SelectPackagesTable.as_view(template_name="customrecipe.html"),
  128. name="customrecipe"),
  129. url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipe_id>\d+)/download$',
  130. views.customrecipe_download,
  131. name="customrecipedownload"),
  132. url(r'^project/(?P<pid>\d+)/recipe/(?P<recipe_id>\d+)$',
  133. tables.PackagesTable.as_view(template_name="recipedetails.html"),
  134. name="recipedetails"),
  135. # typeahead api end points
  136. url(r'^xhr_typeahead/(?P<pid>\d+)/layers$',
  137. typeaheads.LayersTypeAhead.as_view(), name='xhr_layerstypeahead'),
  138. url(r'^xhr_typeahead/(?P<pid>\d+)/machines$',
  139. typeaheads.MachinesTypeAhead.as_view(), name='xhr_machinestypeahead'),
  140. url(r'^xhr_typeahead/(?P<pid>\d+)/recipes$',
  141. typeaheads.RecipesTypeAhead.as_view(), name='xhr_recipestypeahead'),
  142. url(r'^xhr_typeahead/projects$',
  143. typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'),
  144. url(r'^xhr_typeahead/gitrev$',
  145. typeaheads.GitRevisionTypeAhead.as_view(),
  146. name='xhr_gitrevtypeahead'),
  147. url(r'^xhr_typeahead/(?P<pid>\d+)/distros$',
  148. typeaheads.DistrosTypeAhead.as_view(), name='xhr_distrostypeahead'),
  149. url(r'^xhr_testreleasechange/(?P<pid>\d+)$', views.xhr_testreleasechange,
  150. name='xhr_testreleasechange'),
  151. url(r'^xhr_configvaredit/(?P<pid>\d+)$', views.xhr_configvaredit,
  152. name='xhr_configvaredit'),
  153. url(r'^xhr_layer/(?P<pid>\d+)/(?P<layerversion_id>\d+)$',
  154. api.XhrLayer.as_view(),
  155. name='xhr_layer'),
  156. url(r'^xhr_layer/(?P<pid>\d+)$',
  157. api.XhrLayer.as_view(),
  158. name='xhr_layer'),
  159. # JS Unit tests
  160. url(r'^js-unit-tests/$', views.jsunittests, name='js-unit-tests'),
  161. # image customisation functionality
  162. url(r'^xhr_customrecipe/(?P<recipe_id>\d+)'
  163. '/packages/(?P<package_id>\d+|)$',
  164. api.XhrCustomRecipePackages.as_view(),
  165. name='xhr_customrecipe_packages'),
  166. url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/$',
  167. api.XhrCustomRecipePackages.as_view(),
  168. name='xhr_customrecipe_packages'),
  169. url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$',
  170. api.XhrCustomRecipeId.as_view(),
  171. name='xhr_customrecipe_id'),
  172. url(r'^xhr_customrecipe/',
  173. api.XhrCustomRecipe.as_view(),
  174. name='xhr_customrecipe'),
  175. url(r'^xhr_buildrequest/project/(?P<pid>\d+)$',
  176. api.XhrBuildRequest.as_view(),
  177. name='xhr_buildrequest'),
  178. url(r'^xhr_projectupdate/project/(?P<pid>\d+)$',
  179. api.XhrProjectUpdate.as_view(),
  180. name='xhr_projectupdate'),
  181. url(r'^xhr_setdefaultimage/project/(?P<pid>\d+)$',
  182. api.XhrSetDefaultImageUrl.as_view(),
  183. name='xhr_setdefaultimage'),
  184. url(r'xhr_project/(?P<project_id>\d+)$',
  185. api.XhrProject.as_view(),
  186. name='xhr_project'),
  187. url(r'xhr_build/(?P<build_id>\d+)$',
  188. api.XhrBuild.as_view(),
  189. name='xhr_build'),
  190. url(r'^mostrecentbuilds$', widgets.MostRecentBuildsView.as_view(),
  191. name='most_recent_builds'),
  192. # JSON data for aggregators
  193. url(r'^api/builds$', views.json_builds, name='json_builds'),
  194. url(r'^api/building$', views.json_building, name='json_building'),
  195. url(r'^api/build/(?P<build_id>\d+)$', views.json_build, name='json_build'),
  196. # default redirection
  197. url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
  198. ]