Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/plugins/webhooks/iframe/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def main(trans, webhook, params):
url = getattr(trans.app.config, "center_panel_url", None)
if not url:
return {}
return {
"src": url,
"title": getattr(trans.app.config, "center_panel_title", ""),
"height": getattr(trans.app.config, "center_panel_height", 1000),
}
5 changes: 5 additions & 0 deletions config/plugins/webhooks/iframe/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id: iframe
type:
- tool
- workflow
activate: true
28 changes: 28 additions & 0 deletions config/plugins/webhooks/iframe/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(function () {
var galaxyRoot = typeof Galaxy !== "undefined" ? Galaxy.root : "/";
var container = document.getElementById("iframe");
if (!container) return;

fetch(galaxyRoot + "api/webhooks/iframe/data")
.then(function (response) {
return response.json();
})
.then(function (data) {
if (!data || !data.src) return;
var title = data.title || "";
var height = data.height || 1000;
var header = title
? '<div id="iframe-header"><div id="iframe-name">' + title + "</div></div>"
: "";
container.innerHTML =
header +
'<iframe id="webhook-iframe" src="' +
data.src +
'" style="width:100%; height:' +
height +
'px; border:none;"></iframe>';
})
.catch(function (e) {
console.error("Galaxy iframe webhook error:", e);
});
)();
16 changes: 16 additions & 0 deletions config/plugins/webhooks/iframe/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#iframe {
border: 1px solid #adb5bd;
border-radius: 3px;
overflow: hidden;
margin-top: 10px;
}

#iframe-header {
background: #343a40;
padding: 10px 15px;
}

#iframe-name {
color: #fff;
font-size: 14px;
}
38 changes: 38 additions & 0 deletions doc/source/admin/galaxy_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,44 @@
:Type: str


~~~~~~~~~~~~~~~~~~
``center_panel_url``
~~~~~~~~~~~~~~~~~~

:Description:
URL to display in an iframe panel shown to the user after a tool or
workflow job is submitted. When set, the iframe webhook plugin
included with Galaxy will embed this URL below the standard
job-submission confirmation message. Leave unset to disable the
panel. Requires the iframe webhook to be active (enabled by default
when webhooks_dir includes config/plugins/webhooks).
:Default: ``None``
:Type: str


~~~~~~~~~~~~~~~~~~~~
``center_panel_title``
~~~~~~~~~~~~~~~~~~~~

:Description:
Title displayed in the header bar of the center panel iframe. Only
used when center_panel_url is set. Leave unset to omit the header
bar entirely.
:Default: ``None``
:Type: str


~~~~~~~~~~~~~~~~~~~~~
``center_panel_height``
~~~~~~~~~~~~~~~~~~~~~

:Description:
Height in pixels of the center panel iframe. Only used when
center_panel_url is set.
:Default: ``1000``
:Type: int


~~~~~~~~~~~~~~~~~~~~~~~~~
``job_working_directory``
~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
32 changes: 32 additions & 0 deletions doc/source/admin/special_topics/webhooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,38 @@ webhook folders as you like as a comma separated list.
Webhooks supports one additional layer of activating/deactivating by changing the ``activate: true`` in each config of each webhook.


Built-in center panel iframe
----------------------------

Galaxy ships with an ``iframe`` webhook (``config/plugins/webhooks/iframe/``) that displays a configurable web page
in a panel below the standard job-submission confirmation message after a user runs a tool or workflow.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather we don't do that and redirect the user directly to the job (or implicit job collection) info page ? It seems like for this particular usecase were better off keeping this external ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mvdbeek I'm not sure I understand your comment. The user gets redirected to the job info page. This webhook adds something under the green box, like this:

Image

@mvdbeek mvdbeek Jun 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the job info page, you get to the job info page by by clicking on "Here is the link to the Job". We should just do that and remove the /success route. We never had a job info page when the success page was added and staying on the tool form had users submit jobs multiple times.


The webhook is active by default whenever ``webhooks_dir`` includes ``config/plugins/webhooks`` (the default value).
It renders nothing unless ``center_panel_url`` is set in ``galaxy.yml``, so there is no visible effect for
installations that do not configure it.

To enable the center panel, add the following to your ``galaxy.yml``:

.. code-block:: yaml

galaxy:
center_panel_url: https://example.org/your-help-or-news-page
center_panel_title: Resources & Help # optional — omit to hide the header bar
center_panel_height: 800 # optional — defaults to 1000 px

Configuration options
^^^^^^^^^^^^^^^^^^^^^

``center_panel_url``
URL to embed in the iframe. Leave unset (the default) to disable the panel entirely.

``center_panel_title``
Text shown in a dark header bar above the iframe. If omitted, no header bar is rendered.

``center_panel_height``
Height of the iframe in pixels. Defaults to ``1000``.


Entry points
------------

Expand Down
16 changes: 16 additions & 0 deletions lib/galaxy/config/sample/galaxy.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,22 @@ galaxy:
# webhooks used to test the webhook framework.
#webhooks_dir: config/plugins/webhooks

# URL to display in an iframe panel shown to the user after a tool or
# workflow job is submitted. When set, the iframe webhook plugin included
# with Galaxy will embed this URL below the standard job-submission
# confirmation message. Leave unset to disable the panel. Requires the
# iframe webhook to be active (enabled by default when webhooks_dir
# includes config/plugins/webhooks).
#center_panel_url: null

# Title displayed in the header bar of the center panel iframe. Only
# used when center_panel_url is set. Leave unset to omit the header bar.
#center_panel_title: null

# Height in pixels of the center panel iframe. Only used when
# center_panel_url is set.
#center_panel_height: 1000

# Each job is given a unique empty directory as its current working
# directory. This option defines in what parent directory those
# directories will be created.
Expand Down
27 changes: 27 additions & 0 deletions lib/galaxy/config/schemas/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,33 @@ mapping:
comma-separated list. Add test/functional/webhooks to this list to include the demo
webhooks used to test the webhook framework.

center_panel_url:
type: str
default: null
required: false
desc: |
URL to display in an iframe panel shown to the user after a tool or workflow
job is submitted. When set, the iframe webhook plugin included with Galaxy will
embed this URL below the standard job-submission confirmation message. Leave
unset to disable the panel. Requires the iframe webhook to be active (enabled
by default when webhooks_dir includes config/plugins/webhooks).

center_panel_title:
type: str
default: null
required: false
desc: |
Title displayed in the header bar of the center panel iframe. Only used when
center_panel_url is set. Leave unset to omit the header bar entirely.

center_panel_height:
type: int
default: 1000
required: false
desc: |
Height in pixels of the center panel iframe. Only used when center_panel_url
is set.

job_working_directory:
type: str
default: jobs_directory
Expand Down
8 changes: 8 additions & 0 deletions lib/galaxy_test/api/test_webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test_get_all(self):
"trans_object",
"xkcd",
"gtn",
"iframe",
]:
assert expected_id in ids

Expand All @@ -27,6 +28,13 @@ def test_get_data(self):
self._assert_status_code_is(response, 200)
self._assert_has_keys(response.json(), "username")

def test_iframe_data_unconfigured(self):
# When center_panel_url is not set the endpoint must return an empty
# dict so the client-side script can silently skip rendering.
response = self._get("webhooks/iframe/data")
self._assert_status_code_is(response, 200)
assert response.json() == {}

def _assert_are_webhooks(self, response):
response_list = response.json()
assert isinstance(response_list, list)
Expand Down
1 change: 1 addition & 0 deletions test/functional/webhooks/iframe
Loading