urls.py 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. from django.conf.urls import patterns, include, url
  19. from django.views.generic import RedirectView, TemplateView
  20. from django.http import HttpResponseBadRequest
  21. from toastergui import tables
  22. from toastergui import buildtables
  23. from toastergui import typeaheads
  24. from toastergui import api
  25. urlpatterns = patterns('toastergui.views',
  26. # landing page
  27. url(r'^landing/$', 'landing', name='landing'),
  28. url(r'^builds/$',
  29. tables.AllBuildsTable.as_view(template_name="builds-toastertable.html"),
  30. name='all-builds'),
  31. # build info navigation
  32. url(r'^build/(?P<build_id>\d+)$', 'builddashboard', name="builddashboard"),
  33. url(r'^build/(?P<build_id>\d+)/tasks/$',
  34. buildtables.BuildTasksTable.as_view(
  35. template_name="buildinfo-toastertable.html"),
  36. name='tasks'),
  37. url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', 'task', name='task'),
  38. url(r'^build/(?P<build_id>\d+)/recipes/$',
  39. buildtables.BuiltRecipesTable.as_view(
  40. template_name="buildinfo-toastertable.html"),
  41. name='recipes'),
  42. url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)/active_tab/(?P<active_tab>\d{1})$', 'recipe', name='recipe'),
  43. url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', 'recipe', name='recipe'),
  44. url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', 'recipe_packages', name='recipe_packages'),
  45. url(r'^build/(?P<build_id>\d+)/packages/$',
  46. buildtables.BuiltPackagesTable.as_view(
  47. template_name="buildinfo-toastertable.html"),
  48. name='packages'),
  49. url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', 'package_built_detail',
  50. name='package_built_detail'),
  51. url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$',
  52. 'package_built_dependencies', name='package_built_dependencies'),
  53. url(r'^build/(?P<build_id>\d+)/package_included_detail/(?P<target_id>\d+)/(?P<package_id>\d+)$',
  54. 'package_included_detail', name='package_included_detail'),
  55. url(r'^build/(?P<build_id>\d+)/package_included_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
  56. 'package_included_dependencies', name='package_included_dependencies'),
  57. url(r'^build/(?P<build_id>\d+)/package_included_reverse_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
  58. 'package_included_reverse_dependencies', name='package_included_reverse_dependencies'),
  59. url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$',
  60. buildtables.InstalledPackagesTable.as_view(
  61. template_name="target.html"),
  62. name='target'),
  63. url(r'^dentries/build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', 'xhr_dirinfo', name='dirinfo_ajax'),
  64. url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo$', 'dirinfo', name='dirinfo'),
  65. url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo_filepath/_(?P<file_path>(?:/[^/\n]+)*)$', 'dirinfo', name='dirinfo_filepath'),
  66. url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'),
  67. url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'),
  68. url(r'^build/(?P<build_id>\d+)/buildtime$',
  69. buildtables.BuildTimeTable.as_view(
  70. template_name="buildinfo-toastertable.html"),
  71. name='buildtime'),
  72. url(r'^build/(?P<build_id>\d+)/cputime$',
  73. buildtables.BuildCPUTimeTable.as_view(
  74. template_name="buildinfo-toastertable.html"),
  75. name='cputime'),
  76. url(r'^build/(?P<build_id>\d+)/diskio$',
  77. buildtables.BuildIOTable.as_view(
  78. template_name="buildinfo-toastertable.html"),
  79. name='diskio'),
  80. # image information dir
  81. url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packagefile/(?P<packagefile_id>\d+)$',
  82. 'image_information_dir', name='image_information_dir'),
  83. # build download artifact
  84. url(r'^build/(?P<build_id>\d+)/artifact/(?P<artifact_type>\w+)/id/(?P<artifact_id>\w+)', 'build_artifact', name="build_artifact"),
  85. # project URLs
  86. url(r'^newproject/$', 'newproject', name='newproject'),
  87. url(r'^projects/$',
  88. tables.ProjectsTable.as_view(template_name="projects-toastertable.html"),
  89. name='all-projects'),
  90. url(r'^project/(?P<pid>\d+)/$', 'project', name='project'),
  91. url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'),
  92. url(r'^project/(?P<pid>\d+)/builds/$',
  93. tables.ProjectBuildsTable.as_view(template_name="projectbuilds-toastertable.html"),
  94. name='projectbuilds'),
  95. # the import layer is a project-specific functionality;
  96. url(r'^project/(?P<pid>\d+)/importlayer$', 'importlayer', name='importlayer'),
  97. # the table pages that have been converted to ToasterTable widget
  98. url(r'^project/(?P<pid>\d+)/machines/$',
  99. tables.MachinesTable.as_view(template_name="generic-toastertable-page.html"),
  100. name="projectmachines"),
  101. url(r'^project/(?P<pid>\d+)/softwarerecipes/$',
  102. tables.SoftwareRecipesTable.as_view(template_name="generic-toastertable-page.html"),
  103. name="projectsoftwarerecipes"),
  104. url(r'^project/(?P<pid>\d+)/images/$',
  105. tables.ImageRecipesTable.as_view(template_name="generic-toastertable-page.html"), name="projectimagerecipes"),
  106. url(r'^project/(?P<pid>\d+)/customimages/$',
  107. tables.CustomImagesTable.as_view(template_name="generic-toastertable-page.html"), name="projectcustomimages"),
  108. url(r'^project/(?P<pid>\d+)/newcustomimage/$',
  109. tables.NewCustomImagesTable.as_view(template_name="newcustomimage.html"),
  110. name="newcustomimage"),
  111. url(r'^project/(?P<pid>\d+)/layers/$',
  112. tables.LayersTable.as_view(template_name="generic-toastertable-page.html"),
  113. name="projectlayers"),
  114. url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)$',
  115. 'layerdetails', name='layerdetails'),
  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. url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/machines/$',
  122. tables.LayerMachinesTable.as_view(template_name="generic-toastertable-page.html"),
  123. { 'table_name': tables.LayerMachinesTable.__name__.lower(),
  124. 'title' : 'All machines in layer' },
  125. name=tables.LayerMachinesTable.__name__.lower()),
  126. url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)/selectpackages/$',
  127. tables.SelectPackagesTable.as_view(), name="recipeselectpackages"),
  128. url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)$',
  129. tables.SelectPackagesTable.as_view(template_name="customrecipe.html"),
  130. name="customrecipe"),
  131. url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipe_id>\d+)/download$',
  132. 'customrecipe_download',
  133. name="customrecipedownload"),
  134. url(r'^project/(?P<pid>\d+)/recipe/(?P<recipe_id>\d+)$',
  135. tables.PackagesTable.as_view(template_name="recipedetails.html"),
  136. name="recipedetails"),
  137. # typeahead api end points
  138. url(r'^xhr_typeahead/(?P<pid>\d+)/layers$',
  139. typeaheads.LayersTypeAhead.as_view(), name='xhr_layerstypeahead'),
  140. url(r'^xhr_typeahead/(?P<pid>\d+)/machines$',
  141. typeaheads.MachinesTypeAhead.as_view(), name='xhr_machinestypeahead'),
  142. url(r'^xhr_typeahead/(?P<pid>\d+)/recipes$',
  143. typeaheads.RecipesTypeAhead.as_view(), name='xhr_recipestypeahead'),
  144. url(r'^xhr_typeahead/projects$',
  145. typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'),
  146. url(r'^xhr_testreleasechange/(?P<pid>\d+)$', 'xhr_testreleasechange',
  147. name='xhr_testreleasechange'),
  148. url(r'^xhr_configvaredit/(?P<pid>\d+)$', 'xhr_configvaredit',
  149. name='xhr_configvaredit'),
  150. url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'),
  151. url(r'^xhr_layer/(?P<pid>\d+)/(?P<layerversion_id>\d+)$',
  152. api.XhrLayer.as_view(),
  153. name='xhr_layer'),
  154. # JS Unit tests
  155. url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'),
  156. # image customisation functionality
  157. url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/(?P<package_id>\d+|)$',
  158. 'xhr_customrecipe_packages', name='xhr_customrecipe_packages'),
  159. url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/$',
  160. 'xhr_customrecipe_packages', name='xhr_customrecipe_packages'),
  161. url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$', 'xhr_customrecipe_id',
  162. name='xhr_customrecipe_id'),
  163. url(r'^xhr_customrecipe/', 'xhr_customrecipe',
  164. name='xhr_customrecipe'),
  165. url(r'^xhr_buildrequest/project/(?P<pid>\d+)$',
  166. api.XhrBuildRequest.as_view(),
  167. name='xhr_buildrequest'),
  168. url(r'^mostrecentbuilds$', api.MostRecentBuildsView.as_view(),
  169. name='most_recent_builds'),
  170. # default redirection
  171. url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
  172. )