feat: configuration checker for all resources

This commit is contained in:
Andras Bacsai
2024-04-12 12:44:49 +02:00
parent 7b0018b661
commit 7a32b8d1d2
41 changed files with 493 additions and 89 deletions

View File

@@ -24,7 +24,6 @@ class General extends Component
public $customLabels;
public bool $labelsChanged = false;
public bool $isConfigurationChanged = false;
public bool $initLoadingCompose = false;
public ?string $initialDockerComposeLocation = null;
@@ -124,13 +123,8 @@ class General extends Component
$this->application->settings->save();
}
$this->parsedServiceDomains = $this->application->docker_compose_domains ? json_decode($this->application->docker_compose_domains, true) : [];
$this->ports_exposes = $this->application->ports_exposes;
if (str($this->application->status)->startsWith('running') && is_null($this->application->config_hash)) {
$this->application->isConfigurationChanged(true);
}
$this->isConfigurationChanged = $this->application->isConfigurationChanged();
$this->customLabels = $this->application->parseContainerLabels();
$this->customLabels = $this->application->parseContainerLabels();
if (!$this->customLabels && $this->application->destination->server->proxyType() !== 'NONE') {
$this->customLabels = str(implode("|", generateLabelsApplication($this->application)))->replace("|", "\n");
$this->application->custom_labels = base64_encode($this->customLabels);
@@ -141,6 +135,10 @@ class General extends Component
$this->initLoadingCompose = true;
$this->dispatch('info', 'Loading docker compose file...');
}
if (str($this->application->status)->startsWith('running') && is_null($this->application->config_hash)) {
$this->dispatch('configurationChanged');
}
}
public function instantSave()
{
@@ -316,7 +314,7 @@ class General extends Component
} catch (\Throwable $e) {
return handleError($e, $this);
} finally {
$this->isConfigurationChanged = $this->application->isConfigurationChanged();
$this->dispatch('configurationChanged');
}
}
}