okay, now it is way better

This commit is contained in:
Andras Bacsai
2023-09-27 12:45:53 +02:00
parent c9a278b750
commit f0abdcc2da
20 changed files with 1005 additions and 525 deletions

View File

@@ -34,19 +34,11 @@ class Index extends Component
{
$this->applications = $this->service->applications->sort();
$this->applications->each(function ($application) {
$application->fileStorages()->get()->each(function ($fileStorage) use ($application) {
if (!$fileStorage->is_directory && $fileStorage->content == null) {
$application->hasMissingFiles = true;
}
});
$application->configuration_required = $application->configurationRequired();
});
$this->databases = $this->service->databases->sort();
$this->databases->each(function ($database) {
$database->fileStorages()->get()->each(function ($fileStorage) use ($database) {
if (!$fileStorage->is_directory && $fileStorage->content == null) {
$database->hasMissingFiles = true;
}
});
$database->configuration_required = $database->configurationRequired();
});
$this->emit('success', 'Stack refreshed successfully.');
}
@@ -61,24 +53,29 @@ class Index extends Component
{
return view('livewire.project.service.index');
}
public function save()
{
try {
$this->service->save();
$this->service->parse();
$this->service->refresh();
$this->emit('refreshEnvs');
$this->emit('success', 'Service saved successfully.');
$this->service->saveComposeConfigs();
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
// public function save()
// {
// try {
// $this->service->save();
// $this->service->parse();
// $this->service->refresh();
// $this->emit('refreshEnvs');
// $this->emit('success', 'Service saved successfully.');
// $this->service->saveComposeConfigs();
// } catch (\Throwable $e) {
// return handleError($e, $this);
// }
// }
public function submit()
{
try {
$this->validate();
$this->service->save();
$this->service->parse();
$this->service->refresh();
$this->service->saveComposeConfigs();
$this->refreshStack();
$this->emit('refreshEnvs');
$this->emit('success', 'Service saved successfully.');
} catch (\Throwable $e) {
return handleError($e, $this);