From c3a2b84ed3978eccdf28e93e3f1e1ae18abe0426 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 5 Jan 2021 13:59:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BC=93=E5=AD=98=E4=BD=BF?= =?UTF-8?q?=E7=94=A88=E4=B8=AA=E5=B9=B6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/views/cache/update.php | 222 +++++++++++++++++------------ 1 file changed, 134 insertions(+), 88 deletions(-) diff --git a/application/views/cache/update.php b/application/views/cache/update.php index 59785963..c60e8614 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -1,85 +1,128 @@ + -更新静态页-v1.0a - - - - - - + + + + + //下拉选站点 + $('a.sss').on('click', function() { + var site = $(this).html(); + location.href = '/info.php/login/change_site/' + site + '/?url=/cache/update/'; + }); + + //递归ajax + function dg_ajax(dom, star, step) { + var current = dom.eq(star); + if (current.length) { + var file = current.find('.file').attr('title'); + //file = encodeURI(file); + current.find('.msg_wait').css('color', 'red').html('更新中'); + $.ajax({ + url: '', + dataType: 'json', + type: 'POST', + data: { + '': file + }, + success: function(data) { + star = star + step; + current.find('.msg_wait').css('color', 'blue').html('成功'); + count_num(num_zero); + //console.log(star+''+file); + dg_ajax(dom, star, step); + }, + error: function() { + current.find('.msg_wait').css('color', 'red').html('重试'); + dg_ajax(dom, star, step); + } + }); + } + } + + //计数显示 + var num_zero = 1; + + function count_num(num) { + $('#count_num').html('已更新' + num + '个页面 进度' + (Math.ceil(num * 100 / )) + '% ').show(); + num_zero++; + } + }); + +
+ \ No newline at end of file