fix: services view
This commit is contained in:
@@ -9,7 +9,6 @@ use Livewire\Component;
|
||||
|
||||
class Index extends Component
|
||||
{
|
||||
use WithRateLimiting;
|
||||
public Service $service;
|
||||
public $applications;
|
||||
public $databases;
|
||||
@@ -21,26 +20,22 @@ class Index extends Component
|
||||
'service.name' => 'required',
|
||||
'service.description' => 'nullable',
|
||||
];
|
||||
public function manualRefreshStack() {
|
||||
try {
|
||||
$this->rateLimit(5);
|
||||
dispatch_sync(new ContainerStatusJob($this->service->server));
|
||||
$this->refreshStack();
|
||||
} catch(\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
public function checkStatus() {
|
||||
dispatch_sync(new ContainerStatusJob($this->service->server));
|
||||
$this->refreshStack();
|
||||
}
|
||||
public function refreshStack()
|
||||
{
|
||||
$this->applications = $this->service->applications->sort();
|
||||
$this->applications->each(function ($application) {
|
||||
$application->refresh();
|
||||
$application->configuration_required = $application->configurationRequired();
|
||||
});
|
||||
$this->databases = $this->service->databases->sort();
|
||||
$this->databases->each(function ($database) {
|
||||
$database->refresh();
|
||||
$database->configuration_required = $database->configurationRequired();
|
||||
});
|
||||
$this->emit('success', 'Stack refreshed successfully.');
|
||||
}
|
||||
public function mount()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user