-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.html.erb
More file actions
30 lines (22 loc) · 934 Bytes
/
view.html.erb
File metadata and controls
30 lines (22 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<% if service == 'jupyter' %>
<form action="/node/<%= host %>/<%= port %>/login" method="post" target="_blank">
<input type="hidden" name="password" value="<%= password %>">
<button class="btn btn-primary" type="submit">
<i class="fa fa-cogs"></i> Connect to JupyterLab
</button>
</form>
<% elsif service == 'code-server' %>
<%
require 'digest'
# Generate form id, based on host and port
form_id = Digest::SHA1.hexdigest("--" + host.to_s + "--" + port.to_s + "--")
# Generate SHA256 digest of code-server Password
cookieValue = Digest::SHA256.hexdigest(password)
%>
<form id="<%= form_id %>" action="/rnode/<%= host %>/<%= port %>/login?to" method="post" target="_blank">
<input type="hidden" name="password" value="<%= password %>">
<button class="btn btn-primary" type="submit">
<i class="fa fa-cogs"></i> Connect to VS Code
</button>
</form>
<% end %>