diff --git a/web/src/Service.jsx b/web/src/Service.jsx
index a5f4953..2d6e449 100644
--- a/web/src/Service.jsx
+++ b/web/src/Service.jsx
@@ -27,21 +27,8 @@ function Service(props) {
const configMapWidgets = configMaps(service.pods, service.svc.metadata.namespace, capacitorClient)
const secretWidgets = secrets(service.pods, service.svc.metadata.namespace, capacitorClient)
- const svcPort = service.svc.spec.ports[0].port
- let hostPort = ""
- if (svcPort) {
- if (svcPort <= 99) {
- hostPort = "100" + svcPort
- } else if (svcPort <= 999) {
- hostPort = "10" + svcPort
- } else {
- hostPort = svcPort
- }
-
- if (hostPort === "10080") { // Connections to HTTP, HTTPS or FTP servers on port 10080 will fail. This is a mitigation for the NAT Slipstream 2.0 attack.
- hostPort = "10081"
- }
- }
+ const appPort = getAppPort(service.svc.spec.ports) ?? "";
+ const hostPort = getHostPort(service.svc.spec.ports) ?? "";
return (
<>
@@ -167,7 +154,7 @@ function Service(props) {
@@ -185,7 +172,7 @@ function Service(props) {
) : null
}
- {svcPort &&
+ {service.svc.spec.ports &&
<>
http://127.0.0.1:{hostPort}