diff --git a/app/controller/Index.php b/app/controller/Index.php index ea99692..4dfcb7c 100644 --- a/app/controller/Index.php +++ b/app/controller/Index.php @@ -19,15 +19,17 @@ class Index extends BaseController } if ($this->request->isAjax()) { if (input('post.do') == 'stat') { - $stat = ['domains' => 0, 'users' => 0, 'records' => 0, 'types' => count(DnsHelper::$dns_config)]; + $stat = ['domains' => 0, 'tasks' => 0, 'certs' => 0, 'deploys' => 0]; if ($this->request->user['level'] == 2) { $stat['domains'] = Db::name('domain')->count(); - $stat['users'] = Db::name('user')->count(); - $stat['records'] = Db::name('domain')->sum('recordcount'); + $stat['tasks'] = Db::name('dmtask')->count(); + $stat['certs'] = Db::name('cert_order')->count(); + $stat['deploys'] = Db::name('cert_deploy')->count(); } else { $stat['domains'] = Db::name('domain')->where('name', 'in', $this->request->user['permission'])->count(); - $stat['users'] = 1; - $stat['records'] = Db::name('domain')->where('name', 'in', $this->request->user['permission'])->sum('recordcount'); + $stat['tasks'] = Db::name('dmtask')->count(); + $stat['certs'] = Db::name('cert_order')->count(); + $stat['deploys'] = Db::name('cert_deploy')->count(); } return json($stat); } diff --git a/app/utils/MsgNotice.php b/app/utils/MsgNotice.php index 6b01af3..491b541 100644 --- a/app/utils/MsgNotice.php +++ b/app/utils/MsgNotice.php @@ -197,7 +197,14 @@ class MsgNotice $tgbot_token = config_get('tgbot_token'); $tgbot_chatid = config_get('tgbot_chatid'); if (!$tgbot_token || !$tgbot_chatid) return false; - $url = 'https://api.telegram.org/bot'.$tgbot_token.'/sendMessage'; + $tgbot_url = 'https://api.telegram.org'; + if (config_get('tgbot_proxy') == 2) { + $tgbot_url_n = config_get('tgbot_url'); + if (!empty($tgbot_url_n)) { + $tgbot_url = rtrim($tgbot_url_n, '/'); + } + } + $url = $tgbot_url.'/bot'.$tgbot_token.'/sendMessage'; $post = ['chat_id' => $tgbot_chatid, 'text' => $content, 'parse_mode' => 'HTML']; $result = self::telegram_curl($url, http_build_query($post)); $arr = json_decode($result, true); diff --git a/app/view/index/index.html b/app/view/index/index.html index d0669d8..2402e3d 100644 --- a/app/view/index/index.html +++ b/app/view/index/index.html @@ -31,12 +31,12 @@
@@ -45,12 +45,12 @@ @@ -59,12 +59,12 @@ @@ -131,9 +131,9 @@ $(document).ready(function(){ dataType : 'json', success : function(data) { $('#count1').html(data.domains); - $('#count2').html(data.users); - $('#count3').html(data.records); - $('#count4').html(data.types); + $('#count2').html(data.tasks); + $('#count3').html(data.certs); + $('#count4').html(data.deploys); $.ajax({ url: '{$checkupdate}', type: 'get', diff --git a/app/view/system/noticeset.html b/app/view/system/noticeset.html index 3849482..d8c5f82 100644 --- a/app/view/system/noticeset.html +++ b/app/view/system/noticeset.html @@ -94,9 +94,13 @@