增加根据节点批量更新静态链接
parent
1bbb725d95
commit
7c91fa0919
@ -0,0 +1,68 @@
|
||||
<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>
|
||||
|
||||
|
Loading…
Reference in New Issue