Enhance port detection and improve user notifications (#7184)

This commit is contained in:
Andras Bacsai
2025-11-10 13:56:09 +01:00
committed by GitHub
5 changed files with 235 additions and 0 deletions
@@ -1000,4 +1000,23 @@ class General extends Component
}
}
}
public function getDetectedPortInfoProperty(): ?array
{
$detectedPort = $this->application->detectPortFromEnvironment();
if (! $detectedPort) {
return null;
}
$portsExposesArray = $this->application->ports_exposes_array;
$isMatch = in_array($detectedPort, $portsExposesArray);
$isEmpty = empty($portsExposesArray);
return [
'port' => $detectedPort,
'matches' => $isMatch,
'isEmpty' => $isEmpty,
];
}
}