Commit 23815f87 authored by ibuler's avatar ibuler

[Update] 升级url

parent 8afd5ef9
# coding:utf-8 # coding:utf-8
from django.conf.urls import url from django.urls import path
from .. import api from .. import api
from rest_framework_bulk.routes import BulkRouter from rest_framework_bulk.routes import BulkRouter
...@@ -16,45 +16,45 @@ router.register(r'domain', api.DomainViewSet, 'domain') ...@@ -16,45 +16,45 @@ router.register(r'domain', api.DomainViewSet, 'domain')
router.register(r'gateway', api.GatewayViewSet, 'gateway') router.register(r'gateway', api.GatewayViewSet, 'gateway')
urlpatterns = [ urlpatterns = [
url(r'^assets-bulk/$', api.AssetListUpdateApi.as_view(), name='asset-bulk-update'), path('assets-bulk/', api.AssetListUpdateApi.as_view(), name='asset-bulk-update'),
url(r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/auth-info/', api.SystemUserAuthInfoApi.as_view(), path('system-user/<uuid:pk>/auth-info/',
name='system-user-auth-info'), api.SystemUserAuthInfoApi.as_view(), name='system-user-auth-info'),
url(r'^assets/(?P<pk>[0-9a-zA-Z\-]{36})/refresh/$', path('assets/<uuid:pk>/refresh/',
api.AssetRefreshHardwareApi.as_view(), name='asset-refresh'), api.AssetRefreshHardwareApi.as_view(), name='asset-refresh'),
url(r'^assets/(?P<pk>[0-9a-zA-Z\-]{36})/alive/$', path('assets/<uuid:pk>/alive/',
api.AssetAdminUserTestApi.as_view(), name='asset-alive-test'), api.AssetAdminUserTestApi.as_view(), name='asset-alive-test'),
url(r'^assets/(?P<pk>[0-9a-zA-Z\-]{36})/gateway/$', path('assets/<uuid:pk>/gateway/',
api.AssetGatewayApi.as_view(), name='asset-gateway'), api.AssetGatewayApi.as_view(), name='asset-gateway'),
url(r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/nodes/$', path('admin-user/<uuid:pk>/nodes/',
api.ReplaceNodesAdminUserApi.as_view(), name='replace-nodes-admin-user'), api.ReplaceNodesAdminUserApi.as_view(), name='replace-nodes-admin-user'),
url(r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/auth/$', path('admin-user/<uuid:pk>/auth/',
api.AdminUserAuthApi.as_view(), name='admin-user-auth'), api.AdminUserAuthApi.as_view(), name='admin-user-auth'),
url(r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/connective/$', path('admin-user/<uuid:pk>/connective/',
api.AdminUserTestConnectiveApi.as_view(), name='admin-user-connective'), api.AdminUserTestConnectiveApi.as_view(), name='admin-user-connective'),
url(r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/push/$', path('system-user/<uuid:pk>/push/',
api.SystemUserPushApi.as_view(), name='system-user-push'), api.SystemUserPushApi.as_view(), name='system-user-push'),
url(r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/connective/$', path('system-user/<uuid:pk>/connective/',
api.SystemUserTestConnectiveApi.as_view(), name='system-user-connective'), api.SystemUserTestConnectiveApi.as_view(), name='system-user-connective'),
url(r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/children/$', path('nodes/<uuid:pk>/children/',
api.NodeChildrenApi.as_view(), name='node-children'), api.NodeChildrenApi.as_view(), name='node-children'),
url(r'^nodes/children/$', api.NodeChildrenApi.as_view(), name='node-children-2'), path('nodes/children/', api.NodeChildrenApi.as_view(), name='node-children-2'),
url(r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/children/add/$', path('nodes/<uuid:pk>/children/add/',
api.NodeAddChildrenApi.as_view(), name='node-add-children'), api.NodeAddChildrenApi.as_view(), name='node-add-children'),
url(r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$', path('nodes/<uuid:pk>/assets/',
api.NodeAssetsApi.as_view(), name='node-assets'), api.NodeAssetsApi.as_view(), name='node-assets'),
url(r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/assets/add/$', path('nodes/<uuid:pk>/assets/add/',
api.NodeAddAssetsApi.as_view(), name='node-add-assets'), api.NodeAddAssetsApi.as_view(), name='node-add-assets'),
url(r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/assets/replace/$', path('nodes/<uuid:pk>/assets/replace/',
api.NodeReplaceAssetsApi.as_view(), name='node-replace-assets'), api.NodeReplaceAssetsApi.as_view(), name='node-replace-assets'),
url(r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/assets/remove/$', path('nodes/<uuid:pk>/assets/remove/',
api.NodeRemoveAssetsApi.as_view(), name='node-remove-assets'), api.NodeRemoveAssetsApi.as_view(), name='node-remove-assets'),
url(r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/refresh-hardware-info/$', path('nodes/<uuid:pk>/refresh-hardware-info/',
api.RefreshNodeHardwareInfoApi.as_view(), name='node-refresh-hardware-info'), api.RefreshNodeHardwareInfoApi.as_view(), name='node-refresh-hardware-info'),
url(r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/test-connective/$', path('nodes/<uuid:pk>/test-connective/',
api.TestNodeConnectiveApi.as_view(), name='node-test-connective'), api.TestNodeConnectiveApi.as_view(), name='node-test-connective'),
url(r'^gateway/(?P<pk>[0-9a-zA-Z\-]{36})/test-connective/$', path('gateway/<uuid:pk>/test-connective/',
api.GatewayTestConnectionApi.as_view(), name='test-gateway-connective'), api.GatewayTestConnectionApi.as_view(), name='test-gateway-connective'),
] ]
urlpatterns += router.urls urlpatterns += router.urls
......
# coding:utf-8 # coding:utf-8
from django.conf.urls import url from django.urls import path
from .. import views from .. import views
app_name = 'assets' app_name = 'assets'
urlpatterns = [ urlpatterns = [
# Resource asset url # Resource asset url
url(r'^$', views.AssetListView.as_view(), name='asset-index'), path('', views.AssetListView.as_view(), name='asset-index'),
url(r'^asset/$', views.AssetListView.as_view(), name='asset-list'), path('asset/', views.AssetListView.as_view(), name='asset-list'),
url(r'^asset/create/$', views.AssetCreateView.as_view(), name='asset-create'), path('asset/create/', views.AssetCreateView.as_view(), name='asset-create'),
url(r'^asset/export/$', views.AssetExportView.as_view(), name='asset-export'), path('asset/export/', views.AssetExportView.as_view(), name='asset-export'),
url(r'^asset/import/$', views.BulkImportAssetView.as_view(), name='asset-import'), path('asset/import/', views.BulkImportAssetView.as_view(), name='asset-import'),
url(r'^asset/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.AssetDetailView.as_view(), name='asset-detail'), path('asset/<uuid:pk>/', views.AssetDetailView.as_view(), name='asset-detail'),
url(r'^asset/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.AssetUpdateView.as_view(), name='asset-update'), path('asset/<uuid:pk>/update/', views.AssetUpdateView.as_view(), name='asset-update'),
url(r'^asset/(?P<pk>[0-9a-zA-Z\-]{36})/delete/$', views.AssetDeleteView.as_view(), name='asset-delete'), path('asset/<uuid:pk>/delete/', views.AssetDeleteView.as_view(), name='asset-delete'),
url(r'^asset/update/$', views.AssetBulkUpdateView.as_view(), name='asset-bulk-update'), path('asset/update/', views.AssetBulkUpdateView.as_view(), name='asset-bulk-update'),
# User asset view # User asset view
url(r'^user-asset/$', views.UserAssetListView.as_view(), name='user-asset-list'), path('user-asset/', views.UserAssetListView.as_view(), name='user-asset-list'),
# Resource admin user url # Resource admin user url
url(r'^admin-user/$', views.AdminUserListView.as_view(), name='admin-user-list'), path('admin-user/', views.AdminUserListView.as_view(), name='admin-user-list'),
url(r'^admin-user/create/$', views.AdminUserCreateView.as_view(), name='admin-user-create'), path('admin-user/create/', views.AdminUserCreateView.as_view(), name='admin-user-create'),
url(r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.AdminUserDetailView.as_view(), name='admin-user-detail'), path('admin-user/<uuid:pk>/', views.AdminUserDetailView.as_view(), name='admin-user-detail'),
url(r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.AdminUserUpdateView.as_view(), name='admin-user-update'), path('admin-user/<uuid:pk>/update/', views.AdminUserUpdateView.as_view(), name='admin-user-update'),
url(r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/delete/$', views.AdminUserDeleteView.as_view(), name='admin-user-delete'), path('admin-user/<uuid:pk>/delete/', views.AdminUserDeleteView.as_view(), name='admin-user-delete'),
url(r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$', views.AdminUserAssetsView.as_view(), name='admin-user-assets'), path('admin-user/<uuid:pk>/assets/', views.AdminUserAssetsView.as_view(), name='admin-user-assets'),
# Resource system user url # Resource system user url
url(r'^system-user/$', views.SystemUserListView.as_view(), name='system-user-list'), path('system-user/', views.SystemUserListView.as_view(), name='system-user-list'),
url(r'^system-user/create/$', views.SystemUserCreateView.as_view(), name='system-user-create'), path('system-user/create/', views.SystemUserCreateView.as_view(), name='system-user-create'),
url(r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.SystemUserDetailView.as_view(), name='system-user-detail'), path('system-user/<uuid:pk>/', views.SystemUserDetailView.as_view(), name='system-user-detail'),
url(r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.SystemUserUpdateView.as_view(), name='system-user-update'), path('system-user/<uuid:pk>/update/', views.SystemUserUpdateView.as_view(), name='system-user-update'),
url(r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/delete/$', views.SystemUserDeleteView.as_view(), name='system-user-delete'), path('system-user/<uuid:pk>/delete/', views.SystemUserDeleteView.as_view(), name='system-user-delete'),
url(r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/asset/$', views.SystemUserAssetView.as_view(), name='system-user-asset'), path('system-user/<uuid:pk>/asset/', views.SystemUserAssetView.as_view(), name='system-user-asset'),
url(r'^label/$', views.LabelListView.as_view(), name='label-list'), path('label/', views.LabelListView.as_view(), name='label-list'),
url(r'^label/create/$', views.LabelCreateView.as_view(), name='label-create'), path('label/create/', views.LabelCreateView.as_view(), name='label-create'),
url(r'^label/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.LabelUpdateView.as_view(), name='label-update'), path('label/<uuid:pk>/update/', views.LabelUpdateView.as_view(), name='label-update'),
url(r'^label/(?P<pk>[0-9a-zA-Z\-]{36})/delete/$', views.LabelDeleteView.as_view(), name='label-delete'), path('label/<uuid:pk>/delete/', views.LabelDeleteView.as_view(), name='label-delete'),
url(r'^domain/$', views.DomainListView.as_view(), name='domain-list'), path('domain/', views.DomainListView.as_view(), name='domain-list'),
url(r'^domain/create/$', views.DomainCreateView.as_view(), name='domain-create'), path('domain/create/', views.DomainCreateView.as_view(), name='domain-create'),
url(r'^domain/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.DomainDetailView.as_view(), name='domain-detail'), path('domain/<uuid:pk>/', views.DomainDetailView.as_view(), name='domain-detail'),
url(r'^domain/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.DomainUpdateView.as_view(), name='domain-update'), path('domain/<uuid:pk>/update/', views.DomainUpdateView.as_view(), name='domain-update'),
url(r'^domain/(?P<pk>[0-9a-zA-Z\-]{36})/delete/$', views.DomainDeleteView.as_view(), name='domain-delete'), path('domain/<uuid:pk>/delete/', views.DomainDeleteView.as_view(), name='domain-delete'),
url(r'^domain/(?P<pk>[0-9a-zA-Z\-]{36})/gateway/$', views.DomainGatewayListView.as_view(), name='domain-gateway-list'), path('domain/<uuid:pk>/gateway/', views.DomainGatewayListView.as_view(), name='domain-gateway-list'),
url(r'^domain/(?P<pk>[0-9a-zA-Z\-]{36})/gateway/create/$', views.DomainGatewayCreateView.as_view(), name='domain-gateway-create'), path('domain/<uuid:pk>/gateway/create/', views.DomainGatewayCreateView.as_view(), name='domain-gateway-create'),
url(r'^domain/gateway/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.DomainGatewayUpdateView.as_view(), name='domain-gateway-update'), path('domain/gateway/<uuid:pk>/update/', views.DomainGatewayUpdateView.as_view(), name='domain-gateway-update'),
] ]
...@@ -12,7 +12,6 @@ router = DefaultRouter() ...@@ -12,7 +12,6 @@ router = DefaultRouter()
router.register(r'ftp-log', api.FTPLogViewSet, 'ftp-log') router.register(r'ftp-log', api.FTPLogViewSet, 'ftp-log')
urlpatterns = [ urlpatterns = [
# url(r'^celery/task/(?P<pk>[0-9a-zA-Z\-]{36})/log/$', api.CeleryTaskLogApi.as_view(), name='celery-task-log'),
] ]
urlpatterns += router.urls urlpatterns += router.urls
# ~*~ coding: utf-8 ~*~ # ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals from __future__ import unicode_literals
from django.urls import path
from django.conf.urls import url
from .. import views from .. import views
__all__ = ["urlpatterns"] __all__ = ["urlpatterns"]
...@@ -10,5 +9,5 @@ __all__ = ["urlpatterns"] ...@@ -10,5 +9,5 @@ __all__ = ["urlpatterns"]
app_name = "audits" app_name = "audits"
urlpatterns = [ urlpatterns = [
url(r'^ftp-log/$', views.FTPLogListView.as_view(), name='ftp-log-list'), path('ftp-log/', views.FTPLogListView.as_view(), name='ftp-log-list'),
] ]
from __future__ import absolute_import from __future__ import absolute_import
from django.conf.urls import url from django.urls import path
from .. import api from .. import api
app_name = 'common' app_name = 'common'
urlpatterns = [ urlpatterns = [
url(r'^mail/testing/$', api.MailTestingAPI.as_view(), name='mail-testing'), path('mail/testing/', api.MailTestingAPI.as_view(), name='mail-testing'),
url(r'^ldap/testing/$', api.LDAPTestingAPI.as_view(), name='ldap-testing'), path('ldap/testing/', api.LDAPTestingAPI.as_view(), name='ldap-testing'),
# url(r'^django-settings/$', api.DjangoSettingsAPI.as_view(), name='django-settings'), # path('django-settings/', api.DjangoSettingsAPI.as_view(), name='django-settings'),
] ]
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import re import re
from django.conf.urls import url, include from django.urls import path, include, re_path
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from rest_framework.response import Response from rest_framework.response import Response
...@@ -10,23 +10,19 @@ from django.views.decorators.csrf import csrf_exempt ...@@ -10,23 +10,19 @@ from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse from django.http import HttpResponse
from django.utils.encoding import iri_to_uri from django.utils.encoding import iri_to_uri
from rest_framework import permissions from rest_framework import permissions
# from rest_framework.schemas import get_schema_view
# from rest_framework_swagger.renderers import SwaggerUIRenderer, OpenAPIRenderer
from drf_yasg.views import get_schema_view from drf_yasg.views import get_schema_view
from drf_yasg import openapi from drf_yasg import openapi
from .views import IndexView, LunaView from .views import IndexView, LunaView
# schema_view = get_schema_view(title='Users API', renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer])
schema_view = get_schema_view( schema_view = get_schema_view(
openapi.Info( openapi.Info(
title="Snippets API", title="Jumpserver API Docs",
default_version='v1', default_version='v1',
description="Test description", description="Jumpserver Restful api docs",
terms_of_service="https://www.google.com/policies/terms/", terms_of_service="https://www.jumpserver.org",
contact=openapi.Contact(email="contact@snippets.local"), contact=openapi.Contact(email="support@fit2cloud.com"),
license=openapi.License(name="BSD License"), license=openapi.License(name="GPLv2 License"),
), ),
public=True, public=True,
permission_classes=(permissions.AllowAny,), permission_classes=(permissions.AllowAny,),
...@@ -44,52 +40,51 @@ class HttpResponseTemporaryRedirect(HttpResponse): ...@@ -44,52 +40,51 @@ class HttpResponseTemporaryRedirect(HttpResponse):
@csrf_exempt @csrf_exempt
def redirect_format_api(request, *args, **kwargs): def redirect_format_api(request, *args, **kwargs):
path, query = request.path, request.GET.urlencode() _path, query = request.path, request.GET.urlencode()
matched = api_url_pattern.match(path) matched = api_url_pattern.match(_path)
if matched: if matched:
version, app, extra = matched.groups() version, app, extra = matched.groups()
path = '/api/{app}/{version}/{extra}?{query}'.format(**{ _path = '/api/{app}/{version}/{extra}?{query}'.format(**{
"app": app, "version": version, "extra": extra, "app": app, "version": version, "extra": extra,
"query": query "query": query
}) })
return HttpResponseTemporaryRedirect(path) return HttpResponseTemporaryRedirect(_path)
else: else:
return Response({"msg": "Redirect url failed: {}".format(path)}, status=404) return Response({"msg": "Redirect url failed: {}".format(_path)}, status=404)
v1_api_patterns = [ v1_api_patterns = [
url(r'^users/v1/', include('users.urls.api_urls', namespace='api-users')), path('users/v1/', include('users.urls.api_urls', namespace='api-users')),
url(r'^assets/v1/', include('assets.urls.api_urls', namespace='api-assets')), path('assets/v1/', include('assets.urls.api_urls', namespace='api-assets')),
url(r'^perms/v1/', include('perms.urls.api_urls', namespace='api-perms')), path('perms/v1/', include('perms.urls.api_urls', namespace='api-perms')),
url(r'^terminal/v1/', include('terminal.urls.api_urls', namespace='api-terminal')), path('terminal/v1/', include('terminal.urls.api_urls', namespace='api-terminal')),
url(r'^ops/v1/', include('ops.urls.api_urls', namespace='api-ops')), path('ops/v1/', include('ops.urls.api_urls', namespace='api-ops')),
url(r'^audits/v1/', include('audits.urls.api_urls', namespace='api-audits')), path('audits/v1/', include('audits.urls.api_urls', namespace='api-audits')),
url(r'^orgs/v1/', include('orgs.urls.api_urls', namespace='api-orgs')), path('orgs/v1/', include('orgs.urls.api_urls', namespace='api-orgs')),
url(r'^common/v1/', include('common.urls.api_urls', namespace='api-common')), path('common/v1/', include('common.urls.api_urls', namespace='api-common')),
] ]
app_view_patterns = [ app_view_patterns = [
url(r'^users/', include('users.urls.views_urls', namespace='users')), path('users/', include('users.urls.views_urls', namespace='users')),
url(r'^assets/', include('assets.urls.views_urls', namespace='assets')), path('assets/', include('assets.urls.views_urls', namespace='assets')),
url(r'^perms/', include('perms.urls.views_urls', namespace='perms')), path('perms/', include('perms.urls.views_urls', namespace='perms')),
url(r'^terminal/', include('terminal.urls.views_urls', namespace='terminal')), path('terminal/', include('terminal.urls.views_urls', namespace='terminal')),
url(r'^ops/', include('ops.urls.view_urls', namespace='ops')), path('ops/', include('ops.urls.view_urls', namespace='ops')),
url(r'^audits/', include('audits.urls.view_urls', namespace='audits')), path('audits/', include('audits.urls.view_urls', namespace='audits')),
url(r'^orgs/', include('orgs.urls.views_urls', namespace='orgs')), path('orgs/', include('orgs.urls.views_urls', namespace='orgs')),
] ]
urlpatterns = [ urlpatterns = [
url(r'^$', IndexView.as_view(), name='index'), path('', IndexView.as_view(), name='index'),
url(r'^luna/', LunaView.as_view(), name='luna-error'), path('luna/', LunaView.as_view(), name='luna-error'),
url(r'^settings/', include('common.urls.view_urls', namespace='settings')), path('settings/', include('common.urls.view_urls', namespace='settings')),
url(r'^common/', include('common.urls.view_urls', namespace='common')), path('common/', include('common.urls.view_urls', namespace='common')),
url(r'^api/v1/.*', redirect_format_api), path('api/v1/', redirect_format_api),
url(r'^api/', include(v1_api_patterns)), path('api/', include(v1_api_patterns)),
# Api url view map
# External apps url # External apps url
url(r'^captcha/', include('captcha.urls')), path('captcha/', include('captcha.urls')),
] ]
urlpatterns += app_view_patterns urlpatterns += app_view_patterns
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \
...@@ -97,7 +92,7 @@ urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ ...@@ -97,7 +92,7 @@ urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \
if settings.DEBUG: if settings.DEBUG:
urlpatterns += [ urlpatterns += [
url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=None), name='schema-json'), re_path('swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=None), name='schema-json'),
url(r'^docs/', schema_view.with_ui('swagger', cache_timeout=None), name="docs"), path('docs/', schema_view.with_ui('swagger', cache_timeout=None), name="docs"),
url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=None), name='redoc'), path('redoc/', schema_view.with_ui('redoc', cache_timeout=None), name='redoc'),
] ]
# ~*~ coding: utf-8 ~*~ # ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals from __future__ import unicode_literals
from django.conf.urls import url from django.urls import path
from rest_framework.routers import DefaultRouter from rest_framework.routers import DefaultRouter
from .. import api from .. import api
...@@ -14,8 +14,8 @@ router.register(r'adhoc', api.AdHocViewSet, 'adhoc') ...@@ -14,8 +14,8 @@ router.register(r'adhoc', api.AdHocViewSet, 'adhoc')
router.register(r'history', api.AdHocRunHistorySet, 'history') router.register(r'history', api.AdHocRunHistorySet, 'history')
urlpatterns = [ urlpatterns = [
url(r'^tasks/(?P<pk>[0-9a-zA-Z\-]{36})/run/$', api.TaskRun.as_view(), name='task-run'), path('tasks/<uuid:pk>/run/', api.TaskRun.as_view(), name='task-run'),
url(r'^celery/task/(?P<pk>[0-9a-zA-Z\-]{36})/log/$', api.CeleryTaskLogApi.as_view(), name='celery-task-log'), path('celery/task/<uuid:pk>/log/', api.CeleryTaskLogApi.as_view(), name='celery-task-log'),
] ]
urlpatterns += router.urls urlpatterns += router.urls
# ~*~ coding: utf-8 ~*~ # ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals from __future__ import unicode_literals
from django.urls import path
from django.conf.urls import url
from .. import views from .. import views
__all__ = ["urlpatterns"] __all__ = ["urlpatterns"]
...@@ -10,13 +9,13 @@ __all__ = ["urlpatterns"] ...@@ -10,13 +9,13 @@ __all__ = ["urlpatterns"]
app_name = "ops" app_name = "ops"
urlpatterns = [ urlpatterns = [
# TResource Task url # Resource Task url
url(r'^task/$', views.TaskListView.as_view(), name='task-list'), path('task/', views.TaskListView.as_view(), name='task-list'),
url(r'^task/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.TaskDetailView.as_view(), name='task-detail'), path('task/<uuid:pk>/', views.TaskDetailView.as_view(), name='task-detail'),
url(r'^task/(?P<pk>[0-9a-zA-Z\-]{36})/adhoc/$', views.TaskAdhocView.as_view(), name='task-adhoc'), path('task/<uuid:pk>/adhoc/', views.TaskAdhocView.as_view(), name='task-adhoc'),
url(r'^task/(?P<pk>[0-9a-zA-Z\-]{36})/history/$', views.TaskHistoryView.as_view(), name='task-history'), path('task/<uuid:pk>/history/', views.TaskHistoryView.as_view(), name='task-history'),
url(r'^adhoc/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.AdHocDetailView.as_view(), name='adhoc-detail'), path('adhoc/<uuid:pk>/', views.AdHocDetailView.as_view(), name='adhoc-detail'),
url(r'^adhoc/(?P<pk>[0-9a-zA-Z\-]{36})/history/$', views.AdHocHistoryView.as_view(), name='adhoc-history'), path('adhoc/<uuid:pk>/history/', views.AdHocHistoryView.as_view(), name='adhoc-history'),
url(r'^adhoc/history/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.AdHocHistoryDetailView.as_view(), name='adhoc-history-detail'), path('adhoc/history/<uuid:pk>/', views.AdHocHistoryDetailView.as_view(), name='adhoc-history-detail'),
url(r'^celery/task/(?P<pk>[0-9a-zA-Z\-]{36})/log/$', views.CeleryTaskLogView.as_view(), name='celery-task-log'), path('celery/task/<uuid:pk>/log/', views.CeleryTaskLogView.as_view(), name='celery-task-log'),
] ]
...@@ -6,7 +6,6 @@ from .models import Organization ...@@ -6,7 +6,6 @@ from .models import Organization
def org_processor(request): def org_processor(request):
print('Crernt Org', current_org.name)
context = { context = {
'ADMIN_ORGS': Organization.get_user_admin_orgs(request.user), 'ADMIN_ORGS': Organization.get_user_admin_orgs(request.user),
'CURRENT_ORG': get_current_org(), 'CURRENT_ORG': get_current_org(),
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
from django.conf.urls import url
from rest_framework.routers import DefaultRouter from rest_framework.routers import DefaultRouter
from .. import api from .. import api
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
from django.conf.urls import url from django.urls import path
from .. import views from .. import views
app_name = 'orgs' app_name = 'orgs'
urlpatterns = [ urlpatterns = [
url(r'^(?P<pk>.*)/switch/$', views.SwitchOrgView.as_view(), name='org-switch'), path('<str:pk>/switch/', views.SwitchOrgView.as_view(), name='org-switch'),
url(r'^switch-a-org/$', views.SwitchToAOrgView.as_view(), name='switch-a-org') path('switch-a-org/', views.SwitchToAOrgView.as_view(), name='switch-a-org')
] ]
# coding:utf-8 # coding:utf-8
from django.conf.urls import url from django.urls import path
from rest_framework import routers from rest_framework import routers
from .. import api from .. import api
...@@ -11,53 +11,52 @@ router.register('asset-permissions', api.AssetPermissionViewSet, 'asset-permissi ...@@ -11,53 +11,52 @@ router.register('asset-permissions', api.AssetPermissionViewSet, 'asset-permissi
urlpatterns = [ urlpatterns = [
# 查询某个用户授权的资产和资产组 # 查询某个用户授权的资产和资产组
url(r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$', path('user/<uuid:pk>/assets/',
api.UserGrantedAssetsApi.as_view(), name='user-assets'), api.UserGrantedAssetsApi.as_view(), name='user-assets'),
url(r'^user/assets/$', api.UserGrantedAssetsApi.as_view(), path('user/assets/', api.UserGrantedAssetsApi.as_view(),
name='my-assets'), name='my-assets'),
url(r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/nodes/$', path('user/<uuid:pk>/nodes/',
api.UserGrantedNodesApi.as_view(), name='user-nodes'), api.UserGrantedNodesApi.as_view(), name='user-nodes'),
url(r'^user/nodes/$', api.UserGrantedNodesApi.as_view(), path('user/nodes/', api.UserGrantedNodesApi.as_view(),
name='my-nodes'), name='my-nodes'),
url( path('user/<uuid:pk>/nodes/<uuid:node_id>/assets/',
r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/nodes/(?P<node_id>[0-9a-zA-Z\-]{36})/assets/$', api.UserGrantedNodeAssetsApi.as_view(), name='user-node-assets'),
api.UserGrantedNodeAssetsApi.as_view(), name='user-node-assets'), path('user/nodes/<uuid:node_id>/assets/',
url(r'^user/nodes/(?P<node_id>[0-9a-zA-Z\-]{36})/assets/$', api.UserGrantedNodeAssetsApi.as_view(), name='my-node-assets'),
api.UserGrantedNodeAssetsApi.as_view(), name='my-node-assets'), path('user/<uuid:pk>/nodes-assets/',
url(r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/nodes-assets/$', api.UserGrantedNodesWithAssetsApi.as_view(), name='user-nodes-assets'),
api.UserGrantedNodesWithAssetsApi.as_view(), name='user-nodes-assets'), path('user/nodes-assets/', api.UserGrantedNodesWithAssetsApi.as_view(),
url(r'^user/nodes-assets/$', api.UserGrantedNodesWithAssetsApi.as_view(), name='my-nodes-assets'),
name='my-nodes-assets'),
# 查询某个用户组授权的资产和资产组 # 查询某个用户组授权的资产和资产组
url(r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$', path('user-group/<uuid:pk>/assets/',
api.UserGroupGrantedAssetsApi.as_view(), name='user-group-assets'), api.UserGroupGrantedAssetsApi.as_view(), name='user-group-assets'),
url(r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/nodes/$', path('user-group/<uuid:pk>/nodes/',
api.UserGroupGrantedNodesApi.as_view(), name='user-group-nodes'), api.UserGroupGrantedNodesApi.as_view(), name='user-group-nodes'),
url(r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/nodes-assets/$', path('user-group/<uuid:pk>/nodes-assets/',
api.UserGroupGrantedNodesWithAssetsApi.as_view(), api.UserGroupGrantedNodesWithAssetsApi.as_view(),
name='user-group-nodes-assets'), name='user-group-nodes-assets'),
url( path('user-group/<uuid:pk>/nodes/<uuid:node_id>/assets/',
r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/nodes/(?P<node_id>[0-9a-zA-Z\-]{36})/assets/$', api.UserGroupGrantedNodeAssetsApi.as_view(),
api.UserGroupGrantedNodeAssetsApi.as_view(), name='user-group-node-assets'),
name='user-group-node-assets'),
# 用户和资产授权变更 # 用户和资产授权变更
url(r'^asset-permissions/(?P<pk>[0-9a-zA-Z\-]{36})/user/remove/$', path('asset-permissions/<uuid:pk>/user/remove/',
api.AssetPermissionRemoveUserApi.as_view(), api.AssetPermissionRemoveUserApi.as_view(),
name='asset-permission-remove-user'), name='asset-permission-remove-user'),
url(r'^asset-permissions/(?P<pk>[0-9a-zA-Z\-]{36})/user/add/$', path('asset-permissions/<uuid:pk>/user/add/',
api.AssetPermissionAddUserApi.as_view(), api.AssetPermissionAddUserApi.as_view(),
name='asset-permission-add-user'), name='asset-permission-add-user'),
url(r'^asset-permissions/(?P<pk>[0-9a-zA-Z\-]{36})/asset/remove/$', path('asset-permissions/<uuid:pk>/asset/remove/',
api.AssetPermissionRemoveAssetApi.as_view(), api.AssetPermissionRemoveAssetApi.as_view(),
name='asset-permission-remove-asset'), name='asset-permission-remove-asset'),
url(r'^asset-permissions/(?P<pk>[0-9a-zA-Z\-]{36})/asset/add/$', path('asset-permissions/<uuid:pk>/asset/add/',
api.AssetPermissionAddAssetApi.as_view(), api.AssetPermissionAddAssetApi.as_view(),
name='asset-permission-add-asset'), name='asset-permission-add-asset'),
# 验证用户是否有某个资产和系统用户的权限 # 验证用户是否有某个资产和系统用户的权限
url(r'asset-permission/user/validate/$', api.ValidateUserAssetPermissionView.as_view(), name='validate-user-asset-permission'), path('asset-permission/user/validate/', api.ValidateUserAssetPermissionView.as_view(),
name='validate-user-asset-permission'),
] ]
urlpatterns += router.urls urlpatterns += router.urls
......
# coding:utf-8 # coding:utf-8
from django.conf.urls import url from django.conf.urls import url
from django.urls import path
from .. import views from .. import views
app_name = 'perms' app_name = 'perms'
urlpatterns = [ urlpatterns = [
url(r'^asset-permission/$', views.AssetPermissionListView.as_view(), name='asset-permission-list'), path('asset-permission/', views.AssetPermissionListView.as_view(), name='asset-permission-list'),
url(r'^asset-permission/create/$', views.AssetPermissionCreateView.as_view(), name='asset-permission-create'), path('asset-permission/create/', views.AssetPermissionCreateView.as_view(), name='asset-permission-create'),
url(r'^asset-permission/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.AssetPermissionUpdateView.as_view(), name='asset-permission-update'), path('asset-permission/<uuid:pk>/update/', views.AssetPermissionUpdateView.as_view(), name='asset-permission-update'),
url(r'^asset-permission/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.AssetPermissionDetailView.as_view(),name='asset-permission-detail'), path('asset-permission/<uuid:pk>/', views.AssetPermissionDetailView.as_view(),name='asset-permission-detail'),
url(r'^asset-permission/(?P<pk>[0-9a-zA-Z\-]{36})/delete/$', views.AssetPermissionDeleteView.as_view(), name='asset-permission-delete'), path('asset-permission/<uuid:pk>/delete/', views.AssetPermissionDeleteView.as_view(), name='asset-permission-delete'),
url(r'^asset-permission/(?P<pk>[0-9a-zA-Z\-]{36})/user/$', views.AssetPermissionUserView.as_view(), name='asset-permission-user-list'), path('asset-permission/<uuid:pk>/user/', views.AssetPermissionUserView.as_view(), name='asset-permission-user-list'),
url(r'^asset-permission/(?P<pk>[0-9a-zA-Z\-]{36})/asset/$', views.AssetPermissionAssetView.as_view(), name='asset-permission-asset-list'), path('asset-permission/<uuid:pk>/asset/', views.AssetPermissionAssetView.as_view(), name='asset-permission-asset-list'),
] ]
...@@ -253,6 +253,12 @@ jumpserver.selected = {}; ...@@ -253,6 +253,12 @@ jumpserver.selected = {};
jumpserver.language = { jumpserver.language = {
processing: "加载中", processing: "加载中",
search: "搜索", search: "搜索",
select: {
rows: {
_: "选中 %d 项",
0: ""
}
},
lengthMenu: "每页 _MENU_", lengthMenu: "每页 _MENU_",
info: "显示第 _START_ 至 _END_ 项结果; 总共 _TOTAL_ 项", info: "显示第 _START_ 至 _END_ 项结果; 总共 _TOTAL_ 项",
infoFiltered: "", infoFiltered: "",
......
...@@ -6,34 +6,35 @@ ...@@ -6,34 +6,35 @@
<img alt="logo" height="55" width="185" src="/static/img/logo-text.png"/> <img alt="logo" height="55" width="185" src="/static/img/logo-text.png"/>
</div> </div>
</div> </div>
{# <div class="clearfix"></div>#}
<div class="logo-element"> <div class="logo-element">
<img alt="image" height="40px" src="/static/img/logo.png"/> <img alt="image" height="40" src="/static/img/logo.png"/>
</div>
{% if ADMIN_ORGS and ADMIN_ORGS|length != 1 %}
<div style="height: 55px;">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" style="display: block; background-color: transparent; color: #8095a8; padding: 14px 20px 14px 25px">
<i class="fa fa-bookmark" style="width: 14px; "></i>
<span class="nav-label" style="padding-left: 7px">
{{ CURRENT_ORG.name }}
</span>
<span class="fa fa-sort-desc pull-right"></span>
</a>
<ul class="dropdown-menu" style="width: 219px;">
{% for org in ADMIN_ORGS %}
<li>
<a class="org-dropdown"
href="{% url 'orgs:org-switch' pk=org.id %}"
data-id="{{ org.id }}">
{{ org.name }}
{% if org.id == CURRENT_ORG.id %}
<span class="fa fa-circle pull-right" style="padding-top: 5px; color: #1ab394"></span>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div> </div>
{% if ADMIN_ORGS and request.COOKIES.IN_ADMIN_PAGE != 'No' %}
{% if ADMIN_ORGS|length > 1 or not CURRENT_ORG.is_default %}
<div style="height: 55px;">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" style="display: block; background-color: transparent; color: #8095a8; padding: 14px 20px 14px 25px">
<i class="fa fa-bookmark" style="width: 14px; "></i>
<span class="nav-label" style="padding-left: 7px">
{{ CURRENT_ORG.name }}
</span>
<span class="fa fa-sort-desc pull-right"></span>
</a>
<ul class="dropdown-menu" style="width: 219px;">
{% for org in ADMIN_ORGS %}
<li>
<a class="org-dropdown"
href="{% url 'orgs:org-switch' pk=org.id %}"
data-id="{{ org.id }}">
{{ org.name }}
{% if org.id == CURRENT_ORG.id %}
<span class="fa fa-circle pull-right" style="padding-top: 5px; color: #1ab394"></span>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endif %} {% endif %}
</li> </li>
<script> <script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
from django.conf.urls import url from django.urls import path
from rest_framework import routers from rest_framework import routers
from .. import api from .. import api
...@@ -19,15 +19,15 @@ router.register(r'sessions', api.SessionViewSet, 'session') ...@@ -19,15 +19,15 @@ router.register(r'sessions', api.SessionViewSet, 'session')
router.register(r'status', api.StatusViewSet, 'session') router.register(r'status', api.StatusViewSet, 'session')
urlpatterns = [ urlpatterns = [
url(r'^sessions/(?P<pk>[0-9a-zA-Z\-]{36})/replay/$', path('sessions/<uuid:pk>/replay/',
api.SessionReplayV2ViewSet.as_view({'get': 'retrieve', 'post': 'create'}), api.SessionReplayV2ViewSet.as_view({'get': 'retrieve', 'post': 'create'}),
name='session-replay'), name='session-replay'),
url(r'^tasks/kill-session/', api.KillSessionAPI.as_view(), name='kill-session'), path('tasks/kill-session/', api.KillSessionAPI.as_view(), name='kill-session'),
url(r'^terminal/(?P<terminal>[a-zA-Z0-9\-]{36})/access-key', api.TerminalTokenApi.as_view(), path('terminal/<uuid:terminal>/access-key', api.TerminalTokenApi.as_view(),
name='terminal-access-key'), name='terminal-access-key'),
url(r'^terminal/config', api.TerminalConfig.as_view(), name='terminal-config'), path('terminal/config', api.TerminalConfig.as_view(), name='terminal-config'),
# v2: get session's replay # v2: get session's replay
# url(r'^v2/sessions/(?P<pk>[0-9a-zA-Z\-]{36})/replay/$', # path('v2/sessions/<uuid:pk>/replay/',
# api.SessionReplayV2ViewSet.as_view({'get': 'retrieve'}), # api.SessionReplayV2ViewSet.as_view({'get': 'retrieve'}),
# name='session-replay-v2'), # name='session-replay-v2'),
] ]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
from django.conf.urls import url from django.urls import path
from .. import views from .. import views
...@@ -10,20 +10,20 @@ app_name = 'terminal' ...@@ -10,20 +10,20 @@ app_name = 'terminal'
urlpatterns = [ urlpatterns = [
# Terminal view # Terminal view
url(r'^terminal/$', views.TerminalListView.as_view(), name='terminal-list'), path('terminal/', views.TerminalListView.as_view(), name='terminal-list'),
url(r'^terminal/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.TerminalDetailView.as_view(), name='terminal-detail'), path('terminal/<uuid:pk>/', views.TerminalDetailView.as_view(), name='terminal-detail'),
url(r'^terminal/(?P<pk>[0-9a-zA-Z\-]{36})/connect/$', views.TerminalConnectView.as_view(), name='terminal-connect'), path('terminal/<uuid:pk>/connect/', views.TerminalConnectView.as_view(), name='terminal-connect'),
url(r'^terminal/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.TerminalUpdateView.as_view(), name='terminal-update'), path('terminal/<uuid:pk>/update/', views.TerminalUpdateView.as_view(), name='terminal-update'),
url(r'^(?P<pk>[0-9a-zA-Z\-]{36})/accept/$', views.TerminalAcceptView.as_view(), name='terminal-accept'), path('<uuid:pk>/accept/', views.TerminalAcceptView.as_view(), name='terminal-accept'),
url(r'^web-terminal/$', views.WebTerminalView.as_view(), name='web-terminal'), path('web-terminal/', views.WebTerminalView.as_view(), name='web-terminal'),
# Session view # Session view
url(r'^session-online/$', views.SessionOnlineListView.as_view(), name='session-online-list'), path('session-online/', views.SessionOnlineListView.as_view(), name='session-online-list'),
url(r'^session-offline/$', views.SessionOfflineListView.as_view(), name='session-offline-list'), path('session-offline/', views.SessionOfflineListView.as_view(), name='session-offline-list'),
url(r'^session/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.SessionDetailView.as_view(), name='session-detail'), path('session/<uuid:pk>/', views.SessionDetailView.as_view(), name='session-detail'),
# Command view # Command view
url(r'^command/$', views.CommandListView.as_view(), name='command-list'), path('command/', views.CommandListView.as_view(), name='command-list'),
url(r'^command/export/$', views.CommandExportView.as_view(), name='command-export') path('command/export/', views.CommandExportView.as_view(), name='command-export')
] ]
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
from __future__ import absolute_import from __future__ import absolute_import
from django.conf.urls import url from django.urls import path
from rest_framework_bulk.routes import BulkRouter from rest_framework_bulk.routes import BulkRouter
from .. import api from .. import api
...@@ -15,26 +15,19 @@ router.register(r'groups', api.UserGroupViewSet, 'user-group') ...@@ -15,26 +15,19 @@ router.register(r'groups', api.UserGroupViewSet, 'user-group')
urlpatterns = [ urlpatterns = [
# url(r'', api.UserListView.as_view()), # path(r'', api.UserListView.as_view()),
url(r'^token/$', api.UserToken.as_view(), name='user-token'), path('token/', api.UserToken.as_view(), name='user-token'),
url(r'^connection-token/$', api.UserConnectionTokenApi.as_view(), name='connection-token'), path('connection-token/', api.UserConnectionTokenApi.as_view(), name='connection-token'),
url(r'^profile/$', api.UserProfile.as_view(), name='user-profile'), path('profile/', api.UserProfile.as_view(), name='user-profile'),
url(r'^auth/$', api.UserAuthApi.as_view(), name='user-auth'), path('auth/', api.UserAuthApi.as_view(), name='user-auth'),
url(r'^otp/auth/$', api.UserOtpAuthApi.as_view(), name='user-otp-auth'), path('otp/auth/', api.UserOtpAuthApi.as_view(), name='user-otp-auth'),
url(r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/password/$', path('users/<uuid:pk>/password/', api.ChangeUserPasswordApi.as_view(), name='change-user-password'),
api.ChangeUserPasswordApi.as_view(), name='change-user-password'), path('users/<uuid:pk>/password/reset/', api.UserResetPasswordApi.as_view(), name='user-reset-password'),
url(r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/password/reset/$', path('users/<uuid:pk>/pubkey/reset/', api.UserResetPKApi.as_view(), name='user-public-key-reset'),
api.UserResetPasswordApi.as_view(), name='user-reset-password'), path('users/<uuid:pk>/pubkey/update/', api.UserUpdatePKApi.as_view(), name='user-public-key-update'),
url(r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/pubkey/reset/$', path('users/<uuid:pk>/unblock/', api.UserUnblockPKApi.as_view(), name='user-unblock'),
api.UserResetPKApi.as_view(), name='user-public-key-reset'), path('users/<uuid:pk>/groups/', api.UserUpdateGroupApi.as_view(), name='user-update-group'),
url(r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/pubkey/update/$', path('groups/<uuid:pk>/users/', api.UserGroupUpdateUserApi.as_view(), name='user-group-update-user'),
api.UserUpdatePKApi.as_view(), name='user-public-key-update'),
url(r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/unblock/$',
api.UserUnblockPKApi.as_view(), name='user-unblock'),
url(r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/groups/$',
api.UserUpdateGroupApi.as_view(), name='user-update-group'),
url(r'^groups/(?P<pk>[0-9a-zA-Z\-]{36})/users/$',
api.UserGroupUpdateUserApi.as_view(), name='user-group-update-user'),
] ]
urlpatterns += router.urls urlpatterns += router.urls
from __future__ import absolute_import from __future__ import absolute_import
from django.conf.urls import url from django.urls import path
from .. import views from .. import views
...@@ -8,45 +8,45 @@ app_name = 'users' ...@@ -8,45 +8,45 @@ app_name = 'users'
urlpatterns = [ urlpatterns = [
# Login view # Login view
url(r'^login/$', views.UserLoginView.as_view(), name='login'), path('login/', views.UserLoginView.as_view(), name='login'),
url(r'^logout/$', views.UserLogoutView.as_view(), name='logout'), path('logout/', views.UserLogoutView.as_view(), name='logout'),
url(r'^login/otp/$', views.UserLoginOtpView.as_view(), name='login-otp'), path('login/otp/', views.UserLoginOtpView.as_view(), name='login-otp'),
url(r'^password/forgot/$', views.UserForgotPasswordView.as_view(), name='forgot-password'), path('password/forgot/', views.UserForgotPasswordView.as_view(), name='forgot-password'),
url(r'^password/forgot/sendmail-success/$', views.UserForgotPasswordSendmailSuccessView.as_view(), name='forgot-password-sendmail-success'), path('password/forgot/sendmail-success/', views.UserForgotPasswordSendmailSuccessView.as_view(), name='forgot-password-sendmail-success'),
url(r'^password/reset/$', views.UserResetPasswordView.as_view(), name='reset-password'), path('password/reset/', views.UserResetPasswordView.as_view(), name='reset-password'),
url(r'^password/reset/success/$', views.UserResetPasswordSuccessView.as_view(), name='reset-password-success'), path('password/reset/success/', views.UserResetPasswordSuccessView.as_view(), name='reset-password-success'),
# Profile # Profile
url(r'^profile/$', views.UserProfileView.as_view(), name='user-profile'), path('profile/', views.UserProfileView.as_view(), name='user-profile'),
url(r'^profile/update/$', views.UserProfileUpdateView.as_view(), name='user-profile-update'), path('profile/update/', views.UserProfileUpdateView.as_view(), name='user-profile-update'),
url(r'^profile/password/update/$', views.UserPasswordUpdateView.as_view(), name='user-password-update'), path('profile/password/update/', views.UserPasswordUpdateView.as_view(), name='user-password-update'),
url(r'^profile/pubkey/update/$', views.UserPublicKeyUpdateView.as_view(), name='user-pubkey-update'), path('profile/pubkey/update/', views.UserPublicKeyUpdateView.as_view(), name='user-pubkey-update'),
url(r'^profile/pubkey/generate/$', views.UserPublicKeyGenerateView.as_view(), name='user-pubkey-generate'), path('profile/pubkey/generate/', views.UserPublicKeyGenerateView.as_view(), name='user-pubkey-generate'),
url(r'^profile/otp/enable/authentication/$', views.UserOtpEnableAuthenticationView.as_view(), name='user-otp-enable-authentication'), path('profile/otp/enable/authentication/', views.UserOtpEnableAuthenticationView.as_view(), name='user-otp-enable-authentication'),
url(r'^profile/otp/enable/install-app/$', views.UserOtpEnableInstallAppView.as_view(), name='user-otp-enable-install-app'), path('profile/otp/enable/install-app/', views.UserOtpEnableInstallAppView.as_view(), name='user-otp-enable-install-app'),
url(r'^profile/otp/enable/bind/$', views.UserOtpEnableBindView.as_view(), name='user-otp-enable-bind'), path('profile/otp/enable/bind/', views.UserOtpEnableBindView.as_view(), name='user-otp-enable-bind'),
url(r'^profile/otp/disable/authentication/$', views.UserOtpDisableAuthenticationView.as_view(), name='user-otp-disable-authentication'), path('profile/otp/disable/authentication/', views.UserOtpDisableAuthenticationView.as_view(), name='user-otp-disable-authentication'),
url(r'^profile/otp/settings-success/$', views.UserOtpSettingsSuccessView.as_view(), name='user-otp-settings-success'), path('profile/otp/settings-success/', views.UserOtpSettingsSuccessView.as_view(), name='user-otp-settings-success'),
# User view # User view
url(r'^user/$', views.UserListView.as_view(), name='user-list'), path('user/', views.UserListView.as_view(), name='user-list'),
url(r'^user/export/$', views.UserExportView.as_view(), name='user-export'), path('user/export/', views.UserExportView.as_view(), name='user-export'),
url(r'^first-login/$', views.UserFirstLoginView.as_view(), name='user-first-login'), path('first-login/', views.UserFirstLoginView.as_view(), name='user-first-login'),
url(r'^user/import/$', views.UserBulkImportView.as_view(), name='user-import'), path('user/import/', views.UserBulkImportView.as_view(), name='user-import'),
url(r'^user/create/$', views.UserCreateView.as_view(), name='user-create'), path('user/create/', views.UserCreateView.as_view(), name='user-create'),
url(r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.UserUpdateView.as_view(), name='user-update'), path('user/<uuid:pk>/update/', views.UserUpdateView.as_view(), name='user-update'),
url(r'^user/update/$', views.UserBulkUpdateView.as_view(), name='user-bulk-update'), path('user/update/', views.UserBulkUpdateView.as_view(), name='user-bulk-update'),
url(r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.UserDetailView.as_view(), name='user-detail'), path('user/<uuid:pk>/', views.UserDetailView.as_view(), name='user-detail'),
url(r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$', views.UserGrantedAssetView.as_view(), name='user-granted-asset'), path('user/<uuid:pk>/assets/', views.UserGrantedAssetView.as_view(), name='user-granted-asset'),
url(r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/login-history/$', views.UserDetailView.as_view(), name='user-login-history'), path('user/<uuid:pk>/login-history/', views.UserDetailView.as_view(), name='user-login-history'),
# User group view # User group view
url(r'^user-group/$', views.UserGroupListView.as_view(), name='user-group-list'), path('user-group/', views.UserGroupListView.as_view(), name='user-group-list'),
url(r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.UserGroupDetailView.as_view(), name='user-group-detail'), path('user-group/<uuid:pk>/', views.UserGroupDetailView.as_view(), name='user-group-detail'),
url(r'^user-group/create/$', views.UserGroupCreateView.as_view(), name='user-group-create'), path('user-group/create/', views.UserGroupCreateView.as_view(), name='user-group-create'),
url(r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/update/$', views.UserGroupUpdateView.as_view(), name='user-group-update'), path('user-group/<uuid:pk>/update/', views.UserGroupUpdateView.as_view(), name='user-group-update'),
url(r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$', views.UserGroupGrantedAssetView.as_view(), name='user-group-granted-asset'), path('user-group/<uuid:pk>/assets/', views.UserGroupGrantedAssetView.as_view(), name='user-group-granted-asset'),
# Login log # Login log
url(r'^login-log/$', views.LoginLogListView.as_view(), name='login-log-list'), path('login-log/', views.LoginLogListView.as_view(), name='login-log-list'),
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment