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
42e4c64d
Commit
42e4c64d
authored
Feb 11, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复一些bug
parent
9c7bd7d2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
22 deletions
+27
-22
base.py
apps/audits/backends/record/base.py
+0
-3
models.py
apps/audits/models.py
+4
-0
proxy_log_list.html
apps/audits/templates/audits/proxy_log_list.html
+1
-1
views_urls.py
apps/audits/urls/views_urls.py
+9
-5
views.py
apps/audits/views.py
+13
-13
No files found.
apps/audits/backends/record/base.py
View file @
42e4c64d
...
...
@@ -12,6 +12,3 @@ class RecordBase(object):
@abc.abstractmethod
def
filter
(
self
,
date_from_ts
=
None
,
proxy_log_id
=
None
):
pass
apps/audits/models.py
View file @
42e4c64d
...
...
@@ -58,6 +58,10 @@ class ProxyLog(models.Model):
def
__unicode__
(
self
):
return
'
%
s-
%
s-
%
s'
%
(
self
.
user
,
self
.
asset
,
self
.
system_user
)
def
commands
(
self
):
from
audits.backends
import
command_store
return
command_store
.
filter
(
proxy_log_id
=
self
.
id
)
class
Meta
:
ordering
=
[
'-date_start'
,
'user'
]
...
...
apps/audits/templates/audits/proxy_log_list.html
View file @
42e4c64d
...
...
@@ -98,7 +98,7 @@
</td>
{% else %}
<td
class=
"text-center"
>
<
i
class=
"fa fa-times text-danger"
></i
>
<
a><i
class=
"fa fa-times text-danger"
></i></a
>
</td>
<td
class=
"text-center"
>
<a><span
class=
"text-danger"
><i
class=
"fa fa-eye"
></i></span></a>
...
...
apps/audits/urls/views_urls.py
View file @
42e4c64d
...
...
@@ -4,11 +4,15 @@ from .. import views
app_name
=
'audits'
urlpatterns
=
[
url
(
r'^proxy-log$'
,
views
.
ProxyLogListView
.
as_view
(),
name
=
'proxy-log-list'
),
url
(
r'^proxy-log/(?P<pk>\d+)$'
,
views
.
ProxyLogDetailView
.
as_view
(),
name
=
'proxy-log-detail'
),
url
(
r'^proxy-log/(?P<pk>\d+)/commands$'
,
views
.
ProxyLogCommandsListView
.
as_view
(),
name
=
'proxy-log-commands-list'
),
url
(
r'^command-log$'
,
views
.
CommandLogListView
.
as_view
(),
name
=
'command-log-list'
),
url
(
r'^login-log$'
,
views
.
LoginLogListView
.
as_view
(),
name
=
'login-log-list'
),
url
(
r'^proxy-log$'
,
views
.
ProxyLogListView
.
as_view
(),
name
=
'proxy-log-list'
),
url
(
r'^proxy-log/(?P<pk>\d+)$'
,
views
.
ProxyLogDetailView
.
as_view
(),
name
=
'proxy-log-detail'
),
# url(r'^proxy-log/(?P<pk>\d+)/commands$', views.ProxyLogCommandsListView.as_view(), name='proxy-log-commands-list'),
url
(
r'^command-log$'
,
views
.
CommandLogListView
.
as_view
(),
name
=
'command-log-list'
),
url
(
r'^login-log$'
,
views
.
LoginLogListView
.
as_view
(),
name
=
'login-log-list'
),
]
apps/audits/views.py
View file @
42e4c64d
...
...
@@ -110,19 +110,19 @@ class ProxyLogDetailView(AdminUserRequiredMixin,
return
super
(
ProxyLogDetailView
,
self
)
.
get_context_data
(
**
kwargs
)
class
ProxyLogCommandsListView
(
AdminUserRequiredMixin
,
SingleObjectMixin
,
ListView
):
template_name
=
'audits/proxy_log_commands_list_modal.html'
object
=
''
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
object
=
self
.
get_object
(
queryset
=
ProxyLog
.
objects
.
all
())
return
super
(
ProxyLogCommandsListView
,
self
)
.
\
get
(
request
,
*
args
,
**
kwargs
)
def
get_queryset
(
self
):
return
list
(
self
.
object
.
command_log
.
all
())
#
class ProxyLogCommandsListView(AdminUserRequiredMixin,
#
SingleObjectMixin,
#
ListView):
#
template_name = 'audits/proxy_log_commands_list_modal.html'
#
object = ''
#
#
def get(self, request, *args, **kwargs):
#
self.object = self.get_object(queryset=ProxyLog.objects.all())
#
return super(ProxyLogCommandsListView, self).\
#
get(request, *args, **kwargs)
#
#
def get_queryset(self):
#
return list(self.object.command_log.all())
class
CommandLogListView
(
AdminUserRequiredMixin
,
ListView
):
...
...
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