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
9a6bc9fe
Commit
9a6bc9fe
authored
Jan 05, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] session添加登陆ip
parent
1888c698
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
35 deletions
+39
-35
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+34
-32
api.py
apps/terminal/api.py
+0
-1
models.py
apps/terminal/models.py
+1
-0
session_list.html
apps/terminal/templates/terminal/session_list.html
+2
-0
terminal_detail.html
apps/terminal/templates/terminal/terminal_detail.html
+1
-1
api.py
apps/users/api.py
+1
-1
No files found.
apps/locale/zh/LC_MESSAGES/django.mo
View file @
9a6bc9fe
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
9a6bc9fe
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-05 1
7:27
+0800\n"
"POT-Creation-Date: 2018-01-05 1
8:18
+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"
...
...
@@ -107,7 +107,7 @@ msgstr "选择的系统用户将会在该集群资产上创建"
#: perms/templates/perms/asset_permission_detail.html:62
#: perms/templates/perms/asset_permission_list.html:25
#: perms/templates/perms/asset_permission_user.html:54 terminal/models.py:14
#: terminal/models.py:11
7
terminal/templates/terminal/terminal_detail.html:43
#: terminal/models.py:11
8
terminal/templates/terminal/terminal_detail.html:43
#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14
#: users/models/user.py:36 users/templates/users/_select_user_modal.html:13
#: users/templates/users/user_detail.html:62
...
...
@@ -811,7 +811,7 @@ msgstr "比例"
#: ops/templates/ops/adhoc_history.html:59 ops/templates/ops/task_adhoc.html:61
#: ops/templates/ops/task_history.html:62 ops/templates/ops/task_list.html:41
#: perms/templates/perms/asset_permission_list.html:32
#: terminal/templates/terminal/session_list.html:7
8
#: terminal/templates/terminal/session_list.html:7
9
#: terminal/templates/terminal/terminal_list.html:36
#: users/templates/users/user_group_list.html:15
#: users/templates/users/user_list.html:28
...
...
@@ -1418,8 +1418,8 @@ msgstr "执行历史"
#: ops/templates/ops/adhoc_history.html:52
#: ops/templates/ops/adhoc_history_detail.html:58
#: ops/templates/ops/task_history.html:55 terminal/models.py:10
0
#: terminal/templates/terminal/session_list.html:7
6
#: ops/templates/ops/task_history.html:55 terminal/models.py:10
1
#: terminal/templates/terminal/session_list.html:7
7
msgid "Date start"
msgstr "开始日期"
...
...
@@ -1480,6 +1480,7 @@ msgstr "版本"
#: ops/templates/ops/task_adhoc.html:60
#: terminal/templates/terminal/command_list.html:76
#: terminal/templates/terminal/session_detail.html:50
msgid "Datetime"
msgstr "日期"
...
...
@@ -1782,8 +1783,8 @@ msgid "Close"
msgstr "关闭"
#: templates/_nav.html:9 users/views/group.py:30 users/views/group.py:46
#: users/views/group.py:72 users/views/group.py:89 users/views/login.py:19
2
#: users/views/login.py:24
1
users/views/user.py:55 users/views/user.py:70
#: users/views/group.py:72 users/views/group.py:89 users/views/login.py:19
3
#: users/views/login.py:24
2
users/views/user.py:55 users/views/user.py:70
#: users/views/user.py:95 users/views/user.py:151 users/views/user.py:308
#: users/views/user.py:322 users/views/user.py:366 users/views/user.py:388
msgid "Users"
...
...
@@ -1806,7 +1807,7 @@ msgid "Task"
msgstr "任务"
#: templates/_nav.html:47 templates/_nav.html:50
#: terminal/templates/terminal/session_list.html:7
4
#: terminal/templates/terminal/session_list.html:7
5
#: terminal/views/command.py:47 terminal/views/session.py:75
#: terminal/views/session.py:92 terminal/views/session.py:114
#: terminal/views/terminal.py:31 terminal/views/terminal.py:46
...
...
@@ -1822,10 +1823,11 @@ msgstr "在线会话"
msgid "Session offline"
msgstr "离线会话"
#: templates/_nav.html:53 terminal/models.py:9
8
#: templates/_nav.html:53 terminal/models.py:9
9
#: terminal/templates/terminal/command_list.html:55
#: terminal/templates/terminal/command_list.html:71
#: terminal/templates/terminal/session_list.html:75
#: terminal/templates/terminal/session_detail.html:48
#: terminal/templates/terminal/session_list.html:76
msgid "Command"
msgstr "命令"
...
...
@@ -1858,11 +1860,11 @@ msgstr "输出"
msgid "Session"
msgstr "会话"
#: terminal/forms.py:1
6
#: terminal/forms.py:1
5
msgid "Coco ssh listen port"
msgstr "SSH 监听端口"
#: terminal/forms.py:1
7
#: terminal/forms.py:1
6
msgid "Coco http/ws listen port"
msgstr "Http/Websocket 监听端口"
...
...
@@ -1902,15 +1904,19 @@ msgstr "线程数"
msgid "Boot Time"
msgstr "运行时间"
#: terminal/models.py:97 terminal/templates/terminal/session_list.html:98
#: terminal/models.py:96 terminal/templates/terminal/session_list.html:74
msgid "Remote addr"
msgstr "远端地址"
#: terminal/models.py:98 terminal/templates/terminal/session_list.html:100
msgid "Replay"
msgstr "回放"
#: terminal/models.py:10
1
#: terminal/models.py:10
2
msgid "Date end"
msgstr "结束日期"
#: terminal/models.py:11
8
#: terminal/models.py:11
9
msgid "Args"
msgstr "参数"
...
...
@@ -1949,19 +1955,19 @@ msgstr "监控"
msgid "Terminate session"
msgstr "终止会话"
#: terminal/templates/terminal/session_list.html:7
7
#: terminal/templates/terminal/session_list.html:7
8
msgid "Duration"
msgstr "时长"
#: terminal/templates/terminal/session_list.html:10
0
#: terminal/templates/terminal/session_list.html:10
2
msgid "Monitor"
msgstr "监控"
#: terminal/templates/terminal/session_list.html:10
1
#: terminal/templates/terminal/session_list.html:10
3
msgid "Terminate"
msgstr "终断"
#: terminal/templates/terminal/session_list.html:11
7
#: terminal/templates/terminal/session_list.html:11
9
msgid "Terminate task send, waiting ..."
msgstr "终断任务已发送,请等待"
...
...
@@ -1970,10 +1976,6 @@ msgstr "终断任务已发送,请等待"
msgid "Terminal detail"
msgstr "终端详情"
#: terminal/templates/terminal/terminal_detail.html:47
msgid "Remote address"
msgstr "远端地址"
#: terminal/templates/terminal/terminal_detail.html:51
#: terminal/templates/terminal/terminal_list.html:31
msgid "SSH port"
...
...
@@ -2611,40 +2613,40 @@ msgstr "退出登录成功"
msgid "Logout success, return login page"
msgstr "退出登录成功,返回到登录页面"
#: users/views/login.py:
99
#: users/views/login.py:
100
msgid "Email address invalid, please input again"
msgstr "邮箱地址错误,重新输入"
#: users/views/login.py:11
2
#: users/views/login.py:11
3
msgid "Send reset password message"
msgstr "发送重置密码邮件"
#: users/views/login.py:11
3
#: users/views/login.py:11
4
msgid "Send reset password mail success, login your mail box and follow it "
msgstr ""
"发送重置邮件成功, 请登录邮箱查看, 按照提示操作 (如果没收到,请等待3-5分钟)"
#: users/views/login.py:12
7
#: users/views/login.py:12
8
msgid "Reset password success"
msgstr "重置密码成功"
#: users/views/login.py:12
8
#: users/views/login.py:12
9
msgid "Reset password success, return to login page"
msgstr "重置密码成功,返回到登录页面"
#: users/views/login.py:14
5 users/views/login.py:158
#: users/views/login.py:14
6 users/views/login.py:159
msgid "Token invalid or expired"
msgstr "Token错误或失效"
#: users/views/login.py:15
4
#: users/views/login.py:15
5
msgid "Password not same"
msgstr "密码不一致"
#: users/views/login.py:19
2
#: users/views/login.py:19
3
msgid "First login"
msgstr "首次登陆"
#: users/views/login.py:24
2
#: users/views/login.py:24
3
msgid "Login log list"
msgstr "登录日志"
...
...
apps/terminal/api.py
View file @
9a6bc9fe
...
...
@@ -110,7 +110,6 @@ class StatusViewSet(viewsets.ModelViewSet):
def
handle_sessions
(
self
):
sessions_active
=
[]
for
session_data
in
self
.
request
.
data
.
get
(
"sessions"
,
[]):
self
.
create_or_update_session
(
session_data
)
if
not
session_data
[
"is_finished"
]:
...
...
apps/terminal/models.py
View file @
9a6bc9fe
...
...
@@ -93,6 +93,7 @@ class Session(models.Model):
asset
=
models
.
CharField
(
max_length
=
1024
,
verbose_name
=
_
(
"Asset"
))
system_user
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
_
(
"System user"
))
login_from
=
models
.
CharField
(
max_length
=
2
,
choices
=
LOGIN_FROM_CHOICES
,
default
=
"ST"
)
remote_addr
=
models
.
CharField
(
max_length
=
15
,
verbose_name
=
_
(
"Remote addr"
),
blank
=
True
,
null
=
True
)
is_finished
=
models
.
BooleanField
(
default
=
False
)
has_replay
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
_
(
"Replay"
))
has_command
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
_
(
"Command"
))
...
...
apps/terminal/templates/terminal/session_list.html
View file @
9a6bc9fe
...
...
@@ -71,6 +71,7 @@
<th
class=
"text-center"
>
{% trans 'User' %}
</th>
<th
class=
"text-center"
>
{% trans 'Asset' %}
</th>
<th
class=
"text-center"
>
{% trans 'System user' %}
</th>
<th
class=
"text-center"
>
{% trans 'Remote addr' %}
</th>
<th
class=
"text-center"
>
{% trans 'Terminal' %}
</th>
<th
class=
"text-center"
>
{% trans 'Command' %}
</th>
<th
class=
"text-center"
>
{% trans 'Date start' %}
</th>
...
...
@@ -88,6 +89,7 @@
<td
class=
"text-center"
>
{{ session.user }}
</td>
<td
class=
"text-center"
>
{{ session.asset }}
</td>
<td
class=
"text-center"
>
{{ session.system_user }}
</td>
<td
class=
"text-center"
>
{{ session.remote_addr|default:"" }}
</td>
<td
class=
"text-center"
>
{{ session.terminal.name }}
</td>
<td
class=
"text-center"
>
{{ session.id | get_session_command_amount }}
</td>
...
...
apps/terminal/templates/terminal/terminal_detail.html
View file @
9a6bc9fe
...
...
@@ -44,7 +44,7 @@
<td><b>
{{ terminal.name }}
</b></td>
</tr>
<tr>
<td>
{% trans 'Remote addr
ess
' %}:
</td>
<td>
{% trans 'Remote addr' %}:
</td>
<td><b>
{{ terminal.remote_addr }}
</b></td>
</tr>
<tr>
...
...
apps/users/api.py
View file @
9a6bc9fe
...
...
@@ -128,7 +128,7 @@ class UserAuthApi(APIView):
user_agent
=
request
.
data
.
get
(
'HTTP_USER_AGENT'
,
''
)
if
not
login_ip
:
login_ip
=
request
.
META
.
get
(
"REMOTE_ADDR"
)
login_ip
=
request
.
META
.
get
(
'HTTP_X_REAL_IP'
)
or
request
.
META
.
get
(
"REMOTE_ADDR"
)
user
,
msg
=
check_user_valid
(
username
=
username
,
password
=
password
,
...
...
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