abuse_protection.hbs
2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href="/"><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="/abuse_protection">滥用防护</a></li>
</ul>
<h4>疑似爬虫监控</h4>
</div>
</div>
<!-- media -->
</div>
<!-- pageheader -->
<div class="contentpanel servers-page">
<form action="/abuse_protection/abuse_protection" class="form-inline" method="get">
<div class="form-group">
<select name="node" class="form-control" style="height: 40px">
<option value="">Memcached节点</option>
{{#hosts}}
<option value="{{host}}" {{#if isCurrent}}selected="selected"{{/if}}>{{host}}</option>
{{/hosts}}
</select>
</div>
<div class="form-group input-group">
<input id="threshold" type="text" class="form-control" size="3" name="threshold" value="{{threshold}}"/>
<div class="input-group-addon">/天</div>
</div>
<div class="form-group input-group">
<div class="input-group-addon">显示</div>
<input id="threshold" type="text" class="form-control" size="3" name="limit" value="{{limit}}"/>
<div class="input-group-addon">条</div>
</div>
<button class="btn btn-primary">应用</button>
</form>
<table class="table table-striped table-bordered building-table" style="margin-top: 2rem">
<tr>
<th>IP</th>
<th>爬虫指数</th>
<th>操作</th>
</tr>
{{#list}}
<tr>
<td>{{ip}}</td>
<td>{{index}}</td>
<td>
<button class="access-deny btn btn-primary btn-sm btn-danger" data-ip="{{ip}}">禁止访问</button>
<button class="access-allow btn btn-success btn-sm" data-ip="{{ip}}">允许访问</button>
</td>
</tr>
{{/list}}
{{#if noData}}
<tr>
<td colspan="4" class="text-center">无数据</td>
</tr>
{{/if}}
</table>
</div>
<script>
$(function() {
$('.access-deny').click(function() {
$.post('/abuse_protection/lock', {remoteIp: $(this).data('ip')}, function() {
});
});
$('.access-allow').click(function() {
$.post('/abuse_protection/unlock', {remoteIp: $(this).data('ip')}, function() {
});
});
});
</script>