diff --git a/jlog/urls.py b/jlog/urls.py index e9a3063bd..956fbf839 100644 --- a/jlog/urls.py +++ b/jlog/urls.py @@ -3,11 +3,10 @@ from django.conf.urls import patterns, include, url from jlog.views import * urlpatterns = patterns('', - url(r'^$', log_list), - url(r'^log_list/(\w+)/$', log_list), - url(r'^history/$', log_history), - url(r'^log_kill/', log_kill), - url(r'^record/$', log_record), - url(r'^web_terminal/$', web_terminal), - + (r'^$', log_list), + (r'^log_list/(\w+)/$', log_list), + (r'^history/$', log_history), + (r'^log_kill/', log_kill), + (r'^record/$', log_record), + (r'^web_terminal/$', web_terminal), ) \ No newline at end of file diff --git a/jlog/views.py b/jlog/views.py index 462fdf1e8..85d953f86 100644 --- a/jlog/views.py +++ b/jlog/views.py @@ -8,7 +8,7 @@ from jperm.perm_api import user_have_perm from django.http import HttpResponseNotFound from jlog.log_api import renderTemplate -from models import Log +from jlog.models import Log, ExecLog from jumpserver.settings import WEB_SOCKET_HOST @@ -21,9 +21,11 @@ def log_list(request, offset): username_list = request.GET.getlist('username', []) host_list = request.GET.getlist('host', []) cmd = request.GET.get('cmd', '') - print date_seven_day, date_now_str + if offset == 'online': posts = Log.objects.filter(is_finished=False).order_by('-start_time') + if offset == 'exec': + posts = ExecLog.objects.all().order_by('-id') else: posts = Log.objects.filter(is_finished=True).order_by('-start_time') username_all = set([log.user for log in Log.objects.all()]) diff --git a/templates/jlog/log_exec.html b/templates/jlog/log_exec.html index 024d88c5c..d1e096c82 100644 --- a/templates/jlog/log_exec.html +++ b/templates/jlog/log_exec.html @@ -7,125 +7,76 @@ {% block content %} {% include 'nav_cat_bar.html' %} - -
-ol-sm/g -
-
-
用户日志详细信息列表
- +
+
+
批量命令日志
+ +
-
- -
-
-
-
- - to - +
+ +
+
+ +
+ +
+
-
-
- -
-
-
-
- -
-
-
- -
- -
- - - - - - - - - - - + +
+
ID 用户名 主机 来源IP 时间
+ + + + + + + + + + + - {% for post in contacts.object_list %} - - - - - - - {% ifnotequal session_role_id 0 %} - - {% endifnotequal %} - - - - - {% endfor %} - -
ID 用户名 主机 命令 来源IP 时间
{{ post.id }} {{ post.user }} {{ post.host }} {{ post.remote_ip }} {{ post.login_type }} 统计 回放 {{ post.start_time|date:"Y-m-d H:i:s"}} {{ post.end_time|date:"Y-m-d H:i:s" }}
-
-
-
- {% include 'paginator.html' %} + {% for post in contacts.object_list %} + + {{ post.id }} + {{ post.user }} + {{ post.host }} + {{ post.cmd }} + {{ post.remote_ip }} + {{ post.datetime|date:"Y-m-d H:i:s"}} + + {% endfor %} + + +
+
-
+ {% include 'paginator.html' %} +
diff --git a/templates/jlog/log_offline.html b/templates/jlog/log_offline.html index 6559dc344..66184cbe7 100644 --- a/templates/jlog/log_offline.html +++ b/templates/jlog/log_offline.html @@ -54,6 +54,7 @@

diff --git a/templates/jlog/log_online.html b/templates/jlog/log_online.html index d214d39a9..686091a40 100644 --- a/templates/jlog/log_online.html +++ b/templates/jlog/log_online.html @@ -69,6 +69,7 @@

diff --git a/templates/juser/user_list.html b/templates/juser/user_list.html index 38b726168..e7fef1231 100644 --- a/templates/juser/user_list.html +++ b/templates/juser/user_list.html @@ -24,18 +24,18 @@
- 添加用户 - 删除所选 -