mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修复一些bug
parent
9c7bd7d285
commit
42e4c64d06
|
@ -12,6 +12,3 @@ class RecordBase(object):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def filter(self, date_from_ts=None, proxy_log_id=None):
|
def filter(self, date_from_ts=None, proxy_log_id=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,10 @@ class ProxyLog(models.Model):
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return '%s-%s-%s' % (self.user, self.asset, self.system_user)
|
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:
|
class Meta:
|
||||||
ordering = ['-date_start', 'user']
|
ordering = ['-date_start', 'user']
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
</td>
|
</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<i class="fa fa-times text-danger"></i>
|
<a><i class="fa fa-times text-danger"></i></a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a><span class="text-danger"><i class="fa fa-eye"></i></span></a>
|
<a><span class="text-danger"><i class="fa fa-eye"></i></span></a>
|
||||||
|
|
|
@ -4,11 +4,15 @@ from .. import views
|
||||||
app_name = 'audits'
|
app_name = 'audits'
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^proxy-log$', views.ProxyLogListView.as_view(), name='proxy-log-list'),
|
url(r'^proxy-log$', views.ProxyLogListView.as_view(),
|
||||||
url(r'^proxy-log/(?P<pk>\d+)$', views.ProxyLogDetailView.as_view(), name='proxy-log-detail'),
|
name='proxy-log-list'),
|
||||||
url(r'^proxy-log/(?P<pk>\d+)/commands$', views.ProxyLogCommandsListView.as_view(), name='proxy-log-commands-list'),
|
url(r'^proxy-log/(?P<pk>\d+)$', views.ProxyLogDetailView.as_view(),
|
||||||
url(r'^command-log$', views.CommandLogListView.as_view(), name='command-log-list'),
|
name='proxy-log-detail'),
|
||||||
url(r'^login-log$', views.LoginLogListView.as_view(), name='login-log-list'),
|
# 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'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -110,19 +110,19 @@ class ProxyLogDetailView(AdminUserRequiredMixin,
|
||||||
return super(ProxyLogDetailView, self).get_context_data(**kwargs)
|
return super(ProxyLogDetailView, self).get_context_data(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
class ProxyLogCommandsListView(AdminUserRequiredMixin,
|
# class ProxyLogCommandsListView(AdminUserRequiredMixin,
|
||||||
SingleObjectMixin,
|
# SingleObjectMixin,
|
||||||
ListView):
|
# ListView):
|
||||||
template_name = 'audits/proxy_log_commands_list_modal.html'
|
# template_name = 'audits/proxy_log_commands_list_modal.html'
|
||||||
object = ''
|
# object = ''
|
||||||
|
#
|
||||||
def get(self, request, *args, **kwargs):
|
# def get(self, request, *args, **kwargs):
|
||||||
self.object = self.get_object(queryset=ProxyLog.objects.all())
|
# self.object = self.get_object(queryset=ProxyLog.objects.all())
|
||||||
return super(ProxyLogCommandsListView, self).\
|
# return super(ProxyLogCommandsListView, self).\
|
||||||
get(request, *args, **kwargs)
|
# get(request, *args, **kwargs)
|
||||||
|
#
|
||||||
def get_queryset(self):
|
# def get_queryset(self):
|
||||||
return list(self.object.command_log.all())
|
# return list(self.object.command_log.all())
|
||||||
|
|
||||||
|
|
||||||
class CommandLogListView(AdminUserRequiredMixin, ListView):
|
class CommandLogListView(AdminUserRequiredMixin, ListView):
|
||||||
|
|
Loading…
Reference in New Issue