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
fdf2807d
Unverified
Commit
fdf2807d
authored
Jun 14, 2018
by
老广
Committed by
GitHub
Jun 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1419 from jumpserver/feature_login_mode
[Update] 添加功能,系统用户选择登录模式(自动/手动登录)
parents
73f9f546
2e6d238c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
219 additions
and
124 deletions
+219
-124
user.py
apps/assets/forms/user.py
+24
-4
base.py
apps/assets/models/base.py
+1
-1
user.py
apps/assets/models/user.py
+8
-0
system_user.py
apps/assets/serializers/system_user.py
+11
-1
_system_user.html
apps/assets/templates/assets/_system_user.html
+34
-3
system_user_detail.html
apps/assets/templates/assets/system_user_detail.html
+4
-0
system_user_list.html
apps/assets/templates/assets/system_user_list.html
+6
-5
system_user_update.html
apps/assets/templates/assets/system_user_update.html
+0
-1
django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+131
-109
No files found.
apps/assets/forms/user.py
View file @
fdf2807d
...
...
@@ -93,14 +93,20 @@ class SystemUserForm(PasswordAndKeyAuthForm):
# Because we define custom field, so we need rewrite :method: `save`
system_user
=
super
()
.
save
()
password
=
self
.
cleaned_data
.
get
(
'password'
,
''
)
or
None
login_mode
=
self
.
cleaned_data
.
get
(
'login_mode'
,
''
)
or
None
auto_generate_key
=
self
.
cleaned_data
.
get
(
'auto_generate_key'
,
False
)
private_key
,
public_key
=
super
()
.
gen_keys
()
if
login_mode
==
SystemUser
.
MANUAL_LOGIN
:
system_user
.
auto_push
=
0
system_user
.
save
()
if
auto_generate_key
:
logger
.
info
(
'Auto generate key and set system user auth'
)
system_user
.
auto_gen_auth
()
else
:
system_user
.
set_auth
(
password
=
password
,
private_key
=
private_key
,
public_key
=
public_key
)
return
system_user
def
clean
(
self
):
...
...
@@ -109,12 +115,24 @@ class SystemUserForm(PasswordAndKeyAuthForm):
if
not
self
.
instance
and
not
auto_generate
:
super
()
.
validate_password_key
()
def
is_valid
(
self
):
validated
=
super
()
.
is_valid
()
username
=
self
.
cleaned_data
.
get
(
'username'
)
login_mode
=
self
.
cleaned_data
.
get
(
'login_mode'
)
if
login_mode
==
SystemUser
.
AUTO_LOGIN
and
not
username
:
self
.
add_error
(
"username"
,
_
(
'* Automatic login mode,'
' must fill in the username.'
)
)
return
False
return
validated
class
Meta
:
model
=
SystemUser
fields
=
[
'name'
,
'username'
,
'protocol'
,
'auto_generate_key'
,
'password'
,
'private_key_file'
,
'auto_push'
,
'sudo'
,
'comment'
,
'shell'
,
'priority'
,
'comment'
,
'shell'
,
'priority'
,
'login_mode'
,
]
widgets
=
{
'name'
:
forms
.
TextInput
(
attrs
=
{
'placeholder'
:
_
(
'Name'
)}),
...
...
@@ -124,5 +142,8 @@ class SystemUserForm(PasswordAndKeyAuthForm):
'name'
:
'* required'
,
'username'
:
'* required'
,
'auto_push'
:
_
(
'Auto push system user to asset'
),
'priority'
:
_
(
'High level will be using login asset as default, if user was granted more than 2 system user'
),
}
\ No newline at end of file
'priority'
:
_
(
'High level will be using login asset as default, '
'if user was granted more than 2 system user'
),
'login_mode'
:
_
(
'If you choose manual login mode, you do not '
'need to fill in the username and password.'
)
}
apps/assets/models/base.py
View file @
fdf2807d
...
...
@@ -19,7 +19,7 @@ signer = get_signer()
class
AssetUser
(
models
.
Model
):
id
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
)
name
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
_
(
'Name'
))
username
=
models
.
CharField
(
max_length
=
32
,
verbose_name
=
_
(
'Username'
),
validators
=
[
alphanumeric
])
username
=
models
.
CharField
(
max_length
=
32
,
blank
=
True
,
verbose_name
=
_
(
'Username'
),
validators
=
[
alphanumeric
])
_password
=
models
.
CharField
(
max_length
=
256
,
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
'Password'
))
_private_key
=
models
.
TextField
(
max_length
=
4096
,
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
'SSH private key'
),
validators
=
[
private_key_validator
,
])
_public_key
=
models
.
TextField
(
max_length
=
4096
,
blank
=
True
,
verbose_name
=
_
(
'SSH public key'
))
...
...
apps/assets/models/user.py
View file @
fdf2807d
...
...
@@ -100,6 +100,13 @@ class SystemUser(AssetUser):
(
RDP_PROTOCOL
,
'rdp'
),
)
AUTO_LOGIN
=
'auto'
MANUAL_LOGIN
=
'manual'
LOGIN_MODE_CHOICES
=
(
(
AUTO_LOGIN
,
_
(
'Automatic login'
)),
(
MANUAL_LOGIN
,
_
(
'Manually login'
))
)
nodes
=
models
.
ManyToManyField
(
'assets.Node'
,
blank
=
True
,
verbose_name
=
_
(
"Nodes"
))
assets
=
models
.
ManyToManyField
(
'assets.Asset'
,
blank
=
True
,
verbose_name
=
_
(
"Assets"
))
priority
=
models
.
IntegerField
(
default
=
10
,
verbose_name
=
_
(
"Priority"
))
...
...
@@ -107,6 +114,7 @@ class SystemUser(AssetUser):
auto_push
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
_
(
'Auto push'
))
sudo
=
models
.
TextField
(
default
=
'/bin/whoami'
,
verbose_name
=
_
(
'Sudo'
))
shell
=
models
.
CharField
(
max_length
=
64
,
default
=
'/bin/bash'
,
verbose_name
=
_
(
'Shell'
))
login_mode
=
models
.
CharField
(
choices
=
LOGIN_MODE_CHOICES
,
default
=
AUTO_LOGIN
,
max_length
=
10
,
verbose_name
=
_
(
'Login mode'
))
def
__str__
(
self
):
return
'{0.name}({0.username})'
.
format
(
self
)
...
...
apps/assets/serializers/system_user.py
View file @
fdf2807d
...
...
@@ -18,6 +18,13 @@ class SystemUserSerializer(serializers.ModelSerializer):
model
=
SystemUser
exclude
=
(
'_password'
,
'_private_key'
,
'_public_key'
)
def
get_field_names
(
self
,
declared_fields
,
info
):
fields
=
super
(
SystemUserSerializer
,
self
)
.
get_field_names
(
declared_fields
,
info
)
fields
.
extend
([
'get_login_mode_display'
,
])
return
fields
@staticmethod
def
get_unreachable_assets
(
obj
):
return
obj
.
unreachable_assets
...
...
@@ -56,7 +63,10 @@ class AssetSystemUserSerializer(serializers.ModelSerializer):
"""
class
Meta
:
model
=
SystemUser
fields
=
(
'id'
,
'name'
,
'username'
,
'priority'
,
'protocol'
,
'comment'
,)
fields
=
(
'id'
,
'name'
,
'username'
,
'priority'
,
'protocol'
,
'comment'
,
'login_mode'
)
class
SystemUserSimpleSerializer
(
serializers
.
ModelSerializer
):
...
...
apps/assets/templates/assets/_system_user.html
View file @
fdf2807d
...
...
@@ -36,12 +36,13 @@
{% endif %}
<h3>
{% trans 'Basic' %}
</h3>
{% bootstrap_field form.name layout="horizontal" %}
{% bootstrap_field form.login_mode layout="horizontal" %}
{% bootstrap_field form.username layout="horizontal" %}
{% bootstrap_field form.priority layout="horizontal" %}
{% bootstrap_field form.protocol layout="horizontal" %}
<h3
id=
"auth_title_id"
>
{% trans 'Auth' %}
</h3>
{% block auth %}
<h3>
{% trans 'Auth' %}
</h3>
<div
class=
"auto-generate"
>
<div
class=
"form-group"
>
<label
for=
"{{ form.auto_generate_key.id_for_label }}"
class=
"col-sm-2 control-label"
>
{% trans 'Auto generate key' %}
</label>
...
...
@@ -80,15 +81,22 @@
{% endblock %}
{% block custom_foot_js %}
<script>
var
auto_generate_key
=
'#'
+
'{{ form.auto_generate_key.id_for_label }}'
;
var
protocol_id
=
'#'
+
'{{ form.protocol.id_for_label }}'
;
var
login_mode_id
=
'#'
+
'{{ form.login_mode.id_for_label }}'
;
var
auto_generate_key
=
'#'
+
'{{ form.auto_generate_key.id_for_label }}'
;
var
password_id
=
'#'
+
'{{ form.password.id_for_label }}'
;
var
private_key_id
=
'#'
+
'{{ form.private_key_file.id_for_label }}'
;
var
auto_push_id
=
'#'
+
'{{ form.auto_push.id_for_label }}'
;
var
sudo_id
=
'#'
+
'{{ form.sudo.id_for_label }}'
;
var
shell_id
=
'#'
+
'{{ form.shell.id_for_label }}'
;
var
need_change_field
=
[
auto_generate_key
,
private_key_id
,
auto_push_id
,
sudo_id
,
shell_id
];
var
need_change_field_login_mode
=
[
auto_generate_key
,
private_key_id
,
auto_push_id
,
password_id
];
function
protocolChange
()
{
if
(
$
(
protocol_id
+
" option:selected"
).
text
()
===
'rdp'
)
{
...
...
@@ -97,6 +105,11 @@ function protocolChange() {
$
(
value
).
closest
(
'.form-group'
).
addClass
(
'hidden'
)
});
}
else
{
if
(
$
(
login_mode_id
).
val
()
===
'manual'
){
$
(
sudo_id
).
closest
(
'.form-group'
).
removeClass
(
'hidden'
);
$
(
shell_id
).
closest
(
'.form-group'
).
removeClass
(
'hidden'
);
return
}
authFieldsDisplay
();
$
.
each
(
need_change_field
,
function
(
index
,
value
)
{
$
(
value
).
closest
(
'.form-group'
).
removeClass
(
'hidden'
)
...
...
@@ -111,18 +124,35 @@ function authFieldsDisplay() {
$
(
'.auth-fields'
).
removeClass
(
'hidden'
);
}
}
function
loginModeChange
(){
if
(
$
(
login_mode_id
).
val
()
===
'manual'
){
$
(
'#auth_title_id'
).
addClass
(
'hidden'
);
$
.
each
(
need_change_field_login_mode
,
function
(
index
,
value
){
$
(
value
).
closest
(
'.form-group'
).
addClass
(
'hidden'
)
})
}
else
if
(
$
(
login_mode_id
).
val
()
===
'auto'
){
$
(
'#auth_title_id'
).
removeClass
(
'hidden'
);
protocolChange
();
$
(
password_id
).
closest
(
'.form-group'
).
removeClass
(
'hidden'
)
}
}
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
();
authFieldsDisplay
();
protocolChange
();
loginModeChange
();
})
.
on
(
'change'
,
protocol_id
,
function
(){
protocolChange
();
})
.
on
(
'change'
,
auto_generate_key
,
function
(){
authFieldsDisplay
();
});
})
.
on
(
'change'
,
login_mode_id
,
function
(){
loginModeChange
();
})
</script>
{% endblock %}
\ No newline at end of file
apps/assets/templates/assets/system_user_detail.html
View file @
fdf2807d
...
...
@@ -62,6 +62,10 @@
<td>
{% trans 'Username' %}:
</td>
<td><b>
{{ system_user.username }}
</b></td>
</tr>
<tr>
<td>
{% trans 'Login mode' %}:
</td>
<td><b>
{{ system_user.get_login_mode_display }}
</b></td>
</tr>
<tr>
<td>
{% trans 'Protocol' %}:
</td>
<td><b
id=
"id_protocol_type"
>
{{ system_user.protocol }}
</b></td>
...
...
apps/assets/templates/assets/system_user_list.html
View file @
fdf2807d
...
...
@@ -26,6 +26,7 @@
<th
class=
"text-center"
>
{% trans 'Name' %}
</th>
<th
class=
"text-center"
>
{% trans 'Username' %}
</th>
<th
class=
"text-center"
>
{% trans 'Protocol' %}
</th>
<th
class=
"text-center"
>
{% trans 'Login mode' %}
</th>
<th
class=
"text-center"
>
{% trans 'Asset' %}
</th>
<th
class=
"text-center"
>
{% trans 'Reachable' %}
</th>
<th
class=
"text-center"
>
{% trans 'Unreachable' %}
</th>
...
...
@@ -48,7 +49,7 @@ function initTable() {
var
detail_btn
=
'<a href="{% url "assets:system-user-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
{
targets
:
5
,
createdCell
:
function
(
td
,
cellData
)
{
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
""
;
if
(
cellData
!==
0
)
{
innerHtml
=
"<span class='text-navy'>"
+
cellData
+
"</span>"
;
...
...
@@ -57,7 +58,7 @@ function initTable() {
}
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
)
{
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
""
;
if
(
cellData
!==
0
)
{
innerHtml
=
"<span class='text-danger'>"
+
cellData
+
"</span>"
;
...
...
@@ -66,7 +67,7 @@ function initTable() {
}
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
{
targets
:
8
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
val
=
0
;
var
innerHtml
=
""
;
var
total
=
rowData
.
assets_amount
;
...
...
@@ -84,14 +85,14 @@ function initTable() {
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
{
targets
:
9
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
{
targets
:
10
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "assets:system-user-update" pk=DEFAULT_PK %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_admin_user_delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
ajax_url
:
'{% url "api-assets:system-user-list" %}'
,
columns
:
[
{
data
:
"id"
},
{
data
:
"name"
},
{
data
:
"username"
},
{
data
:
"protocol"
},
{
data
:
"assets_amount"
},
{
data
:
"id"
},
{
data
:
"name"
},
{
data
:
"username"
},
{
data
:
"protocol"
},
{
data
:
"
get_login_mode_display"
},
{
data
:
"
assets_amount"
},
{
data
:
"reachable_amount"
},
{
data
:
"unreachable_amount"
},
{
data
:
"id"
},
{
data
:
"comment"
},
{
data
:
"id"
}
],
op_html
:
$
(
'#actions'
).
html
()
...
...
apps/assets/templates/assets/system_user_update.html
View file @
fdf2807d
...
...
@@ -4,7 +4,6 @@
{% load bootstrap3 %}
{% block auth %}
<h3>
{% trans 'Auth' %}
</h3>
{% bootstrap_field form.password layout="horizontal" %}
{% bootstrap_field form.private_key_file layout="horizontal" %}
<div
class=
"form-group"
>
...
...
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
fdf2807d
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
fdf2807d
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-
07 11:34
+0800\n"
"POT-Creation-Date: 2018-06-
11 13:36
+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"
...
...
@@ -29,10 +29,10 @@ msgstr ""
msgid "测试节点下资产是否可连接: {}"
msgstr ""
#: assets/forms/asset.py:24 assets/models/asset.py:75 assets/models/user.py:1
03
#: assets/forms/asset.py:24 assets/models/asset.py:75 assets/models/user.py:1
10
#: assets/templates/assets/asset_detail.html:183
#: assets/templates/assets/asset_detail.html:191
#: assets/templates/assets/system_user_detail.html:17
5
perms/models.py:33
#: assets/templates/assets/system_user_detail.html:17
9
perms/models.py:33
msgid "Nodes"
msgstr "节点管理"
...
...
@@ -103,7 +103,7 @@ msgstr "端口"
#: assets/templates/assets/domain_detail.html:60
#: assets/templates/assets/domain_list.html:15
#: assets/templates/assets/label_list.html:16
#: assets/templates/assets/system_user_list.html:
29
audits/models.py:11
#: assets/templates/assets/system_user_list.html:
30
audits/models.py:11
#: audits/templates/audits/ftp_log_list.html:41
#: audits/templates/audits/ftp_log_list.html:72 perms/forms.py:37
#: perms/models.py:32
...
...
@@ -118,7 +118,7 @@ msgstr "端口"
msgid "Asset"
msgstr "资产"
#: assets/forms/domain.py:54 assets/forms/user.py:79 assets/forms/user.py:1
20
#: assets/forms/domain.py:54 assets/forms/user.py:79 assets/forms/user.py:1
31
#: assets/models/base.py:21 assets/models/cluster.py:18
#: assets/models/domain.py:17 assets/models/group.py:20
#: assets/models/label.py:17 assets/templates/assets/admin_user_detail.html:56
...
...
@@ -147,15 +147,15 @@ msgstr "资产"
msgid "Name"
msgstr "名称"
#: assets/forms/domain.py:55 assets/forms/user.py:80 assets/forms/user.py:1
21
#: assets/forms/domain.py:55 assets/forms/user.py:80 assets/forms/user.py:1
32
#: assets/models/base.py:22 assets/templates/assets/admin_user_detail.html:60
#: assets/templates/assets/admin_user_list.html:24
#: assets/templates/assets/domain_gateway_list.html:60
#: assets/templates/assets/system_user_detail.html:62
#: assets/templates/assets/system_user_list.html:27
#: perms/templates/perms/asset_permission_user.html:55 users/forms.py:13
#: users/forms.py:
21 users/forms.py:30 users/models/authentication.py:45
#: users/
models/user.py:47 users/
templates/users/_select_user_modal.html:14
#: users/forms.py:
31 users/models/authentication.py:45 users/models/user.py:47
#: users/templates/users/_select_user_modal.html:14
#: users/templates/users/login.html:56
#: users/templates/users/login_log_list.html:49
#: users/templates/users/user_detail.html:67
...
...
@@ -169,7 +169,7 @@ msgid "Password or private key passphrase"
msgstr "密码或密钥密码"
#: assets/forms/user.py:25 assets/models/base.py:23 common/forms.py:113
#: users/forms.py:15 users/forms.py:
23 users/forms.py:32 users/forms.py:44
#: users/forms.py:15 users/forms.py:
33 users/forms.py:45
#: users/templates/users/login.html:59
#: users/templates/users/reset_password.html:53
#: users/templates/users/user_create.html:10
...
...
@@ -192,16 +192,26 @@ msgstr "ssh密钥不合法"
msgid "Password and private key file must be input one"
msgstr "密码和私钥, 必须输入一个"
#: assets/forms/user.py:126
#: assets/forms/user.py:118
msgid "* Automatic login mode, must fill in the username."
msgstr "自动登录模式,必须填写用户名"
#: assets/forms/user.py:137
msgid "Auto push system user to asset"
msgstr "自动推送系统用户到资产"
#: assets/forms/user.py:1
27
#: assets/forms/user.py:1
38
msgid ""
"High level will be using login asset as default, if user was granted more "
"than 2 system user"
msgstr "高优先级的系统用户将会作为默认登录用户"
#: assets/forms/user.py:139
msgid ""
"If you choose manual login mode, you do not need to fill in the username and "
"password."
msgstr "如果选择手动登录模式,用户名和密码则不需要填写"
#: assets/models/asset.py:63 assets/models/domain.py:43
#: assets/templates/assets/_asset_list_modal.html:46
#: assets/templates/assets/admin_user_assets.html:52
...
...
@@ -309,7 +319,7 @@ msgstr "标签管理"
#: assets/templates/assets/admin_user_detail.html:68
#: assets/templates/assets/asset_detail.html:117
#: assets/templates/assets/domain_detail.html:72
#: assets/templates/assets/system_user_detail.html:
96
#: assets/templates/assets/system_user_detail.html:
100
#: ops/templates/ops/adhoc_detail.html:86 perms/models.py:38 perms/models.py:81
#: perms/templates/perms/asset_permission_detail.html:98
#: users/models/user.py:90 users/templates/users/user_detail.html:111
...
...
@@ -320,7 +330,7 @@ msgstr "创建者"
#: assets/models/domain.py:20 assets/models/group.py:22
#: assets/models/label.py:23 assets/templates/assets/admin_user_detail.html:64
#: assets/templates/assets/domain_detail.html:68
#: assets/templates/assets/system_user_detail.html:9
2
#: assets/templates/assets/system_user_detail.html:9
6
#: ops/templates/ops/adhoc_detail.html:90 ops/templates/ops/task_detail.html:63
#: perms/models.py:39 perms/models.py:82
#: perms/templates/perms/asset_permission_detail.html:94
...
...
@@ -338,8 +348,8 @@ msgstr "创建日期"
#: assets/templates/assets/domain_detail.html:76
#: assets/templates/assets/domain_gateway_list.html:61
#: assets/templates/assets/domain_list.html:17
#: assets/templates/assets/system_user_detail.html:10
0
#: assets/templates/assets/system_user_list.html:3
3
common/models.py:30
#: assets/templates/assets/system_user_detail.html:10
4
#: assets/templates/assets/system_user_list.html:3
4
common/models.py:30
#: ops/models/adhoc.py:42 perms/models.py:40 perms/models.py:83
#: perms/templates/perms/asset_permission_detail.html:102 terminal/models.py:26
#: terminal/templates/terminal/terminal_detail.html:63 users/models/group.py:13
...
...
@@ -392,7 +402,7 @@ msgid "Default"
msgstr "默认"
#: assets/models/cluster.py:36 assets/models/label.py:13
#: users/models/user.py:34
3
#: users/models/user.py:34
5
msgid "System"
msgstr "系统"
...
...
@@ -404,9 +414,9 @@ msgstr "默认Cluster"
msgid "Cluster"
msgstr "集群"
#: assets/models/domain.py:45 assets/models/user.py:1
06
#: assets/models/domain.py:45 assets/models/user.py:1
13
#: assets/templates/assets/domain_gateway_list.html:59
#: assets/templates/assets/system_user_detail.html:
66
#: assets/templates/assets/system_user_detail.html:
70
#: assets/templates/assets/system_user_list.html:28
#: terminal/templates/terminal/session_list.html:75
msgid "Protocol"
...
...
@@ -431,10 +441,10 @@ msgstr "默认资产组"
#: terminal/templates/terminal/command_list.html:32
#: terminal/templates/terminal/command_list.html:72
#: terminal/templates/terminal/session_list.html:33
#: terminal/templates/terminal/session_list.html:71 users/forms.py:28
1
#: users/models/user.py:31 users/models/user.py:33
1
#: terminal/templates/terminal/session_list.html:71 users/forms.py:28
2
#: users/models/user.py:31 users/models/user.py:33
3
#: users/templates/users/user_group_detail.html:78
#: users/templates/users/user_group_list.html:13 users/views/user.py:3
62
#: users/templates/users/user_group_list.html:13 users/views/user.py:3
59
msgid "User"
msgstr "用户"
...
...
@@ -451,7 +461,15 @@ msgstr "分类"
msgid "Key"
msgstr ""
#: assets/models/user.py:104
#: assets/models/user.py:106
msgid "Automatic login"
msgstr "自动登录"
#: assets/models/user.py:107
msgid "Manually login"
msgstr "手动登录"
#: assets/models/user.py:111
#: assets/templates/assets/_asset_group_bulk_update_modal.html:11
#: assets/templates/assets/system_user_asset.html:21
#: assets/views/admin_user.py:29 assets/views/admin_user.py:47
...
...
@@ -469,25 +487,30 @@ msgstr ""
msgid "Assets"
msgstr "资产管理"
#: assets/models/user.py:1
05
#: assets/models/user.py:1
12
msgid "Priority"
msgstr "优先级"
#: assets/models/user.py:1
07 assets/templates/assets/_system_user.html:58
#: assets/templates/assets/system_user_detail.html:1
18
#: assets/templates/assets/system_user_update.html:1
1
#: assets/models/user.py:1
14 assets/templates/assets/_system_user.html:59
#: assets/templates/assets/system_user_detail.html:1
22
#: assets/templates/assets/system_user_update.html:1
0
msgid "Auto push"
msgstr "自动推送"
#: assets/models/user.py:1
08 assets/templates/assets/system_user_detail.html:70
#: assets/models/user.py:1
15 assets/templates/assets/system_user_detail.html:74
msgid "Sudo"
msgstr "Sudo"
#: assets/models/user.py:1
09 assets/templates/assets/system_user_detail.html:75
#: assets/models/user.py:1
16 assets/templates/assets/system_user_detail.html:79
msgid "Shell"
msgstr "Shell"
#: assets/models/user.py:149 audits/models.py:12
#: assets/models/user.py:117 assets/templates/assets/system_user_detail.html:66
#: assets/templates/assets/system_user_list.html:29
msgid "Login mode"
msgstr "登录模式"
#: assets/models/user.py:157 audits/models.py:12
#: audits/templates/audits/ftp_log_list.html:49
#: audits/templates/audits/ftp_log_list.html:73 perms/forms.py:43
#: perms/models.py:34 perms/models.py:78
...
...
@@ -604,16 +627,15 @@ msgstr "基本"
#: assets/templates/assets/asset_create.html:25
#: assets/templates/assets/asset_update.html:30
#: assets/templates/assets/gateway_create_update.html:45
#: assets/templates/assets/system_user_update.html:7
#: users/templates/users/_user.html:21
msgid "Auth"
msgstr "认证"
#: assets/templates/assets/_system_user.html:4
7
#: assets/templates/assets/_system_user.html:4
8
msgid "Auto generate key"
msgstr "自动生成密钥"
#: assets/templates/assets/_system_user.html:6
4
#: assets/templates/assets/_system_user.html:6
5
#: assets/templates/assets/asset_create.html:59
#: assets/templates/assets/asset_update.html:63
#: assets/templates/assets/gateway_create_update.html:53
...
...
@@ -622,7 +644,7 @@ msgstr "自动生成密钥"
msgid "Other"
msgstr "其它"
#: assets/templates/assets/_system_user.html:7
0
#: assets/templates/assets/_system_user.html:7
1
#: assets/templates/assets/admin_user_create_update.html:45
#: assets/templates/assets/asset_bulk_update.html:23
#: assets/templates/assets/asset_create.html:66
...
...
@@ -647,7 +669,7 @@ msgstr "其它"
msgid "Reset"
msgstr "重置"
#: assets/templates/assets/_system_user.html:7
1
#: assets/templates/assets/_system_user.html:7
2
#: assets/templates/assets/admin_user_create_update.html:46
#: assets/templates/assets/asset_bulk_update.html:24
#: assets/templates/assets/asset_create.html:67
...
...
@@ -702,14 +724,14 @@ msgstr "资产列表"
#: assets/templates/assets/admin_user_assets.html:54
#: assets/templates/assets/admin_user_list.html:26
#: assets/templates/assets/system_user_asset.html:52
#: assets/templates/assets/system_user_list.html:3
0
#: assets/templates/assets/system_user_list.html:3
1
#: users/templates/users/user_group_granted_asset.html:47
msgid "Reachable"
msgstr "可连接"
#: assets/templates/assets/admin_user_assets.html:66
#: assets/templates/assets/system_user_asset.html:64
#: assets/templates/assets/system_user_detail.html:11
2
#: assets/templates/assets/system_user_detail.html:11
6
#: perms/templates/perms/asset_permission_detail.html:114
msgid "Quick update"
msgstr "快速更新"
...
...
@@ -722,7 +744,7 @@ msgstr "测试可连接性"
#: assets/templates/assets/admin_user_assets.html:75
#: assets/templates/assets/asset_detail.html:171
#: assets/templates/assets/system_user_asset.html:81
#: assets/templates/assets/system_user_detail.html:1
47
#: assets/templates/assets/system_user_detail.html:1
51
msgid "Test"
msgstr "测试"
...
...
@@ -736,7 +758,7 @@ msgstr "测试"
#: assets/templates/assets/domain_list.html:42
#: assets/templates/assets/label_list.html:38
#: assets/templates/assets/system_user_detail.html:26
#: assets/templates/assets/system_user_list.html:8
8
#: assets/templates/assets/system_user_list.html:8
9
#: perms/templates/perms/asset_permission_detail.html:30
#: perms/templates/perms/asset_permission_list.html:191
#: terminal/templates/terminal/terminal_detail.html:16
...
...
@@ -760,7 +782,7 @@ msgstr "更新"
#: assets/templates/assets/domain_list.html:43
#: assets/templates/assets/label_list.html:39
#: assets/templates/assets/system_user_detail.html:30
#: assets/templates/assets/system_user_list.html:
89
#: assets/templates/assets/system_user_list.html:
90
#: ops/templates/ops/task_list.html:72
#: perms/templates/perms/asset_permission_detail.html:34
#: perms/templates/perms/asset_permission_list.html:192
...
...
@@ -785,8 +807,8 @@ msgstr "选择节点"
#: assets/templates/assets/admin_user_detail.html:100
#: assets/templates/assets/asset_detail.html:200
#: assets/templates/assets/asset_list.html:638
#: assets/templates/assets/system_user_detail.html:19
2
#: assets/templates/assets/system_user_list.html:13
8
templates/_modal.html:22
#: assets/templates/assets/system_user_detail.html:19
6
#: assets/templates/assets/system_user_list.html:13
9
templates/_modal.html:22
#: terminal/templates/terminal/session_detail.html:108
#: users/templates/users/user_detail.html:366
#: users/templates/users/user_detail.html:391
...
...
@@ -804,12 +826,12 @@ msgid "Create admin user"
msgstr "创建管理用户"
#: assets/templates/assets/admin_user_list.html:27
#: assets/templates/assets/system_user_list.html:3
1
#: assets/templates/assets/system_user_list.html:3
2
msgid "Unreachable"
msgstr "不可达"
#: assets/templates/assets/admin_user_list.html:28
#: assets/templates/assets/system_user_list.html:3
2
#: assets/templates/assets/system_user_list.html:3
3
#: ops/templates/ops/adhoc_history.html:54
#: ops/templates/ops/task_history.html:60
msgid "Ratio"
...
...
@@ -820,7 +842,7 @@ msgstr "比例"
#: assets/templates/assets/domain_gateway_list.html:62
#: assets/templates/assets/domain_list.html:18
#: assets/templates/assets/label_list.html:17
#: assets/templates/assets/system_user_list.html:3
4
#: assets/templates/assets/system_user_list.html:3
5
#: ops/templates/ops/adhoc_history.html:59 ops/templates/ops/task_adhoc.html:64
#: ops/templates/ops/task_history.html:65 ops/templates/ops/task_list.html:42
#: perms/templates/perms/asset_permission_list.html:60
...
...
@@ -978,7 +1000,7 @@ msgid "Have assets, cancel"
msgstr "存在资产,不能删除"
#: assets/templates/assets/asset_list.html:633
#: assets/templates/assets/system_user_list.html:13
3
#: assets/templates/assets/system_user_list.html:13
4
#: users/templates/users/user_detail.html:361
#: users/templates/users/user_detail.html:386
#: users/templates/users/user_group_list.html:81
...
...
@@ -1053,17 +1075,17 @@ msgid "Assets of "
msgstr "资产"
#: assets/templates/assets/system_user_asset.html:70
#: assets/templates/assets/system_user_detail.html:13
5
#: assets/templates/assets/system_user_detail.html:13
9
msgid "Push system user now"
msgstr "立刻推送系统"
#: assets/templates/assets/system_user_asset.html:73
#: assets/templates/assets/system_user_detail.html:1
38
#: assets/templates/assets/system_user_detail.html:1
42
msgid "Push"
msgstr "推送"
#: assets/templates/assets/system_user_asset.html:78
#: assets/templates/assets/system_user_detail.html:14
4
#: assets/templates/assets/system_user_detail.html:14
8
msgid "Test assets connective"
msgstr "测试资产可连接性"
...
...
@@ -1075,28 +1097,28 @@ msgstr "任务已下发,查看ops任务列表"
msgid "Task has been send, seen left assets status"
msgstr "任务已下发,查看左侧资产状态"
#: assets/templates/assets/system_user_detail.html:8
1
#: assets/templates/assets/system_user_detail.html:8
5
msgid "Home"
msgstr "家目录"
#: assets/templates/assets/system_user_detail.html:
87
#: assets/templates/assets/system_user_detail.html:
91
msgid "Uid"
msgstr "Uid"
#: assets/templates/assets/system_user_detail.html:15
3
#: assets/templates/assets/system_user_detail.html:3
39
#: assets/templates/assets/system_user_detail.html:15
7
#: assets/templates/assets/system_user_detail.html:3
43
msgid "Clear auth"
msgstr "清除认证信息"
#: assets/templates/assets/system_user_detail.html:1
56
#: assets/templates/assets/system_user_detail.html:1
60
msgid "Clear"
msgstr "清除"
#: assets/templates/assets/system_user_detail.html:18
3
#: assets/templates/assets/system_user_detail.html:18
7
msgid "Add to node"
msgstr "添加到节点"
#: assets/templates/assets/system_user_detail.html:3
39
#: assets/templates/assets/system_user_detail.html:3
43
msgid "success"
msgstr "成功"
...
...
@@ -1105,20 +1127,20 @@ msgstr "成功"
msgid "Create system user"
msgstr "创建系统用户"
#: assets/templates/assets/system_user_list.html:13
4
#: assets/templates/assets/system_user_list.html:13
5
msgid "This will delete the selected System Users !!!"
msgstr "删除选择系统用户"
#: assets/templates/assets/system_user_list.html:14
2
#: assets/templates/assets/system_user_list.html:14
3
msgid "System Users Deleted."
msgstr "已被删除"
#: assets/templates/assets/system_user_list.html:14
3
#: assets/templates/assets/system_user_list.html:14
8
#: assets/templates/assets/system_user_list.html:14
4
#: assets/templates/assets/system_user_list.html:14
9
msgid "System Users Delete"
msgstr "删除系统用户"
#: assets/templates/assets/system_user_list.html:14
7
#: assets/templates/assets/system_user_list.html:14
8
msgid "System Users Deleting failed."
msgstr "系统用户删除失败"
...
...
@@ -1805,8 +1827,8 @@ msgstr "任务列表"
msgid "Task run history"
msgstr "执行历史"
#: perms/forms.py:18 users/forms.py:23
8 users/forms.py:243 users/forms.py:255
#: users/forms.py:28
5
#: perms/forms.py:18 users/forms.py:23
9 users/forms.py:244 users/forms.py:256
#: users/forms.py:28
6
msgid "Select users"
msgstr "选择用户"
...
...
@@ -1958,14 +1980,14 @@ msgstr "商业支持"
msgid "Docs"
msgstr "文档"
#: templates/_header_bar.html:37 templates/_nav_user.html:9 users/forms.py:12
1
#: templates/_header_bar.html:37 templates/_nav_user.html:9 users/forms.py:12
2
#: users/templates/users/_user.html:39
#: users/templates/users/first_login.html:39
#: users/templates/users/user_password_update.html:39
#: users/templates/users/user_profile.html:17
#: users/templates/users/user_profile_update.html:37
#: users/templates/users/user_profile_update.html:57
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:34
4
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:34
1
msgid "Profile"
msgstr "个人信息"
...
...
@@ -2022,13 +2044,13 @@ msgstr "关闭"
#: templates/_nav.html:10 users/views/group.py:28 users/views/group.py:44
#: users/views/group.py:62 users/views/group.py:79 users/views/group.py:95
#: users/views/login.py:277 users/views/login.py:335 users/views/user.py:6
6
#: users/views/user.py:8
1 users/views/user.py:103 users/views/user.py:174
#: users/views/user.py:32
9 users/views/user.py:381 users/views/user.py:416
#: users/views/login.py:277 users/views/login.py:335 users/views/user.py:6
5
#: users/views/user.py:8
0 users/views/user.py:102 users/views/user.py:173
#: users/views/user.py:32
8 users/views/user.py:378 users/views/user.py:413
msgid "Users"
msgstr "用户管理"
#: templates/_nav.html:13 users/views/user.py:6
7
#: templates/_nav.html:13 users/views/user.py:6
6
msgid "User list"
msgstr "用户列表"
...
...
@@ -2334,11 +2356,11 @@ msgstr ""
msgid "Invalid token or cache refreshed."
msgstr ""
#: users/forms.py:3
8
#: users/forms.py:3
9
msgid "MFA code"
msgstr "MFA 验证码"
#: users/forms.py:
49
users/models/user.py:59
#: users/forms.py:
50
users/models/user.py:59
#: users/templates/users/_select_user_modal.html:15
#: users/templates/users/user_detail.html:87
#: users/templates/users/user_list.html:25
...
...
@@ -2346,31 +2368,31 @@ msgstr "MFA 验证码"
msgid "Role"
msgstr "角色"
#: users/forms.py:5
2 users/forms.py:201
#: users/forms.py:5
3 users/forms.py:202
msgid "ssh public key"
msgstr "ssh公钥"
#: users/forms.py:5
3 users/forms.py:202
#: users/forms.py:5
4 users/forms.py:203
msgid "ssh-rsa AAAA..."
msgstr ""
#: users/forms.py:5
4
#: users/forms.py:5
5
msgid "Paste user id_rsa.pub here."
msgstr "复制用户公钥到这里"
#: users/forms.py:7
2
users/templates/users/user_detail.html:200
#: users/forms.py:7
3
users/templates/users/user_detail.html:200
msgid "Join user groups"
msgstr "添加到用户组"
#: users/forms.py:8
3 users/forms.py:216
#: users/forms.py:8
4 users/forms.py:217
msgid "Public key should not be the same as your old one."
msgstr "不能和原来的密钥相同"
#: users/forms.py:8
7 users/forms.py:220
users/serializers.py:48
#: users/forms.py:8
8 users/forms.py:221
users/serializers.py:48
msgid "Not a valid ssh public key"
msgstr "ssh密钥不合法"
#: users/forms.py:12
7
#: users/forms.py:12
8
msgid ""
"Tip: when enabled, you will enter the MFA binding process the next time you "
"log in. you can also directly bind in \"personal information -> quick "
...
...
@@ -2379,16 +2401,16 @@ msgstr ""
"提示:启用之后您将会在下次登录时进入MFA绑定流程;您也可以在(个人信息->快速修"
"改->更改MFA设置)中直接绑定!"
#: users/forms.py:13
7
#: users/forms.py:13
8
msgid "* Enable MFA authentication to make the account more secure."
msgstr "* 启用MFA认证,使账号更加安全."
#: users/forms.py:14
2
users/models/user.py:71
#: users/forms.py:14
3
users/models/user.py:71
#: users/templates/users/first_login.html:45
msgid "MFA"
msgstr "MFA"
#: users/forms.py:14
7
#: users/forms.py:14
8
msgid ""
"In order to protect you and your company, please keep your account, password "
"and key sensitive information properly. (for example: setting complex "
...
...
@@ -2397,41 +2419,41 @@ msgstr ""
"为了保护您和公司的安全,请妥善保管您的账户、密码和密钥等重要敏感信息;(如:"
"设置复杂密码,启用MFA认证)"
#: users/forms.py:15
4
users/templates/users/first_login.html:48
#: users/forms.py:15
5
users/templates/users/first_login.html:48
#: users/templates/users/first_login.html:107
#: users/templates/users/first_login.html:130
msgid "Finish"
msgstr "完成"
#: users/forms.py:16
0
#: users/forms.py:16
1
msgid "Old password"
msgstr "原来密码"
#: users/forms.py:16
5
#: users/forms.py:16
6
msgid "New password"
msgstr "新密码"
#: users/forms.py:17
0
#: users/forms.py:17
1
msgid "Confirm password"
msgstr "确认密码"
#: users/forms.py:18
0
#: users/forms.py:18
1
msgid "Old password error"
msgstr "原来密码错误"
#: users/forms.py:18
8
#: users/forms.py:18
9
msgid "Password does not match"
msgstr "密码不一致"
#: users/forms.py:
199
#: users/forms.py:
200
msgid "Automatically configure and download the SSH key"
msgstr "自动配置并下载SSH密钥"
#: users/forms.py:20
3
#: users/forms.py:20
4
msgid "Paste your id_rsa.pub here."
msgstr "复制你的公钥到这里"
#: users/forms.py:23
1
users/models/user.py:79
#: users/forms.py:23
2
users/models/user.py:79
#: users/templates/users/first_login.html:42
#: users/templates/users/user_password_update.html:45
#: users/templates/users/user_profile.html:68
...
...
@@ -2464,7 +2486,7 @@ msgstr "Agent"
msgid "Date login"
msgstr "登录日期"
#: users/models/user.py:30 users/models/user.py:3
39
#: users/models/user.py:30 users/models/user.py:3
41
msgid "Administrator"
msgstr "管理员"
...
...
@@ -2506,7 +2528,7 @@ msgstr "微信"
msgid "Source"
msgstr "用户来源"
#: users/models/user.py:34
2
#: users/models/user.py:34
4
msgid "Administrator is the super user of system"
msgstr "Administrator是初始的超级管理员"
...
...
@@ -2649,7 +2671,7 @@ msgid "Setting"
msgstr "设置"
#: users/templates/users/user_create.html:4
#: users/templates/users/user_list.html:16 users/views/user.py:8
1
#: users/templates/users/user_list.html:16 users/views/user.py:8
0
msgid "Create user"
msgstr "创建用户"
...
...
@@ -2658,7 +2680,7 @@ msgid "Reset link will be generated and sent to the user. "
msgstr "生成重置密码连接,通过邮件发送给用户"
#: users/templates/users/user_detail.html:19
#: users/templates/users/user_granted_asset.html:18 users/views/user.py:17
5
#: users/templates/users/user_granted_asset.html:18 users/views/user.py:17
4
msgid "User detail"
msgstr "用户详情"
...
...
@@ -2793,8 +2815,8 @@ msgstr "用户删除失败"
msgid "Administrator Settings force MFA login"
msgstr "管理员设置强制使用MFA登录"
#: users/templates/users/user_profile.html:116 users/views/user.py:20
4
#: users/views/user.py:25
8
#: users/templates/users/user_profile.html:116 users/views/user.py:20
3
#: users/views/user.py:25
7
msgid "User groups"
msgstr "用户组"
...
...
@@ -2840,7 +2862,7 @@ msgid ""
"corresponding private key."
msgstr "新的公钥已设置成功,请下载对应的私钥"
#: users/templates/users/user_update.html:4 users/views/user.py:10
4
#: users/templates/users/user_update.html:4 users/views/user.py:10
3
msgid "Update user"
msgstr "更新用户"
...
...
@@ -2998,7 +3020,7 @@ msgstr "用户组授权资产"
msgid "Please enable cookies and try again."
msgstr "设置你的浏览器支持cookie"
#: users/views/login.py:128 users/views/user.py:
501 users/views/user.py:526
#: users/views/login.py:128 users/views/user.py:
498 users/views/user.py:523
msgid "MFA code invalid"
msgstr "MFA码认证失败"
...
...
@@ -3039,7 +3061,7 @@ msgstr "Token错误或失效"
msgid "Password not same"
msgstr "密码不一致"
#: users/views/login.py:239 users/views/user.py:11
6 users/views/user.py:399
#: users/views/login.py:239 users/views/user.py:11
5 users/views/user.py:396
msgid "* Your password does not meet the requirements"
msgstr "* 您的密码不符合要求"
...
...
@@ -3051,46 +3073,46 @@ msgstr "首次登陆"
msgid "Login log list"
msgstr "登录日志"
#: users/views/user.py:12
8
#: users/views/user.py:12
7
msgid "Bulk update user success"
msgstr "批量更新用户成功"
#: users/views/user.py:23
3
#: users/views/user.py:23
2
msgid "Invalid file."
msgstr "文件不合法"
#: users/views/user.py:3
30
#: users/views/user.py:3
29
msgid "User granted assets"
msgstr "用户授权资产"
#: users/views/user.py:36
3
#: users/views/user.py:36
0
msgid "Profile setting"
msgstr "个人信息设置"
#: users/views/user.py:3
82
#: users/views/user.py:3
79
msgid "Password update"
msgstr "密码更新"
#: users/views/user.py:41
7
#: users/views/user.py:41
4
msgid "Public key update"
msgstr "密钥更新"
#: users/views/user.py:45
8
#: users/views/user.py:45
5
msgid "Password invalid"
msgstr "用户名或密码无效"
#: users/views/user.py:5
52
#: users/views/user.py:5
49
msgid "MFA enable success"
msgstr "MFA 绑定成功"
#: users/views/user.py:55
3
#: users/views/user.py:55
0
msgid "MFA enable success, return login page"
msgstr "MFA 绑定成功,返回到登录页面"
#: users/views/user.py:55
5
#: users/views/user.py:55
2
msgid "MFA disable success"
msgstr "MFA 解绑成功"
#: users/views/user.py:55
6
#: users/views/user.py:55
3
msgid "MFA disable success, return login page"
msgstr "MFA 解绑成功,返回登录页面"
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