mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 03:57:27 +08:00
feat(admin): batch node-machine binding & frontend update
This commit is contained in:
@@ -226,6 +226,7 @@ class ManageController extends Controller
|
||||
'ids.*' => 'integer',
|
||||
'show' => 'nullable|integer|in:0,1',
|
||||
'enabled' => 'nullable|boolean',
|
||||
'machine_id' => 'nullable|integer',
|
||||
]);
|
||||
|
||||
$ids = $params['ids'];
|
||||
@@ -240,6 +241,9 @@ class ManageController extends Controller
|
||||
if (array_key_exists('enabled', $params) && $params['enabled'] !== null) {
|
||||
$update['enabled'] = (bool) $params['enabled'];
|
||||
}
|
||||
if (array_key_exists('machine_id', $params)) {
|
||||
$update['machine_id'] = $params['machine_id'] ?: null;
|
||||
}
|
||||
|
||||
if (empty($update)) {
|
||||
return $this->fail([400, '没有可更新的字段']);
|
||||
|
||||
Reference in New Issue
Block a user