Fix (per-domain) favicon url

This commit is contained in:
mvdbeek
2022-01-05 14:06:12 +01:00
parent 9c4c4ee0b7
commit c9aa48ea25
4 changed files with 12 additions and 6 deletions
+9 -3
View File
@@ -2,6 +2,7 @@ import $ from "jquery";
import Scratchbook from "layout/scratchbook";
import QuotaMeter from "mvc/user/user-quotameter";
import { getGalaxyInstance } from "app";
import { getAppRoot } from "onload/loadConfig";
import Masthead from "../components/Masthead/Masthead";
import { mountVueComponent } from "../utils/mountVueComponent";
@@ -42,16 +43,21 @@ export class MastheadState {
}
}
function staticUrlToPrefixed(appRoot, url) {
return url?.startsWith("/static/") ? `${appRoot}${url}` : url;
}
export function mountMasthead(el, options, mastheadState) {
const appRoot = getAppRoot();
return mountVueComponent(Masthead)(
{
el: el,
mastheadState: mastheadState,
displayGalaxyBrand: options.display_galaxy_brand,
brand: options.brand,
brandLink: options.logo_url,
brandImage: options.logo_src,
brandImageSecondary: options.logo_src_secondary,
brandLink: staticUrlToPrefixed(appRoot, options.logo_url),
brandImage: staticUrlToPrefixed(appRoot, options.logo_src),
brandImageSecondary: staticUrlToPrefixed(appRoot, options.logo_src_secondary),
menuOptions: options,
},
el
+1 -1
View File
@@ -1957,7 +1957,7 @@
:Description:
The brand image source.
:Default: ``static/favicon.png``
:Default: ``/static/favicon.png``
:Type: str
+1 -1
View File
@@ -1024,7 +1024,7 @@ galaxy:
#logo_url: /
# The brand image source.
#logo_src: static/favicon.png
#logo_src: /static/favicon.png
# The custom brand image source.
#logo_src_secondary: null
+1 -1
View File
@@ -1417,7 +1417,7 @@ mapping:
logo_src:
type: str
default: static/favicon.png
default: /static/favicon.png
required: false
per_host: true
desc: |