diff --git a/create-a-container/routers/containers.js b/create-a-container/routers/containers.js index 808b31b5..cc8aa7bb 100644 --- a/create-a-container/routers/containers.js +++ b/create-a-container/routers/containers.js @@ -178,9 +178,10 @@ router.get('/', requireAuth, async (req, res) => { const sshPort = ssh?.transportService?.externalPort || null; const http = services.find(s => s.type === 'http'); const httpPort = http ? http.internalPort : null; - const httpExternalUrl = http?.httpService?.externalHostname && http?.httpService?.externalDomain?.name - ? `https://${http.httpService.externalHostname}.${http.httpService.externalDomain.name}` + const httpExternalHost = http?.httpService?.externalHostname && http?.httpService?.externalDomain?.name + ? `${http.httpService.externalHostname}.${http.httpService.externalDomain.name}` : null; + const httpExternalUrl = httpExternalHost ? `https://${httpExternalHost}` : null; // Common object structure for both API and View return { @@ -194,6 +195,7 @@ router.get('/', requireAuth, async (req, res) => { template: c.template, creationJobId: c.creationJobId, sshPort, + sshHost: httpExternalHost || site.externalIp, httpPort, httpExternalUrl, nodeName: c.node ? c.node.name : '-', diff --git a/create-a-container/views/containers/index.ejs b/create-a-container/views/containers/index.ejs index 1cadb174..2155a7dc 100644 --- a/create-a-container/views/containers/index.ejs +++ b/create-a-container/views/containers/index.ejs @@ -73,10 +73,10 @@ <% } %> - <% if (r.sshPort && site.externalIp) { %> + <% if (r.sshPort && r.sshHost) { %> <%= r.sshPort %> - - + + <% } else { %> <%= r.sshPort || '-' %> <% } %>