Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
23815f87
Commit
23815f87
authored
Jul 27, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 升级url
parent
8afd5ef9
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
222 additions
and
232 deletions
+222
-232
api_urls.py
apps/assets/urls/api_urls.py
+22
-22
views_urls.py
apps/assets/urls/views_urls.py
+38
-38
api_urls.py
apps/audits/urls/api_urls.py
+0
-1
view_urls.py
apps/audits/urls/view_urls.py
+2
-3
api_urls.py
apps/common/urls/api_urls.py
+4
-4
urls.py
apps/jumpserver/urls.py
+36
-41
api_urls.py
apps/ops/urls/api_urls.py
+3
-3
view_urls.py
apps/ops/urls/view_urls.py
+10
-11
context_processor.py
apps/orgs/context_processor.py
+0
-1
api_urls.py
apps/orgs/urls/api_urls.py
+0
-2
views_urls.py
apps/orgs/urls/views_urls.py
+4
-3
api_urls.py
apps/perms/urls/api_urls.py
+19
-20
views_urls.py
apps/perms/urls/views_urls.py
+8
-7
jumpserver.js
apps/static/js/jumpserver.js
+6
-0
_user_profile.html
apps/templates/_user_profile.html
+4
-3
api_urls.py
apps/terminal/urls/api_urls.py
+6
-6
views_urls.py
apps/terminal/urls/views_urls.py
+12
-12
api_urls.py
apps/users/urls/api_urls.py
+14
-21
views_urls.py
apps/users/urls/views_urls.py
+34
-34
No files found.
apps/assets/urls/api_urls.py
View file @
23815f87
# coding:utf-8
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
..
import
api
from
rest_framework_bulk.routes
import
BulkRouter
...
...
@@ -16,44 +16,44 @@ router.register(r'domain', api.DomainViewSet, 'domain')
router
.
register
(
r'gateway'
,
api
.
GatewayViewSet
,
'gateway'
)
urlpatterns
=
[
url
(
r'^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
()
,
name
=
'system-user-auth-info'
),
url
(
r'^assets/(?P<pk>[0-9a-zA-Z\-]{36})/refresh/$
'
,
path
(
'assets-bulk/
'
,
api
.
AssetListUpdateApi
.
as_view
(),
name
=
'asset-bulk-update'
),
path
(
'system-user/<uuid:pk>/auth-info/'
,
api
.
SystemUserAuthInfoApi
.
as_view
(),
name
=
'system-user-auth-info'
),
path
(
'assets/<uuid:pk>/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'
),
url
(
r'^assets/(?P<pk>[0-9a-zA-Z\-]{36})/gateway/$
'
,
path
(
'assets/<uuid:pk>/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'
),
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'
),
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'
),
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'
),
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'
),
url
(
r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/children/$
'
,
path
(
'nodes/<uuid:pk>/children/
'
,
api
.
NodeChildrenApi
.
as_view
(),
name
=
'node-children'
),
url
(
r'^nodes/children/$
'
,
api
.
NodeChildrenApi
.
as_view
(),
name
=
'node-children-2'
),
url
(
r'^nodes/(?P<pk>[0-9a-zA-Z\-]{36})/children/add/$
'
,
path
(
'nodes/children/
'
,
api
.
NodeChildrenApi
.
as_view
(),
name
=
'node-children-2'
),
path
(
'nodes/<uuid:pk>/children/add/
'
,
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'
),
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'
),
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'
),
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'
),
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'
),
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'
),
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'
),
]
...
...
apps/assets/urls/views_urls.py
View file @
23815f87
# coding:utf-8
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
..
import
views
app_name
=
'assets'
urlpatterns
=
[
# Resource asset url
url
(
r'^$
'
,
views
.
AssetListView
.
as_view
(),
name
=
'asset-index'
),
url
(
r'^asset/$
'
,
views
.
AssetListView
.
as_view
(),
name
=
'asset-list'
),
url
(
r'^asset/create/$
'
,
views
.
AssetCreateView
.
as_view
(),
name
=
'asset-create'
),
url
(
r'^asset/export/$
'
,
views
.
AssetExportView
.
as_view
(),
name
=
'asset-export'
),
url
(
r'^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'
),
url
(
r'^asset/(?P<pk>[0-9a-zA-Z\-]{36})/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'
),
url
(
r'^asset/update/$
'
,
views
.
AssetBulkUpdateView
.
as_view
(),
name
=
'asset-bulk-update'
),
path
(
'
'
,
views
.
AssetListView
.
as_view
(),
name
=
'asset-index'
),
path
(
'asset/
'
,
views
.
AssetListView
.
as_view
(),
name
=
'asset-list'
),
path
(
'asset/create/
'
,
views
.
AssetCreateView
.
as_view
(),
name
=
'asset-create'
),
path
(
'asset/export/
'
,
views
.
AssetExportView
.
as_view
(),
name
=
'asset-export'
),
path
(
'asset/import/
'
,
views
.
BulkImportAssetView
.
as_view
(),
name
=
'asset-import'
),
path
(
'asset/<uuid:pk>/
'
,
views
.
AssetDetailView
.
as_view
(),
name
=
'asset-detail'
),
path
(
'asset/<uuid:pk>/update/
'
,
views
.
AssetUpdateView
.
as_view
(),
name
=
'asset-update'
),
path
(
'asset/<uuid:pk>/delete/
'
,
views
.
AssetDeleteView
.
as_view
(),
name
=
'asset-delete'
),
path
(
'asset/update/
'
,
views
.
AssetBulkUpdateView
.
as_view
(),
name
=
'asset-bulk-update'
),
# 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
url
(
r'^admin-user/$
'
,
views
.
AdminUserListView
.
as_view
(),
name
=
'admin-user-list'
),
url
(
r'^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'
),
url
(
r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/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'
),
url
(
r'^admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$
'
,
views
.
AdminUserAssetsView
.
as_view
(),
name
=
'admin-user-assets'
),
path
(
'admin-user/
'
,
views
.
AdminUserListView
.
as_view
(),
name
=
'admin-user-list'
),
path
(
'admin-user/create/
'
,
views
.
AdminUserCreateView
.
as_view
(),
name
=
'admin-user-create'
),
path
(
'admin-user/<uuid:pk>/
'
,
views
.
AdminUserDetailView
.
as_view
(),
name
=
'admin-user-detail'
),
path
(
'admin-user/<uuid:pk>/update/
'
,
views
.
AdminUserUpdateView
.
as_view
(),
name
=
'admin-user-update'
),
path
(
'admin-user/<uuid:pk>/delete/
'
,
views
.
AdminUserDeleteView
.
as_view
(),
name
=
'admin-user-delete'
),
path
(
'admin-user/<uuid:pk>/assets/
'
,
views
.
AdminUserAssetsView
.
as_view
(),
name
=
'admin-user-assets'
),
# Resource system user url
url
(
r'^system-user/$
'
,
views
.
SystemUserListView
.
as_view
(),
name
=
'system-user-list'
),
url
(
r'^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'
),
url
(
r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/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'
),
url
(
r'^system-user/(?P<pk>[0-9a-zA-Z\-]{36})/asset/$
'
,
views
.
SystemUserAssetView
.
as_view
(),
name
=
'system-user-asset'
),
url
(
r'^label/$
'
,
views
.
LabelListView
.
as_view
(),
name
=
'label-list'
),
url
(
r'^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'
),
url
(
r'^label/(?P<pk>[0-9a-zA-Z\-]{36})/delete/$
'
,
views
.
LabelDeleteView
.
as_view
(),
name
=
'label-delete'
),
url
(
r'^domain/$
'
,
views
.
DomainListView
.
as_view
(),
name
=
'domain-list'
),
url
(
r'^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'
),
url
(
r'^domain/(?P<pk>[0-9a-zA-Z\-]{36})/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'
),
url
(
r'^domain/(?P<pk>[0-9a-zA-Z\-]{36})/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'
),
url
(
r'^domain/gateway/(?P<pk>[0-9a-zA-Z\-]{36})/update/$
'
,
views
.
DomainGatewayUpdateView
.
as_view
(),
name
=
'domain-gateway-update'
),
path
(
'system-user/
'
,
views
.
SystemUserListView
.
as_view
(),
name
=
'system-user-list'
),
path
(
'system-user/create/
'
,
views
.
SystemUserCreateView
.
as_view
(),
name
=
'system-user-create'
),
path
(
'system-user/<uuid:pk>/
'
,
views
.
SystemUserDetailView
.
as_view
(),
name
=
'system-user-detail'
),
path
(
'system-user/<uuid:pk>/update/
'
,
views
.
SystemUserUpdateView
.
as_view
(),
name
=
'system-user-update'
),
path
(
'system-user/<uuid:pk>/delete/
'
,
views
.
SystemUserDeleteView
.
as_view
(),
name
=
'system-user-delete'
),
path
(
'system-user/<uuid:pk>/asset/
'
,
views
.
SystemUserAssetView
.
as_view
(),
name
=
'system-user-asset'
),
path
(
'label/
'
,
views
.
LabelListView
.
as_view
(),
name
=
'label-list'
),
path
(
'label/create/
'
,
views
.
LabelCreateView
.
as_view
(),
name
=
'label-create'
),
path
(
'label/<uuid:pk>/update/
'
,
views
.
LabelUpdateView
.
as_view
(),
name
=
'label-update'
),
path
(
'label/<uuid:pk>/delete/
'
,
views
.
LabelDeleteView
.
as_view
(),
name
=
'label-delete'
),
path
(
'domain/
'
,
views
.
DomainListView
.
as_view
(),
name
=
'domain-list'
),
path
(
'domain/create/
'
,
views
.
DomainCreateView
.
as_view
(),
name
=
'domain-create'
),
path
(
'domain/<uuid:pk>/
'
,
views
.
DomainDetailView
.
as_view
(),
name
=
'domain-detail'
),
path
(
'domain/<uuid:pk>/update/
'
,
views
.
DomainUpdateView
.
as_view
(),
name
=
'domain-update'
),
path
(
'domain/<uuid:pk>/delete/
'
,
views
.
DomainDeleteView
.
as_view
(),
name
=
'domain-delete'
),
path
(
'domain/<uuid:pk>/gateway/
'
,
views
.
DomainGatewayListView
.
as_view
(),
name
=
'domain-gateway-list'
),
path
(
'domain/<uuid:pk>/gateway/create/
'
,
views
.
DomainGatewayCreateView
.
as_view
(),
name
=
'domain-gateway-create'
),
path
(
'domain/gateway/<uuid:pk>/update/
'
,
views
.
DomainGatewayUpdateView
.
as_view
(),
name
=
'domain-gateway-update'
),
]
apps/audits/urls/api_urls.py
View file @
23815f87
...
...
@@ -12,7 +12,6 @@ router = DefaultRouter()
router
.
register
(
r'ftp-log'
,
api
.
FTPLogViewSet
,
'ftp-log'
)
urlpatterns
=
[
# url(r'^celery/task/(?P<pk>[0-9a-zA-Z\-]{36})/log/$', api.CeleryTaskLogApi.as_view(), name='celery-task-log'),
]
urlpatterns
+=
router
.
urls
apps/audits/urls/view_urls.py
View file @
23815f87
# ~*~ coding: utf-8 ~*~
from
__future__
import
unicode_literals
from
django.conf.urls
import
url
from
django.urls
import
path
from
..
import
views
__all__
=
[
"urlpatterns"
]
...
...
@@ -10,5 +9,5 @@ __all__ = ["urlpatterns"]
app_name
=
"audits"
urlpatterns
=
[
url
(
r'^ftp-log/$
'
,
views
.
FTPLogListView
.
as_view
(),
name
=
'ftp-log-list'
),
path
(
'ftp-log/
'
,
views
.
FTPLogListView
.
as_view
(),
name
=
'ftp-log-list'
),
]
apps/common/urls/api_urls.py
View file @
23815f87
from
__future__
import
absolute_import
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
..
import
api
app_name
=
'common'
urlpatterns
=
[
url
(
r'^mail/testing/$
'
,
api
.
MailTestingAPI
.
as_view
(),
name
=
'mail-testing'
),
url
(
r'^ldap/testing/$
'
,
api
.
LDAPTestingAPI
.
as_view
(),
name
=
'ldap-testing'
),
#
url(r'^django-settings/$
', api.DjangoSettingsAPI.as_view(), name='django-settings'),
path
(
'mail/testing/
'
,
api
.
MailTestingAPI
.
as_view
(),
name
=
'mail-testing'
),
path
(
'ldap/testing/
'
,
api
.
LDAPTestingAPI
.
as_view
(),
name
=
'ldap-testing'
),
#
path('django-settings/
', api.DjangoSettingsAPI.as_view(), name='django-settings'),
]
apps/jumpserver/urls.py
View file @
23815f87
...
...
@@ -2,7 +2,7 @@
from
__future__
import
unicode_literals
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.urls.static
import
static
from
rest_framework.response
import
Response
...
...
@@ -10,23 +10,19 @@ from django.views.decorators.csrf import csrf_exempt
from
django.http
import
HttpResponse
from
django.utils.encoding
import
iri_to_uri
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
import
openapi
from
.views
import
IndexView
,
LunaView
# schema_view = get_schema_view(title='Users API', renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer])
schema_view
=
get_schema_view
(
openapi
.
Info
(
title
=
"
Snippets API
"
,
title
=
"
Jumpserver API Docs
"
,
default_version
=
'v1'
,
description
=
"
Test description
"
,
terms_of_service
=
"https://www.
google.com/policies/terms/
"
,
contact
=
openapi
.
Contact
(
email
=
"
contact@snippets.local
"
),
license
=
openapi
.
License
(
name
=
"
BSD
License"
),
description
=
"
Jumpserver Restful api docs
"
,
terms_of_service
=
"https://www.
jumpserver.org
"
,
contact
=
openapi
.
Contact
(
email
=
"
support@fit2cloud.com
"
),
license
=
openapi
.
License
(
name
=
"
GPLv2
License"
),
),
public
=
True
,
permission_classes
=
(
permissions
.
AllowAny
,),
...
...
@@ -44,52 +40,51 @@ class HttpResponseTemporaryRedirect(HttpResponse):
@csrf_exempt
def
redirect_format_api
(
request
,
*
args
,
**
kwargs
):
path
,
query
=
request
.
path
,
request
.
GET
.
urlencode
()
matched
=
api_url_pattern
.
match
(
path
)
_
path
,
query
=
request
.
path
,
request
.
GET
.
urlencode
()
matched
=
api_url_pattern
.
match
(
_
path
)
if
matched
:
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
,
"query"
:
query
})
return
HttpResponseTemporaryRedirect
(
path
)
return
HttpResponseTemporaryRedirect
(
_
path
)
else
:
return
Response
({
"msg"
:
"Redirect url failed: {}"
.
format
(
path
)},
status
=
404
)
return
Response
({
"msg"
:
"Redirect url failed: {}"
.
format
(
_
path
)},
status
=
404
)
v1_api_patterns
=
[
url
(
r'^
users/v1/'
,
include
(
'users.urls.api_urls'
,
namespace
=
'api-users'
)),
url
(
r'^
assets/v1/'
,
include
(
'assets.urls.api_urls'
,
namespace
=
'api-assets'
)),
url
(
r'^
perms/v1/'
,
include
(
'perms.urls.api_urls'
,
namespace
=
'api-perms'
)),
url
(
r'^
terminal/v1/'
,
include
(
'terminal.urls.api_urls'
,
namespace
=
'api-terminal'
)),
url
(
r'^
ops/v1/'
,
include
(
'ops.urls.api_urls'
,
namespace
=
'api-ops'
)),
url
(
r'^
audits/v1/'
,
include
(
'audits.urls.api_urls'
,
namespace
=
'api-audits'
)),
url
(
r'^
orgs/v1/'
,
include
(
'orgs.urls.api_urls'
,
namespace
=
'api-orgs'
)),
url
(
r'^
common/v1/'
,
include
(
'common.urls.api_urls'
,
namespace
=
'api-common'
)),
path
(
'
users/v1/'
,
include
(
'users.urls.api_urls'
,
namespace
=
'api-users'
)),
path
(
'
assets/v1/'
,
include
(
'assets.urls.api_urls'
,
namespace
=
'api-assets'
)),
path
(
'
perms/v1/'
,
include
(
'perms.urls.api_urls'
,
namespace
=
'api-perms'
)),
path
(
'
terminal/v1/'
,
include
(
'terminal.urls.api_urls'
,
namespace
=
'api-terminal'
)),
path
(
'
ops/v1/'
,
include
(
'ops.urls.api_urls'
,
namespace
=
'api-ops'
)),
path
(
'
audits/v1/'
,
include
(
'audits.urls.api_urls'
,
namespace
=
'api-audits'
)),
path
(
'
orgs/v1/'
,
include
(
'orgs.urls.api_urls'
,
namespace
=
'api-orgs'
)),
path
(
'
common/v1/'
,
include
(
'common.urls.api_urls'
,
namespace
=
'api-common'
)),
]
app_view_patterns
=
[
url
(
r'^
users/'
,
include
(
'users.urls.views_urls'
,
namespace
=
'users'
)),
url
(
r'^
assets/'
,
include
(
'assets.urls.views_urls'
,
namespace
=
'assets'
)),
url
(
r'^
perms/'
,
include
(
'perms.urls.views_urls'
,
namespace
=
'perms'
)),
url
(
r'^
terminal/'
,
include
(
'terminal.urls.views_urls'
,
namespace
=
'terminal'
)),
url
(
r'^
ops/'
,
include
(
'ops.urls.view_urls'
,
namespace
=
'ops'
)),
url
(
r'^
audits/'
,
include
(
'audits.urls.view_urls'
,
namespace
=
'audits'
)),
url
(
r'^
orgs/'
,
include
(
'orgs.urls.views_urls'
,
namespace
=
'orgs'
)),
path
(
'
users/'
,
include
(
'users.urls.views_urls'
,
namespace
=
'users'
)),
path
(
'
assets/'
,
include
(
'assets.urls.views_urls'
,
namespace
=
'assets'
)),
path
(
'
perms/'
,
include
(
'perms.urls.views_urls'
,
namespace
=
'perms'
)),
path
(
'
terminal/'
,
include
(
'terminal.urls.views_urls'
,
namespace
=
'terminal'
)),
path
(
'
ops/'
,
include
(
'ops.urls.view_urls'
,
namespace
=
'ops'
)),
path
(
'
audits/'
,
include
(
'audits.urls.view_urls'
,
namespace
=
'audits'
)),
path
(
'
orgs/'
,
include
(
'orgs.urls.views_urls'
,
namespace
=
'orgs'
)),
]
urlpatterns
=
[
url
(
r'^$
'
,
IndexView
.
as_view
(),
name
=
'index'
),
url
(
r'^
luna/'
,
LunaView
.
as_view
(),
name
=
'luna-error'
),
url
(
r'^
settings/'
,
include
(
'common.urls.view_urls'
,
namespace
=
'settings'
)),
url
(
r'^
common/'
,
include
(
'common.urls.view_urls'
,
namespace
=
'common'
)),
url
(
r'^api/v1/.*
'
,
redirect_format_api
),
url
(
r'^
api/'
,
include
(
v1_api_patterns
)),
path
(
'
'
,
IndexView
.
as_view
(),
name
=
'index'
),
path
(
'
luna/'
,
LunaView
.
as_view
(),
name
=
'luna-error'
),
path
(
'
settings/'
,
include
(
'common.urls.view_urls'
,
namespace
=
'settings'
)),
path
(
'
common/'
,
include
(
'common.urls.view_urls'
,
namespace
=
'common'
)),
path
(
'api/v1/
'
,
redirect_format_api
),
path
(
'
api/'
,
include
(
v1_api_patterns
)),
# Api url view map
# External apps url
url
(
r'^
captcha/'
,
include
(
'captcha.urls'
)),
path
(
'
captcha/'
,
include
(
'captcha.urls'
)),
]
urlpatterns
+=
app_view_patterns
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
:
urlpatterns
+=
[
url
(
r'^
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"
),
url
(
r'^redoc/$
'
,
schema_view
.
with_ui
(
'redoc'
,
cache_timeout
=
None
),
name
=
'redoc'
),
re_path
(
'
swagger(?P<format>
\
.json|
\
.yaml)$'
,
schema_view
.
without_ui
(
cache_timeout
=
None
),
name
=
'schema-json'
),
path
(
'
docs/'
,
schema_view
.
with_ui
(
'swagger'
,
cache_timeout
=
None
),
name
=
"docs"
),
path
(
'redoc/
'
,
schema_view
.
with_ui
(
'redoc'
,
cache_timeout
=
None
),
name
=
'redoc'
),
]
apps/ops/urls/api_urls.py
View file @
23815f87
# ~*~ coding: utf-8 ~*~
from
__future__
import
unicode_literals
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
rest_framework.routers
import
DefaultRouter
from
..
import
api
...
...
@@ -14,8 +14,8 @@ router.register(r'adhoc', api.AdHocViewSet, 'adhoc')
router
.
register
(
r'history'
,
api
.
AdHocRunHistorySet
,
'history'
)
urlpatterns
=
[
url
(
r'^tasks/(?P<pk>[0-9a-zA-Z\-]{36})/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
(
'tasks/<uuid:pk>/run/
'
,
api
.
TaskRun
.
as_view
(),
name
=
'task-run'
),
path
(
'celery/task/<uuid:pk>/log/
'
,
api
.
CeleryTaskLogApi
.
as_view
(),
name
=
'celery-task-log'
),
]
urlpatterns
+=
router
.
urls
apps/ops/urls/view_urls.py
View file @
23815f87
# ~*~ coding: utf-8 ~*~
from
__future__
import
unicode_literals
from
django.urls
import
path
from
django.conf.urls
import
url
from
..
import
views
__all__
=
[
"urlpatterns"
]
...
...
@@ -10,13 +9,13 @@ __all__ = ["urlpatterns"]
app_name
=
"ops"
urlpatterns
=
[
#
T
Resource Task url
url
(
r'^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'
),
url
(
r'^task/(?P<pk>[0-9a-zA-Z\-]{36})/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'
),
url
(
r'^adhoc/(?P<pk>[0-9a-zA-Z\-]{36})/$
'
,
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'
),
url
(
r'^adhoc/history/(?P<pk>[0-9a-zA-Z\-]{36})/$
'
,
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'
),
# Resource Task url
path
(
'task/
'
,
views
.
TaskListView
.
as_view
(),
name
=
'task-list'
),
path
(
'task/<uuid:pk>/
'
,
views
.
TaskDetailView
.
as_view
(),
name
=
'task-detail'
),
path
(
'task/<uuid:pk>/adhoc/
'
,
views
.
TaskAdhocView
.
as_view
(),
name
=
'task-adhoc'
),
path
(
'task/<uuid:pk>/history/
'
,
views
.
TaskHistoryView
.
as_view
(),
name
=
'task-history'
),
path
(
'adhoc/<uuid:pk>/
'
,
views
.
AdHocDetailView
.
as_view
(),
name
=
'adhoc-detail'
),
path
(
'adhoc/<uuid:pk>/history/
'
,
views
.
AdHocHistoryView
.
as_view
(),
name
=
'adhoc-history'
),
path
(
'adhoc/history/<uuid:pk>/
'
,
views
.
AdHocHistoryDetailView
.
as_view
(),
name
=
'adhoc-history-detail'
),
path
(
'celery/task/<uuid:pk>/log/
'
,
views
.
CeleryTaskLogView
.
as_view
(),
name
=
'celery-task-log'
),
]
apps/orgs/context_processor.py
View file @
23815f87
...
...
@@ -6,7 +6,6 @@ from .models import Organization
def
org_processor
(
request
):
print
(
'Crernt Org'
,
current_org
.
name
)
context
=
{
'ADMIN_ORGS'
:
Organization
.
get_user_admin_orgs
(
request
.
user
),
'CURRENT_ORG'
:
get_current_org
(),
...
...
apps/orgs/urls/api_urls.py
View file @
23815f87
# -*- coding: utf-8 -*-
#
from
django.conf.urls
import
url
from
rest_framework.routers
import
DefaultRouter
from
..
import
api
...
...
apps/orgs/urls/views_urls.py
View file @
23815f87
# -*- coding: utf-8 -*-
#
from
django.conf.urls
import
url
from
django.urls
import
path
from
..
import
views
app_name
=
'orgs'
urlpatterns
=
[
url
(
r'^(?P<pk>.*)/switch/$
'
,
views
.
SwitchOrgView
.
as_view
(),
name
=
'org-switch'
),
url
(
r'^switch-a-org/$
'
,
views
.
SwitchToAOrgView
.
as_view
(),
name
=
'switch-a-org'
)
path
(
'<str:pk>/switch/
'
,
views
.
SwitchOrgView
.
as_view
(),
name
=
'org-switch'
),
path
(
'switch-a-org/
'
,
views
.
SwitchToAOrgView
.
as_view
(),
name
=
'switch-a-org'
)
]
apps/perms/urls/api_urls.py
View file @
23815f87
# coding:utf-8
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
rest_framework
import
routers
from
..
import
api
...
...
@@ -11,53 +11,52 @@ router.register('asset-permissions', api.AssetPermissionViewSet, 'asset-permissi
urlpatterns
=
[
# 查询某个用户授权的资产和资产组
url
(
r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$
'
,
path
(
'user/<uuid:pk>/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'
),
url
(
r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/nodes/$
'
,
path
(
'user/<uuid:pk>/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'
),
url
(
r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/nodes/(?P<node_id>[0-9a-zA-Z\-]{36})/assets/$'
,
path
(
'user/<uuid:pk>/nodes/<uuid:node_id>/assets/'
,
api
.
UserGrantedNodeAssetsApi
.
as_view
(),
name
=
'user-node-assets'
),
url
(
r'^user/nodes/(?P<node_id>[0-9a-zA-Z\-]{36})/assets/$
'
,
path
(
'user/nodes/<uuid:node_id>/assets/
'
,
api
.
UserGrantedNodeAssetsApi
.
as_view
(),
name
=
'my-node-assets'
),
url
(
r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/nodes-assets/$
'
,
path
(
'user/<uuid:pk>/nodes-assets/
'
,
api
.
UserGrantedNodesWithAssetsApi
.
as_view
(),
name
=
'user-nodes-assets'
),
url
(
r'^user/nodes-assets/$
'
,
api
.
UserGrantedNodesWithAssetsApi
.
as_view
(),
path
(
'user/nodes-assets/
'
,
api
.
UserGrantedNodesWithAssetsApi
.
as_view
(),
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'
),
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'
),
url
(
r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/nodes-assets/$
'
,
path
(
'user-group/<uuid:pk>/nodes-assets/
'
,
api
.
UserGroupGrantedNodesWithAssetsApi
.
as_view
(),
name
=
'user-group-nodes-assets'
),
url
(
r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/nodes/(?P<node_id>[0-9a-zA-Z\-]{36})/assets/$'
,
path
(
'user-group/<uuid:pk>/nodes/<uuid:node_id>/assets/'
,
api
.
UserGroupGrantedNodeAssetsApi
.
as_view
(),
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
(),
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
(),
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
(),
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
(),
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
...
...
apps/perms/urls/views_urls.py
View file @
23815f87
# coding:utf-8
from
django.conf.urls
import
url
from
django.urls
import
path
from
..
import
views
app_name
=
'perms'
urlpatterns
=
[
url
(
r'^asset-permission/$
'
,
views
.
AssetPermissionListView
.
as_view
(),
name
=
'asset-permission-list'
),
url
(
r'^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'
),
url
(
r'^asset-permission/(?P<pk>[0-9a-zA-Z\-]{36})/$
'
,
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'
),
url
(
r'^asset-permission/(?P<pk>[0-9a-zA-Z\-]{36})/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/
'
,
views
.
AssetPermissionListView
.
as_view
(),
name
=
'asset-permission-list'
),
path
(
'asset-permission/create/
'
,
views
.
AssetPermissionCreateView
.
as_view
(),
name
=
'asset-permission-create'
),
path
(
'asset-permission/<uuid:pk>/update/
'
,
views
.
AssetPermissionUpdateView
.
as_view
(),
name
=
'asset-permission-update'
),
path
(
'asset-permission/<uuid:pk>/
'
,
views
.
AssetPermissionDetailView
.
as_view
(),
name
=
'asset-permission-detail'
),
path
(
'asset-permission/<uuid:pk>/delete/
'
,
views
.
AssetPermissionDeleteView
.
as_view
(),
name
=
'asset-permission-delete'
),
path
(
'asset-permission/<uuid:pk>/user/
'
,
views
.
AssetPermissionUserView
.
as_view
(),
name
=
'asset-permission-user-list'
),
path
(
'asset-permission/<uuid:pk>/asset/
'
,
views
.
AssetPermissionAssetView
.
as_view
(),
name
=
'asset-permission-asset-list'
),
]
apps/static/js/jumpserver.js
View file @
23815f87
...
...
@@ -253,6 +253,12 @@ jumpserver.selected = {};
jumpserver
.
language
=
{
processing
:
"加载中"
,
search
:
"搜索"
,
select
:
{
rows
:
{
_
:
"选中 %d 项"
,
0
:
""
}
},
lengthMenu
:
"每页 _MENU_"
,
info
:
"显示第 _START_ 至 _END_ 项结果; 总共 _TOTAL_ 项"
,
infoFiltered
:
""
,
...
...
apps/templates/_user_profile.html
View file @
23815f87
...
...
@@ -6,11 +6,11 @@
<img
alt=
"logo"
height=
"55"
width=
"185"
src=
"/static/img/logo-text.png"
/>
</div>
</div>
{#
<div
class=
"clearfix"
></div>
#}
<div
class=
"logo-element"
>
<img
alt=
"image"
height=
"40
px
"
src=
"/static/img/logo.png"
/>
<img
alt=
"image"
height=
"40"
src=
"/static/img/logo.png"
/>
</div>
{% if ADMIN_ORGS and ADMIN_ORGS|length != 1 %}
{% 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>
...
...
@@ -35,6 +35,7 @@
</ul>
</div>
{% endif %}
{% endif %}
</li>
<script>
$
(
document
).
ready
(
function
()
{
...
...
apps/terminal/urls/api_urls.py
View file @
23815f87
...
...
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
rest_framework
import
routers
from
..
import
api
...
...
@@ -19,15 +19,15 @@ router.register(r'sessions', api.SessionViewSet, 'session')
router
.
register
(
r'status'
,
api
.
StatusViewSet
,
'session'
)
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'
}),
name
=
'session-replay'
),
url
(
r'^
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
(
'
tasks/kill-session/'
,
api
.
KillSessionAPI
.
as_view
(),
name
=
'kill-session'
),
path
(
'terminal/<uuid:terminal>
/access-key'
,
api
.
TerminalTokenApi
.
as_view
(),
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
#
url(r'^v2/sessions/(?P<pk>[0-9a-zA-Z\-]{36})/replay/$
',
#
path('v2/sessions/<uuid:pk>/replay/
',
# api.SessionReplayV2ViewSet.as_view({'get': 'retrieve'}),
# name='session-replay-v2'),
]
...
...
apps/terminal/urls/views_urls.py
View file @
23815f87
...
...
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
..
import
views
...
...
@@ -10,20 +10,20 @@ app_name = 'terminal'
urlpatterns
=
[
# Terminal view
url
(
r'^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'
),
url
(
r'^terminal/(?P<pk>[0-9a-zA-Z\-]{36})/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'
),
url
(
r'^(?P<pk>[0-9a-zA-Z\-]{36})/accept/$
'
,
views
.
TerminalAcceptView
.
as_view
(),
name
=
'terminal-accept'
),
url
(
r'^web-terminal/$
'
,
views
.
WebTerminalView
.
as_view
(),
name
=
'web-terminal'
),
path
(
'terminal/
'
,
views
.
TerminalListView
.
as_view
(),
name
=
'terminal-list'
),
path
(
'terminal/<uuid:pk>/
'
,
views
.
TerminalDetailView
.
as_view
(),
name
=
'terminal-detail'
),
path
(
'terminal/<uuid:pk>/connect/
'
,
views
.
TerminalConnectView
.
as_view
(),
name
=
'terminal-connect'
),
path
(
'terminal/<uuid:pk>/update/
'
,
views
.
TerminalUpdateView
.
as_view
(),
name
=
'terminal-update'
),
path
(
'<uuid:pk>/accept/
'
,
views
.
TerminalAcceptView
.
as_view
(),
name
=
'terminal-accept'
),
path
(
'web-terminal/
'
,
views
.
WebTerminalView
.
as_view
(),
name
=
'web-terminal'
),
# Session view
url
(
r'^session-online/$
'
,
views
.
SessionOnlineListView
.
as_view
(),
name
=
'session-online-list'
),
url
(
r'^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-online/
'
,
views
.
SessionOnlineListView
.
as_view
(),
name
=
'session-online-list'
),
path
(
'session-offline/
'
,
views
.
SessionOfflineListView
.
as_view
(),
name
=
'session-offline-list'
),
path
(
'session/<uuid:pk>/
'
,
views
.
SessionDetailView
.
as_view
(),
name
=
'session-detail'
),
# Command view
url
(
r'^command/$
'
,
views
.
CommandListView
.
as_view
(),
name
=
'command-list'
),
url
(
r'^command/export/$
'
,
views
.
CommandExportView
.
as_view
(),
name
=
'command-export'
)
path
(
'command/
'
,
views
.
CommandListView
.
as_view
(),
name
=
'command-list'
),
path
(
'command/export/
'
,
views
.
CommandExportView
.
as_view
(),
name
=
'command-export'
)
]
apps/users/urls/api_urls.py
View file @
23815f87
...
...
@@ -3,7 +3,7 @@
#
from
__future__
import
absolute_import
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
rest_framework_bulk.routes
import
BulkRouter
from
..
import
api
...
...
@@ -15,26 +15,19 @@ router.register(r'groups', api.UserGroupViewSet, 'user-group')
urlpatterns
=
[
# url(r'', api.UserListView.as_view()),
url
(
r'^token/$'
,
api
.
UserToken
.
as_view
(),
name
=
'user-token'
),
url
(
r'^connection-token/$'
,
api
.
UserConnectionTokenApi
.
as_view
(),
name
=
'connection-token'
),
url
(
r'^profile/$'
,
api
.
UserProfile
.
as_view
(),
name
=
'user-profile'
),
url
(
r'^auth/$'
,
api
.
UserAuthApi
.
as_view
(),
name
=
'user-auth'
),
url
(
r'^otp/auth/$'
,
api
.
UserOtpAuthApi
.
as_view
(),
name
=
'user-otp-auth'
),
url
(
r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/password/$'
,
api
.
ChangeUserPasswordApi
.
as_view
(),
name
=
'change-user-password'
),
url
(
r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/password/reset/$'
,
api
.
UserResetPasswordApi
.
as_view
(),
name
=
'user-reset-password'
),
url
(
r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/pubkey/reset/$'
,
api
.
UserResetPKApi
.
as_view
(),
name
=
'user-public-key-reset'
),
url
(
r'^users/(?P<pk>[0-9a-zA-Z\-]{36})/pubkey/update/$'
,
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'
),
# path(r'', api.UserListView.as_view()),
path
(
'token/'
,
api
.
UserToken
.
as_view
(),
name
=
'user-token'
),
path
(
'connection-token/'
,
api
.
UserConnectionTokenApi
.
as_view
(),
name
=
'connection-token'
),
path
(
'profile/'
,
api
.
UserProfile
.
as_view
(),
name
=
'user-profile'
),
path
(
'auth/'
,
api
.
UserAuthApi
.
as_view
(),
name
=
'user-auth'
),
path
(
'otp/auth/'
,
api
.
UserOtpAuthApi
.
as_view
(),
name
=
'user-otp-auth'
),
path
(
'users/<uuid:pk>/password/'
,
api
.
ChangeUserPasswordApi
.
as_view
(),
name
=
'change-user-password'
),
path
(
'users/<uuid:pk>/password/reset/'
,
api
.
UserResetPasswordApi
.
as_view
(),
name
=
'user-reset-password'
),
path
(
'users/<uuid:pk>/pubkey/reset/'
,
api
.
UserResetPKApi
.
as_view
(),
name
=
'user-public-key-reset'
),
path
(
'users/<uuid:pk>/pubkey/update/'
,
api
.
UserUpdatePKApi
.
as_view
(),
name
=
'user-public-key-update'
),
path
(
'users/<uuid:pk>/unblock/'
,
api
.
UserUnblockPKApi
.
as_view
(),
name
=
'user-unblock'
),
path
(
'users/<uuid:pk>/groups/'
,
api
.
UserUpdateGroupApi
.
as_view
(),
name
=
'user-update-group'
),
path
(
'groups/<uuid:pk>/users/'
,
api
.
UserGroupUpdateUserApi
.
as_view
(),
name
=
'user-group-update-user'
),
]
urlpatterns
+=
router
.
urls
apps/users/urls/views_urls.py
View file @
23815f87
from
__future__
import
absolute_import
from
django.
conf.urls
import
url
from
django.
urls
import
path
from
..
import
views
...
...
@@ -8,45 +8,45 @@ app_name = 'users'
urlpatterns
=
[
# Login view
url
(
r'^login/$
'
,
views
.
UserLoginView
.
as_view
(),
name
=
'login'
),
url
(
r'^logout/$
'
,
views
.
UserLogoutView
.
as_view
(),
name
=
'logout'
),
url
(
r'^login/otp/$
'
,
views
.
UserLoginOtpView
.
as_view
(),
name
=
'login-otp'
),
url
(
r'^password/forgot/$
'
,
views
.
UserForgotPasswordView
.
as_view
(),
name
=
'forgot-password'
),
url
(
r'^password/forgot/sendmail-success/$
'
,
views
.
UserForgotPasswordSendmailSuccessView
.
as_view
(),
name
=
'forgot-password-sendmail-success'
),
url
(
r'^password/reset/$
'
,
views
.
UserResetPasswordView
.
as_view
(),
name
=
'reset-password'
),
url
(
r'^password/reset/success/$
'
,
views
.
UserResetPasswordSuccessView
.
as_view
(),
name
=
'reset-password-success'
),
path
(
'login/
'
,
views
.
UserLoginView
.
as_view
(),
name
=
'login'
),
path
(
'logout/
'
,
views
.
UserLogoutView
.
as_view
(),
name
=
'logout'
),
path
(
'login/otp/
'
,
views
.
UserLoginOtpView
.
as_view
(),
name
=
'login-otp'
),
path
(
'password/forgot/
'
,
views
.
UserForgotPasswordView
.
as_view
(),
name
=
'forgot-password'
),
path
(
'password/forgot/sendmail-success/
'
,
views
.
UserForgotPasswordSendmailSuccessView
.
as_view
(),
name
=
'forgot-password-sendmail-success'
),
path
(
'password/reset/
'
,
views
.
UserResetPasswordView
.
as_view
(),
name
=
'reset-password'
),
path
(
'password/reset/success/
'
,
views
.
UserResetPasswordSuccessView
.
as_view
(),
name
=
'reset-password-success'
),
# Profile
url
(
r'^profile/$
'
,
views
.
UserProfileView
.
as_view
(),
name
=
'user-profile'
),
url
(
r'^profile/update/$
'
,
views
.
UserProfileUpdateView
.
as_view
(),
name
=
'user-profile-update'
),
url
(
r'^profile/password/update/$
'
,
views
.
UserPasswordUpdateView
.
as_view
(),
name
=
'user-password-update'
),
url
(
r'^profile/pubkey/update/$
'
,
views
.
UserPublicKeyUpdateView
.
as_view
(),
name
=
'user-pubkey-update'
),
url
(
r'^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'
),
url
(
r'^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'
),
url
(
r'^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/
'
,
views
.
UserProfileView
.
as_view
(),
name
=
'user-profile'
),
path
(
'profile/update/
'
,
views
.
UserProfileUpdateView
.
as_view
(),
name
=
'user-profile-update'
),
path
(
'profile/password/update/
'
,
views
.
UserPasswordUpdateView
.
as_view
(),
name
=
'user-password-update'
),
path
(
'profile/pubkey/update/
'
,
views
.
UserPublicKeyUpdateView
.
as_view
(),
name
=
'user-pubkey-update'
),
path
(
'profile/pubkey/generate/
'
,
views
.
UserPublicKeyGenerateView
.
as_view
(),
name
=
'user-pubkey-generate'
),
path
(
'profile/otp/enable/authentication/
'
,
views
.
UserOtpEnableAuthenticationView
.
as_view
(),
name
=
'user-otp-enable-authentication'
),
path
(
'profile/otp/enable/install-app/
'
,
views
.
UserOtpEnableInstallAppView
.
as_view
(),
name
=
'user-otp-enable-install-app'
),
path
(
'profile/otp/enable/bind/
'
,
views
.
UserOtpEnableBindView
.
as_view
(),
name
=
'user-otp-enable-bind'
),
path
(
'profile/otp/disable/authentication/
'
,
views
.
UserOtpDisableAuthenticationView
.
as_view
(),
name
=
'user-otp-disable-authentication'
),
path
(
'profile/otp/settings-success/
'
,
views
.
UserOtpSettingsSuccessView
.
as_view
(),
name
=
'user-otp-settings-success'
),
# User view
url
(
r'^user/$
'
,
views
.
UserListView
.
as_view
(),
name
=
'user-list'
),
url
(
r'^user/export/$
'
,
views
.
UserExportView
.
as_view
(),
name
=
'user-export'
),
url
(
r'^first-login/$
'
,
views
.
UserFirstLoginView
.
as_view
(),
name
=
'user-first-login'
),
url
(
r'^user/import/$
'
,
views
.
UserBulkImportView
.
as_view
(),
name
=
'user-import'
),
url
(
r'^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'
),
url
(
r'^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'
),
url
(
r'^user/(?P<pk>[0-9a-zA-Z\-]{36})/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/
'
,
views
.
UserListView
.
as_view
(),
name
=
'user-list'
),
path
(
'user/export/
'
,
views
.
UserExportView
.
as_view
(),
name
=
'user-export'
),
path
(
'first-login/
'
,
views
.
UserFirstLoginView
.
as_view
(),
name
=
'user-first-login'
),
path
(
'user/import/
'
,
views
.
UserBulkImportView
.
as_view
(),
name
=
'user-import'
),
path
(
'user/create/
'
,
views
.
UserCreateView
.
as_view
(),
name
=
'user-create'
),
path
(
'user/<uuid:pk>/update/
'
,
views
.
UserUpdateView
.
as_view
(),
name
=
'user-update'
),
path
(
'user/update/
'
,
views
.
UserBulkUpdateView
.
as_view
(),
name
=
'user-bulk-update'
),
path
(
'user/<uuid:pk>/
'
,
views
.
UserDetailView
.
as_view
(),
name
=
'user-detail'
),
path
(
'user/<uuid:pk>/assets/
'
,
views
.
UserGrantedAssetView
.
as_view
(),
name
=
'user-granted-asset'
),
path
(
'user/<uuid:pk>/login-history/
'
,
views
.
UserDetailView
.
as_view
(),
name
=
'user-login-history'
),
# User group view
url
(
r'^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'
),
url
(
r'^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'
),
url
(
r'^user-group/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$
'
,
views
.
UserGroupGrantedAssetView
.
as_view
(),
name
=
'user-group-granted-asset'
),
path
(
'user-group/
'
,
views
.
UserGroupListView
.
as_view
(),
name
=
'user-group-list'
),
path
(
'user-group/<uuid:pk>/
'
,
views
.
UserGroupDetailView
.
as_view
(),
name
=
'user-group-detail'
),
path
(
'user-group/create/
'
,
views
.
UserGroupCreateView
.
as_view
(),
name
=
'user-group-create'
),
path
(
'user-group/<uuid:pk>/update/
'
,
views
.
UserGroupUpdateView
.
as_view
(),
name
=
'user-group-update'
),
path
(
'user-group/<uuid:pk>/assets/
'
,
views
.
UserGroupGrantedAssetView
.
as_view
(),
name
=
'user-group-granted-asset'
),
# 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'
),
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment