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
5745c8cc
Commit
5745c8cc
authored
Nov 16, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish url namespace change
parent
a5e48744
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
38 additions
and
38 deletions
+38
-38
admin_user_list.html
apps/assets/templates/assets/admin_user_list.html
+1
-1
asset_list.html
apps/assets/templates/assets/asset_list.html
+2
-2
idc_assets.html
apps/assets/templates/assets/idc_assets.html
+1
-1
idc_list.html
apps/assets/templates/assets/idc_list.html
+1
-1
urls.py
apps/perms/urls.py
+2
-2
terminal_list.html
apps/terminal/templates/terminal/terminal_list.html
+2
-2
urls.py
apps/terminal/urls.py
+2
-2
user_asset_permission.html
apps/users/templates/users/user_asset_permission.html
+1
-1
user_detail.html
apps/users/templates/users/user_detail.html
+6
-6
user_granted_asset.html
apps/users/templates/users/user_granted_asset.html
+2
-2
user_group_asset_permission.html
apps/users/templates/users/user_group_asset_permission.html
+1
-1
user_group_detail.html
apps/users/templates/users/user_group_detail.html
+1
-1
user_group_granted_asset.html
apps/users/templates/users/user_group_granted_asset.html
+1
-1
user_group_list.html
apps/users/templates/users/user_group_list.html
+3
-3
user_list.html
apps/users/templates/users/user_list.html
+4
-4
urls.py
apps/users/urls.py
+8
-8
No files found.
apps/assets/templates/assets/admin_user_list.html
View file @
5745c8cc
...
...
@@ -52,7 +52,7 @@ $(document).ready(function(){
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_admin_user_delete" data-uid="99991937">{% trans "Delete" %}</a>'
.
replace
(
'99991937'
,
cellData
);
$
(
td
).
html
(
script_btn
+
update_btn
+
del_btn
)
}}],
ajax_url
:
'{% url "a
ssets:api-
admin-user-list" %}'
,
ajax_url
:
'{% url "a
pi-assets:
admin-user-list" %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"username"
},
{
data
:
"assets_amount"
},
{
data
:
function
()
{
return
'lost'
}
},
{
data
:
"comment"
},
{
data
:
"id"
}],
op_html
:
$
(
'#actions'
).
html
()
...
...
apps/assets/templates/assets/asset_list.html
View file @
5745c8cc
...
...
@@ -72,7 +72,7 @@
</td>
<td
class=
"text-center"
>
<a
href=
"{% url 'assets:asset-update' pk=asset.id %}"
class=
"btn btn-xs btn-info"
>
{% trans 'Update' %}
</a>
<a
onclick=
"objectDelete(this,'{{ asset.hostname }}','{% url 'a
ssets:api-
asset-detail' pk=asset.id %}')"
class=
"btn btn-xs btn-danger del"
>
<a
onclick=
"objectDelete(this,'{{ asset.hostname }}','{% url 'a
pi-assets:
asset-detail' pk=asset.id %}')"
class=
"btn btn-xs btn-danger del"
>
{% trans 'Delete' %}
</a>
</td>
</tr>
...
...
@@ -190,7 +190,7 @@
var
column2
=
table
.
rows
(
'.selected'
).
data
();
var
id_list
=
[];
var
plain_id_list
=
[];
var
the_url
=
"{% url 'a
ssets:api-
asset-bulk-update' %}"
;
var
the_url
=
"{% url 'a
pi-assets:
asset-bulk-update' %}"
;
for
(
var
i
=
0
;
i
<
column2
.
length
;
i
++
){
id_list
.
push
({
id
:
column2
[
i
].
id
,
hostname
:
column2
[
i
].
ip
});
plain_id_list
.
push
(
parseInt
(
column2
[
i
].
id
));
...
...
apps/assets/templates/assets/idc_assets.html
View file @
5745c8cc
...
...
@@ -118,7 +118,7 @@
$
(
td
).
html
(
'<i class="fa fa-check text-navy"></i>'
)
}
}}],
ajax_url
:
'{% url "a
ssets:api-
asset-list" %}?idc={{ idc.id }}'
,
ajax_url
:
'{% url "a
pi-assets:
asset-list" %}?idc={{ idc.id }}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"hostname"
},
{
data
:
"ip"
},
{
data
:
"port"
},
{
data
:
"type"
},
{
data
:
"is_active"
}]
};
...
...
apps/assets/templates/assets/idc_list.html
View file @
5745c8cc
...
...
@@ -50,7 +50,7 @@ $(document).ready(function(){
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_user_delete" data-uid="99991937">{% trans "Delete" %}</a>'
.
replace
(
'99991937'
,
cellData
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
ajax_url
:
'{% url "a
ssets:api-
idc-list" %}'
,
ajax_url
:
'{% url "a
pi-assets:
idc-list" %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"assets_amount"
},
{
data
:
"contact"
},
{
data
:
"phone"
},
{
data
:
"operator"
},
{
data
:
"id"
}],
op_html
:
$
(
'#actions'
).
html
()
...
...
apps/perms/urls.py
View file @
5745c8cc
...
...
@@ -34,12 +34,12 @@ urlpatterns += [
# Select user permission of asset and asset group
url
(
r'^v1/user/(?P<pk>[0-9]+)/assets/$'
,
api
.
UserGrantedAssetsApi
.
as_view
(),
name
=
'user-assets'
),
url
(
r'^v1/user/(?P<pk>[0-9]+)/asset-groups/$'
,
api
.
UserGrantedAssetGroupsApi
.
as_view
(),
name
=
'
api-
user-asset-groups'
),
name
=
'user-asset-groups'
),
# Select user group permission of asset and asset group
url
(
r'^v1/user-group/(?P<pk>[0-9]+)/assets/$'
,
api
.
UserGroupGrantedAssetsApi
.
as_view
(),
name
=
'user-group-assets'
),
url
(
r'^v1/user-group/(?P<pk>[0-9]+)/asset-groups/$'
,
api
.
UserGroupGrantedAssetGroupsApi
.
as_view
(),
name
=
'
api-
user-group-asset-groups'
),
name
=
'user-group-asset-groups'
),
# Revoke permission api
...
...
apps/terminal/templates/terminal/terminal_list.html
View file @
5745c8cc
...
...
@@ -73,7 +73,7 @@ $(document).ready(function(){
$
(
td
).
html
(
update_btn
+
delete_btn
)
}}
],
ajax_url
:
'{% url "
terminal:api-
terminal-list" %}'
,
ajax_url
:
'{% url "
api-terminal:
terminal-list" %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"ip"
},
{
data
:
"get_type_display"
},
{
data
:
"proxy_online"
},
{
data
:
"is_active"
},
{
data
:
'is_active'
},
{
data
:
"id"
}],
op_html
:
$
(
'#actions'
).
html
()
...
...
@@ -83,7 +83,7 @@ $(document).ready(function(){
var
$this
=
$
(
this
);
var
uid
=
$this
.
data
(
'uid'
);
var
name
=
$
(
this
).
data
(
'name'
);
var
the_url
=
'{% url "
terminal:api-
terminal-detail" pk=99991937 %}'
.
replace
(
'99991937'
,
uid
);
var
the_url
=
'{% url "
api-terminal:
terminal-detail" pk=99991937 %}'
.
replace
(
'99991937'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
)
})
</script>
...
...
apps/terminal/urls.py
View file @
5745c8cc
...
...
@@ -16,8 +16,8 @@ urlpatterns = [
]
router
=
routers
.
DefaultRouter
()
router
.
register
(
r'v1/terminal/heatbeat'
,
api
.
TerminalHeatbeatViewSet
,
'
api-
terminal-heatbeat'
)
router
.
register
(
r'v1/terminal'
,
api
.
TerminalViewSet
,
'
api-
terminal'
)
router
.
register
(
r'v1/terminal/heatbeat'
,
api
.
TerminalHeatbeatViewSet
,
'terminal-heatbeat'
)
router
.
register
(
r'v1/terminal'
,
api
.
TerminalViewSet
,
'terminal'
)
# urlpatterns += [
# url(r'v1/terminal/heatbeat/', api.TerminalHeatbeatApi.as_view(), name='api-terminal-heatbeat')
# ]
...
...
apps/users/templates/users/user_asset_permission.html
View file @
5745c8cc
...
...
@@ -158,7 +158,7 @@
}
}}
],
ajax_url
:
'{% url "
perms:api-
asset-permission-list" %}?user={{ user.id }}'
,
ajax_url
:
'{% url "
api-perms:
asset-permission-list" %}?user={{ user.id }}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"assets"
},
{
data
:
"asset_groups"
},
{
data
:
"system_users"
},
{
data
:
"is_active"
},
{
data
:
"id"
}]
};
...
...
apps/users/templates/users/user_detail.html
View file @
5745c8cc
...
...
@@ -228,7 +228,7 @@
jumpserver
.
groups_selected
=
{};
function
updateUserGroups
(
groups
)
{
var
the_url
=
"{% url '
users:api-
user-update-group' pk=user.id %}"
;
var
the_url
=
"{% url '
api-users:
user-update-group' pk=user.id %}"
;
var
body
=
{
groups
:
Object
.
assign
([],
groups
)
};
...
...
@@ -265,7 +265,7 @@ $(document).ready(function() {
delete
jumpserver
.
groups_selected
[
data
.
id
]
})
}).
on
(
'click'
,
'#is_active'
,
function
()
{
var
the_url
=
"{% url '
users:api-
user-detail' pk=user.id %}"
;
var
the_url
=
"{% url '
api-users:
user-detail' pk=user.id %}"
;
var
checked
=
$
(
this
).
prop
(
'checked'
);
var
body
=
{
'is_active'
:
checked
...
...
@@ -277,7 +277,7 @@ $(document).ready(function() {
success_message
:
success
});
}).
on
(
'click'
,
'#enable_otp'
,
function
()
{
var
the_url
=
"{% url '
users:api-
user-detail' pk=user.id %}"
;
var
the_url
=
"{% url '
api-users:
user-detail' pk=user.id %}"
;
var
checked
=
$
(
this
).
prop
(
'checked'
);
var
body
=
{
'enable_otp'
:
checked
...
...
@@ -316,7 +316,7 @@ $(document).ready(function() {
updateUserGroups
(
groups
)
}).
on
(
'click'
,
'#btn_reset_password'
,
function
()
{
function
doReset
()
{
var
the_url
=
'{% url "
users:api-
user-reset-password" pk=user.id %}'
;
var
the_url
=
'{% url "
api-users:
user-reset-password" pk=user.id %}'
;
var
body
=
{};
var
success
=
function
()
{
var
msg
=
"{% trans "
An
e
-
mail
has
been
sent
to
the
user
\
's mailbox." %}";
...
...
@@ -341,7 +341,7 @@ $(document).ready(function() {
});
}).on('click', '#btn_reset_pk', function() {
function doReset() {
var the_url = '{% url "
users
:
api
-
user
-
reset
-
pk
" pk=user.id %}';
var the_url = '{% url "
api
-
users
:
user
-
reset
-
pk
" pk=user.id %}';
var body = {};
var success = function() {
var msg = "
{
%
trans
'The reset-ssh-public-key E-mail has been sent successfully. Please inform the user to update his new ssh public key.'
%
}
";
...
...
@@ -367,7 +367,7 @@ $(document).ready(function() {
}).on('click', '#btn_user_update_pk', function(){
var $this = $(this);
var pk = $('#txt_pk').val();
var the_url = '{% url "
users
:
api
-
user
-
update
-
pk
" pk=user.id %}';
var the_url = '{% url "
api
-
users
:
user
-
update
-
pk
" pk=user.id %}';
var body = {'_public_key': pk};
var success = function() {
$('#txt_pk').val('');
...
...
apps/users/templates/users/user_granted_asset.html
View file @
5745c8cc
...
...
@@ -133,7 +133,7 @@
}
}}
],
ajax_url
:
'{% url "
perms:api-
user-assets" pk=user.id %}'
,
ajax_url
:
'{% url "
api-perms:
user-assets" pk=user.id %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"hostname"
},
{
data
:
"ip"
},
{
data
:
"port"
},
{
data
:
"system_users_join"
},
{
data
:
"is_active"
}]
};
...
...
@@ -148,7 +148,7 @@
$
(
td
).
html
(
detail_btn
.
replace
(
'99991937'
,
rowData
.
id
));
}}
],
ajax_url
:
'{% url "
perms:api-
user-asset-groups" pk=user.id %}'
,
ajax_url
:
'{% url "
api-perms:
user-asset-groups" pk=user.id %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"assets_amount"
}]
};
jumpserver
.
initDataTable
(
options
);
...
...
apps/users/templates/users/user_group_asset_permission.html
View file @
5745c8cc
...
...
@@ -154,7 +154,7 @@
$
(
td
).
html
(
btn
)
}}
],
ajax_url
:
'{% url "
perms:api-
asset-permission-list" %}?user_group={{ user_group.id }}'
,
ajax_url
:
'{% url "
api-perms:
asset-permission-list" %}?user_group={{ user_group.id }}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"assets"
},
{
data
:
"asset_groups"
},
{
data
:
"system_users"
},
{
data
:
"is_active"
},
{
data
:
"id"
}]
};
...
...
apps/users/templates/users/user_group_detail.html
View file @
5745c8cc
...
...
@@ -119,7 +119,7 @@
jumpserver
.
users_selected
=
{};
function
updateGroupMember
(
users
)
{
var
the_url
=
"{% url '
users:api-
user-group-update-user' pk=user_group.id %}"
;
var
the_url
=
"{% url '
api-users:
user-group-update-user' pk=user_group.id %}"
;
var
body
=
{
users
:
Object
.
assign
([],
users
)
};
...
...
apps/users/templates/users/user_group_granted_asset.html
View file @
5745c8cc
...
...
@@ -148,7 +148,7 @@
$
(
td
).
html
(
detail_btn
.
replace
(
'99991937'
,
rowData
.
id
));
}}
],
ajax_url
:
'{% url "
perms:api-
user-group-asset-groups" pk=user_group.id %}'
,
ajax_url
:
'{% url "
api-perms:
user-group-asset-groups" pk=user_group.id %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"assets_amount"
}]
};
jumpserver
.
initDataTable
(
options
);
...
...
apps/users/templates/users/user_group_list.html
View file @
5745c8cc
...
...
@@ -55,7 +55,7 @@ $(document).ready(function() {
$
(
td
).
html
(
update_btn
+
del_btn
)
}
}}],
ajax_url
:
'{% url "
users:api-
user-group-list" %}'
,
ajax_url
:
'{% url "
api-users:
user-group-list" %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"user_amount"
},
{
data
:
"comment"
},
{
data
:
"id"
}],
op_html
:
$
(
'#actions'
).
html
()
...
...
@@ -65,7 +65,7 @@ $(document).ready(function() {
var
$this
=
$
(
this
);
function
doDelete
()
{
var
group_id
=
$this
.
data
(
'gid'
);
var
the_url
=
"{% url '
users:api-
user-group-detail' pk=99991937 %}"
.
replace
(
'99991937'
,
group_id
);
var
the_url
=
"{% url '
api-users:
user-group-detail' pk=99991937 %}"
.
replace
(
'99991937'
,
group_id
);
var
body
=
{};
var
success
=
function
()
{
var
msg
=
"{% trans 'Group Deleted.' %}"
;
...
...
@@ -105,7 +105,7 @@ $(document).ready(function() {
if
(
plain_id_list
===
[])
{
return
false
;
}
var
the_url
=
"{% url '
users:api-
user-group-list' %}"
;
var
the_url
=
"{% url '
api-users:
user-group-list' %}"
;
function
doDelete
()
{
swal
({
title
:
"{% trans 'Are you sure?' %}"
,
...
...
apps/users/templates/users/user_list.html
View file @
5745c8cc
...
...
@@ -81,7 +81,7 @@ $(document).ready(function(){
$
(
td
).
html
(
update_btn
+
del_btn
)
}
}}],
ajax_url
:
'{% url "
users:api-
user-list" %}'
,
ajax_url
:
'{% url "
api-users:
user-list" %}'
,
columns
:
[{
data
:
"id"
},
{
data
:
"username"
},
{
data
:
"name"
},
{
data
:
"get_role_display"
},
{
data
:
"groups_display"
},
{
data
:
"is_valid"
},
{
data
:
"id"
}]
};
...
...
@@ -107,7 +107,7 @@ $(document).ready(function(){
if
(
id_list
===
[])
{
return
false
;
}
var
the_url
=
"{% url '
users:api-
user-list' %}"
;
var
the_url
=
"{% url '
api-users:
user-list' %}"
;
function
doDeactive
()
{
var
body
=
$
.
each
(
id_list
,
function
(
index
,
user_object
)
{
user_object
[
'is_active'
]
=
false
;
...
...
@@ -160,7 +160,7 @@ $(document).ready(function(){
var
$this
=
$
(
this
);
function
doDelete
()
{
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "
users:api-
user-detail" pk=99991937 %}'
.
replace
(
'99991937'
,
uid
);
var
the_url
=
'{% url "
api-users:
user-detail" pk=99991937 %}'
.
replace
(
'99991937'
,
uid
);
var
body
=
{};
var
success
=
function
()
{
var
msg
=
"{% trans 'User Deleted.' %}"
;
...
...
@@ -215,7 +215,7 @@ $(document).ready(function(){
if
(
post_list
===
[])
{
return
false
}
var
the_url
=
"{% url '
users:api-
user-list' %}"
;
var
the_url
=
"{% url '
api-users:
user-list' %}"
;
var
success
=
function
()
{
var
msg
=
"{% trans 'The selected users has been updated successfully.' %}"
;
swal
(
"{% trans 'User Updated' %}"
,
msg
,
"success"
);
...
...
apps/users/urls.py
View file @
5745c8cc
...
...
@@ -44,25 +44,25 @@ urlpatterns = [
router
=
BulkRouter
()
router
.
register
(
r'v1/users'
,
api
.
UserViewSet
,
'
api-
user'
)
router
.
register
(
r'v1/user-groups'
,
api
.
UserGroupViewSet
,
'
api-
user-group'
)
router
.
register
(
r'v1/users'
,
api
.
UserViewSet
,
'user'
)
router
.
register
(
r'v1/user-groups'
,
api
.
UserGroupViewSet
,
'user-group'
)
# router.register(r'v1/user-groups', api.AssetViewSet, 'api-groups')
urlpatterns
+=
[
# url(r'^v1/users/$', api.UserListUpdateApi.as_view(), name='user-bulk-update-api'),
url
(
r'^v1/users/token/$'
,
api
.
UserAuthApi
.
as_view
(),
name
=
'
api-
user-token'
),
url
(
r'^v1/users/(?P<pk>\d+)/reset-password/$'
,
api
.
UserResetPasswordApi
.
as_view
(),
name
=
'
api-
user-reset-password'
),
url
(
r'^v1/users/(?P<pk>\d+)/reset-pk/$'
,
api
.
UserResetPKApi
.
as_view
(),
name
=
'
api-
user-reset-pk'
),
url
(
r'^v1/users/(?P<pk>\d+)/update-pk/$'
,
api
.
UserUpdatePKApi
.
as_view
(),
name
=
'
api-
user-update-pk'
),
url
(
r'^v1/users/token/$'
,
api
.
UserAuthApi
.
as_view
(),
name
=
'user-token'
),
url
(
r'^v1/users/(?P<pk>\d+)/reset-password/$'
,
api
.
UserResetPasswordApi
.
as_view
(),
name
=
'user-reset-password'
),
url
(
r'^v1/users/(?P<pk>\d+)/reset-pk/$'
,
api
.
UserResetPKApi
.
as_view
(),
name
=
'user-reset-pk'
),
url
(
r'^v1/users/(?P<pk>\d+)/update-pk/$'
,
api
.
UserUpdatePKApi
.
as_view
(),
name
=
'user-update-pk'
),
# url(r'^v1/user-groups/$', api.GroupListUpdateApi.as_view(), name='user-group-bulk-update-api'),
# url(r'^v1/user-groups/(?P<pk>\d+)/$', api.GroupDetailApi.as_view(), name='user-group-detail-api'),
# url(r'^v1/user-groups/(?P<pk>\d+)/user/(?P<uid>\d+)/$',
# api.DeleteUserFromGroupApi.as_view(), name='delete-user-from-group-api'),
url
(
r'^v1/users/(?P<pk>\d+)/groups/$'
,
api
.
UserUpdateGroupApi
.
as_view
(),
name
=
'
api-
user-update-group'
),
api
.
UserUpdateGroupApi
.
as_view
(),
name
=
'user-update-group'
),
url
(
r'^v1/user-groups/(?P<pk>\d+)/users/$'
,
api
.
UserGroupUpdateUserApi
.
as_view
(),
name
=
'
api-
user-group-update-user'
),
api
.
UserGroupUpdateUserApi
.
as_view
(),
name
=
'user-group-update-user'
),
]
urlpatterns
+=
router
.
urls
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