1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

urls.py: convert re_path to path

This commit is contained in:
catborise 2020-06-04 14:31:37 +03:00
parent fc2662bd91
commit 028ce0c208
3 changed files with 33 additions and 40 deletions

View file

@ -1,6 +1,4 @@
from secrets.views import secrets
from django.urls import path
from django.urls import path, include
from . import views
from create.views import create_instance, create_instance_select_type
@ -8,6 +6,7 @@ from instances.views import instances
from interfaces.views import interface, interfaces
from networks.views import network, networks
from nwfilters.views import nwfilter, nwfilters
from secrets.views import secrets
from storages.views import get_volumes, storage, storages
from . import forms
@ -17,30 +16,24 @@ urlpatterns = [
path('add_ssh_host/', views.add_host, {'FormClass': forms.SshComputeForm}, name='add_ssh_host'),
path('add_tls_host/', views.add_host, {'FormClass': forms.TlsComputeForm}, name='add_tls_host'),
path('add_socket_host/', views.add_host, {'FormClass': forms.SocketComputeForm}, name='add_socket_host'),
path('<int:compute_id>/', views.overview, name='overview'),
path('<int:compute_id>/statistics/', views.compute_graph, name='compute_graph'),
path('<int:compute_id>/instances/', instances, name='instances'),
path('<int:compute_id>/storages/', storages, name='storages'),
path('<int:compute_id>/storage/<str:pool>/volumes/', get_volumes, name='volumes'),
path('<int:compute_id>/storage/<str:pool>/', storage, name='storage'),
path('<int:compute_id>/networks/', networks, name='networks'),
path('<int:compute_id>/network/<str:pool>/', network, name='network'),
path('<int:compute_id>/interfaces/', interfaces, name='interfaces'),
path('<int:compute_id>/interface/<str:iface>/', interface, name='interface'),
path('<int:compute_id>/nwfilters/', nwfilters, name='nwfilters'),
path('<int:compute_id>/nwfilter/<str:nwfltr>/', nwfilter, name='nwfilter'),
path('<int:compute_id>/secrets/', secrets, name='secrets'),
path('<int:compute_id>/create/', create_instance_select_type, name='create_instance_select_type'),
path('<int:compute_id>/create/archs/<str:arch>/machines/<str:machine>/', create_instance, name='create_instance'),
path('<int:compute_id>/archs/<str:arch>/machines/', views.get_compute_machine_types, name='machines'),
path(
'<int:compute_id>/archs/<str:arch>/machines/<str:machine>/disks/<str:disk>/buses/',
views.get_compute_disk_buses,
name='buses',
),
path(
'<int:compute_id>/archs/<str:arch>/machines/<str:machine>/capabilities/',
views.get_dom_capabilities,
name='domcaps',
),
path('<int:compute_id>/', include([
path('', views.overview, name='overview'),
path('statistics', views.compute_graph, name='compute_graph'),
path('instances/', instances, name='instances'),
path('storages/', storages, name='storages'),
path('storage/<str:pool>/volumes', get_volumes, name='volumes'),
path('storage/<str:pool>/', storage, name='storage'),
path('networks/', networks, name='networks'),
path('network/<str:pool>/', network, name='network'),
path('interfaces/', interfaces, name='interfaces'),
path('interface/<str:iface>/', interface, name='interface'),
path('nwfilters/', nwfilters, name='nwfilters'),
path('nwfilter/<str:nwfltr>/', nwfilter, name='nwfilter'),
path('secrets/', secrets, name='secrets'),
path('create/', create_instance_select_type, name='create_instance_select_type'),
path('create/archs/<str:arch>/machines/<str:machine>', create_instance, name='create_instance'),
path('archs/<str:arch>/machines', views.get_compute_machine_types, name='machines'),
path('archs/<str:arch>/machines/<str:machine>/disks/<str:disk>/buses', views.get_compute_disk_buses, name='buses'),
path('archs/<str:arch>/machines/<str:machine>/capabilities', views.get_dom_capabilities, name='domcaps'),
])),
]

View file

@ -1,14 +1,14 @@
from django.urls import path, re_path
from django.urls import path
from . import views
urlpatterns = [
path('', views.allinstances, name='allinstances'),
re_path(r'^(?P<compute_id>[0-9]+)/(?P<vname>[\w\-\.]+)/$', views.instance, name='instance'),
re_path(r'^statistics/(?P<compute_id>[0-9]+)/(?P<vname>[\w\-\.]+)/$', views.inst_graph, name='inst_graph'),
re_path(r'^status/(?P<compute_id>[0-9]+)/(?P<vname>[\w\-\.]+)/$', views.inst_status, name='inst_status'),
re_path(r'^guess_mac_address/(?P<vname>[\w\-\.]+)/$', views.guess_mac_address, name='guess_mac_address'),
re_path(r'^guess_clone_name/$', views.guess_clone_name, name='guess_clone_name'),
re_path(r'^random_mac_address/$', views.random_mac_address, name='random_mac_address'),
re_path(r'^check_instance/(?P<vname>[\w\-\.]+)/$', views.check_instance, name='check_instance'),
re_path(r'^sshkeys/(?P<vname>[\w\-\.]+)/$', views.sshkeys, name='sshkeys'),
path('<int:compute_id>/<vname>/', views.instance, name='instance'),
path('statistics/<int:compute_id>/<vname>/', views.inst_graph, name='inst_graph'),
path('status/<int:compute_id>/<vname>/', views.inst_status, name='inst_status'),
path('guess_mac_address/<vname>/', views.guess_mac_address, name='guess_mac_address'),
path('guess_clone_name/', views.guess_clone_name, name='guess_clone_name'),
path('random_mac_address/', views.random_mac_address, name='random_mac_address'),
path('check_instance/<vname>/', views.check_instance, name='check_instance'),
path('sshkeys/<vname>/', views.sshkeys, name='sshkeys'),
]

View file

@ -1,6 +1,6 @@
from django.urls import path, re_path
from django.urls import path
from . import views
urlpatterns = [
re_path(r'^vm_logs/(?P<vname>[\w\-\.]+)/$', views.vm_logs, name='vm_logs'),
path('vm_logs/<vname>/', views.vm_logs, name='vm_logs'),
]