更新缓存使用8个并发

ct-mobile-first
LMR 5 years ago
parent 80a208e707
commit c3a2b84ed3

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>更新静态页-v1.0a</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@ -7,23 +8,61 @@
<script type="text/javascript" src="//int.mycht.cn/js/jquery.js"></script>
<script type="text/javascript" src="//int.mycht.cn/bootstrap/js/bootstrap.min.js"></script>
<style type="text/css">
.show-grid {padding: 15px; background: #efefef; border-radius: 5px;}
.mr10 {margin-right: 10px;}
.nav {margin-bottom: 5px;}
.pic {display: none;}
.msg {color: #07c;}
.mt12 {margin-top: 12px;}
.msg_wait {color: #999;}
.none {display: none;}
.form-search {display: inline-block;margin:0 0 0 5px !important;}
.input-medium.search-query {width: 250px;}
#search,#insert,#update {margin-top: 2px;float: right;}
.show-grid {
padding: 15px;
background: #efefef;
border-radius: 5px;
}
.mr10 {
margin-right: 10px;
}
.nav {
margin-bottom: 5px;
}
.pic {
display: none;
}
.msg {
color: #07c;
}
.mt12 {
margin-top: 12px;
}
.msg_wait {
color: #999;
}
.none {
display: none;
}
.form-search {
display: inline-block;
margin: 0 0 0 5px !important;
}
.input-medium.search-query {
width: 250px;
}
#search,
#insert,
#update {
margin-top: 2px;
float: right;
}
</style>
<script type="text/javascript">
$(function() {
//更新静态页,异步请求队列(setp_set个)
var setp_set = 6;
var setp_set = 8;
$('#update').on('click', function() {
var $data = $('.data');
for (var i = 0; i < setp_set; i++) {
@ -48,7 +87,9 @@ $(function() {
url: '<?php echo ($cache_api); ?>',
dataType: 'json',
type: 'POST',
data : {'<?php echo($post_para);?>':file},
data: {
'<?php echo ($post_para); ?>': file
},
success: function(data) {
star = star + step;
current.find('.msg_wait').css('color', 'blue').html('成功');
@ -66,6 +107,7 @@ $(function() {
//计数显示
var num_zero = 1;
function count_num(num) {
$('#count_num').html('已更新' + num + '个页面 进度' + (Math.ceil(num * 100 / <?php echo (count($file)); ?>)) + '% ').show();
num_zero++;
@ -73,6 +115,7 @@ $(function() {
});
</script>
</head>
<body>
<div class="container">
<div class="row show-grid">
@ -107,7 +150,9 @@ $(function() {
<span class="mt12 label label-info">含文件<?php echo (count($file)); ?></span>
<span class="mt12 label label-important none" id="count_num">已更新0个页面 进度0%</span>
<form class="form-search" id="path_search" action="#" method="post">
<input type="text" placeholder="输入路径删选,例如:/tours/。" value="<?php if(isset($_POST['p'])) {echo($_POST['p']);}?>" class="input-medium search-query" name="p"/>
<input type="text" placeholder="输入路径删选,例如:/tours/。" value="<?php if (isset($_POST['p'])) {
echo ($_POST['p']);
} ?>" class="input-medium search-query" name="p" />
<button type="submit" class="btn">筛选</button>
</form>
<a id="update" class="btn mr10 btn-info">更新</a>
@ -144,4 +189,5 @@ $(function() {
</div>
</div>
</body>
</html>
Loading…
Cancel
Save