cdn_cache.hbs
3.51 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<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="/servers">缓存管理</a></li>
</ul>
<h4>清理CdnCahe缓存</h4>
</div>
</div>
<!-- media -->
</div>
<div class="contentpanel">
<div class="row cache-panel">
<div class="panel panel-default">
<div class="panel-body">
<div class="col-sm-6">
<div class="operations mb20">
</div>
<div class="query">
<textarea name="" id="uri" cols="30" rows="20" class="form-control" placeholder="支持多条换行输入"></textarea>
</div>
</div>
<div class="col-sm-6">
<div class="panel">
<div class="panel-heading">
<h4 class="panel-title">日志</h4>
</div><!-- panel-heading -->
<div class="panel-body yoho-log-dark">
<div class="results-list ">
</div><!-- results-list -->
</div><!-- panel-body -->
</div><!-- panel -->
</div>
</div>
<div class="panel-footer">
<select id="objectType" class="form-control input-sm selcet-auto pull-left mr20">
{{#each typeList}}
<option value="{{typeName}}">{{name}}</option>
{{/each}}
</select>
<select id="cloud" class="form-control input-sm selcet-auto pull-left mr20">
{{#each cloudList}}
<option value="{{cloudName}}">{{name}}</option>
{{/each}}
</select>
<button class="btn btn-warning btn-clear pull-left">清除</button>
<div class="result pull-left ml20"></div>
</div>
</div>
</div>
</div>
<script>
var posing = false;
$(document).on('ready pjax:success', function() {
$('.btn-clear').click(function() {
var typeName = $('#objectType').val();
var uri = $('#uri').val();
var cloud = $('#cloud').val();
if (uri && typeName) {
$logs.empty();
$.post('/cdn_cache/clear', {
query_uri: uri,
object_type: typeName,
cloud: cloud
}, function(res) {
});
}
})
function layoutResize() {
$('.yoho-log-dark').height($('body').height() - 450);
}
$(window).resize(function() {
layoutResize();
});
layoutResize();
var $logs = $('.yoho-log-dark .results-list');
var $dark = $('.yoho-log-dark');
function appendLog(message) {
var html = '<p><span class="message">- ' + message + '</span></p>';
$logs.append(html);
$dark.scrollTop($logs[0].scrollHeight);
}
var ws = io();
ws.on('connect', function() {
ws.on('/cdn_cache/log', function(data) {
appendLog(data.message)
});
});
});
</script>