mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 07:52:34 +00:00
#591 - workers
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
use App\Models\Site;
|
||||
use App\Models\Worker;
|
||||
use App\SSH\Services\ProcessManager\ProcessManager;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
@ -20,6 +21,8 @@ class CreateWorker
|
||||
*/
|
||||
public function create(Server $server, array $input, ?Site $site = null): void
|
||||
{
|
||||
Validator::make($input, self::rules($server, $site))->validate();
|
||||
|
||||
$worker = new Worker([
|
||||
'server_id' => $server->id,
|
||||
'site_id' => $site?->id,
|
||||
|
@ -8,6 +8,7 @@
|
||||
use App\Models\Site;
|
||||
use App\Models\Worker;
|
||||
use App\SSH\Services\ProcessManager\ProcessManager;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
@ -20,6 +21,8 @@ class EditWorker
|
||||
*/
|
||||
public function edit(Worker $worker, array $input): void
|
||||
{
|
||||
Validator::make($input, self::rules($worker->server, $worker->site))->validate();
|
||||
|
||||
$worker->fill([
|
||||
'command' => $input['command'],
|
||||
'user' => $input['user'],
|
||||
|
Reference in New Issue
Block a user