chore: Refactor container name logic in GetContainersStatus.php and ForcePasswordReset.php

This commit is contained in:
Andras Bacsai 2024-05-22 14:44:11 +02:00
parent 4b287b758d
commit 6c3b4070ba
2 changed files with 27 additions and 3 deletions

View File

@ -221,7 +221,19 @@ private function sentinel()
}
$name = data_get($exitedService, 'name');
$fqdn = data_get($exitedService, 'fqdn');
$containerName = $name ? "$name, available at $fqdn" : $fqdn;
if ($name) {
if ($fqdn) {
$containerName = "$name, available at $fqdn";
} else {
$containerName = $name;
}
} else {
if ($fqdn) {
$containerName = $fqdn;
} else {
$containerName = null;
}
}
$projectUuid = data_get($service, 'environment.project.uuid');
$serviceUuid = data_get($service, 'uuid');
$environmentName = data_get($service, 'environment.name');
@ -539,7 +551,19 @@ private function old_way()
}
$name = data_get($exitedService, 'name');
$fqdn = data_get($exitedService, 'fqdn');
$containerName = $name ? "$name, available at $fqdn" : $fqdn;
if ($name) {
if ($fqdn) {
$containerName = "$name, available at $fqdn";
} else {
$containerName = $name;
}
} else {
if ($fqdn) {
$containerName = $fqdn;
} else {
$containerName = null;
}
}
$projectUuid = data_get($service, 'environment.project.uuid');
$serviceUuid = data_get($service, 'uuid');
$environmentName = data_get($service, 'environment.name');

View File

@ -24,7 +24,7 @@ public function mount()
}
public function render()
{
return view('livewire.force-password-reset');
return view('livewire.force-password-reset')->layout('layouts.simple');
}
public function submit()
{