2014-11-02 14:54:26 +00:00
|
|
|
{% extends 'base.html' %}
|
2014-11-02 15:11:44 +00:00
|
|
|
{% load mytags %}
|
|
|
|
|
2014-11-02 14:54:26 +00:00
|
|
|
{% block content %}
|
2014-11-12 09:52:56 +00:00
|
|
|
|
2014-11-02 14:54:26 +00:00
|
|
|
<form method="post" action="">
|
|
|
|
<table class="table table-striped table-hover table-condensed">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2014-11-06 10:48:13 +00:00
|
|
|
<th>id</th>
|
2014-11-02 14:54:26 +00:00
|
|
|
<th>用户名</th>
|
|
|
|
<th>主机</th>
|
|
|
|
<th>监控</th>
|
|
|
|
<th>命令统计</th>
|
|
|
|
<th>阻断</th>
|
|
|
|
<th>开始时间</th>
|
|
|
|
<th>结束时间</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for log in logs.object_list %}
|
|
|
|
<tr>
|
2014-11-06 10:48:13 +00:00
|
|
|
<!--<td><input type="checkbox" name="selected" value="{{ log.id }}"></td>-->
|
|
|
|
<td>{{ log.id }}</td>
|
2014-11-02 14:54:26 +00:00
|
|
|
<td>{{ log.user }}</td>
|
|
|
|
<td>{{ log.host }}</td>
|
2014-11-04 13:56:39 +00:00
|
|
|
{% if log.finish %}
|
|
|
|
<td>监控</td>
|
2014-11-06 10:48:13 +00:00
|
|
|
<td><a href="/logHistory/?id={{ log.id }}" class="log_command">统计</a></td>
|
2014-11-04 13:56:39 +00:00
|
|
|
<td>阻断</td>
|
|
|
|
{% else %}
|
2014-11-07 07:18:52 +00:00
|
|
|
<td><a class='monitor' filename="{{ log.logfile }}">监控</a></td>
|
2014-11-04 13:56:39 +00:00
|
|
|
<td>命令统计</td>
|
2014-11-04 13:48:34 +00:00
|
|
|
<td><a href="/killSession/?id={{ log.id }}">阻断</a> </td>
|
2014-11-04 13:56:39 +00:00
|
|
|
{% endif %}
|
2014-11-02 14:54:26 +00:00
|
|
|
<td>{{ log.start_time|stamp2str }}</td>
|
|
|
|
<td>{{ log.end_time|stamp2str }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2014-11-12 09:52:56 +00:00
|
|
|
<script src="http://{{ web_socket_host }}:3000/socket.io/socket.io.js"></script>
|
|
|
|
|
|
|
|
|
2014-11-04 09:18:27 +00:00
|
|
|
<script >
|
|
|
|
$('.log_command').on('click',function(){
|
2014-11-04 09:22:47 +00:00
|
|
|
var url = $(this).attr('href');
|
2014-11-04 09:18:27 +00:00
|
|
|
$.ajax({url:url,success:function(data){
|
|
|
|
BootstrapDialog.show({title:'命令统计',message:data});
|
|
|
|
}});
|
|
|
|
return false;
|
|
|
|
})
|
2014-11-12 09:52:56 +00:00
|
|
|
globalConfig = {
|
|
|
|
SOCKET_HOST: "{{ web_socket_host }}"
|
|
|
|
}
|
2014-11-07 07:33:41 +00:00
|
|
|
$(".monitor").webSocket()
|
2014-11-12 09:52:56 +00:00
|
|
|
|
2014-11-04 09:18:27 +00:00
|
|
|
</script>
|
2014-11-02 14:54:26 +00:00
|
|
|
<!--<button class="btn btn-primary">删除</button>-->
|
|
|
|
</form>
|
2014-11-02 15:01:36 +00:00
|
|
|
<nav>
|
|
|
|
<ul class="pager">
|
2014-11-03 02:57:23 +00:00
|
|
|
{% if logs.has_previous %}
|
|
|
|
<li><a href="?page={{ logs.previous_page_number }}">上一页</a></li>
|
2014-11-02 15:01:36 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<span class="current">
|
2014-11-03 02:57:23 +00:00
|
|
|
Page {{ logs.number }} of {{ logs.paginator.num_pages }}.
|
2014-11-02 15:01:36 +00:00
|
|
|
</span>
|
|
|
|
|
2014-11-03 02:57:23 +00:00
|
|
|
{% if logs.has_next %}
|
|
|
|
<li><a href="?page={{ logs.next_page_number }}">下一页</a></li>
|
2014-11-02 15:01:36 +00:00
|
|
|
{% endif %}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2014-11-02 14:54:26 +00:00
|
|
|
{% endblock %}
|