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
7987056b
Unverified
Commit
7987056b
authored
May 28, 2018
by
老广
Committed by
GitHub
May 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1365 from jumpserver/dev
Dev修复
parents
62c114d9
0bc86543
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
26 deletions
+35
-26
asset_list.html
apps/assets/templates/assets/asset_list.html
+9
-6
django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+14
-10
utils.py
apps/perms/utils.py
+7
-9
user_group_granted_asset.html
apps/users/templates/users/user_group_granted_asset.html
+2
-1
utils.py
apps/users/utils.py
+3
-0
No files found.
apps/assets/templates/assets/asset_list.html
View file @
7987056b
...
@@ -17,20 +17,21 @@
...
@@ -17,20 +17,21 @@
position
:
absolute
;
position
:
absolute
;
visibility
:
hidden
;
visibility
:
hidden
;
text-align
:
left
;
text-align
:
left
;
top
:
100%
;
{#
top
:
100%
;
#
}
top
:
0
;
left
:
0
;
left
:
0
;
z-index
:
1000
;
z-index
:
1000
;
float
:
left
;
{
#
float
:
left
;
#
}
padding
:
5px
0
;
padding
:
0
0
;
margin
:
2px
0
0
;
margin
:
2px
0
0
;
list-style
:
none
;
list-style
:
none
;
background-clip
:
padding-box
;
background-clip
:
padding-box
;
}
}
div
#rMenu
li
{
div
#rMenu
li
{
margin
:
1px
0
;
margin
:
1px
0
;
cursor
:
pointer
;
cursor
:
pointer
;
{#
list-style
:
none
outside
none
;
#
}
list-style
:
none
outside
none
;
}
}
.dropdown
a
:hover
{
.dropdown
a
:hover
{
background-color
:
#f1f1f1
background-color
:
#f1f1f1
}
}
...
@@ -266,6 +267,8 @@ function OnRightClick(event, treeId, treeNode) {
...
@@ -266,6 +267,8 @@ function OnRightClick(event, treeId, treeNode) {
function
showRMenu
(
type
,
x
,
y
)
{
function
showRMenu
(
type
,
x
,
y
)
{
$
(
"#rMenu ul"
).
show
();
$
(
"#rMenu ul"
).
show
();
x
-=
220
;
x
-=
220
;
x
+=
document
.
body
.
scrollLeft
;
y
+=
document
.
body
.
scrollTop
+
document
.
documentElement
.
scrollTop
;
rMenu
.
css
({
"top"
:
y
+
"px"
,
"left"
:
x
+
"px"
,
"visibility"
:
"visible"
});
rMenu
.
css
({
"top"
:
y
+
"px"
,
"left"
:
x
+
"px"
,
"visibility"
:
"visible"
});
$
(
"body"
).
bind
(
"mousedown"
,
onBodyMouseDown
);
$
(
"body"
).
bind
(
"mousedown"
,
onBodyMouseDown
);
...
...
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
7987056b
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
7987056b
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-
17 11:32
+0800\n"
"POT-Creation-Date: 2018-05-
25 18:11
+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
...
@@ -535,7 +535,7 @@ msgstr "测试系统用户可连接性: {}"
...
@@ -535,7 +535,7 @@ msgstr "测试系统用户可连接性: {}"
msgid "定期测试系统用户可连接性: {}"
msgid "定期测试系统用户可连接性: {}"
msgstr ""
msgstr ""
#: assets/tasks.py:40
2
#: assets/tasks.py:40
1
msgid "推送系统用户到入资产: {}"
msgid "推送系统用户到入资产: {}"
msgstr ""
msgstr ""
...
@@ -2540,7 +2540,7 @@ msgid "Can't provide security? Please contact the administrator!"
...
@@ -2540,7 +2540,7 @@ msgid "Can't provide security? Please contact the administrator!"
msgstr "如果不能提供MFA验证码,请联系管理员!"
msgstr "如果不能提供MFA验证码,请联系管理员!"
#: users/templates/users/reset_password.html:45
#: users/templates/users/reset_password.html:45
#: users/templates/users/user_detail.html:348 users/utils.py:7
3
#: users/templates/users/user_detail.html:348 users/utils.py:7
6
msgid "Reset password"
msgid "Reset password"
msgstr "重置密码"
msgstr "重置密码"
...
@@ -2744,13 +2744,15 @@ msgid "Create account successfully"
...
@@ -2744,13 +2744,15 @@ msgid "Create account successfully"
msgstr "创建账户成功"
msgstr "创建账户成功"
#: users/utils.py:39
#: users/utils.py:39
#, python-format
#,
fuzzy,
python-format
msgid ""
msgid ""
"\n"
"\n"
" Hello %(name)s:\n"
" Hello %(name)s:\n"
" </br>\n"
" </br>\n"
" Your account has been created successfully\n"
" Your account has been created successfully\n"
" </br>\n"
" </br>\n"
" Username: %(username)s\n"
" </br>\n"
" <a href=\"%(rest_password_url)s?token=%(rest_password_token)s\">click "
" <a href=\"%(rest_password_url)s?token=%(rest_password_token)s\">click "
"here to set your password</a>\n"
"here to set your password</a>\n"
" </br>\n"
" </br>\n"
...
@@ -2770,6 +2772,8 @@ msgstr ""
...
@@ -2770,6 +2772,8 @@ msgstr ""
" 你好 %(name)s:\n"
" 你好 %(name)s:\n"
" </br>\n"
" </br>\n"
" 恭喜您,您的账号已经创建成功 </br>\n"
" 恭喜您,您的账号已经创建成功 </br>\n"
" 用户名: %(username)s\n"
" </br>\n"
" <a href=\"%(rest_password_url)s?token=%(rest_password_token)s\">请点击这"
" <a href=\"%(rest_password_url)s?token=%(rest_password_token)s\">请点击这"
"里设置密码</a> </br>\n"
"里设置密码</a> </br>\n"
" 这个链接有效期1小时, 超过时间您可以 <a href=\"%(forget_password_url)s?"
" 这个链接有效期1小时, 超过时间您可以 <a href=\"%(forget_password_url)s?"
...
@@ -2784,7 +2788,7 @@ msgstr ""
...
@@ -2784,7 +2788,7 @@ msgstr ""
" </br>\n"
" </br>\n"
" "
" "
#: users/utils.py:7
5
#: users/utils.py:7
8
#, python-format
#, python-format
msgid ""
msgid ""
"\n"
"\n"
...
@@ -2828,11 +2832,11 @@ msgstr ""
...
@@ -2828,11 +2832,11 @@ msgstr ""
" </br>\n"
" </br>\n"
" "
" "
#: users/utils.py:10
6
#: users/utils.py:10
9
msgid "SSH Key Reset"
msgid "SSH Key Reset"
msgstr "重置ssh密钥"
msgstr "重置ssh密钥"
#: users/utils.py:1
08
#: users/utils.py:1
11
#, python-format
#, python-format
msgid ""
msgid ""
"\n"
"\n"
...
@@ -2857,15 +2861,15 @@ msgstr ""
...
@@ -2857,15 +2861,15 @@ msgstr ""
" </br>\n"
" </br>\n"
" "
" "
#: users/utils.py:14
1
#: users/utils.py:14
4
msgid "User not exist"
msgid "User not exist"
msgstr "用户不存在"
msgstr "用户不存在"
#: users/utils.py:14
3
#: users/utils.py:14
6
msgid "Disabled or expired"
msgid "Disabled or expired"
msgstr "禁用或失效"
msgstr "禁用或失效"
#: users/utils.py:15
6
#: users/utils.py:15
9
msgid "Password or SSH public key invalid"
msgid "Password or SSH public key invalid"
msgstr "密码或密钥不合法"
msgstr "密码或密钥不合法"
...
...
apps/perms/utils.py
View file @
7987056b
...
@@ -106,21 +106,19 @@ class AssetPermissionUtil:
...
@@ -106,21 +106,19 @@ class AssetPermissionUtil:
return
assets
return
assets
@classmethod
@classmethod
def
get_user_group_nodes_with_assets
(
cls
,
user
):
def
get_user_group_nodes_with_assets
(
cls
,
group
):
"""
"""
:param
user
:
:param
group
:
:return: {node: {asset: set(su1, su2)}}
:return: {node: {asset: set(su1, su2)}}
"""
"""
nodes
=
defaultdict
(
dict
)
_assets
=
cls
.
get_user_group_assets
(
group
)
_assets
=
cls
.
get_user_group_assets
(
user
)
tree
=
Tree
(
)
for
asset
,
_system_users
in
_assets
.
items
():
for
asset
,
_system_users
in
_assets
.
items
():
_nodes
=
asset
.
get_nodes
()
_nodes
=
asset
.
get_nodes
()
tree
.
add_nodes
(
_nodes
)
for
node
in
_nodes
:
for
node
in
_nodes
:
if
asset
in
nodes
[
node
]:
tree
.
nodes
[
node
][
asset
]
.
update
(
_system_users
)
nodes
[
node
][
asset
]
.
update
(
_system_users
)
return
tree
.
nodes
else
:
nodes
[
node
][
asset
]
=
_system_users
return
nodes
@classmethod
@classmethod
def
get_user_assets_direct
(
cls
,
user
):
def
get_user_assets_direct
(
cls
,
user
):
...
...
apps/users/templates/users/user_group_granted_asset.html
View file @
7987056b
...
@@ -64,10 +64,11 @@
...
@@ -64,10 +64,11 @@
var
zTree
;
var
zTree
;
var
inited
=
false
;
var
inited
=
false
;
var
url
;
var
url
;
var
asset_table
;
function
initTable
()
{
function
initTable
()
{
if
(
inited
){
if
(
inited
){
return
return
asset_table
}
else
{
}
else
{
inited
=
true
;
inited
=
true
;
}
}
...
...
apps/users/utils.py
View file @
7987056b
...
@@ -41,6 +41,8 @@ def send_user_created_mail(user):
...
@@ -41,6 +41,8 @@ def send_user_created_mail(user):
</br>
</br>
Your account has been created successfully
Your account has been created successfully
</br>
</br>
Username:
%(username)
s
</br>
<a href="
%(rest_password_url)
s?token=
%(rest_password_token)
s">click here to set your password</a>
<a href="
%(rest_password_url)
s?token=
%(rest_password_token)
s">click here to set your password</a>
</br>
</br>
This link is valid for 1 hour. After it expires, <a href="
%(forget_password_url)
s?email=
%(email)
s">request new one</a>
This link is valid for 1 hour. After it expires, <a href="
%(forget_password_url)
s?email=
%(email)
s">request new one</a>
...
@@ -54,6 +56,7 @@ def send_user_created_mail(user):
...
@@ -54,6 +56,7 @@ def send_user_created_mail(user):
</br>
</br>
"""
)
%
{
"""
)
%
{
'name'
:
user
.
name
,
'name'
:
user
.
name
,
'username'
:
user
.
username
,
'rest_password_url'
:
reverse
(
'users:reset-password'
,
external
=
True
),
'rest_password_url'
:
reverse
(
'users:reset-password'
,
external
=
True
),
'rest_password_token'
:
user
.
generate_reset_token
(),
'rest_password_token'
:
user
.
generate_reset_token
(),
'forget_password_url'
:
reverse
(
'users:forgot-password'
,
external
=
True
),
'forget_password_url'
:
reverse
(
'users:forgot-password'
,
external
=
True
),
...
...
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