mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-28 06:47:24 +08:00
feat: add AnyTLS support and improve system functionality
- Add AnyTLS protocol support - Add system logs viewing in admin panel - Refactor client subscription delivery code - Refactor hook mechanism - Add plugin support for Shadowsocks protocol - Add CSV export option for batch user creation - Fix mobile admin login page width display issue
This commit is contained in:
+10
-1
@@ -2,12 +2,15 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Services\Plugin\HookManager;
|
||||
use App\Services\UpdateService;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Octane\Facades\Octane;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Laravel\Octane\Events\WorkerStarting;
|
||||
|
||||
class OctaneSchedulerProvider extends ServiceProvider
|
||||
class OctaneServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
@@ -18,6 +21,12 @@ class OctaneSchedulerProvider extends ServiceProvider
|
||||
if ($this->app->runningInConsole()) {
|
||||
return;
|
||||
}
|
||||
if ($this->app->bound('octane')) {
|
||||
$this->app['events']->listen(WorkerStarting::class, function () {
|
||||
app(UpdateService::class)->updateVersionCache();
|
||||
HookManager::reset();
|
||||
});
|
||||
}
|
||||
// 每半钟执行一次调度检查
|
||||
Octane::tick('scheduler', function () {
|
||||
$lock = Cache::lock('scheduler-lock', 30);
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Services\UpdateService;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Octane\Events\WorkerStarting;
|
||||
|
||||
class OctaneVersionProvider extends ServiceProvider
|
||||
{
|
||||
public function boot(): void
|
||||
{
|
||||
if ($this->app->bound('octane')) {
|
||||
$this->app['events']->listen(WorkerStarting::class, function () {
|
||||
app(UpdateService::class)->updateVersionCache();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,13 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Plugin;
|
||||
use App\Services\Plugin\HookManager;
|
||||
use App\Services\Plugin\PluginManager;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Laravel\Octane\Events\WorkerStarting;
|
||||
|
||||
class PluginServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Support\ProtocolManager;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ProtocolServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* 注册服务
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->scoped('protocols.manager', function ($app) {
|
||||
return new ProtocolManager($app);
|
||||
});
|
||||
|
||||
$this->app->scoped('protocols.flags', function ($app) {
|
||||
return $app->make('protocols.manager')->getAllFlags();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动服务
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// 在启动时预加载协议类并缓存
|
||||
$this->app->make('protocols.manager')->registerAllProtocols();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供的服务
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return [
|
||||
'protocols.manager',
|
||||
'protocols.flags',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user