fix: labelling

This commit is contained in:
Andras Bacsai
2023-12-12 15:48:51 +01:00
parent 4bc63e283c
commit f042c70b3c
5 changed files with 28 additions and 15 deletions

View File

@@ -110,16 +110,18 @@ class General extends Component
}
$this->isConfigurationChanged = $this->application->isConfigurationChanged();
if (base64_encode(base64_decode(data_get($this->application, 'custom_labels'), true)) === data_get($this->application, 'custom_labels')) {
ray('custom_labels is base64 encoded');
} else {
ray('custom_labels is not base64 encoded');
$this->application->custom_labels = str($this->application->custom_labels)->replace(',', "\n");
$this->application->custom_labels = base64_encode(data_get($this->application, 'custom_labels'));
$this->application->save();
if (data_get($this->application, 'custom_labels')) {
if (base64_encode(base64_decode(data_get($this->application, 'custom_labels'), true)) === data_get($this->application, 'custom_labels')) {
ray('custom_labels is base64 encoded');
} else {
ray('custom_labels is not base64 encoded');
$this->application->custom_labels = str($this->application->custom_labels)->replace(',', "\n");
$this->application->custom_labels = base64_encode(data_get($this->application, 'custom_labels'));
$this->application->save();
}
$this->customLabels = base64_decode(data_get($this->application, 'custom_labels'));
}
$this->customLabels = base64_decode(data_get($this->application, 'custom_labels'));
$this->initialDockerComposeLocation = $this->application->docker_compose_location;
$this->checkLabelUpdates();
}
@@ -242,8 +244,9 @@ class General extends Component
$this->application->docker_compose_domains = json_encode($this->parsedServiceDomains);
$this->parsedServices = $this->application->parseCompose();
}
$this->application->custom_labels = base64_encode($this->customLabels);
if ($this->customLabels) {
$this->application->custom_labels = base64_encode($this->customLabels);
}
$this->application->save();
$showToaster && $this->dispatch('success', 'Application settings updated!');
} catch (\Throwable $e) {