server forms
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function show()
|
||||
{
|
||||
$projects = session('currentTeam')->load(['projects'])->projects;
|
||||
$servers = session('currentTeam')->load(['servers'])->servers;
|
||||
|
||||
return view('home', [
|
||||
'servers' => $servers,
|
||||
'projects' => $projects
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,7 @@ class General extends Component
|
||||
}
|
||||
public function submit()
|
||||
{
|
||||
$this->validate();
|
||||
$this->application->save();
|
||||
}
|
||||
}
|
||||
|
||||
41
app/Http/Livewire/Server/Form.php
Normal file
41
app/Http/Livewire/Server/Form.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Server;
|
||||
|
||||
use App\Models\Server;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Livewire\Component;
|
||||
|
||||
class Form extends Component
|
||||
{
|
||||
public $server_id;
|
||||
public Server $server;
|
||||
|
||||
protected $rules = [
|
||||
'server.name' => 'required|min:6',
|
||||
'server.description' => 'nullable',
|
||||
'server.ip' => 'required',
|
||||
'server.user' => 'required',
|
||||
'server.port' => 'required',
|
||||
];
|
||||
public function mount()
|
||||
{
|
||||
$this->server = Server::find($this->server_id);
|
||||
}
|
||||
public function submit()
|
||||
{
|
||||
$this->validate();
|
||||
// $validation = Validator::make($this->server->toArray(), [
|
||||
// 'ip' => [
|
||||
// 'ip'
|
||||
// ],
|
||||
// ]);
|
||||
// if ($validation->fails()) {
|
||||
// foreach ($validation->errors()->getMessages() as $key => $value) {
|
||||
// $this->addError("server.{$key}", $value[0]);
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
$this->server->save();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
namespace App\Http\Livewire\Settings;
|
||||
|
||||
use App\Models\InstanceSettings as ModelsInstanceSettings;
|
||||
use Livewire\Component;
|
||||
|
||||
class InstanceSettings extends Component
|
||||
class Form extends Component
|
||||
{
|
||||
public ModelsInstanceSettings $settings;
|
||||
public $do_not_track;
|
||||
@@ -41,6 +41,7 @@ class InstanceSettings extends Component
|
||||
$this->addError('settings.public_port_min', 'The minimum port must be lower than the maximum port.');
|
||||
return;
|
||||
}
|
||||
$this->validate();
|
||||
$this->settings->save();
|
||||
}
|
||||
}
|
||||
@@ -395,7 +395,6 @@ class DeployApplicationJob implements ShouldQueue
|
||||
if ($this->source->is_public) {
|
||||
$git_clone_command = "{$git_clone_command} {$this->source->html_url}/{$this->application->git_repository}.git {$this->workdir}";
|
||||
$git_clone_command = $this->setGitImportSettings($git_clone_command);
|
||||
dump($git_clone_command);
|
||||
return [
|
||||
$this->execute_in_builder($git_clone_command)
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user