Reset default labels when application FQDN is updated

This commit is contained in:
Andras Bacsai 2024-04-10 08:21:06 +02:00
parent d95e5a169d
commit 5ec553f68d

View File

@ -177,6 +177,9 @@ public function updatedApplicationBaseDirectory()
$this->loadComposeFile(); $this->loadComposeFile();
} }
} }
public function updatedApplicationFqdn() {
$this->resetDefaultLabels();
}
public function updatedApplicationBuildPack() public function updatedApplicationBuildPack()
{ {
if ($this->application->build_pack !== 'nixpacks') { if ($this->application->build_pack !== 'nixpacks') {
@ -204,11 +207,13 @@ public function getWildcardDomain()
$fqdn = generateFqdn($server, $this->application->uuid); $fqdn = generateFqdn($server, $this->application->uuid);
$this->application->fqdn = $fqdn; $this->application->fqdn = $fqdn;
$this->application->save(); $this->application->save();
$this->resetDefaultLabels();
$this->dispatch('success', 'Wildcard domain generated.'); $this->dispatch('success', 'Wildcard domain generated.');
} }
} }
public function resetDefaultLabels() public function resetDefaultLabels()
{ {
ray('resetDefaultLabels');
$this->customLabels = str(implode("|", generateLabelsApplication($this->application)))->replace("|", "\n"); $this->customLabels = str(implode("|", generateLabelsApplication($this->application)))->replace("|", "\n");
$this->ports_exposes = $this->application->ports_exposes; $this->ports_exposes = $this->application->ports_exposes;