Compare commits

...

2 Commits

5 changed files with 14 additions and 10 deletions

View File

@ -4,12 +4,16 @@ import appConfig from './config';
const { object, node } = PropTypes; const { object, node } = PropTypes;
appConfig.loadConfig();
// Connect to the SSE Gateway and allocate a // Connect to the SSE Gateway and allocate a
// dispatcher for blueocean. // dispatcher for blueocean.
// TODO: We might want to move this code to a local SSE util module. // TODO: We might want to move this code to a local SSE util module.
sse.connect('jenkins_blueocean'); sse.connect({
clientId: 'jenkins_blueocean',
appConfig.loadConfig(); onConnect: undefined,
jenkinsUrl: `${appConfig.getJenkinsRootURL()}/`, // FIXME sse should not require this to end with a /
});
class Dashboard extends Component { class Dashboard extends Component {

View File

@ -38,7 +38,7 @@ export default class Pipelines extends Component {
]; ];
const baseUrl = config.getRootURL(); const baseUrl = config.getRootURL();
const newJobUrl = `${baseUrl}view/All/newJob`; const newJobUrl = `${baseUrl}/view/All/newJob`;
return ( return (
<Page> <Page>

View File

@ -6,10 +6,10 @@
export default class Config { export default class Config {
constructor(options) { constructor(options) {
this._appURLBase = options.appURLBase || "/"; this._appURLBase = options.appURLBase || '';
this._rootURL = options.rootURL || "/"; this._rootURL = options.rootURL || '';
this._resourceURL = options.resourceURL || "/"; this._resourceURL = options.resourceURL || '';
this._adjunctURL = options.adjunctURL || "/"; this._adjunctURL = options.adjunctURL || '';
} }
getAppURLBase() { getAppURLBase() {

View File

@ -84,7 +84,7 @@ function startApp(routes, stores) {
let appURLBase = headElement.getAttribute("data-appurl"); let appURLBase = headElement.getAttribute("data-appurl");
if (typeof appURLBase !== "string") { if (typeof appURLBase !== "string") {
appURLBase = "/"; appURLBase = '';
} }
// Look up some other URLs we may need // Look up some other URLs we may need

View File

@ -9,7 +9,7 @@
<j:invokeStatic var="j" className="jenkins.model.Jenkins" method="getActiveInstance"/> <j:invokeStatic var="j" className="jenkins.model.Jenkins" method="getActiveInstance"/>
${h.initPageVariables(context)} ${h.initPageVariables(context)}
<head data-rooturl="${rootURL}/" <head data-rooturl="${rootURL}"
data-resurl="${resURL}" data-resurl="${resURL}"
data-appurl="${rootURL}/${it.urlBase}" data-appurl="${rootURL}/${it.urlBase}"
data-adjuncturl="${rootURL}/${j.getAdjuncts('').rootURL}" data-adjuncturl="${rootURL}/${j.getAdjuncts('').rootURL}"