Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions create-a-container/routers/containers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 : '-',
Expand Down
6 changes: 3 additions & 3 deletions create-a-container/views/containers/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
<% } %>
</td>
<td>
<% if (r.sshPort && site.externalIp) { %>
<% if (r.sshPort && r.sshHost) { %>
<%= r.sshPort %>
<a href="vscode://vscode-remote/ssh-remote+<%= req.session.user %>@<%= site.externalIp %>:<%= r.sshPort %>/" target="_blank" rel="noopener noreferrer" title="Open in VS Code" aria-label="Open SSH in VS Code for container <%= r.hostname %>" class="ms-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256" aria-hidden="true" style="vertical-align: -0.125em;"><path fill="#0065A9" d="M246.94 27.64l-52.75-25.4c-6.1-2.94-13.4-1.7-18.2 3.1L3.33 162.77c-4.64 4.24-4.64 11.55.01 15.78l14.1 12.82c3.8 3.46 9.53 3.71 13.62.61L239 34.23c6.98-5.3 17-.32 17 8.44v-.61c0-6.15-3.52-11.75-9.06-14.42z"/><path fill="#007ACC" d="M246.94 228.36l-52.75 25.4c-6.1 2.94-13.4 1.7-18.2-3.09L3.33 93.23c-4.64-4.24-4.64-11.55.01-15.78l14.1-12.82c3.8-3.46 9.53-3.71 13.62-.61L239 221.77c6.98 5.3 17 .32 17-8.44v.61c0 6.15-3.52 11.75-9.06 14.42z"/><path fill="#1F9CF0" d="M194.2 253.76c-6.11 2.94-13.4 1.7-18.2-3.1 5.9 5.91 16 1.73 16-6.62V11.96c0-8.35-10.1-12.53-16-6.63 4.8-4.79 12.09-6.03 18.2-3.1l52.74 25.36c5.54 2.67 9.07 8.27 9.07 14.42v197.33c0 6.15-3.53 11.75-9.07 14.42z"/></svg></a>
<a href="ssh://<%= req.session.user %>@<%= site.externalIp %>:<%= r.sshPort %>" target="_blank" rel="noopener noreferrer" title="Open SSH in terminal" aria-label="Open SSH terminal for container <%= r.hostname %>" class="ms-2"><i class="bi bi-terminal"></i></a>
<a href="vscode://vscode-remote/ssh-remote+<%= req.session.user %>@<%= r.sshHost %>:<%= r.sshPort %>/" target="_blank" rel="noopener noreferrer" title="Open in VS Code" aria-label="Open SSH in VS Code for container <%= r.hostname %>" class="ms-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256" aria-hidden="true" style="vertical-align: -0.125em;"><path fill="#0065A9" d="M246.94 27.64l-52.75-25.4c-6.1-2.94-13.4-1.7-18.2 3.1L3.33 162.77c-4.64 4.24-4.64 11.55.01 15.78l14.1 12.82c3.8 3.46 9.53 3.71 13.62.61L239 34.23c6.98-5.3 17-.32 17 8.44v-.61c0-6.15-3.52-11.75-9.06-14.42z"/><path fill="#007ACC" d="M246.94 228.36l-52.75 25.4c-6.1 2.94-13.4 1.7-18.2-3.09L3.33 93.23c-4.64-4.24-4.64-11.55.01-15.78l14.1-12.82c3.8-3.46 9.53-3.71 13.62-.61L239 221.77c6.98 5.3 17 .32 17-8.44v.61c0 6.15-3.52 11.75-9.06 14.42z"/><path fill="#1F9CF0" d="M194.2 253.76c-6.11 2.94-13.4 1.7-18.2-3.1 5.9 5.91 16 1.73 16-6.62V11.96c0-8.35-10.1-12.53-16-6.63 4.8-4.79 12.09-6.03 18.2-3.1l52.74 25.36c5.54 2.67 9.07 8.27 9.07 14.42v197.33c0 6.15-3.53 11.75-9.07 14.42z"/></svg></a>
<a href="ssh://<%= req.session.user %>@<%= r.sshHost %>:<%= r.sshPort %>" target="_blank" rel="noopener noreferrer" title="Open SSH in terminal" aria-label="Open SSH terminal for container <%= r.hostname %>" class="ms-2"><i class="bi bi-terminal"></i></a>
<% } else { %>
<%= r.sshPort || '-' %>
<% } %>
Expand Down
Loading