feat(api): 新增节点墙检测自动托管与显隐
新增定时墙检测命令与节点托管字段,自动为开启托管的父 节点创建检测任务,并在 blocked 时自动隐藏节点、normal 时仅恢复由墙检测自动隐藏的节点 更新自动上线服务以尊重 blocked 与自动隐藏状态,避免疑 似被墙节点被重新发布;同时补齐管理端墙检测托管开关、 刷新入口、批量设置与相关测试和知识库同步
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('v2_server', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('v2_server', 'gfw_check_enabled')) {
|
||||
$table->boolean('gfw_check_enabled')
|
||||
->default(true)
|
||||
->after('auto_online')
|
||||
->comment('Automatically run GFW checks and visibility actions');
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('v2_server', 'gfw_auto_hidden')) {
|
||||
$table->boolean('gfw_auto_hidden')
|
||||
->default(false)
|
||||
->after('gfw_check_enabled')
|
||||
->comment('Hidden by automated GFW check action');
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('v2_server', 'gfw_auto_action_at')) {
|
||||
$table->unsignedInteger('gfw_auto_action_at')
|
||||
->nullable()
|
||||
->after('gfw_auto_hidden')
|
||||
->comment('Last automated GFW visibility action time');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('v2_server', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('v2_server', 'gfw_auto_action_at')) {
|
||||
$table->dropColumn('gfw_auto_action_at');
|
||||
}
|
||||
|
||||
if (Schema::hasColumn('v2_server', 'gfw_auto_hidden')) {
|
||||
$table->dropColumn('gfw_auto_hidden');
|
||||
}
|
||||
|
||||
if (Schema::hasColumn('v2_server', 'gfw_check_enabled')) {
|
||||
$table->dropColumn('gfw_check_enabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user