You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.1 KiB
PHTML
69 lines
2.1 KiB
PHTML
8 years ago
|
<script language="javascript">
|
||
|
$(function() {
|
||
|
var idList = [];
|
||
|
var index = 0;
|
||
|
$("td[data-id]").each(function(index, element) {
|
||
|
idList[index] = $(element).data("id");
|
||
|
});
|
||
|
console.info(idList);
|
||
|
$("#startButton").click(function() {
|
||
|
batch_update_cache(idList[index]);
|
||
|
});
|
||
|
|
||
|
function batch_update_cache(infoId) {
|
||
|
var $statusLabel = $("#status" + infoId);
|
||
|
$statusLabel.html("\u7a0d\u7b49...");
|
||
|
console.info("infoId: " + infoId + "; length: " + idList.length + "; index: " + index);
|
||
|
$.get("/info.php/welcome/change_static_url/" + infoId,
|
||
|
function(result) {
|
||
|
console.info(result);
|
||
|
$statusLabel.html(result.message);
|
||
|
index++;
|
||
|
if (index < idList.length) {
|
||
|
batch_update_cache(idList[index]);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<div class="row-fluid">
|
||
|
<div class="span1">
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="span10">
|
||
|
|
||
|
<table class="table table-striped">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="span1">#ID</th>
|
||
|
<th class="span9">URL</th>
|
||
|
<th class="span2"><button id="startButton">开始</button></th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<?php
|
||
|
foreach ($all_information as $key => $info) {
|
||
|
if ($info->ic_status == 1 && !empty($info->ic_url)) {
|
||
|
?>
|
||
|
<tr>
|
||
|
<td data-id='<?php echo $info->is_ic_id; ?>'><?php echo $info->is_ic_id; ?></td>
|
||
|
<td class="cache_url"><?php echo $info->ic_url; ?></a></td>
|
||
|
<td id="status<?php echo $info->is_ic_id; ?>"><i class="icon-refresh"></i></td>
|
||
|
</tr>
|
||
|
<?php }
|
||
|
} ?>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
<div class="span1">
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|