feat(admin): batch node-machine binding & frontend update
This commit is contained in:
parent
6be8137ed5
commit
e0f41257db
@ -226,6 +226,7 @@ class ManageController extends Controller
|
|||||||
'ids.*' => 'integer',
|
'ids.*' => 'integer',
|
||||||
'show' => 'nullable|integer|in:0,1',
|
'show' => 'nullable|integer|in:0,1',
|
||||||
'enabled' => 'nullable|boolean',
|
'enabled' => 'nullable|boolean',
|
||||||
|
'machine_id' => 'nullable|integer',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$ids = $params['ids'];
|
$ids = $params['ids'];
|
||||||
@ -240,6 +241,9 @@ class ManageController extends Controller
|
|||||||
if (array_key_exists('enabled', $params) && $params['enabled'] !== null) {
|
if (array_key_exists('enabled', $params) && $params['enabled'] !== null) {
|
||||||
$update['enabled'] = (bool) $params['enabled'];
|
$update['enabled'] = (bool) $params['enabled'];
|
||||||
}
|
}
|
||||||
|
if (array_key_exists('machine_id', $params)) {
|
||||||
|
$update['machine_id'] = $params['machine_id'] ?: null;
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($update)) {
|
if (empty($update)) {
|
||||||
return $this->fail([400, '没有可更新的字段']);
|
return $this->fail([400, '没有可更新的字段']);
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
<?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) {
|
||||||
|
$table->boolean('enabled')->nullable()->default(true)->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('v2_server', function (Blueprint $table) {
|
||||||
|
$table->boolean('enabled')->default(true)->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit f03d07a87951e1492c675a37413693a371366a99
|
Subproject commit fe6dc2952241c6bed807d1ca965e7d5907303265
|
||||||
Loading…
Reference in New Issue
Block a user