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