feat(project): add icons and improve persistent volume management

Add project icon storage and serving with local/S3 support, prevent deletion of compose-managed volumes, and optimize volume backups. Refine project and backup UI components with consistent styling and coverage.
This commit is contained in:
Andras Bacsai
2026-08-13 22:56:52 +02:00
parent a02d02d19b
commit fd5eb3e0cd
43 changed files with 728 additions and 60 deletions
+37
View File
@@ -3,13 +3,16 @@
namespace App\Livewire\Project;
use App\Models\Project;
use App\Services\ProjectIconStorageService;
use App\Support\ValidationPatterns;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;
use Livewire\WithFileUploads;
class Edit extends Component
{
use AuthorizesRequests;
use WithFileUploads;
public Project $project;
@@ -17,6 +20,40 @@ class Edit extends Component
public ?string $description = null;
public $icon;
public function uploadIcon(ProjectIconStorageService $iconStorage): bool
{
try {
$this->authorize('update', $this->project);
$this->validate([
'icon' => ['required', 'image', 'mimes:jpg,jpeg,png,webp', 'max:5120', 'dimensions:max_width=6000,max_height=6000'],
]);
$iconStorage->storeProject($this->project, $this->icon);
$this->reset('icon');
$this->project->refresh();
$this->dispatch('success', 'Project icon updated.');
return true;
} catch (\Throwable $e) {
handleError($e, $this);
return false;
}
}
public function removeIcon(ProjectIconStorageService $iconStorage): void
{
try {
$this->authorize('update', $this->project);
$iconStorage->deleteProject($this->project);
$this->project->refresh();
$this->dispatch('success', 'Project icon removed.');
} catch (\Throwable $e) {
handleError($e, $this);
}
}
protected function rules(): array
{
return [