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 %}
|
|
|
|
<form method="post" action="">
|
|
|
|
<table class="table table-striped table-hover table-condensed">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><input onclick="selectAll()" type="checkbox" name="select_all" style="select_all" id="select_all"/></th>
|
|
|
|
<th>用户名</th>
|
|
|
|
<th>主机</th>
|
|
|
|
<th>监控</th>
|
|
|
|
<th>命令统计</th>
|
|
|
|
<th>阻断</th>
|
|
|
|
<th>开始时间</th>
|
|
|
|
<th>结束时间</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for log in logs.object_list %}
|
|
|
|
<tr>
|
|
|
|
<td><input type="checkbox" name="selected" value="{{ log.id }}"></td>
|
|
|
|
<td>{{ log.user }}</td>
|
|
|
|
<td>{{ log.host }}</td>
|
|
|
|
<td><a href="#">监控</a></td>
|
2014-11-04 09:18:27 +00:00
|
|
|
<td><a href="/logHistory/?id={{ log.id }}" class="log_command">命令统计</a></td>
|
2014-11-04 13:46:19 +00:00
|
|
|
<td><a href="/killSession/?id={{ log.id }}}}">阻断</a> </td>
|
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-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;
|
|
|
|
})
|
|
|
|
</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 %}
|