mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-14 08:42:38 -04:00
- Refresh application, database and volume backup lists on BackupCreated - Refresh backup execution, edit and service resource views on ServiceStatusChanged as well as ServiceChecked - Hide the deployments counter when only the current page's application is deploying, since its heading already shows "Deploying…" - Show storage section shortcuts in the service configuration sidebar - Drive server sidebar Sentinel/Security active state from activeMenu and activeSubMenu instead of route matching - Start the app sidebar expanded for new users - Drop a column from the backup executions table grid and adjust the responsive breakpoints - Update the related feature tests
66 lines
1.8 KiB
PHP
66 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Livewire\Project\Application\Backup;
|
|
|
|
use App\Models\Application;
|
|
use App\Models\ScheduledVolumeBackup;
|
|
use App\Traits\ListensToTeamChannel;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
|
use Livewire\Component;
|
|
|
|
class Index extends Component
|
|
{
|
|
use AuthorizesRequests;
|
|
use ListensToTeamChannel;
|
|
|
|
public Application $application;
|
|
|
|
public array $parameters;
|
|
|
|
public string $search = '';
|
|
|
|
public function getListeners(): array
|
|
{
|
|
return [
|
|
'refreshVolumeBackups' => '$refresh',
|
|
...$this->teamChannelListeners(['BackupCreated' => '$refresh']),
|
|
];
|
|
}
|
|
|
|
public function mount(): void
|
|
{
|
|
$this->application = $this->findApplication();
|
|
$this->authorize('view', $this->application);
|
|
$this->parameters = get_route_parameters();
|
|
$this->search = request()->string('search')->toString();
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
$backups = ScheduledVolumeBackup::query()
|
|
->with(['backupable', 'latestExecution', 's3', 's3Storages'])
|
|
->withCount('executions')
|
|
->forApplication($this->application)
|
|
->latest()
|
|
->get();
|
|
|
|
return view('livewire.project.application.backup.index', ['backups' => $backups]);
|
|
}
|
|
|
|
private function findApplication(): Application
|
|
{
|
|
$project = currentTeam()->projects()
|
|
->where('uuid', request()->route('project_uuid'))
|
|
->firstOrFail();
|
|
$environment = $project->environments()
|
|
->where('uuid', request()->route('environment_uuid'))
|
|
->firstOrFail();
|
|
|
|
return $environment->applications()
|
|
->with('destination.server')
|
|
->where('uuid', request()->route('application_uuid'))
|
|
->firstOrFail();
|
|
}
|
|
}
|