diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php index 347f34b8..4965f7d5 100644 --- a/application/controllers/welcome.php +++ b/application/controllers/welcome.php @@ -104,12 +104,31 @@ class Welcome extends CI_Controller { return false; } $data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path); - $data['last_backup'] = $this->Logs_model->get_last_backup($is_parent_id); + $this->load->view('bootstrap/header', $data); $this->load->view('bootstrap/static_url', $data); $this->load->view('bootstrap/footer'); } + public function get_info_backup_id($info_id) { + $last_backup = $this->Logs_model->get_last_backup($info_id); + if (empty($last_backup)) { + $this->echo_json(array( + 'status' => 'error', + 'logId' => 0, + 'datetime' => 0, + 'username' => 0 + )); + } else { + $this->echo_json(array( + 'status' => 'success', + 'logId' => $last_backup->log_id, + 'datetime' => $last_backup->log_datetime, + 'username' => $last_backup->log_ht_username + )); + } + } + public function change_static_url($info_id) { $information = $this->Information_model->Detail($info_id); $htm_doc = new DOMDocument();//('1.0', 'UTF-8'); diff --git a/application/views/bootstrap/static_url.php b/application/views/bootstrap/static_url.php index 8048a444..f227dfa9 100644 --- a/application/views/bootstrap/static_url.php +++ b/application/views/bootstrap/static_url.php @@ -8,6 +8,7 @@ $("#startButton").click(function() { batch_update_cache(idList[index]); }); + batch_get_backup(idList[index]); function batch_update_cache(infoId) { var $statusLabel = $("#status" + infoId); @@ -23,6 +24,25 @@ } }); } + + function batch_get_backup(infoId) { + var $backupLabel = $("#backup" + infoId); + $backupLabel.html("\u7a0d\u7b49..."); + $.get("/info.php/welcome/get_info_backup_id/" + infoId, + function(result) { + console.info(result); + if (result.status == 'success') { + $backupLabel.html(result.username + ', ' + result.datetime + ', ' + result.logId); + $backupLabel.attr('href', '/info.php/information/backup_content/' + result.logId); + } else { + $backupLabel.html('无'); + } + index++; + if (index < idList.length) { + batch_get_backup(idList[index]); + } + }); + } }); function update_content(infoId) { @@ -49,7 +69,7 @@ #ID URL - 备份 + 备份 操作 @@ -62,7 +82,7 @@ is_id; ?> ic_url; ?> - log_id; ?>查看 + 查看 GO @@ -71,12 +91,4 @@ - -
- -
- - - -