From 24fcbc1f5cb19e6fb760f939e9aa03bfe3fc1a24 Mon Sep 17 00:00:00 2001 From: xiahe93 Date: Thu, 20 Mar 2025 17:16:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=A0=E7=9A=84=E6=8F=90=E4=BA=A4=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controllers/WebAPI/UserController.php | 18 +- src/Middleware/NodeApi_back.php | 23 ++ src/Middleware/NodeToken.php | 32 -- ...82680e07f0a90a1beec1_0.file_create.tpl.php | 153 +++++++++ ...73c82931dc0f8a0b3009_0.file_create.tpl.php | 28 +- ...c0da9f2a265e77c84ab_0.file_support.tpl.php | 194 ++++++++++++ ...bdc1dcb6629578648ef5c1_0.file_edit.tpl.php | 29 +- ...ff51b94c20bfe33b4847_0.file_online.tpl.php | 109 +++++++ ...c23baf5d34525163f7cd1c_0.file_cron.tpl.php | 292 ++++++++++++++++++ 9 files changed, 828 insertions(+), 50 deletions(-) create mode 100755 src/Middleware/NodeApi_back.php create mode 100644 storage/framework/smarty/compile/0ac2413c32ab0a76bef982680e07f0a90a1beec1_0.file_create.tpl.php create mode 100644 storage/framework/smarty/compile/8c329fed6515224854997c0da9f2a265e77c84ab_0.file_support.tpl.php create mode 100644 storage/framework/smarty/compile/c924c42ad5005fd4c503ff51b94c20bfe33b4847_0.file_online.tpl.php create mode 100644 storage/framework/smarty/compile/daf164b5b65e20e7acc23baf5d34525163f7cd1c_0.file_cron.tpl.php diff --git a/src/Controllers/WebAPI/UserController.php b/src/Controllers/WebAPI/UserController.php index d3b68f76..64253a92 100755 --- a/src/Controllers/WebAPI/UserController.php +++ b/src/Controllers/WebAPI/UserController.php @@ -98,15 +98,15 @@ final class UserController extends BaseController } } - if ($user_raw->node_iplimit !== 0 && - $user_raw->node_iplimit < - (new OnlineLog()) - ->where('user_id', $user_raw->id) - ->where('last_time', '>', time() - 90) - ->count() - ) { - continue; - } + //if ($user_raw->node_iplimit !== 0 && + // $user_raw->node_iplimit < + // (new OnlineLog()) + // ->where('user_id', $user_raw->id) + // ->where('last_time', '>', time() - 90) + // ->count() + //) { + // continue; + // } if ($node->sort === 1) { $method = json_decode($node->custom_config)->method ?? '2022-blake3-aes-128-gcm'; diff --git a/src/Middleware/NodeApi_back.php b/src/Middleware/NodeApi_back.php new file mode 100755 index 00000000..12b7bbb1 --- /dev/null +++ b/src/Middleware/NodeApi_back.php @@ -0,0 +1,23 @@ +checkRateLimit('webapi_ip', $request->getServerParam('REMOTE_ADDR')) || - ! (new RateLimit())->checkRateLimit('webapi_key', $antiXss->xss_clean($key))) - ) { - return AppFactory::determineResponseFactory()->createResponse(401)->withJson([ - 'ret' => 0, - 'msg' => 'Invalid request.', - ]); - } - - if (! $_ENV['webAPI'] || - $key !== $_ENV['muKey'] || - 'https://' . $request->getHeaderLine('Host') !== $_ENV['webAPIUrl'] - ) { - return AppFactory::determineResponseFactory()->createResponse(401)->withJson([ - 'ret' => 0, - 'msg' => 'Invalid request.', - ]); - } - - if ($_ENV['checkNodeIp']) { - $ip = $request->getServerParam('REMOTE_ADDR'); - - if ($ip !== '127.0.0.1' && $ip !== '::1' && $ip !== '0:0:0:0:0:0:0:1' && - ! (new Node())->where('ipv4', $ip)->orWhere('ipv6', $ip)->exists() - ) { - return AppFactory::determineResponseFactory()->createResponse(401)->withJson([ - 'ret' => 0, - 'msg' => 'Invalid request IP.', - ]); - } - } return $handler->handle($request); } diff --git a/storage/framework/smarty/compile/0ac2413c32ab0a76bef982680e07f0a90a1beec1_0.file_create.tpl.php b/storage/framework/smarty/compile/0ac2413c32ab0a76bef982680e07f0a90a1beec1_0.file_create.tpl.php new file mode 100644 index 00000000..a4da7153 --- /dev/null +++ b/storage/framework/smarty/compile/0ac2413c32ab0a76bef982680e07f0a90a1beec1_0.file_create.tpl.php @@ -0,0 +1,153 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.3.1', + 'unifunc' => 'content_67d94b96c53de5_22273192', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '0ac2413c32ab0a76bef982680e07f0a90a1beec1' => + array ( + 0 => 'admin/announcement/create.tpl', + 1 => 1740366544, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:admin/header.tpl' => 1, + 'file:admin/footer.tpl' => 1, + ), +))) { +function content_67d94b96c53de5_22273192 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/announcement'; +$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +?> + + + src="//cdnjs.cloudflare.com/ajax/libs/tinymce/7.0.0/tinymce.min.js"> +> + +
+
+ +
+
+
+
+
+
+
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + +> + document.addEventListener("DOMContentLoaded", function () { + let options = { + selector: '#tinymce', + menubar: false, + statusbar: false, + plugins: + 'advlist autolink lists link image charmap preview anchor searchreplace visualblocks ' + + 'code insertdatetime media table', + toolbar: 'undo redo | bold italic backcolor link | styles | fontsize | lineheight | alignleft aligncenter ' + + 'alignright alignjustify | bullist numlist outdent indent | removeformat', + content_style: 'body { font-size: 14px; }', + getValue('user')->is_dark_mode) {?> + skin: 'oxide-dark', + content_css: 'dark', + + } + tinyMCE.init(options); + }) + + $("#create-ann").click(function () { + $.ajax({ + url: '/admin/announcement', + type: 'POST', + dataType: "json", + data: { + getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('update_field'), 'key'); +$foreach0DoElse = true; +foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value) { +$foreach0DoElse = false; +?> + getValue('key');?> +: $('#getValue('key');?> +').val(), + getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> + email_notify: $("#email_notify").is(":checked"), + content: tinyMCE.activeEditor.getContent(), + }, + success: function (data) { + if (data.ret === 1) { + $('#success-message').text(data.msg); + $('#success-dialog').modal('show'); + window.setTimeout("location.href=top.document.referrer", getValue('config')['jump_delay'];?> +); + } else { + $('#fail-message').text(data.msg); + $('#fail-dialog').modal('show'); + } + } + }) + }); + +> + +renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +} +} diff --git a/storage/framework/smarty/compile/8a4a96cc30f8d77573b273c82931dc0f8a0b3009_0.file_create.tpl.php b/storage/framework/smarty/compile/8a4a96cc30f8d77573b273c82931dc0f8a0b3009_0.file_create.tpl.php index 332d6fe5..320553a4 100644 --- a/storage/framework/smarty/compile/8a4a96cc30f8d77573b273c82931dc0f8a0b3009_0.file_create.tpl.php +++ b/storage/framework/smarty/compile/8a4a96cc30f8d77573b273c82931dc0f8a0b3009_0.file_create.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.3.1', - 'unifunc' => 'content_67d04241e14fd3_53744222', + 'unifunc' => 'content_67d50165f165f5_00455396', 'has_nocache_code' => false, 'file_dependency' => array ( '8a4a96cc30f8d77573b273c82931dc0f8a0b3009' => array ( 0 => 'admin/node/create.tpl', - 1 => 1741700609, + 1 => 1741954578, 2 => 'file', ), ), @@ -22,7 +22,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:admin/footer.tpl' => 1, ), ))) { -function content_67d04241e14fd3_53744222 (\Smarty\Template $_smarty_tpl) { +function content_67d50165f165f5_00455396 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/node'; $_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); ?> @@ -185,11 +185,29 @@ $_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id,
- +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
流量设置
diff --git a/storage/framework/smarty/compile/8c329fed6515224854997c0da9f2a265e77c84ab_0.file_support.tpl.php b/storage/framework/smarty/compile/8c329fed6515224854997c0da9f2a265e77c84ab_0.file_support.tpl.php new file mode 100644 index 00000000..5c9f2830 --- /dev/null +++ b/storage/framework/smarty/compile/8c329fed6515224854997c0da9f2a265e77c84ab_0.file_support.tpl.php @@ -0,0 +1,194 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.3.1', + 'unifunc' => 'content_67dbd9e163d388_71231086', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '8c329fed6515224854997c0da9f2a265e77c84ab' => + array ( + 0 => 'admin/setting/support.tpl', + 1 => 1740366544, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:admin/header.tpl' => 1, + 'file:admin/footer.tpl' => 1, + ), +))) { +function content_67dbd9e163d388_71231086 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/setting'; +$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +?> + +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ + +> + $("#save-setting").click(function () { + $.ajax({ + url: '/admin/setting/support', + type: 'POST', + dataType: "json", + data: { + getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('update_field'), 'key'); +$foreach0DoElse = true; +foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value) { +$foreach0DoElse = false; +?> + getValue('key');?> +: $('#getValue('key');?> +').val(), + getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> + }, + success: function (data) { + if (data.ret === 1) { + $('#success-message').text(data.msg); + $('#success-dialog').modal('show'); + } else { + $('#fail-message').text(data.msg); + $('#fail-dialog').modal('show'); + } + } + }) + }); + +> + + renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +} +} diff --git a/storage/framework/smarty/compile/933b7b5b66c1e2891bbdc1dcb6629578648ef5c1_0.file_edit.tpl.php b/storage/framework/smarty/compile/933b7b5b66c1e2891bbdc1dcb6629578648ef5c1_0.file_edit.tpl.php index 42ef9df5..5a25ade6 100644 --- a/storage/framework/smarty/compile/933b7b5b66c1e2891bbdc1dcb6629578648ef5c1_0.file_edit.tpl.php +++ b/storage/framework/smarty/compile/933b7b5b66c1e2891bbdc1dcb6629578648ef5c1_0.file_edit.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.3.1', - 'unifunc' => 'content_67d0426d4956f8_69230533', + 'unifunc' => 'content_67d422f233a1c2_03544758', 'has_nocache_code' => false, 'file_dependency' => array ( '933b7b5b66c1e2891bbdc1dcb6629578648ef5c1' => array ( 0 => 'admin/node/edit.tpl', - 1 => 1741700740, + 1 => 1741954578, 2 => 'file', ), ), @@ -22,7 +22,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:admin/footer.tpl' => 1, ), ))) { -function content_67d0426d4956f8_69230533 (\Smarty\Template $_smarty_tpl) { +function content_67d422f233a1c2_03544758 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/node'; $_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); ?> @@ -214,6 +214,27 @@ $_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id,
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
diff --git a/storage/framework/smarty/compile/c924c42ad5005fd4c503ff51b94c20bfe33b4847_0.file_online.tpl.php b/storage/framework/smarty/compile/c924c42ad5005fd4c503ff51b94c20bfe33b4847_0.file_online.tpl.php new file mode 100644 index 00000000..a924a65a --- /dev/null +++ b/storage/framework/smarty/compile/c924c42ad5005fd4c503ff51b94c20bfe33b4847_0.file_online.tpl.php @@ -0,0 +1,109 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.3.1', + 'unifunc' => 'content_67d67b4a8846c7_49301269', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'c924c42ad5005fd4c503ff51b94c20bfe33b4847' => + array ( + 0 => 'admin/log/online.tpl', + 1 => 1740366544, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:admin/header.tpl' => 1, + 'file:datatable.tpl' => 1, + 'file:admin/footer.tpl' => 1, + ), +))) { +function content_67d67b4a8846c7_49301269 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/log'; +$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +?> + +
+
+ +
+
+
+
+
+
+
+ + + + getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('details')['field'], 'value', false, 'key'); +$foreach0DoElse = true; +foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value => $_smarty_tpl->getVariable('value')->value) { +$foreach0DoElse = false; +?> + + getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> + + +
getValue('value');?> +
+
+
+
+
+
+
+ + renderSubTemplate('file:datatable.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +?> + + +> + tableConfig.serverSide = true; + tableConfig.ajax = { + url: '/admin/online/ajax', + type: 'POST', + dataSrc: 'onlines.data' + }; + tableConfig.order = [ + [0, 'desc'] + ]; + tableConfig.columnDefs = [ + { + orderable: false, + targets: [0, 3, 5] + }, + ]; + + let table = new DataTable('#data-table', tableConfig); + + function loadTable() { + table; + } + + loadTable(); + +> + + renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +} +} diff --git a/storage/framework/smarty/compile/daf164b5b65e20e7acc23baf5d34525163f7cd1c_0.file_cron.tpl.php b/storage/framework/smarty/compile/daf164b5b65e20e7acc23baf5d34525163f7cd1c_0.file_cron.tpl.php new file mode 100644 index 00000000..2bfbfeb3 --- /dev/null +++ b/storage/framework/smarty/compile/daf164b5b65e20e7acc23baf5d34525163f7cd1c_0.file_cron.tpl.php @@ -0,0 +1,292 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.3.1', + 'unifunc' => 'content_67d67b72034c50_31518284', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'daf164b5b65e20e7acc23baf5d34525163f7cd1c' => + array ( + 0 => 'admin/setting/cron.tpl', + 1 => 1740366544, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:admin/header.tpl' => 1, + 'file:admin/footer.tpl' => 1, + ), +))) { +function content_67d67b72034c50_31518284 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/setting'; +$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +?> + +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ + +> + $("#save-setting").click(function () { + $.ajax({ + url: '/admin/setting/cron', + type: 'POST', + dataType: "json", + data: { + getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('update_field'), 'key'); +$foreach0DoElse = true; +foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value) { +$foreach0DoElse = false; +?> + getValue('key');?> +: $('#getValue('key');?> +').val(), + getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> + }, + success: function (data) { + if (data.ret === 1) { + $('#success-message').text(data.msg); + $('#success-dialog').modal('show'); + } else { + $('#fail-message').text(data.msg); + $('#fail-dialog').modal('show'); + } + } + }) + }); + +> + + renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +} +}