diff --git a/application/controllers/information.php b/application/controllers/information.php index e7e61f10..8c4eaab6 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -571,6 +571,7 @@ class Information extends CI_Controller { if ($this->input->post('cache_url')) { echo json_encode($data); } + return $data; } //更新CDN缓存 @@ -707,4 +708,37 @@ class Information extends CI_Controller { return true; } + function batch_update() + { + $this->load->view('bootstrap3/batch_update'); + } + + function batch_update_fun() + { + $url_post = $this->input->post(); + $url_str = $url_post['url']; + $url_str = str_replace("\r\n", ";", $url_str); + $url_str = str_replace("\n", ";", $url_str); + $url_arr = explode(";", $url_str); + $url_arr = array_filter($url_arr); + $all_cnt = count($url_arr); + $ret['success_url'] = [];$ret['success_cnt'] = 0; + $ret['failure_url'] = [];$ret['failure_cnt'] = 0; + foreach ($url_arr as $key => $url) { + $update_ret = $this->update_cache($url); + $update_status = $update_ret[0]["name"]; + if ($update_status == "ok") { + // ok + $ret['success_url'][] = $url; + $ret['success_cnt']++; + } else { + // no + $ret['failure_url'][] = $url; + $ret['failure_cnt']++; + } + } + echo ""; + return; + } + } diff --git a/application/views/bootstrap3/batch_update.php b/application/views/bootstrap3/batch_update.php new file mode 100644 index 00000000..6e2008f4 --- /dev/null +++ b/application/views/bootstrap3/batch_update.php @@ -0,0 +1,53 @@ + + + + + 信息平台 + + + + + +
+ +
+
+ + +
+
+ +
+
+
+ +
+ ------------------------------- +
+ +
+ ------------------------------- +
+
+
+ + + diff --git a/application/views/bootstrap3/header.php b/application/views/bootstrap3/header.php index c5ef8df2..4aa38612 100644 --- a/application/views/bootstrap3/header.php +++ b/application/views/bootstrap3/header.php @@ -10,12 +10,12 @@ + @@ -68,9 +68,9 @@