-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.html.erb
36 lines (32 loc) · 1.47 KB
/
view.html.erb
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
30
31
32
33
34
35
<%-
base_url = "/node/#{host}/#{port}"
login_url = "#{base_url}/login"
next_url = "#{base_url}/#{jupyter_api}"
full_url = "#{login_url}?next=#{CGI.escape(next_url)}"
form_id = "juypyter_form#{login_url.gsub('/', '_')}"
jupyter_connection_info = OodAppkit.files.url(path: staged_root).to_s
%>
<!-- Zoom on iPad doesn't like opening in a new tab. It won't foward the form parameters. -->
<script type="text/javascript">
function changeTarget() {
const agent = navigator.userAgent;
if (/Mozilla\/5\.0 \(Macintosh; Intel Mac OS X \d+_\d+_\d+\) AppleWebKit\/\d+\.\d+\.\d+ \(KHTML, like Gecko\)/.test(agent)) {
document.getElementById("<%= form_id %>").target = "_self";
}
}
</script>
<form id="<%= form_id %>" action="<%= full_url %>" method="post" target="_blank" onsubmit="changeTarget()" >
<input type="hidden" name="password" value="<%= password %>">
<button class="btn btn-primary" type="submit">
<i class="fa fa-cogs"></i> Connect to Jupyter
</button>
</form>
<p>
To connect to this jupyter server in your own local VSCode application, please open a terminal on your local computer and run the following command: <code><%= ssh_tunnel %></code>
<p>
<p>
Once you have done this, go to "Select Another Kernel", then select "Existing Jupyter Server", and paste following URL: <code><%= connection_string %></code>
<p>
<p>
At this point, you will be asked for a password, which you can find here: <a href="<%= jupyter_connection_info %>">connection.yml</a>
<p>