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
4b7af145
Commit
4b7af145
authored
May 17, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 系统用户新增清除认证的操作
parent
e66cfc2e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
29 deletions
+67
-29
system_user.py
apps/assets/api/system_user.py
+6
-1
base.py
apps/assets/models/base.py
+1
-0
system_user_detail.html
apps/assets/templates/assets/system_user_detail.html
+21
-4
django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+38
-23
group.py
apps/users/models/group.py
+1
-1
No files found.
apps/assets/api/system_user.py
View file @
4b7af145
...
...
@@ -40,7 +40,7 @@ class SystemUserViewSet(BulkModelViewSet):
permission_classes
=
(
IsSuperUserOrAppUser
,)
class
SystemUserAuthInfoApi
(
generics
.
RetrieveUpdateAPIView
):
class
SystemUserAuthInfoApi
(
generics
.
RetrieveUpdate
Destroy
APIView
):
"""
Get system user auth info
"""
...
...
@@ -48,6 +48,11 @@ class SystemUserAuthInfoApi(generics.RetrieveUpdateAPIView):
permission_classes
=
(
IsSuperUserOrAppUser
,)
serializer_class
=
serializers
.
SystemUserAuthSerializer
def
destroy
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
instance
.
clear_auth
()
return
Response
(
status
=
204
)
class
SystemUserPushApi
(
generics
.
RetrieveAPIView
):
"""
...
...
apps/assets/models/base.py
View file @
4b7af145
...
...
@@ -107,6 +107,7 @@ class AssetUser(models.Model):
def
clear_auth
(
self
):
self
.
_password
=
''
self
.
_private_key
=
''
self
.
_public_key
=
''
self
.
save
()
def
auto_gen_auth
(
self
):
...
...
apps/assets/templates/assets/system_user_detail.html
View file @
4b7af145
...
...
@@ -107,14 +107,14 @@
</div>
<div
class=
"col-sm-4"
style=
"padding-left: 0;padding-right: 0"
>
<div
class=
"panel panel-primary
only-ssh
"
>
<div
class=
"panel panel-primary "
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-info-circle"
></i>
{% trans 'Quick update' %}
</div>
<div
class=
"panel-body"
>
<table
class=
"table"
>
<tbody>
<tr
class=
"
no-borders-tr
"
>
<tr
class=
"
only-ssh
"
>
<td
width=
"50%"
>
{% trans 'Auto push' %}:
</td>
<td>
<span
class=
"pull-right"
>
...
...
@@ -130,8 +130,8 @@
</span>
</td>
</tr>
<tr
class=
"no-borders-tr"
>
{% if system_user.auto_push %}
<tr
class=
"only-ssh"
>
<td
width=
"50%"
>
{% trans 'Push system user now' %}:
</td>
<td>
<span
style=
"float: right"
>
...
...
@@ -139,8 +139,8 @@
</span>
</td>
</tr>
<tr>
{% endif %}
<tr
class=
"only-ssh"
>
<td
width=
"50%"
>
{% trans 'Test assets connective' %}:
</td>
<td>
<span
style=
"float: right"
>
...
...
@@ -149,6 +149,15 @@
</td>
</tr>
<tr>
<td
width=
"50%"
>
{% trans 'Clear auth' %}:
</td>
<td>
<span
style=
"float: right"
>
<button
type=
"button"
class=
"btn btn-primary btn-xs btn-clear-auth"
style=
"width: 54px"
>
{% trans 'Clear' %}
</button>
</span>
</td>
</tr>
{#
<tr>
#}
{#
<td
width=
"50%"
>
{% trans 'Change auth period' %}:
</td>
#}
{#
<td>
#}
...
...
@@ -239,6 +248,7 @@ $(document).ready(function () {
if
(
$
(
'#id_protocol_type'
).
text
()
===
'rdp'
){
$
(
'.only-ssh'
).
addClass
(
'hidden'
)
}
$
(
".panel-body .table tr:visible:first"
).
addClass
(
'no-borders-tr'
);
$
(
'.select2'
).
select2
()
.
on
(
'select2:select'
,
function
(
evt
)
{
var
data
=
evt
.
params
.
data
;
...
...
@@ -321,6 +331,13 @@ $(document).ready(function () {
success
:
success
,
flash_message
:
false
});
}).
on
(
'click'
,
'.btn-clear-auth'
,
function
()
{
var
the_url
=
'{% url "api-assets:system-user-auth-info" pk=system_user.id %}'
;
APIUpdateAttr
({
url
:
the_url
,
method
:
'DELETE'
,
success_message
:
"{% trans 'Clear auth' %}"
+
" {% trans 'success' %}"
});
})
</script>
{% endblock %}
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
4b7af145
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
4b7af145
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-
08 17:24
+0800\n"
"POT-Creation-Date: 2018-05-
17 11:32
+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
...
...
@@ -17,22 +17,22 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: assets/api/node.py:
9
6
#: assets/api/node.py:
10
6
msgid "New node {}"
msgstr "新节点 {}"
#: assets/api/node.py:2
25
#: assets/api/node.py:2
42
msgid "更新节点资产硬件信息: {}"
msgstr ""
#: assets/api/node.py:2
38
#: assets/api/node.py:2
55
msgid "测试节点下资产是否可连接: {}"
msgstr ""
#: assets/forms/asset.py:24 assets/models/asset.py:66 assets/models/user.py:103
#: assets/templates/assets/asset_detail.html:183
#: assets/templates/assets/asset_detail.html:191
#: assets/templates/assets/system_user_detail.html:1
66
perms/models.py:33
#: assets/templates/assets/system_user_detail.html:1
75
perms/models.py:33
msgid "Nodes"
msgstr "节点管理"
...
...
@@ -438,7 +438,7 @@ msgstr "默认资产组"
msgid "User"
msgstr "用户"
#: assets/models/label.py:18 assets/models/node.py:1
5
#: assets/models/label.py:18 assets/models/node.py:1
8
#: assets/templates/assets/label_list.html:15 common/models.py:27
msgid "Value"
msgstr "值"
...
...
@@ -535,7 +535,7 @@ msgstr "测试系统用户可连接性: {}"
msgid "定期测试系统用户可连接性: {}"
msgstr ""
#: assets/tasks.py:40
1
#: assets/tasks.py:40
2
msgid "推送系统用户到入资产: {}"
msgstr ""
...
...
@@ -660,7 +660,7 @@ msgstr "重置"
#: common/templates/common/ldap_setting.html:60
#: common/templates/common/terminal_setting.html:103
#: perms/templates/perms/asset_permission_create_update.html:70
#: terminal/templates/terminal/session_list.html:12
0
#: terminal/templates/terminal/session_list.html:12
4
#: terminal/templates/terminal/terminal_update.html:48
#: users/templates/users/_user.html:47
#: users/templates/users/forgot_password.html:44
...
...
@@ -782,8 +782,8 @@ msgstr "选择节点"
#: assets/templates/assets/admin_user_detail.html:100
#: assets/templates/assets/asset_detail.html:200
#: assets/templates/assets/asset_list.html:63
4
#: assets/templates/assets/system_user_detail.html:1
83
#: assets/templates/assets/asset_list.html:63
6
#: assets/templates/assets/system_user_detail.html:1
92
#: assets/templates/assets/system_user_list.html:138 templates/_modal.html:22
#: terminal/templates/terminal/session_detail.html:108
#: users/templates/users/user_detail.html:362
...
...
@@ -963,19 +963,19 @@ msgstr "仅显示当前节点资产"
msgid "Displays all child node assets"
msgstr "显示所有子节点资产"
#: assets/templates/assets/asset_list.html:21
5
#: assets/templates/assets/asset_list.html:21
7
msgid "Create node failed"
msgstr "创建节点失败"
#: assets/templates/assets/asset_list.html:22
7
#: assets/templates/assets/asset_list.html:22
9
msgid "Have child node, cancel"
msgstr "存在子节点,不能删除"
#: assets/templates/assets/asset_list.html:2
29
#: assets/templates/assets/asset_list.html:2
31
msgid "Have assets, cancel"
msgstr "存在资产,不能删除"
#: assets/templates/assets/asset_list.html:6
29
#: assets/templates/assets/asset_list.html:6
31
#: assets/templates/assets/system_user_list.html:133
#: users/templates/users/user_detail.html:357
#: users/templates/users/user_detail.html:382
...
...
@@ -984,20 +984,20 @@ msgstr "存在资产,不能删除"
msgid "Are you sure?"
msgstr "你确认吗?"
#: assets/templates/assets/asset_list.html:63
0
#: assets/templates/assets/asset_list.html:63
2
msgid "This will delete the selected assets !!!"
msgstr "删除选择资产"
#: assets/templates/assets/asset_list.html:6
38
#: assets/templates/assets/asset_list.html:6
40
msgid "Asset Deleted."
msgstr "已被删除"
#: assets/templates/assets/asset_list.html:6
39
#: assets/templates/assets/asset_list.html:64
4
#: assets/templates/assets/asset_list.html:6
41
#: assets/templates/assets/asset_list.html:64
6
msgid "Asset Delete"
msgstr "删除"
#: assets/templates/assets/asset_list.html:64
3
#: assets/templates/assets/asset_list.html:64
5
msgid "Asset Deleting failed."
msgstr "删除失败"
...
...
@@ -1032,6 +1032,7 @@ msgid "Create gateway"
msgstr "创建网关"
#: assets/templates/assets/domain_gateway_list.html:87
#: assets/templates/assets/domain_gateway_list.html:89
#: common/templates/common/email_setting.html:58
#: common/templates/common/ldap_setting.html:58
msgid "Test connection"
...
...
@@ -1080,10 +1081,23 @@ msgstr "家目录"
msgid "Uid"
msgstr "Uid"
#: assets/templates/assets/system_user_detail.html:174
#: assets/templates/assets/system_user_detail.html:153
#: assets/templates/assets/system_user_detail.html:339
msgid "Clear auth"
msgstr "清除认证信息"
#: assets/templates/assets/system_user_detail.html:156
msgid "Clear"
msgstr "清除"
#: assets/templates/assets/system_user_detail.html:183
msgid "Add to node"
msgstr "添加到节点"
#: assets/templates/assets/system_user_detail.html:339
msgid "success"
msgstr "成功"
#: assets/templates/assets/system_user_list.html:18
#: assets/views/system_user.py:45
msgid "Create system user"
...
...
@@ -2113,15 +2127,16 @@ msgstr "时长"
msgid "Monitor"
msgstr "监控"
#: terminal/templates/terminal/session_list.html:105
#: terminal/templates/terminal/session_list.html:106
#: terminal/templates/terminal/session_list.html:108
msgid "Terminate"
msgstr "终断"
#: terminal/templates/terminal/session_list.html:1
16
#: terminal/templates/terminal/session_list.html:1
20
msgid "Terminate selected"
msgstr "终断所选"
#: terminal/templates/terminal/session_list.html:1
36
#: terminal/templates/terminal/session_list.html:1
40
msgid "Terminate task send, waiting ..."
msgstr "终断任务已发送,请等待"
...
...
apps/users/models/group.py
View file @
4b7af145
...
...
@@ -11,7 +11,7 @@ __all__ = ['UserGroup']
class
UserGroup
(
NoDeleteModelMixin
):
id
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
)
name
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
_
(
'Name'
))
name
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
_
(
'Name'
))
comment
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'Comment'
))
date_created
=
models
.
DateTimeField
(
auto_now_add
=
True
,
null
=
True
,
verbose_name
=
_
(
'Date created'
))
...
...
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