wip
This commit is contained in:
@@ -17,6 +17,16 @@ class General extends Component
|
||||
public string|null $git_commit_sha;
|
||||
public string $build_pack;
|
||||
|
||||
public bool $is_git_submodules_allowed;
|
||||
public bool $is_git_lfs_allowed;
|
||||
public bool $is_debug;
|
||||
public bool $is_previews;
|
||||
public bool $is_bot;
|
||||
public bool $is_custom_ssl;
|
||||
public bool $is_http2;
|
||||
public bool $is_auto_deploy;
|
||||
public bool $is_dual_cert;
|
||||
|
||||
protected $rules = [
|
||||
'application.name' => 'required|min:6',
|
||||
'application.fqdn' => 'nullable',
|
||||
@@ -26,17 +36,37 @@ class General extends Component
|
||||
'application.build_pack' => 'required',
|
||||
'application.base_directory' => 'required',
|
||||
'application.publish_directory' => 'nullable',
|
||||
'application.environment.name' => 'required',
|
||||
'application.destination.network' => 'required',
|
||||
];
|
||||
|
||||
public function instantSave()
|
||||
{
|
||||
// @TODO: find another way
|
||||
$this->application->settings->is_git_submodules_allowed = $this->is_git_submodules_allowed;
|
||||
$this->application->settings->is_git_lfs_allowed = $this->is_git_lfs_allowed;
|
||||
$this->application->settings->is_debug = $this->is_debug;
|
||||
$this->application->settings->is_previews = $this->is_previews;
|
||||
$this->application->settings->is_bot = $this->is_bot;
|
||||
$this->application->settings->is_custom_ssl = $this->is_custom_ssl;
|
||||
$this->application->settings->is_http2 = $this->is_http2;
|
||||
$this->application->settings->is_auto_deploy = $this->is_auto_deploy;
|
||||
$this->application->settings->is_dual_cert = $this->is_dual_cert;
|
||||
$this->application->settings->save();
|
||||
}
|
||||
public function mount()
|
||||
{
|
||||
$this->application = Application::find($this->applicationId)->with('destination')->first();
|
||||
$this->application = Application::find($this->applicationId)->with('destination', 'settings')->first();
|
||||
$this->is_git_submodules_allowed = $this->application->settings->is_git_submodules_allowed;
|
||||
$this->is_git_lfs_allowed = $this->application->settings->is_git_lfs_allowed;
|
||||
$this->is_debug = $this->application->settings->is_debug;
|
||||
$this->is_previews = $this->application->settings->is_previews;
|
||||
$this->is_bot = $this->application->settings->is_bot;
|
||||
$this->is_custom_ssl = $this->application->settings->is_custom_ssl;
|
||||
$this->is_http2 = $this->application->settings->is_http2;
|
||||
$this->is_auto_deploy = $this->application->settings->is_auto_deploy;
|
||||
$this->is_dual_cert = $this->application->settings->is_dual_cert;
|
||||
|
||||
}
|
||||
public function submit()
|
||||
{
|
||||
$this->validate();
|
||||
$this->application->save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,5 @@ use Livewire\Component;
|
||||
|
||||
class Secrets extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.application.secrets');
|
||||
}
|
||||
public array $secrets = [];
|
||||
}
|
||||
|
||||
11
app/Http/Livewire/Application/Storages.php
Normal file
11
app/Http/Livewire/Application/Storages.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Application;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Livewire\Component;
|
||||
|
||||
class Storages extends Component
|
||||
{
|
||||
public Collection $storages;
|
||||
}
|
||||
@@ -6,6 +6,10 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ApplicationSetting extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'is_git_submodules_allowed',
|
||||
'is_git_lfs_allowed',
|
||||
];
|
||||
public function application()
|
||||
{
|
||||
return $this->belongsTo(Application::class);
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace App\Models;
|
||||
|
||||
class GithubApp extends BaseModel
|
||||
{
|
||||
protected $casts = [
|
||||
'is_public' => 'boolean',
|
||||
];
|
||||
public function applications()
|
||||
{
|
||||
return $this->morphMany(Application::class, 'source');
|
||||
|
||||
@@ -16,6 +16,8 @@ class Input extends Component
|
||||
public bool $required = false,
|
||||
public bool $readonly = false,
|
||||
public string|null $label = null,
|
||||
public string|null $type = 'text',
|
||||
public bool $instantSave = false,
|
||||
) {
|
||||
//
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user