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
bd4f9613
Commit
bd4f9613
authored
Mar 04, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改一些文案
parent
d284c217
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
50 additions
and
29 deletions
+50
-29
asset_list.html
apps/assets/templates/assets/asset_list.html
+11
-7
asset.py
apps/assets/views/asset.py
+1
-2
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+8
-8
urls.py
apps/jumpserver/urls.py
+2
-2
views.py
apps/jumpserver/views.py
+12
-1
style.css
apps/static/css/style.css
+1
-1
_header_bar.html
apps/templates/_header_bar.html
+2
-2
_nav.html
apps/templates/_nav.html
+5
-0
command.py
apps/terminal/views/command.py
+2
-2
session.py
apps/terminal/views/session.py
+1
-1
api.py
apps/users/api.py
+2
-1
authentication.py
apps/users/models/authentication.py
+2
-1
login.py
apps/users/views/login.py
+1
-0
user.py
apps/users/views/user.py
+0
-1
No files found.
apps/assets/templates/assets/asset_list.html
View file @
bd4f9613
...
@@ -319,32 +319,36 @@ function beforeDrag() {
...
@@ -319,32 +319,36 @@ function beforeDrag() {
return
true
return
true
}
}
function
beforeDrop
()
{
function
beforeDrop
(
treeId
,
treeNodes
,
targetNode
,
moveType
)
{
var
treeNodesNames
=
[];
$
.
each
(
treeNodes
,
function
(
index
,
value
)
{
treeNodesNames
.
push
(
value
.
value
);
});
var
msg
=
"你想移动节点: `"
+
treeNodesNames
.
join
(
","
)
+
"` 到 `"
+
targetNode
.
value
+
"` 下吗?"
;
if
(
confirm
(
msg
)){
return
true
return
true
}
else
{
return
false
}
}
}
function
onDrag
(
event
,
treeId
,
treeNodes
)
{
function
onDrag
(
event
,
treeId
,
treeNodes
)
{
}
}
function
onDrop
(
event
,
treeId
,
treeNodes
,
targetNode
,
moveType
)
{
function
onDrop
(
event
,
treeId
,
treeNodes
,
targetNode
,
moveType
)
{
var
treeNodesNames
=
[];
var
treeNodesIds
=
[];
var
treeNodesIds
=
[];
$
.
each
(
treeNodes
,
function
(
index
,
value
)
{
$
.
each
(
treeNodes
,
function
(
index
,
value
)
{
treeNodesNames
.
push
(
value
.
value
);
treeNodesIds
.
push
(
value
.
id
);
treeNodesIds
.
push
(
value
.
id
);
});
});
var
msg
=
"你想移动节点: `"
+
treeNodesNames
.
join
(
","
)
+
"` 到 `"
+
targetNode
.
value
+
"` 下吗?"
;
var
the_url
=
"{% url 'api-assets:node-add-children' pk=DEFAULT_PK %}"
.
replace
(
"{{ DEFAULT_PK }}"
,
targetNode
.
id
);
var
the_url
=
"{% url 'api-assets:node-add-children' pk=DEFAULT_PK %}"
.
replace
(
"{{ DEFAULT_PK }}"
,
targetNode
.
id
);
var
body
=
{
nodes
:
treeNodesIds
};
var
body
=
{
nodes
:
treeNodesIds
};
if
(
confirm
(
msg
)){
APIUpdateAttr
({
APIUpdateAttr
({
url
:
the_url
,
url
:
the_url
,
method
:
"PUT"
,
method
:
"PUT"
,
body
:
JSON
.
stringify
(
body
)
body
:
JSON
.
stringify
(
body
)
})
})
}
}
}
function
initTree
()
{
function
initTree
()
{
...
...
apps/assets/views/asset.py
View file @
bd4f9613
...
@@ -58,8 +58,7 @@ class UserAssetListView(LoginRequiredMixin, TemplateView):
...
@@ -58,8 +58,7 @@ class UserAssetListView(LoginRequiredMixin, TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
{
context
=
{
'app'
:
_
(
'Assets'
),
'action'
:
_
(
'My assets'
),
'action'
:
_
(
'Asset list'
),
'system_users'
:
SystemUser
.
objects
.
all
(),
'system_users'
:
SystemUser
.
objects
.
all
(),
}
}
kwargs
.
update
(
context
)
kwargs
.
update
(
context
)
...
...
apps/i18n/zh/LC_MESSAGES/django.po
View file @
bd4f9613
...
@@ -84,7 +84,7 @@ msgstr "资产"
...
@@ -84,7 +84,7 @@ msgstr "资产"
#: assets/forms/user.py:24
#: assets/forms/user.py:24
msgid "Password or private key passphrase"
msgid "Password or private key passphrase"
msgstr "密码或
秘
钥密码"
msgstr "密码或
密
钥密码"
#: assets/forms/user.py:25 assets/models/user.py:30 common/forms.py:113
#: assets/forms/user.py:25 assets/models/user.py:30 common/forms.py:113
#: users/forms.py:16 users/forms.py:24 users/templates/users/login.html:56
#: users/forms.py:16 users/forms.py:24 users/templates/users/login.html:56
...
@@ -683,7 +683,7 @@ msgstr "认证"
...
@@ -683,7 +683,7 @@ msgstr "认证"
#: assets/templates/assets/_system_user.html:47
#: assets/templates/assets/_system_user.html:47
msgid "Auto generate key"
msgid "Auto generate key"
msgstr "自动生成
秘
钥"
msgstr "自动生成
密
钥"
#: assets/templates/assets/_system_user.html:64
#: assets/templates/assets/_system_user.html:64
#: assets/templates/assets/asset_create.html:58
#: assets/templates/assets/asset_create.html:58
...
@@ -1192,7 +1192,7 @@ msgstr "密码认证"
...
@@ -1192,7 +1192,7 @@ msgstr "密码认证"
#: common/forms.py:156
#: common/forms.py:156
msgid "Public key auth"
msgid "Public key auth"
msgstr "
秘
钥认证"
msgstr "
密
钥认证"
#: common/forms.py:159 common/templates/common/terminal_setting.html:63
#: common/forms.py:159 common/templates/common/terminal_setting.html:63
#: terminal/forms.py:30 terminal/models.py:20
#: terminal/forms.py:30 terminal/models.py:20
...
@@ -1731,7 +1731,7 @@ msgid ""
...
@@ -1731,7 +1731,7 @@ msgid ""
" "
" "
msgstr ""
msgstr ""
"\n"
"\n"
" 您的ssh
秘
钥没有设置或已失效,请点击 <a href="
" 您的ssh
密
钥没有设置或已失效,请点击 <a href="
"\"%(user_pubkey_update)s\"> 链接 </a> 更新\n"
"\"%(user_pubkey_update)s\"> 链接 </a> 更新\n"
" "
" "
...
@@ -2329,7 +2329,7 @@ msgstr "将失效用户当前密码,并发送重设密码邮件到用户邮箱
...
@@ -2329,7 +2329,7 @@ msgstr "将失效用户当前密码,并发送重设密码邮件到用户邮箱
msgid ""
msgid ""
"The reset-ssh-public-key E-mail has been sent successfully. Please inform "
"The reset-ssh-public-key E-mail has been sent successfully. Please inform "
"the user to update his new ssh public key."
"the user to update his new ssh public key."
msgstr "重设
秘
钥邮件将会发送到用户邮箱"
msgstr "重设
密
钥邮件将会发送到用户邮箱"
#: users/templates/users/user_detail.html:350
#: users/templates/users/user_detail.html:350
#: users/templates/users/user_profile.html:140
#: users/templates/users/user_profile.html:140
...
@@ -2338,7 +2338,7 @@ msgstr "重置SSH密钥"
...
@@ -2338,7 +2338,7 @@ msgstr "重置SSH密钥"
#: users/templates/users/user_detail.html:360
#: users/templates/users/user_detail.html:360
msgid "This will reset the user public key and send a reset mail"
msgid "This will reset the user public key and send a reset mail"
msgstr "将会失效用户当前
秘
钥,并发送重置邮件到用户邮箱"
msgstr "将会失效用户当前
密
钥,并发送重置邮件到用户邮箱"
#: users/templates/users/user_detail.html:377
#: users/templates/users/user_detail.html:377
#: users/templates/users/user_profile.html:166
#: users/templates/users/user_profile.html:166
...
@@ -2561,7 +2561,7 @@ msgstr "禁用或失效"
...
@@ -2561,7 +2561,7 @@ msgstr "禁用或失效"
#: users/utils.py:154
#: users/utils.py:154
msgid "Password or SSH public key invalid"
msgid "Password or SSH public key invalid"
msgstr "密码或
秘
钥不合法"
msgstr "密码或
密
钥不合法"
#: users/views/group.py:29
#: users/views/group.py:29
msgid "User group list"
msgid "User group list"
...
@@ -2642,7 +2642,7 @@ msgstr "密码更新"
...
@@ -2642,7 +2642,7 @@ msgstr "密码更新"
#: users/views/user.py:375
#: users/views/user.py:375
msgid "Public key update"
msgid "Public key update"
msgstr "
秘
钥更新"
msgstr "
密
钥更新"
#~ msgid "Help"
#~ msgid "Help"
#~ msgstr "帮助"
#~ msgstr "帮助"
apps/jumpserver/urls.py
View file @
bd4f9613
...
@@ -4,16 +4,16 @@ from __future__ import unicode_literals
...
@@ -4,16 +4,16 @@ from __future__ import unicode_literals
from
django.conf.urls
import
url
,
include
from
django.conf.urls
import
url
,
include
from
django.conf
import
settings
from
django.conf
import
settings
from
django.conf.urls.static
import
static
from
django.conf.urls.static
import
static
from
django.views.static
import
serve
as
static_serve
from
rest_framework.schemas
import
get_schema_view
from
rest_framework.schemas
import
get_schema_view
from
rest_framework_swagger.renderers
import
SwaggerUIRenderer
,
OpenAPIRenderer
from
rest_framework_swagger.renderers
import
SwaggerUIRenderer
,
OpenAPIRenderer
from
.views
import
IndexView
from
.views
import
IndexView
,
LunaView
schema_view
=
get_schema_view
(
title
=
'Users API'
,
renderer_classes
=
[
OpenAPIRenderer
,
SwaggerUIRenderer
])
schema_view
=
get_schema_view
(
title
=
'Users API'
,
renderer_classes
=
[
OpenAPIRenderer
,
SwaggerUIRenderer
])
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^$'
,
IndexView
.
as_view
(),
name
=
'index'
),
url
(
r'^$'
,
IndexView
.
as_view
(),
name
=
'index'
),
url
(
r'^luna/$'
,
LunaView
.
as_view
(),
name
=
'luna-error'
),
url
(
r'^users/'
,
include
(
'users.urls.views_urls'
,
namespace
=
'users'
)),
url
(
r'^users/'
,
include
(
'users.urls.views_urls'
,
namespace
=
'users'
)),
url
(
r'^assets/'
,
include
(
'assets.urls.views_urls'
,
namespace
=
'assets'
)),
url
(
r'^assets/'
,
include
(
'assets.urls.views_urls'
,
namespace
=
'assets'
)),
url
(
r'^perms/'
,
include
(
'perms.urls.views_urls'
,
namespace
=
'perms'
)),
url
(
r'^perms/'
,
include
(
'perms.urls.views_urls'
,
namespace
=
'perms'
)),
...
...
apps/jumpserver/views.py
View file @
bd4f9613
from
django.views.generic
import
TemplateView
from
django.http
import
HttpResponse
from
django.views.generic
import
TemplateView
,
View
from
django.utils
import
timezone
from
django.utils
import
timezone
from
django.db.models
import
Count
from
django.db.models
import
Count
from
django.contrib.auth.mixins
import
LoginRequiredMixin
from
django.contrib.auth.mixins
import
LoginRequiredMixin
...
@@ -150,3 +151,12 @@ class IndexView(LoginRequiredMixin, TemplateView):
...
@@ -150,3 +151,12 @@ class IndexView(LoginRequiredMixin, TemplateView):
kwargs
.
update
(
context
)
kwargs
.
update
(
context
)
return
super
(
IndexView
,
self
)
.
get_context_data
(
**
kwargs
)
return
super
(
IndexView
,
self
)
.
get_context_data
(
**
kwargs
)
class
LunaView
(
View
):
def
get
(
self
,
request
):
msg
=
"""
Luna是单独部署的一个程序,你需要部署luna,coco,配置nginx做url分发,
如果你看到了这个页面,证明你访问的不是nginx监听的端口,祝你好运
"""
return
HttpResponse
(
msg
)
\ No newline at end of file
apps/static/css/style.css
View file @
bd4f9613
...
@@ -3299,7 +3299,7 @@ body.tour-open .animated {
...
@@ -3299,7 +3299,7 @@ body.tour-open .animated {
border-bottom
:
1px
solid
#e7eaec
;
border-bottom
:
1px
solid
#e7eaec
;
}
}
body
{
body
{
font-family
:
"open sans"
,
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
font-family
:
"open sans"
,
"Helvetica Neue"
,
"微软雅黑"
,
Helvetica
,
Arial
,
sans-serif
;
background-color
:
#2f4050
;
background-color
:
#2f4050
;
font-size
:
13px
;
font-size
:
13px
;
color
:
#676a6c
;
color
:
#676a6c
;
...
...
apps/templates/_header_bar.html
View file @
bd4f9613
...
@@ -62,11 +62,11 @@
...
@@ -62,11 +62,11 @@
<li>
<li>
<a
href=
""
>
{% trans 'Dashboard' %}
</a>
<a
href=
""
>
{% trans 'Dashboard' %}
</a>
</li>
</li>
<li>
{% if app %}
{% if app %}
<li>
<a>
{{ app }}
</a>
<a>
{{ app }}
</a>
{% endif %}
</li>
</li>
{% endif %}
{% if action %}
{% if action %}
<li
class=
"active"
>
<li
class=
"active"
>
<strong>
{{ action }}
</strong>
<strong>
{{ action }}
</strong>
...
...
apps/templates/_nav.html
View file @
bd4f9613
...
@@ -42,6 +42,11 @@
...
@@ -42,6 +42,11 @@
<li
id=
"session-online"
><a
href=
"{% url 'terminal:session-online-list' %}"
>
{% trans 'Session online' %}
</a></li>
<li
id=
"session-online"
><a
href=
"{% url 'terminal:session-online-list' %}"
>
{% trans 'Session online' %}
</a></li>
<li
id=
"session-offline"
><a
href=
"{% url 'terminal:session-offline-list' %}"
>
{% trans 'Session offline' %}
</a></li>
<li
id=
"session-offline"
><a
href=
"{% url 'terminal:session-offline-list' %}"
>
{% trans 'Session offline' %}
</a></li>
<li
id=
"command"
><a
href=
"{% url 'terminal:command-list' %}"
>
{% trans 'Commands' %}
</a></li>
<li
id=
"command"
><a
href=
"{% url 'terminal:command-list' %}"
>
{% trans 'Commands' %}
</a></li>
<li>
<a
href=
"{% url 'terminal:web-terminal' %}"
target=
"_blank"
>
<span
class=
"nav-label"
>
{% trans 'Web terminal' %}
</span>
</a>
</li>
<li
id=
"terminal"
><a
href=
"{% url 'terminal:terminal-list' %}"
>
{% trans 'Terminal' %}
</a></li>
<li
id=
"terminal"
><a
href=
"{% url 'terminal:terminal-list' %}"
>
{% trans 'Terminal' %}
</a></li>
</ul>
</ul>
</li>
</li>
...
...
apps/terminal/views/command.py
View file @
bd4f9613
...
@@ -6,7 +6,7 @@ from django.conf import settings
...
@@ -6,7 +6,7 @@ from django.conf import settings
from
django.utils
import
timezone
from
django.utils
import
timezone
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
from
common.mixins
import
DatetimeSearchMixin
from
common.mixins
import
DatetimeSearchMixin
,
AdminUserRequiredMixin
from
..models
import
Command
from
..models
import
Command
from
..
import
utils
from
..
import
utils
from
..backends
import
get_multi_command_store
from
..backends
import
get_multi_command_store
...
@@ -15,7 +15,7 @@ __all__ = ['CommandListView']
...
@@ -15,7 +15,7 @@ __all__ = ['CommandListView']
common_storage
=
get_multi_command_store
()
common_storage
=
get_multi_command_store
()
class
CommandListView
(
DatetimeSearchMixin
,
ListView
):
class
CommandListView
(
DatetimeSearchMixin
,
AdminUserRequiredMixin
,
ListView
):
model
=
Command
model
=
Command
template_name
=
"terminal/command_list.html"
template_name
=
"terminal/command_list.html"
context_object_name
=
'command_list'
context_object_name
=
'command_list'
...
...
apps/terminal/views/session.py
View file @
bd4f9613
...
@@ -97,7 +97,7 @@ class SessionOfflineListView(SessionListView):
...
@@ -97,7 +97,7 @@ class SessionOfflineListView(SessionListView):
return
super
()
.
get_context_data
(
**
kwargs
)
return
super
()
.
get_context_data
(
**
kwargs
)
class
SessionDetailView
(
SingleObjectMixin
,
ListView
):
class
SessionDetailView
(
SingleObjectMixin
,
AdminUserRequiredMixin
,
ListView
):
template_name
=
'terminal/session_detail.html'
template_name
=
'terminal/session_detail.html'
model
=
Session
model
=
Session
object
=
None
object
=
None
...
...
apps/users/api.py
View file @
bd4f9613
...
@@ -145,7 +145,8 @@ class UserAuthApi(APIView):
...
@@ -145,7 +145,8 @@ class UserAuthApi(APIView):
if
not
login_ip
:
if
not
login_ip
:
x_forwarded_for
=
request
.
META
.
get
(
'HTTP_X_FORWARDED_FOR'
,
''
)
.
split
(
','
)
x_forwarded_for
=
request
.
META
.
get
(
'HTTP_X_FORWARDED_FOR'
,
''
)
.
split
(
','
)
if
x_forwarded_for
:
if
x_forwarded_for
and
x_forwarded_for
[
0
]:
login_ip
=
x_forwarded_for
[
0
]
login_ip
=
x_forwarded_for
[
0
]
else
:
else
:
login_ip
=
request
.
META
.
get
(
"REMOTE_ADDR"
)
login_ip
=
request
.
META
.
get
(
"REMOTE_ADDR"
)
...
...
apps/users/models/authentication.py
View file @
bd4f9613
...
@@ -16,7 +16,8 @@ class AccessKey(models.Model):
...
@@ -16,7 +16,8 @@ class AccessKey(models.Model):
default
=
uuid
.
uuid4
,
editable
=
False
)
default
=
uuid
.
uuid4
,
editable
=
False
)
secret
=
models
.
UUIDField
(
verbose_name
=
'AccessKeySecret'
,
secret
=
models
.
UUIDField
(
verbose_name
=
'AccessKeySecret'
,
default
=
uuid
.
uuid4
,
editable
=
False
)
default
=
uuid
.
uuid4
,
editable
=
False
)
user
=
models
.
ForeignKey
(
User
,
verbose_name
=
'User'
,
on_delete
=
models
.
CASCADE
,
related_name
=
'access_key'
)
user
=
models
.
ForeignKey
(
User
,
verbose_name
=
'User'
,
on_delete
=
models
.
CASCADE
,
related_name
=
'access_key'
)
def
get_id
(
self
):
def
get_id
(
self
):
return
str
(
self
.
id
)
return
str
(
self
.
id
)
...
...
apps/users/views/login.py
View file @
bd4f9613
...
@@ -57,6 +57,7 @@ class UserLoginView(FormView):
...
@@ -57,6 +57,7 @@ class UserLoginView(FormView):
return
HttpResponse
(
_
(
"Please enable cookies and try again."
))
return
HttpResponse
(
_
(
"Please enable cookies and try again."
))
auth_login
(
self
.
request
,
form
.
get_user
())
auth_login
(
self
.
request
,
form
.
get_user
())
x_forwarded_for
=
self
.
request
.
META
.
get
(
'HTTP_X_FORWARDED_FOR'
,
''
)
.
split
(
','
)
x_forwarded_for
=
self
.
request
.
META
.
get
(
'HTTP_X_FORWARDED_FOR'
,
''
)
.
split
(
','
)
if
x_forwarded_for
and
x_forwarded_for
[
0
]:
if
x_forwarded_for
and
x_forwarded_for
[
0
]:
login_ip
=
x_forwarded_for
[
0
]
login_ip
=
x_forwarded_for
[
0
]
else
:
else
:
...
...
apps/users/views/user.py
View file @
bd4f9613
...
@@ -313,7 +313,6 @@ class UserProfileView(LoginRequiredMixin, TemplateView):
...
@@ -313,7 +313,6 @@ class UserProfileView(LoginRequiredMixin, TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
{
context
=
{
'app'
:
_
(
'Users'
),
'action'
:
_
(
'Profile'
),
'action'
:
_
(
'Profile'
),
}
}
kwargs
.
update
(
context
)
kwargs
.
update
(
context
)
...
...
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