-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathview.html.erb
More file actions
62 lines (53 loc) · 1.83 KB
/
Copy pathview.html.erb
File metadata and controls
62 lines (53 loc) · 1.83 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<%
webaccess_url = "/secure-rnode/#{host}/#{port}/"
enabled_client = "web" # Supported values: web, native, both
# Authentication method for ThinLinc Web Access. Pick one:
# "oidc" - OIDC via a provider configured in ThinLinc (requires ThinLinc >= 4.21)
# "manual" - User enters credentials at the ThinLinc login prompt
auth_method = "manual"
# When auth_method is "oidc": the provider name matching the
# [/webaccess/oidc/<provider>] section configured in ThinLinc's webaccess.hconf
# on the compute nodes.
oidc_provider = "keycloak"
%>
<% if enabled_client == "web" || enabled_client == "both" %>
<button
type="button"
class="btn btn-primary"
onclick="connect_<%= job_id %>();">
<i class="fa fa-sign-in"></i>
Connect using the browser
</button>
<script type="text/javascript">
function connect_<%= job_id %>() {
<% if auth_method == "oidc" %>
window.open("<%= webaccess_url %>?oidc=<%= oidc_provider %>", "_blank");
<% else %>
window.open("<%= webaccess_url %>", "_blank");
<% end %>
}
</script>
<% end %>
<% if enabled_client == "native" || enabled_client == "both" %>
<button
type="button"
class="btn btn-primary"
onclick="download_<%= job_id %>();">
<i class="fa fa-sign-in"></i>
Connect using the native client
</button>
<script type="text/javascript">
function download_<%= job_id %>() {
const oodConfigElement = document.getElementById("ood_config");
const rootPath = oodConfigElement.dataset.rootPath;
const fullPath = `${rootPath}files/fs<%= client_path %>`
const link = document.createElement('a');
link.href = fullPath;
link.download = `<%= job_id %>.tlclient`;
link.style.display = 'none';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
</script>
<% end %>