Merge pull request #2303 from coollabsio/next

v4.0.0-beta.288
This commit is contained in:
Andras Bacsai 2024-05-28 13:07:55 +02:00 committed by GitHub
commit 6a058372bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 37 additions and 14 deletions

View File

@ -16,7 +16,7 @@ class Add extends Component
public string $mount_path; public string $mount_path;
public ?string $host_path = null; public ?string $host_path = null;
public string $file_storage_path; public string $file_storage_path;
public string $file_storage_content; public ?string $file_storage_content = null;
public string $file_storage_directory_source; public string $file_storage_directory_source;
public string $file_storage_directory_destination; public string $file_storage_directory_destination;
@ -25,7 +25,7 @@ class Add extends Component
'mount_path' => 'required|string', 'mount_path' => 'required|string',
'host_path' => 'string|nullable', 'host_path' => 'string|nullable',
'file_storage_path' => 'string', 'file_storage_path' => 'string',
'file_storage_content' => 'string', 'file_storage_content' => 'nullable|string',
'file_storage_directory_source' => 'string', 'file_storage_directory_source' => 'string',
'file_storage_directory_destination' => 'string', 'file_storage_directory_destination' => 'string',
]; ];
@ -62,6 +62,10 @@ class Add extends Component
public function submitFileStorage() public function submitFileStorage()
{ {
try { try {
$this->validate([
'file_storage_path' => 'string',
'file_storage_content' => 'nullable|string',
]);
$this->file_storage_path = trim($this->file_storage_path); $this->file_storage_path = trim($this->file_storage_path);
$this->file_storage_path = str($this->file_storage_path)->start('/')->value(); $this->file_storage_path = str($this->file_storage_path)->start('/')->value();
if ($this->resource->getMorphClass() === 'App\Models\Application') { if ($this->resource->getMorphClass() === 'App\Models\Application') {
@ -86,6 +90,10 @@ class Add extends Component
public function submitFileStorageDirectory() public function submitFileStorageDirectory()
{ {
try { try {
$this->validate([
'file_storage_directory_source' => 'string',
'file_storage_directory_destination' => 'string',
]);
$this->file_storage_directory_source = trim($this->file_storage_directory_source); $this->file_storage_directory_source = trim($this->file_storage_directory_source);
$this->file_storage_directory_source = str($this->file_storage_directory_source)->start('/')->value(); $this->file_storage_directory_source = str($this->file_storage_directory_source)->start('/')->value();
$this->file_storage_directory_destination = trim($this->file_storage_directory_destination); $this->file_storage_directory_destination = trim($this->file_storage_directory_destination);
@ -108,7 +116,11 @@ class Add extends Component
public function submitPersistentVolume() public function submitPersistentVolume()
{ {
try { try {
$this->validate($this->rules); $this->validate([
'name' => 'required|string',
'mount_path' => 'required|string',
'host_path' => 'string|nullable',
]);
$name = $this->uuid . '-' . $this->name; $name = $this->uuid . '-' . $this->name;
$this->dispatch('addNewVolume', [ $this->dispatch('addNewVolume', [
'name' => $name, 'name' => $name,

View File

@ -12,6 +12,8 @@ class Show extends Component
public bool $isReadOnly = false; public bool $isReadOnly = false;
public ?string $modalId = null; public ?string $modalId = null;
public bool $isFirst = true; public bool $isFirst = true;
public bool $isService = false;
public ?string $startedAt = null;
protected $rules = [ protected $rules = [
'storage.name' => 'required|string', 'storage.name' => 'required|string',

View File

@ -7,7 +7,7 @@ return [
// The release version of your application // The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.287', 'release' => '4.0.0-beta.288',
// When left empty or `null` the Laravel environment will be used // When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'), 'environment' => config('app.env'),

View File

@ -1,3 +1,3 @@
<?php <?php
return '4.0.0-beta.287'; return '4.0.0-beta.288';

View File

@ -3,10 +3,11 @@
@foreach ($resource->persistentStorages as $storage) @foreach ($resource->persistentStorages as $storage)
@if ($resource->type() === 'service') @if ($resource->type() === 'service')
<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage" <livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"
:isFirst="$loop->first" isReadOnly='true' /> :isFirst="$loop->first" isReadOnly='true' isService='true' />
@else @else
<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage" <livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"
isReadOnly="{{ data_get($storage, 'is_readonly') }}" /> isReadOnly="{{ data_get($storage, 'is_readonly') }}"
startedAt="{{ data_get($resource, 'started_at') }}" />
@endif @endif
@endforeach @endforeach
</div> </div>

View File

@ -4,9 +4,16 @@
@if ($isFirst) @if ($isFirst)
<x-forms.input id="storage.name" label="Volume Name" required <x-forms.input id="storage.name" label="Volume Name" required
helper="Warning: Changing the volume name after the initial start could cause problems. Only use it when you know what are you doing." /> helper="Warning: Changing the volume name after the initial start could cause problems. Only use it when you know what are you doing." />
@if ($isService || $startedAt)
<x-forms.input id="storage.host_path" readonly helper="Directory on the host system."
label="Source Path"
helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." />
@else
<x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path" <x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path"
helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." /> helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." />
<x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container." required readonly /> @endif
<x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container."
required readonly />
<x-forms.button type="submit"> <x-forms.button type="submit">
Update Update
</x-forms.button> </x-forms.button>
@ -20,7 +27,8 @@
@if ($isFirst) @if ($isFirst)
<x-forms.input id="storage.name" label="Volume Name" required /> <x-forms.input id="storage.name" label="Volume Name" required />
<x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path" /> <x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path" />
<x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container." required /> <x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container."
required />
@else @else
<x-forms.input id="storage.name" required /> <x-forms.input id="storage.name" required />
<x-forms.input id="storage.host_path" helper="Directory on the host system." /> <x-forms.input id="storage.host_path" helper="Directory on the host system." />

View File

@ -1,7 +1,7 @@
{ {
"coolify": { "coolify": {
"v4": { "v4": {
"version": "4.0.0-beta.287" "version": "4.0.0-beta.288"
}, },
"sentinel": { "sentinel": {
"version": "0.0.4" "version": "0.0.4"