mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Provide Galaxy.config var to indicate whether onload webhooks should kick off; use it. Fixes shed/reports use of them.
This commit is contained in:
@@ -204,20 +204,23 @@ $(document).ready(() => {
|
||||
}
|
||||
|
||||
function onloadWebhooks() {
|
||||
if (Galaxy.root !== undefined) {
|
||||
// Load all webhooks with the type 'onload'
|
||||
$.getJSON(`${Galaxy.root}api/webhooks/onload/all`, webhooks => {
|
||||
_.each(webhooks, webhook => {
|
||||
if (webhook.activate && webhook.script) {
|
||||
$("<script/>", { type: "text/javascript" })
|
||||
.text(webhook.script)
|
||||
.appendTo("head");
|
||||
$("<style/>", { type: "text/css" })
|
||||
.text(webhook.styles)
|
||||
.appendTo("head");
|
||||
}
|
||||
// Wait until Galaxy.config is loaded.
|
||||
if (Galaxy.config) {
|
||||
if (Galaxy.config.enable_webhooks){
|
||||
// Load all webhooks with the type 'onload'
|
||||
$.getJSON(`${Galaxy.root}api/webhooks/onload/all`, webhooks => {
|
||||
_.each(webhooks, webhook => {
|
||||
if (webhook.activate && webhook.script) {
|
||||
$("<script/>", { type: "text/javascript" })
|
||||
.text(webhook.script)
|
||||
.appendTo("head");
|
||||
$("<style/>", { type: "text/css" })
|
||||
.text(webhook.styles)
|
||||
.appendTo("head");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setTimeout(onloadWebhooks, 100);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ class RootController(controller.JSAppLauncher, UsesAnnotations):
|
||||
config = {
|
||||
'active_view' : 'analysis',
|
||||
'enable_cloud_launch' : app.config.get_bool('enable_cloud_launch', False),
|
||||
'enable_webhooks' : True if app.webhooks_registry.webhooks else False,
|
||||
# TODO: next two should be redundant - why can't we build one from the other?
|
||||
'toolbox' : app.toolbox.to_dict(trans, in_panel=False),
|
||||
'toolbox_in_panel' : app.toolbox.to_dict(trans),
|
||||
|
||||
Reference in New Issue
Block a user