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
a57dac07
Commit
a57dac07
authored
Mar 24, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fixture] 拆分proxy log 为在线和离线
parent
b60e5a7e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
58 additions
and
79 deletions
+58
-79
api.py
apps/applications/api.py
+0
-3
terminal_list.html
apps/applications/templates/applications/terminal_list.html
+1
-1
api.py
apps/audits/api.py
+0
-5
command_log_list.html
apps/audits/templates/audits/command_log_list.html
+4
-4
proxy_log_detail.html
apps/audits/templates/audits/proxy_log_detail.html
+1
-0
proxy_log_offline_list.html
apps/audits/templates/audits/proxy_log_offline_list.html
+5
-19
proxy_log_online_list.html
apps/audits/templates/audits/proxy_log_online_list.html
+5
-5
views.py
apps/audits/views.py
+19
-20
_footer.html
apps/templates/_footer.html
+2
-1
_nav.html
apps/templates/_nav.html
+21
-21
No files found.
apps/applications/api.py
View file @
a57dac07
...
...
@@ -95,9 +95,6 @@ class TerminateConnectionView(APIView):
proxy_log_id
=
d
.
get
(
'proxy_log_id'
)
proxy_log
=
get_object_or_404
(
ProxyLog
,
id
=
proxy_log_id
)
terminal_id
=
proxy_log
.
terminal
proxy_log
.
is_finished
=
True
proxy_log
.
date_finished
=
timezone
.
now
()
proxy_log
.
save
()
if
terminal_id
in
tasks
:
tasks
[
terminal_id
]
.
append
({
'name'
:
'kill_proxy'
,
'proxy_log_id'
:
proxy_log_id
})
...
...
apps/applications/templates/applications/terminal_list.html
View file @
a57dac07
...
...
@@ -29,7 +29,7 @@
<th
class=
"text-center"
>
{% trans 'Name' %}
</th>
<th
class=
"text-center"
>
{% trans 'IP' %}
</th>
<th
class=
"text-center"
>
{% trans 'Type' %}
</th>
<th
class=
"text-center"
>
{% trans '
proxy
online' %}
</th>
<th
class=
"text-center"
>
{% trans '
Session
online' %}
</th>
<th
class=
"text-center"
>
{% trans 'Active' %}
</th>
<th
class=
"text-center"
>
{% trans 'Alive' %}
</th>
<th
class=
"text-center"
>
{% trans 'Action' %}
</th>
...
...
apps/audits/api.py
View file @
a57dac07
...
...
@@ -90,8 +90,3 @@ class RecordLogViewSet(BulkModelViewSet):
else
:
return
record_store
.
all
()
apps/audits/templates/audits/command_log_list.html
View file @
a57dac07
...
...
@@ -23,18 +23,18 @@
</div>
</div>
<div
class=
"input-group"
>
<select
class=
"select2 form-control"
name=
"user"
>
<select
class=
"select2 form-control"
name=
"user
name
"
>
<option
value=
""
>
{% trans 'User' %}
</option>
{% for u in user_list %}
<option
value=
"{{ u.username }}"
{%
if
user =
=
u
.
username
%}
selected
{%
endif
%}
>
{{ u.username }}
</option>
<option
value=
"{{ u.username }}"
{%
if
user
name
=
=
u
.
username
%}
selected
{%
endif
%}
>
{{ u.username }}
</option>
{% endfor %}
</select>
</div>
<div
class=
"input-group"
>
<select
class=
"select2 form-control"
name=
"
asset
"
>
<select
class=
"select2 form-control"
name=
"
ip
"
>
<option
value=
""
>
{% trans 'Asset' %}
</option>
{% for a in asset_list %}
<option
value=
"{{ a.ip }}"
{%
if
asset
=
=
a
.
ip
%}
selected
{%
endif
%}
>
{{ a.ip }}
</option>
<option
value=
"{{ a.ip }}"
{%
if
ip
=
=
a
.
ip
%}
selected
{%
endif
%}
>
{{ a.ip }}
</option>
{% endfor %}
</select>
</div>
...
...
apps/audits/templates/audits/proxy_log_detail.html
View file @
a57dac07
{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% load common_tags %}
{% block custom_head_css_js %}
<link
href=
"{% static "
css
/
plugins
/
footable
/
footable
.
core
.
css
"
%}"
rel=
"stylesheet"
>
...
...
apps/audits/templates/audits/proxy_log_offline_list.html
View file @
a57dac07
...
...
@@ -24,16 +24,16 @@
<div
class=
"input-group"
>
<select
class=
"select2 form-control"
name=
"username"
>
<option
value=
""
>
{% trans 'User' %}
</option>
{% for u
ser
in user_list %}
<option
value=
"{{ u
ser }}"
{%
if
user =
=
username
%}
selected
{%
endif
%}
>
{{ user
}}
</option>
{% for u in user_list %}
<option
value=
"{{ u
}}"
{%
if
u =
=
username
%}
selected
{%
endif
%}
>
{{ u
}}
</option>
{% endfor %}
</select>
</div>
<div
class=
"input-group"
>
<select
class=
"select2 form-control"
name=
"ip"
>
<option
value=
""
>
{% trans 'Asset' %}
</option>
{% for a
sset
in asset_list %}
<option
value=
"{{ a
sset }}"
{%
if
asset =
=
ip
%}
selected
{%
endif
%}
>
{{ asset
}}
</option>
{% for a in asset_list %}
<option
value=
"{{ a
}}"
{%
if
a =
=
ip
%}
selected
{%
endif
%}
>
{{ a
}}
</option>
{% endfor %}
</select>
</div>
...
...
@@ -68,7 +68,7 @@
<th
class=
"text-center"
>
{% trans 'Command' %}
</th>
<th
class=
"text-center"
>
{% trans 'Success' %}
</th>
<th
class=
"text-center"
>
{% trans 'Finished' %}
</th>
<th
class=
"text-center"
>
{% trans '
R/M
' %}
</th>
<th
class=
"text-center"
>
{% trans '
Play
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Date start' %}
</th>
<th
class=
"text-center"
>
{% trans 'Time' %}
</th>
{% endblock %}
...
...
@@ -113,20 +113,6 @@
{% endfor %}
{% endblock %}
{% block content_bottom_left %}
<div
id=
"actions"
>
<div
class=
"input-group"
>
<select
class=
"form-control m-b"
style=
"width: auto"
id=
"slct_bulk_update"
>
<option
value=
"terminate"
>
{% trans 'Terminate selected' %}
</option>
</select>
<div
class=
"input-group-btn pull-left"
style=
"padding-left: 5px;"
>
<button
id=
'btn_bulk_update'
style=
"height: 32px;"
class=
"btn btn-sm btn-primary"
>
{% trans 'Submit' %}
</button>
</div>
</div>
</div>
{% endblock %}
{% block custom_foot_js %}
<script
src=
"{% static 'js/plugins/datepicker/bootstrap-datepicker.js' %}"
></script>
...
...
apps/audits/templates/audits/proxy_log_online_list.html
View file @
a57dac07
...
...
@@ -24,16 +24,16 @@
<div
class=
"input-group"
>
<select
class=
"select2 form-control"
name=
"username"
>
<option
value=
""
>
{% trans 'User' %}
</option>
{% for u
ser
in user_list %}
<option
value=
"{{ u
ser }}"
{%
if
user =
=
username
%}
selected
{%
endif
%}
>
{{ user
}}
</option>
{% for u in user_list %}
<option
value=
"{{ u
}}"
{%
if
u =
=
username
%}
selected
{%
endif
%}
>
{{ u
}}
</option>
{% endfor %}
</select>
</div>
<div
class=
"input-group"
>
<select
class=
"select2 form-control"
name=
"ip"
>
<option
value=
""
>
{% trans 'Asset' %}
</option>
{% for a
sset
in asset_list %}
<option
value=
"{{ a
sset }}"
{%
if
asset =
=
ip
%}
selected
{%
endif
%}
>
{{ asset
}}
</option>
{% for a in asset_list %}
<option
value=
"{{ a
}}"
{%
if
a =
=
ip
%}
selected
{%
endif
%}
>
{{ a
}}
</option>
{% endfor %}
</select>
</div>
...
...
@@ -68,7 +68,7 @@
<th
class=
"text-center"
>
{% trans 'Command' %}
</th>
<th
class=
"text-center"
>
{% trans 'Success' %}
</th>
<th
class=
"text-center"
>
{% trans 'Finished' %}
</th>
<th
class=
"text-center"
>
{% trans '
R/M
' %}
</th>
<th
class=
"text-center"
>
{% trans '
Monitor
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Date start' %}
</th>
<th
class=
"text-center"
>
{% trans 'Time' %}
</th>
{% endblock %}
...
...
apps/audits/views.py
View file @
a57dac07
...
...
@@ -3,7 +3,6 @@
import
time
from
datetime
import
datetime
import
pytz
from
django.views.generic
import
ListView
,
UpdateView
,
DeleteView
,
DetailView
,
TemplateView
from
django.views.generic.edit
import
SingleObjectMixin
from
django.utils.translation
import
ugettext
as
_
...
...
@@ -25,7 +24,7 @@ class ProxyLogListView(AdminUserRequiredMixin, ListView):
template_name
=
'audits/proxy_log_online_list.html'
context_object_name
=
'proxy_log_list'
paginate_by
=
settings
.
CONFIG
.
DISPLAY_PER_PAGE
keyword
=
user
=
asset
=
system_user
=
date_from_s
=
date_to_s
=
''
keyword
=
user
name
=
hostname
=
system_user
=
date_from_s
=
date_to_s
=
''
ordering
=
[
'is_finished'
,
'-id'
]
date_format
=
'
%
m/
%
d/
%
Y'
...
...
@@ -37,8 +36,8 @@ class ProxyLogListView(AdminUserRequiredMixin, ListView):
self
.
queryset
=
super
(
ProxyLogListView
,
self
)
.
get_queryset
()
self
.
keyword
=
self
.
request
.
GET
.
get
(
'keyword'
,
''
)
self
.
user
=
self
.
request
.
GET
.
get
(
'user
'
)
self
.
asset
=
self
.
request
.
GET
.
get
(
'asset
'
)
self
.
user
name
=
self
.
request
.
GET
.
get
(
'username
'
)
self
.
ip
=
self
.
request
.
GET
.
get
(
'ip
'
)
self
.
system_user
=
self
.
request
.
GET
.
get
(
'system_user'
)
self
.
date_from_s
=
self
.
request
.
GET
.
get
(
'date_from'
,
date_from_default
)
self
.
date_to_s
=
self
.
request
.
GET
.
get
(
'date_to'
,
date_to_default
)
...
...
@@ -53,10 +52,10 @@ class ProxyLogListView(AdminUserRequiredMixin, ListView):
self
.
date_to_s
+
' 23:59:59'
,
'
%
m/
%
d/
%
Y
%
H:
%
M:
%
S'
)
date_to
=
date_to
.
replace
(
tzinfo
=
timezone
.
get_current_timezone
())
filter_kwargs
[
'date_start__lt'
]
=
date_to
if
self
.
user
:
filter_kwargs
[
'user'
]
=
self
.
user
if
self
.
asset
:
filter_kwargs
[
'
asset'
]
=
self
.
asset
if
self
.
user
name
:
filter_kwargs
[
'user'
]
=
self
.
user
name
if
self
.
ip
:
filter_kwargs
[
'
ip'
]
=
self
.
ip
if
self
.
system_user
:
filter_kwargs
[
'system_user'
]
=
self
.
system_user
if
self
.
keyword
:
...
...
@@ -81,8 +80,8 @@ class ProxyLogListView(AdminUserRequiredMixin, ListView):
'keyword'
:
self
.
keyword
,
'date_from'
:
self
.
date_from_s
,
'date_to'
:
self
.
date_to_s
,
'user
'
:
self
.
user
,
'
asset'
:
self
.
asset
,
'user
name'
:
self
.
username
,
'
ip'
:
self
.
ip
,
'system_user'
:
self
.
system_user
,
}
kwargs
.
update
(
context
)
...
...
@@ -90,7 +89,7 @@ class ProxyLogListView(AdminUserRequiredMixin, ListView):
class
ProxyLogOfflineListView
(
ProxyLogListView
):
template_name
=
'audits/proxy_log_o
n
line_list.html'
template_name
=
'audits/proxy_log_o
ff
line_list.html'
def
get_queryset
(
self
):
queryset
=
super
(
ProxyLogOfflineListView
,
self
)
.
get_queryset
()
...
...
@@ -163,7 +162,7 @@ class CommandLogListView(AdminUserRequiredMixin, ListView):
template_name
=
'audits/command_log_list.html'
paginate_by
=
settings
.
CONFIG
.
DISPLAY_PER_PAGE
context_object_name
=
'command_list'
user
=
asset
=
system_user
=
command
=
date_from_s
=
date_to_s
=
''
user
name
=
ip
=
system_user
=
command
=
date_from_s
=
date_to_s
=
''
date_format
=
'
%
m/
%
d/
%
Y'
ordering
=
[
'-id'
]
...
...
@@ -173,8 +172,8 @@ class CommandLogListView(AdminUserRequiredMixin, ListView):
date_from_default
=
(
date_now
-
timezone
.
timedelta
(
7
))
\
.
strftime
(
self
.
date_format
)
self
.
command
=
self
.
request
.
GET
.
get
(
'command'
,
''
)
self
.
user
=
self
.
request
.
GET
.
get
(
'user
'
)
self
.
asset
=
self
.
request
.
GET
.
get
(
'asset
'
)
self
.
user
name
=
self
.
request
.
GET
.
get
(
'username
'
)
self
.
ip
=
self
.
request
.
GET
.
get
(
'ip
'
)
self
.
system_user
=
self
.
request
.
GET
.
get
(
'system_user'
)
self
.
date_from_s
=
\
self
.
request
.
GET
.
get
(
'date_from'
,
date_from_default
)
...
...
@@ -194,10 +193,10 @@ class CommandLogListView(AdminUserRequiredMixin, ListView):
.
replace
(
tzinfo
=
timezone
.
get_current_timezone
())
date_to_ts
=
time
.
mktime
(
date_to
.
timetuple
())
filter_kwargs
[
'date_to_ts'
]
=
date_to_ts
if
self
.
user
:
filter_kwargs
[
'user'
]
=
self
.
user
if
self
.
asset
:
filter_kwargs
[
'asset'
]
=
self
.
asset
if
self
.
user
name
:
filter_kwargs
[
'user'
]
=
self
.
user
name
if
self
.
ip
:
filter_kwargs
[
'asset'
]
=
self
.
ip
if
self
.
system_user
:
filter_kwargs
[
'system_user'
]
=
self
.
system_user
if
self
.
command
:
...
...
@@ -215,8 +214,8 @@ class CommandLogListView(AdminUserRequiredMixin, ListView):
'command'
:
self
.
command
,
'date_from'
:
self
.
date_from_s
,
'date_to'
:
self
.
date_to_s
,
'user
'
:
self
.
user
,
'
asset'
:
self
.
asset
,
'user
name'
:
self
.
username
,
'
ip'
:
self
.
ip
,
'system_user'
:
self
.
system_user
,
}
kwargs
.
update
(
context
)
...
...
apps/templates/_footer.html
View file @
a57dac07
...
...
@@ -3,6 +3,6 @@
Version
<strong>
0.4.0
</strong>
GPL.
</div>
<div>
<strong>
Copyright
</strong>
Jumpserver.org Team
©
2014-201
6
<strong>
Copyright
</strong>
Jumpserver.org Team
©
2014-201
7
</div>
</div>
\ No newline at end of file
apps/templates/_nav.html
View file @
a57dac07
...
...
@@ -56,11 +56,11 @@
<li
id=
"audits"
>
<a
href=
"#"
><i
class=
"fa fa-files-o"
></i>
<span
class=
"nav-label"
>
{% trans 'Audits' %}
</span><span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
>
<li
id=
"proxy-log-offline"
>
<a
href=
"{% url 'audits:proxy-log-offline-list' %}"
>
{% trans 'Session online' %}
</a>
</li>
<li
id=
"proxy-log-online"
>
<a
href=
"{% url 'audits:proxy-log-online-list' %}"
>
{% trans 'Session history' %}
</a>
<a
href=
"{% url 'audits:proxy-log-online-list' %}"
>
{% trans 'Session online' %}
</a>
</li>
<li
id=
"proxy-log-offline"
>
<a
href=
"{% url 'audits:proxy-log-offline-list' %}"
>
{% trans 'Session history' %}
</a>
</li>
<li
id=
"command-log"
>
<a
href=
"{% url 'audits:command-log-list' %}"
>
{% trans 'Command log' %}
</a>
...
...
@@ -68,26 +68,26 @@
<li
id=
"login-log"
>
<a
href=
"{% url 'audits:login-log-list' %}"
>
{% trans 'Login log' %}
</a>
</li>
<li
id=
"admin-log"
>
<a
href=
"{% url 'perms:asset-permission-list' %}"
>
{% trans 'Admin log' %}
</a>
</li>
{#
<li
id=
"admin-log"
>
#}
{#
<a
href=
"{% url 'perms:asset-permission-list' %}"
>
{% trans 'Admin log' %}
</a>
#}
{#
</li>
#}
</ul>
</li>
<li
id=
""
>
<a
href=
"#"
>
<i
class=
"fa fa-download"
></i>
<span
class=
"nav-label"
>
{% trans 'File' %}
</span><span
class=
"fa arrow"
></span>
</a>
<ul
class=
"nav nav-second-level"
>
<li
id=
"upload"
><a
href=
""
>
{% trans 'File upload' %}
</a></li>
<li
id=
"download"
><a
href=
""
>
{% trans 'File download' %}
</a></li>
</ul>
</li>
<li
id=
""
>
<a
href=
""
>
<i
class=
"fa fa-gears"
></i>
<span
class=
"nav-label"
>
{% trans 'Settings' %}
</span><span
class=
"label label-info pull-right"
></span>
</a>
</li>
{#
<li
id=
""
>
#}
{#
<a
href=
"#"
>
#}
{#
<i
class=
"fa fa-download"
></i>
<span
class=
"nav-label"
>
{% trans 'File' %}
</span><span
class=
"fa arrow"
></span>
#}
{#
</a>
#}
{#
<ul
class=
"nav nav-second-level"
>
#}
{#
<li
id=
"upload"
><a
href=
""
>
{% trans 'File upload' %}
</a></li>
#}
{#
<li
id=
"download"
><a
href=
""
>
{% trans 'File download' %}
</a></li>
#}
{#
</ul>
#}
{#
</li>
#}
{#
<li
id=
""
>
#}
{#
<a
href=
""
>
#}
{#
<i
class=
"fa fa-gears"
></i>
<span
class=
"nav-label"
>
{% trans 'Settings' %}
</span><span
class=
"label label-info pull-right"
></span>
#}
{#
</a>
#}
{#
</li>
#}
<li
class=
"special_link"
>
<a
href=
"http://www.jumpserver.org"
target=
"_blank"
><i
class=
"fa fa-database"
></i>
<span
class=
"nav-label"
>
{% trans 'Visit us' %}
</span>
...
...
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