Merge remote-tracking branch 'origin/next' into harden-database-import-files

This commit is contained in:
Andras Bacsai committed 2026-06-29 10:35:35 +02:00
commit 7d65a4b496
550 files changed
+18078 -5008

No files matched your search

+8
View File
@@ -33,6 +33,8 @@ class Form extends Component
public ?bool $isUsable = null;
public bool $isPasswordHiddenForMember = false;
protected function rules(): array
{
return [
@@ -110,6 +112,12 @@ class Form extends Component
public function mount()
{
$this->syncData(false);
$this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;
if ($this->isPasswordHiddenForMember) {
$this->key = '';
$this->secret = '';
}
}
public function testConnection()
+11
View File
@@ -4,16 +4,21 @@ namespace App\Livewire\Storage;
use App\Models\S3Storage;
use App\Models\ScheduledDatabaseBackup;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;
class Resources extends Component
{
use AuthorizesRequests;
public S3Storage $storage;
public array $selectedStorages = [];
public function mount(): void
{
$this->authorize('view', $this->storage);
$backups = ScheduledDatabaseBackup::where('s3_storage_id', $this->storage->id)
->where('save_s3', true)
->get();
@@ -25,6 +30,8 @@ class Resources extends Component
public function disableS3(int $backupId): void
{
$this->authorize('update', $this->storage);
$backup = ScheduledDatabaseBackup::where('id', $backupId)
->where('s3_storage_id', $this->storage->id)
->firstOrFail();
@@ -41,6 +48,8 @@ class Resources extends Component
public function moveBackup(int $backupId): void
{
$this->authorize('update', $this->storage);
$backup = ScheduledDatabaseBackup::where('id', $backupId)
->where('s3_storage_id', $this->storage->id)
->firstOrFail();
@@ -62,6 +71,8 @@ class Resources extends Component
return;
}
$this->authorize('update', $newStorage);
$backup->update(['s3_storage_id' => $newStorage->id]);
unset($this->selectedStorages[$backupId]);
+6 -1
View File
@@ -4,6 +4,7 @@ namespace App\Livewire\Storage;
use App\Models\S3Storage;
use App\Models\ScheduledDatabaseBackup;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;
@@ -23,7 +24,11 @@ class Show extends Component
if (! $this->storage) {
abort(404);
}
$this->authorize('view', $this->storage);
try {
$this->authorize('view', $this->storage);
} catch (AuthorizationException) {
return $this->redirectRoute('storage.index', navigate: true);
}
$this->currentRoute = request()->route()->getName();
$this->backupCount = ScheduledDatabaseBackup::where('s3_storage_id', $this->storage->id)->count();
}