mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 11:20:53 +08:00
feat: node traffic limit & batch operations
- Traffic monitoring with transfer_enable limit - Batch delete nodes - Reset traffic (single/batch)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('v2_server', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('v2_server', 'transfer_enable')) {
|
||||
$table->bigInteger('transfer_enable')
|
||||
->default(0)
|
||||
->after('rate')
|
||||
->comment('Traffic limit , 0 or null=no limit');
|
||||
}
|
||||
if (!Schema::hasColumn('v2_server', 'u')) {
|
||||
$table->bigInteger('u')
|
||||
->default(0)
|
||||
->after('transfer_enable')
|
||||
->comment('upload traffic');
|
||||
}
|
||||
if (!Schema::hasColumn('v2_server', 'd')) {
|
||||
$table->bigInteger('d')
|
||||
->default(0)
|
||||
->after('u')
|
||||
->comment('donwload traffic');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('v2_server', function (Blueprint $table) {
|
||||
$table->dropColumn(['transfer_enable', 'u', 'd']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user