-
Notifications
You must be signed in to change notification settings - Fork 6
/
view.html.erb
47 lines (42 loc) · 2.02 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
36
37
38
39
40
41
42
43
44
45
46
47
<%- extend ERB::Util -%>
Some helpful resources on using Apache Spark in a Jupyter notebook:
- <a href="https://spark.apache.org/examples.html" target="_blank">Apache Spark Examples</a>
(some work is required to translate the Python 2 examples here to Python 3)
- <a href="https://github.com/jadianes/spark-py-notebooks/blob/master/nb2-rdd-basics/nb2-rdd-basics.ipynb" target="_blank">RDD Basics</a>
<script type="text/javascript">
(function () {
let date = new Date();
date.setTime(date.getTime() + (7*24*60*60*1000));
let expires = `expires="${date.toUTCString()}"`;
let cookiePath = 'path=/rnode/<%= spark_master_host %>/<%= spark_master_webui_port %>';
let cookie = `spark_ui_auth_token=<%= spark_ui_auth_token %>;${cookiePath};${expires};samesite=strict;secure;`;
document.cookie = cookie;
})();
</script>
<div class="row">
<div class="col-md-<%= tutorials_root.blank? ? "6" : "4" %>">
<form action="/node/<%= host %>/<%= port %>/login" method="post" target="_blank">
<input type="hidden" name="password" value="<%= password %>">
<button class="btn btn-primary" type="submit" style="margin-top: 6px;">
<i class="fa fa-cogs"></i> Connect to Jupyter
</button>
</form>
</div>
<%- if spark_version.to_s >= '3.4.1' -%>
<div class="col-md-<%= tutorials_root.blank? ? "6" : "4" %>">
<a class="btn btn-primary" target="_blank" href="/rnode/<%= spark_master_host %>/<%= spark_master_webui_port %>/">
<i class="fa fa-star"></i> Connect to Spark WebUI
</a>
</div>
<%- end-%>
<%- unless tutorials_root.blank? -%>
<div class="ml-3 col-xs-6">
<form action="/node/<%= host %>/<%= port %>/login?next=<%= url_encode "/node/#{host}/#{port}/tree#{tutorials_root}" %>" method="post" target="_blank" class="pull-right">
<input type="hidden" name="password" value="<%= password %>">
<button class="btn btn-primary" type="submit" style="margin-top: 6px;">
<i class="fa fa-folder"></i> Open Tutorials Folder
</button>
</form>
</div>
<%- end -%>
</div>