From 059e6a88eba8e4acc3fd7187455c62cbdd5af8e4 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jan 2024 12:30:49 +0100 Subject: [PATCH] Replace comma with pipe in customLabels --- app/Livewire/Project/Application/General.php | 8 ++++---- app/Models/Application.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php index ab16f64d7..0e93d389c 100644 --- a/app/Livewire/Project/Application/General.php +++ b/app/Livewire/Project/Application/General.php @@ -117,7 +117,7 @@ class General extends Component $this->isConfigurationChanged = $this->application->isConfigurationChanged(); $this->customLabels = $this->application->parseContainerLabels(); if (!$this->customLabels && $this->application->destination->server->proxyType() === 'TRAEFIK_V2') { - $this->customLabels = str(implode(",", generateLabelsApplication($this->application)))->replace(',', "\n"); + $this->customLabels = str(implode("|", generateLabelsApplication($this->application)))->replace("|", "\n"); $this->application->custom_labels = base64_encode($this->customLabels); $this->application->save(); } @@ -182,7 +182,7 @@ class General extends Component } public function checkLabelUpdates() { - if (md5($this->application->custom_labels) !== md5(implode(",", generateLabelsApplication($this->application)))) { + if (md5($this->application->custom_labels) !== md5(implode("|", generateLabelsApplication($this->application)))) { $this->labelsChanged = true; } else { $this->labelsChanged = false; @@ -201,7 +201,7 @@ class General extends Component } public function resetDefaultLabels($showToaster = true) { - $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->submit($showToaster); } @@ -215,7 +215,7 @@ class General extends Component { try { if (!$this->customLabels && $this->application->destination->server->proxyType() === 'TRAEFIK_V2') { - $this->customLabels = str(implode(",", generateLabelsApplication($this->application)))->replace(',', "\n"); + $this->customLabels = str(implode("|", generateLabelsApplication($this->application)))->replace("|", "\n"); $this->application->custom_labels = base64_encode($this->customLabels); $this->application->save(); } diff --git a/app/Models/Application.php b/app/Models/Application.php index 5f3b7afe2..4e845fe0d 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -1066,7 +1066,7 @@ class Application extends BaseModel $customLabels = base64_decode($this->custom_labels); if (mb_detect_encoding($customLabels, 'ASCII', true) === false) { ray('custom_labels contains non-ascii characters'); - $customLabels = str(implode(",", generateLabelsApplication($this, $preview)))->replace(',', "\n"); + $customLabels = str(implode("|", generateLabelsApplication($this, $preview)))->replace("|", "\n"); } $this->custom_labels = base64_encode($customLabels); $this->save();