diff --git a/ui-v2/lib/startup/index.js b/ui-v2/lib/startup/index.js index 732c95f396ec..9d62e7f7e8a3 100644 --- a/ui-v2/lib/startup/index.js +++ b/ui-v2/lib/startup/index.js @@ -3,92 +3,17 @@ module.exports = { name: 'startup', contentFor: function(type, config) { - const enterprise = config.CONSUL_BINARY_TYPE !== 'oss' && config.CONSUL_BINARY_TYPE !== ''; - // .ContentPath here is populated via the go binary - const rootURL = config.environment === 'production' ? '{{.ContentPath}}' : config.rootURL; - const appName = config.modulePrefix; + const vars = { + appName: config.modulePrefix, + environment: config.environment, + rootURL: config.environment === 'production' ? '{{.ContentPath}}' : rootURL, + config: config, + }; switch (type) { case 'head': - return [ - ``, - ``, - ` - - - - `, - ].join('\n'); + return require('./templates/head.html.js')(vars); case 'body': - return [ - ` - - `, - ``, - ` - - - - - `, - ].join('\n'); + return require('./templates/body.html.js')(vars); case 'root-class': return 'ember-loading'; } diff --git a/ui-v2/lib/startup/templates/body.html.js b/ui-v2/lib/startup/templates/body.html.js new file mode 100644 index 000000000000..36cc1b63cbe5 --- /dev/null +++ b/ui-v2/lib/startup/templates/body.html.js @@ -0,0 +1,42 @@ +module.exports = ({ appName, environment, rootURL, config }) => ` + + + + ${environment === 'test' ? `` : ``} + + + + ${environment === 'test' ? `` : ``} +`; diff --git a/ui-v2/lib/startup/templates/head.html.js b/ui-v2/lib/startup/templates/head.html.js new file mode 100644 index 000000000000..37d2bdab1b6c --- /dev/null +++ b/ui-v2/lib/startup/templates/head.html.js @@ -0,0 +1,37 @@ +module.exports = ({ appName, environment, rootURL, config }) => ` + + + + + + + ${ + environment === 'test' ? `` : `` + } +`; diff --git a/ui-v2/tests/index.html b/ui-v2/tests/index.html index bb4c9e254e38..9fccbf208809 100644 --- a/ui-v2/tests/index.html +++ b/ui-v2/tests/index.html @@ -6,14 +6,9 @@