web terminal kill方法

This commit is contained in:
ibuler
2015-11-07 15:27:49 +08:00
parent 24730ebd0f
commit 98c4d9bdba
5 changed files with 46 additions and 14 deletions

View File

@@ -97,7 +97,7 @@
{% 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 class="monitor" file_path="{{ post.log_path }}"> 监控 </a></td>
<td class="text-center"><input type="button" id="cut" class="btn btn-danger btn-xs" name="cut" value="阻断" onclick='cut("{{ post.pid }}")' /></td>
<td class="text-center"><input type="button" id="cut" class="btn btn-danger btn-xs" name="cut" value="阻断" onclick='cut("{{ post.pid }}", "{{ post.remote_ip }}")' /></td>
{% endifnotequal %}
<td class="text-center" id="start_time"> {{ post.start_time|date:"Y-m-d H:i:s" }} </td>
</tr>
@@ -202,8 +202,14 @@
{# }#}
function cut(num){
var g_url = "/jlog/log_kill/?id="+num;
function cut(num, host){
console.log(host);
if (host=='Web'){
var g_url = '{{ web_kill_uri }}' + '?id=' + num;
} else {
g_url = "/jlog/log_kill/?id=" + num;
}
$.ajax({
type: "GET",
url: g_url,