-
Notifications
You must be signed in to change notification settings - Fork 924
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4585 from galaxyproject/improve-my.gtn
Improve my.galaxy.training
- Loading branch information
Showing
9 changed files
with
262 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: Importing and Launching a Dockstore workflow | ||
area: workflows | ||
box_type: hands_on | ||
layout: faq | ||
contributors: [hexylena] | ||
--- | ||
|
||
{% if include.dockstore_id %} | ||
|
||
<div class="show-when-galaxy-proxy-active"> | ||
|
||
Click here to run <span class="workflow" data-workflow="https://dockstore.org/api/ga4gh/trs/v2/tools/#{{ include.dockstore_id }}"><strong>{{ include.title }}</strong> <i class="fas fa-share-alt" aria-hidden="true"></i></span> | ||
|
||
</div> | ||
|
||
<div class="hide-when-galaxy-proxy-active"> | ||
|
||
Click here to run <a href="https://my.galaxy.training/?path=/workflows/trs_import%3ftrs_server=dockstore.org%26run_form=true%26trs_id=%2523{{ include.dockstore_id }}"><strong>{{ include.title }}</strong> <i class="fas fa-share-alt" aria-hidden="true"></i></a> | ||
|
||
|
||
</div> | ||
|
||
{% else %} | ||
|
||
1. Go to [Workflow → Import](https://my.galaxy.training/?path=/workflows/import) in your Galaxy | ||
2. Switch tabs to TRS ID | ||
3. Ensure the TRS server is set to "dockstore.org" | ||
4. Provide your workflow hub ID | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: Importing and Launching a WorkflowHub.eu Workflow | ||
area: workflows | ||
box_type: hands_on | ||
layout: faq | ||
contributors: [hexylena] | ||
--- | ||
|
||
{% if include.wfhub_id %} | ||
|
||
<div class="show-when-galaxy-proxy-active"> | ||
|
||
Click here to run <span class="workflow" data-workflow="https://workflowhub.eu/ga4gh/trs/v2/tools/{{ include.wfhub_id }}/versions/{{ include.wfhub_version | default: 1 }}"><strong>{{ include.title }}</strong> <i class="fas fa-share-alt" aria-hidden="true"></i></span> | ||
|
||
</div> | ||
|
||
<div class="hide-when-galaxy-proxy-active"> | ||
|
||
Click here to run <a href="https://my.galaxy.training/?path=/workflows/trs_import%3ftrs_server=workflowhub.eu%26run_form=true%26trs_id={{ include.wfhub_id }}%26trs_version={{ include.wfhub_version | default: 1}}"><strong>{{ include.title }}</strong> <i class="fas fa-share-alt" aria-hidden="true"></i></a> | ||
|
||
</div> | ||
|
||
{% else %} | ||
|
||
1. Go to [Workflow → Import](https://my.galaxy.training/?path=/workflows/import) in your Galaxy | ||
2. Switch tabs to TRS ID | ||
3. Ensure the TRS server is set to "workflowhub.eu" | ||
4. Provide your workflow hub ID | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: What is my.galaxy.training | ||
area: introduction | ||
layout: faq | ||
box_type: tip | ||
contributors: [hexylena] | ||
--- | ||
|
||
The [`my.galaxy.training`](https://my.galaxy.training) is part of the GTN. We found that often need to direct our learners to specific pages within Galaxy, but which Galaxy? Should we add three links, one for each of the current bigger UseGalaxy.* servers? That would be really annoying for users who aren't using one of those servers. | ||
|
||
E.g. how do we link to [/user](https://my.galaxy.training/?path=/user), the user preferences page which is available on every Galaxy Instance? This service handles that in a private and user-friendly manner. | ||
|
||
## (Learners) How to Use It | ||
|
||
When you access a my.galaxy.training page you'll be prompted to select a server, simply select one and you're good to go! | ||
|
||
If you want to enter a private Galaxy instance, perhaps, behind a firewall, that's also an option! Just select the 'other' option and provide your domain. Since the redirection happens in your browser with no servers involved, as long as *you* can access the server, you'll get redirected to the right location. | ||
|
||
## (Tutorial Authors) How to use it | ||
|
||
If you want to link to a specific page within Galaxy, simple construct the URL: `https://my.galaxy.training/?path=/user` where everything after `?path` is the location they should be redirected to on Galaxy. That example link will eventually redirect the learner to something like `https://usegalaxy.eu/user`. | ||
|
||
## Technical Background | ||
|
||
So we took inspiration from [Home Assistant](https://my.home-assistant.io/) which had the same problem, how to redirect users to pages on their own servers. The `my.galaxy.training` service is a very simple static page which looks in the user's [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) for their preferred server. | ||
If it's not set, the user can click one of the common domains, and be redirected. When they access another link, they'll be prompted to use a button that remembers which server they chose. | ||
|
||
## Data Privacy | ||
|
||
Any domain selected is not tracked nor communicated to any third party. Your preferred server is stored in your browser, and never transmitted to the GTN. That's why we use localStorage instead of cookies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: "Tutorial Feature: Easier launching of WorkflowHub & Dockstore Workflows" | ||
contributions: | ||
authorship: [hexylena] | ||
funding: [by-covid] | ||
tags: [feature update, gtn, tutorials] | ||
layout: news | ||
--- | ||
|
||
While most GTN tutorials include their associated workflow directly in the GTN, some may wish to write a tutorial about running workflows from WorkflowHub, e.g. leveraging the [IWC workflow collection](https://workflowhub.eu/projects/33). | ||
|
||
We've added two snippets which make that easier than ever: | ||
|
||
{% snippet faqs/galaxy/workflows_run_wfh.md title="gromacs-mmgbsa/main" wfhub_id="248" %} | ||
|
||
And one for Dockstore: | ||
|
||
{% snippet faqs/galaxy/workflows_run_ds.md title="My Cool Workflow" dockstore_id="workflow/github.com/jmchilton/galaxy-workflow-dockstore-example-1/mycoolworkflow" %} | ||
|
||
You can read more about these snippets and how to use them yourself in your tutorials in the [GTN Contribution Guide section on Workflows]({% link topics/contributing/tutorials/create-new-tutorial-content/tutorial.md %}#workflows). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,124 @@ | ||
--- | ||
layout: base | ||
title: My Galaxy instance | ||
title: My Galaxy Instance | ||
description: This page will redirect you to a specific page in your preferred Galaxy instance. | ||
--- | ||
|
||
<h1> My Galaxy Instance </h1> | ||
<div class="row justify-content-md-center"> | ||
<div class="card col-md-6"> | ||
<div class="card-body"> | ||
<h1 class="h5 card-title" style="margin-top: 0">My Galaxy Training</h1> | ||
|
||
<p> | ||
My Galaxy Instance allows the GTN to link you to specific pages in your preferred Galaxy | ||
</p> | ||
<p class="card-text"> | ||
This page lets us redirect you to specific pages in your preferred Galaxy. See the <a href="{% link faqs/gtn/my-galaxy-training.md %}">FAQ</a> for more information. | ||
</p> | ||
|
||
<a id="clickthrough" class="btn btn-primary" href="https://usegalaxy.eu">Go to your server</a> | ||
<input id="domain" type="text" placeholder="usegalaxy.eu" /> | ||
<button id="edit" class="btn btn-secondary">Edit</button> | ||
<button id="save" class="btn btn-primary">Save</button> | ||
<p class="card-text"> | ||
You are being redirected to <code id="path"></code> | ||
</p> | ||
|
||
<h2 class="preferred-set">Go!</h2> | ||
<p class="preferred-set card-text"> | ||
<a id="preferred" class="btn btn-primary" href="https://usegalaxy.eu">Go to https://usegalaxy.eu</a> | ||
</p> | ||
|
||
<details id="set-preferred" open> | ||
<summary>Select your Preferred Galaxy Server</summary> | ||
<p class="card-text"> | ||
<a class="clickthrough btn btn-primary" href="https://usegalaxy.eu">UseGalaxy.eu 🌍🇪🇺</a> | ||
<a class="clickthrough btn btn-primary" href="https://usegalaxy.org">UseGalaxy.org 🌎🇺🇸</a> | ||
<a class="clickthrough btn btn-primary" href="https://usegalaxy.org.au">UseGalaxy.org.au 🌏</a> | ||
<button id="set-other" type="button" class="btn btn-secondary" data-toggle="modal" data-target="#exampleModal">Other</button> | ||
</p> | ||
</details> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="modal" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="exampleModalLabel">Set Custom Server</h5> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<input id="domain" type="text" placeholder="usegalaxy.eu" /> | ||
<b>Note</b>: This URL is only stored in your browser. | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> | ||
<button id="save-other" type="button" class="btn btn-primary">Save changes</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.preferred-set { | ||
display: none; | ||
text-align: center; | ||
} | ||
</style> | ||
|
||
<p> | ||
Configure My Galaxy Instance by entering your preferred Galaxy Server (e.g. usegalaxy.eu or usegalaxy.org.au) and clicking Save. | ||
</p> | ||
<p> | ||
<b>Note</b>: This URL is only stored in your browser. | ||
</p> | ||
|
||
<script> | ||
// Without jquery we wait for the page to load | ||
document.addEventListener("DOMContentLoaded", function(event) { | ||
// Get the path from the URL parameter named 'path' | ||
let params = new URLSearchParams(window.location.search); | ||
let path = params.get('path') || '/'; | ||
var url = localStorage.getItem('gxy-url'); | ||
|
||
function setUrl(url, path) { | ||
$('#clickthrough').attr('href', 'https://' + url + path); | ||
$("#clickthrough").text(`Go to your https://${url}${path}`); | ||
$('#clickthrough').show(); | ||
$('#domain').hide(); | ||
$('#domain').val(url); | ||
$('#edit').show(); | ||
$('#save').hide(); | ||
} | ||
if (url) { | ||
setUrl(url, path); | ||
} else { | ||
$('#edit').hide(); | ||
$('#clickthrough').hide(); | ||
} | ||
|
||
$('#save').click(function() { | ||
var url = $('#domain').val(); | ||
localStorage.setItem('gxy-url', url); | ||
setUrl(url, path); | ||
let path = params.get('path') || '/'; | ||
var preferred_server = localStorage.getItem('gxy-url'); | ||
|
||
document.getElementById('path').innerHTML = path; | ||
|
||
function showPreferred(server_domain) { | ||
// Show the preferred server buttons | ||
document.querySelectorAll('.preferred-set').forEach(function(el) { | ||
el.style.display = 'block'; | ||
}); | ||
// Collapse the details box | ||
document.getElementById('set-preferred').open = false; | ||
document.getElementById('preferred').innerHTML = 'Go to ' + server_domain; | ||
document.getElementById('preferred').href = server_domain + path; | ||
} | ||
// If no preferred server is set | ||
if (preferred_server === null) { | ||
// Dialog is open by default. | ||
} else { | ||
showPreferred(preferred_server); | ||
} | ||
|
||
document.querySelectorAll('.clickthrough').forEach(function(el) { | ||
el.addEventListener('click', function(event) { | ||
// Don't follow the link | ||
var href = $(this).attr('href'); | ||
event.preventDefault(); | ||
console.log(href); | ||
// Set the url | ||
localStorage.setItem('gxy-url', href); | ||
// Redirect | ||
window.location.href = href + path; | ||
}); | ||
$('#edit').click(function() { | ||
$('#clickthrough').hide(); | ||
$('#domain').show(); | ||
$('#domain').val(url); | ||
$('#edit').hide(); | ||
$('#save').show(); | ||
}); | ||
|
||
// They're bootstrap modals, and this is the only modal interaction, so we have | ||
// to wait for BS+JQ to be available. | ||
document.addEventListener("DOMContentLoaded", function(event) { | ||
document.getElementById('save-other').addEventListener('click', function(event) { | ||
// Set the url | ||
var domain = document.getElementById('domain').value; | ||
if (domain === '') { | ||
alert('Please enter a domain'); | ||
return; | ||
} | ||
if (!domain.startsWith('http')) { | ||
domain = 'https://' + domain; | ||
} | ||
localStorage.setItem('gxy-url', domain); | ||
showPreferred(domain); | ||
|
||
//Close | ||
$('#exampleModal').modal('hide'); | ||
}); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters