fix: Show deployment exposure details - #110
Conversation
Code Review SummaryThis PR enhances the deployment detail view by displaying the routed service and container port. This provides immediate visibility into the exposure state for both simple and complex deployment configurations. 🚀 Key Improvements
💡 Minor Suggestions
|
| return null; | ||
| }); | ||
|
|
||
| const singleDomainTarget = computed(() => { |
There was a problem hiding this comment.
This computed property can be refactored to improve both readability and robustness. By caching the metadata object, we avoid repeated reactive lookups of deployment.value. Additionally, switching to the nullish coalescing operator (??) is safer for optional configuration properties; it ensures that valid but falsy values (like an empty service name or a port of 0, should they ever occur in this context) are correctly handled rather than triggering an unintended fallback to global networking settings.
| const singleDomainTarget = computed(() => { | |
| const singleDomainTarget = computed(() => { | |
| const metadata = deployment.value?.metadata; | |
| const domains = metadata?.domains; | |
| const configured = domains?.length === 1 ? domains[0] : null; | |
| const service = configured?.service ?? metadata?.networking?.service; | |
| const port = configured?.container_port ?? metadata?.networking?.container_port; | |
| return service && port ? `${service}:${port}` : ""; | |
| }); |
Show the routed service and container port in deployment details so exposure state is visible without reading service configuration.