|
|
@ -98,6 +98,7 @@
|
|
|
|
<table class="table table-striped table-bordered table-hover ">
|
|
|
|
<table class="table table-striped table-bordered table-hover ">
|
|
|
|
<thead>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th class="text-center"> ID </th>
|
|
|
|
<th class="text-center"> 用户名 </th>
|
|
|
|
<th class="text-center"> 用户名 </th>
|
|
|
|
<th class="text-center"> 登录主机 </th>
|
|
|
|
<th class="text-center"> 登录主机 </th>
|
|
|
|
<th class="text-center"> 来源IP </th>
|
|
|
|
<th class="text-center"> 来源IP </th>
|
|
|
@ -114,15 +115,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
{% for post in contacts.object_list %}
|
|
|
|
{% for post in contacts.object_list %}
|
|
|
|
<tr class="gradeX">
|
|
|
|
<tr class="gradeX">
|
|
|
|
<td class="text-center" id="username"> {{ post.user }} </td>
|
|
|
|
<td class="text-center username"> {{ post.id }} </td>
|
|
|
|
<td class="text-center" id="ip"> {{ post.host }} </td>
|
|
|
|
<td class="text-center username"> {{ post.user }} </td>
|
|
|
|
<td class="text-center" id="remote_ip"> {{ post.remote_ip }} </td>
|
|
|
|
<td class="text-center ip"> {{ post.host }} </td>
|
|
|
|
|
|
|
|
<td class="text-center remote_ip"> {{ post.remote_ip }} </td>
|
|
|
|
{% ifnotequal session_role_id 0 %}
|
|
|
|
{% ifnotequal session_role_id 0 %}
|
|
|
|
<td class="text-center"><a href="/jlog/history/?id={{ post.id }}" class="log_command"> 命令统计 </a></td>
|
|
|
|
<td class="text-center"><a href="/jlog/history/?id={{ post.id }}" class="log_command"> 命令统计 </a></td>
|
|
|
|
{% endifnotequal %}
|
|
|
|
{% endifnotequal %}
|
|
|
|
<td class="text-center"><a value="/jlog/record/?id={{ post.id }}" class="log_record"> 回放 </a></td>
|
|
|
|
<td class="text-center"><a value="/jlog/record/?id={{ post.id }}" class="log_record"> 回放 </a></td>
|
|
|
|
<td class="text-center" id="start_time"> {{ post.start_time|date:"Y-m-d H:i:s"}} </td>
|
|
|
|
<td class="text-center start_time"> {{ post.start_time|date:"Y-m-d H:i:s"}} </td>
|
|
|
|
<td class="text-center" id="end_time"> {{ post.end_time|date:"Y-m-d H:i:s" }} </td>
|
|
|
|
<td class="text-center end_time"> {{ post.end_time|date:"Y-m-d H:i:s" }} </td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
@ -142,20 +144,36 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
$('.log_record').click(function(){
|
|
|
|
$('.log_record').click(function(){
|
|
|
|
var url = $(this).attr('value');
|
|
|
|
var url = $(this).attr('value');
|
|
|
|
window.open(url, '播放', 'height=500, width=910, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
|
|
|
|
//window.open(url, '播放', 'height=500, width=910, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
|
|
|
|
|
|
|
|
var username = $(this).closest('tr').find('.username')[0].innerHTML;
|
|
|
|
|
|
|
|
var ip = $(this).closest('tr').find('.ip')[0].innerHTML;
|
|
|
|
|
|
|
|
var start_time = $(this).closest('tr').find('.start_time')[0].innerHTML;
|
|
|
|
|
|
|
|
var end_time = $(this).closest('tr').find('.end_time')[0].innerHTML;
|
|
|
|
|
|
|
|
var div_username = ' 用户名: '+'<span class="text-info">'+username+'' + '</span>';
|
|
|
|
|
|
|
|
var div_ip = ' 主机: '+'<span class="text-info">' + ip + '</span>';
|
|
|
|
|
|
|
|
var div_time = ' 时间: ' + '<span class="text-info">'+start_time +'</span>' +' - <span class="text-info">' + end_time + '</span>';
|
|
|
|
|
|
|
|
var title = 'JumpServer录像回放 '+ div_username + div_ip + div_time;
|
|
|
|
|
|
|
|
layer.open({
|
|
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
|
|
title: title,
|
|
|
|
|
|
|
|
maxmin: true,
|
|
|
|
|
|
|
|
shade: false,
|
|
|
|
|
|
|
|
area: ['800px', '520px'],
|
|
|
|
|
|
|
|
content: url
|
|
|
|
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('.log_command').on('click',function(){
|
|
|
|
$('.log_command').on('click',function(){
|
|
|
|
var url = $(this).attr('href');
|
|
|
|
var url = $(this).attr('href');
|
|
|
|
var username = $('#username')[0].innerText;
|
|
|
|
var username = $(this).closest('tr').find('.username')[0].innerHTML;
|
|
|
|
var ip = $('#ip')[0].innerText;
|
|
|
|
var ip = $(this).closest('tr').find('.ip')[0].innerHTML;
|
|
|
|
var start_time = $('#start_time')[0].innerText;
|
|
|
|
var start_time = $(this).closest('tr').find('.start_time')[0].innerHTML;
|
|
|
|
var end_time = $('#end_time')[0].innerText;
|
|
|
|
var end_time = $(this).closest('tr').find('.end_time')[0].innerHTML;
|
|
|
|
var div_username = ' 用户名: '+'<span class="text-info">'+username+'' + '</span>';
|
|
|
|
var div_username = ' 用户名: '+'<span class="text-info">'+username+'' + '</span>';
|
|
|
|
var div_ip = ' 主机: '+'<span class="text-info">' + ip + '</span>';
|
|
|
|
var div_ip = ' 主机: '+'<span class="text-info">' + ip + '</span>';
|
|
|
|
var div_time = ' 开始时间: ' + '<span class="text-info">'+start_time +'</span>' + ' 结束时间: ' +'<span class="text-info">' + end_time + '</span>';
|
|
|
|
var div_time = ' 开始时间: ' + '<span class="text-info">'+start_time +'</span>' + ' 结束时间: ' +'<span class="text-info">' + end_time + '</span>';
|
|
|
|
var title = 'JumpServer命令统计 '+ div_username + div_ip + div_time;
|
|
|
|
var title = 'JumpServer命令统计 '+ div_username + div_ip + div_time;
|
|
|
|
$.ajax({url:url,
|
|
|
|
$.ajax({url:url,
|
|
|
|
success:function(data){
|
|
|
|
success:function(data){
|
|
|
|
var tag = $('<div style="height: 500px;overflow: auto;background-color: rgba(0, 0, 0, 0);"></div>').html(data.replace(/\n/g,"<br />"));
|
|
|
|
var tag = $('<div style="height: 500px;overflow: auto;background-color: rgba(0, 0, 0, 0);"></div>').html(data.replace(/\n/g,"<br />"));
|
|
|
|