Merge pull request #4658 from w33ble/fix/redirect-links

Root path hash redirect
This commit is contained in:
Spencer 2015-08-13 09:15:31 -07:00
commit 00afa44c4b
3 changed files with 14 additions and 3 deletions

View file

@ -85,7 +85,10 @@ module.exports = function (kbnServer, server, config) {
path: '/',
method: 'GET',
handler: function (req, reply) {
reply.redirect(getDefaultRoute(kbnServer));
return reply.view('rootRedirect', {
hashRoute: '/app/kibana',
defaultRoute: getDefaultRoute(kbnServer),
});
}
});

View file

@ -16,7 +16,6 @@ module.exports = async function (kbnServer, server, config) {
}
}
let path = [];
let initialize = async id => {
let plugin = enabledPlugins[id];
@ -27,7 +26,6 @@ module.exports = async function (kbnServer, server, config) {
path.push(id);
for (let reqId of plugin.requiredIds) {
if (!enabledPlugins[reqId]) {
if (plugins.byId[reqId]) {

View file

@ -0,0 +1,10 @@
script.
var hashRoute = '#{hashRoute}';
var defaultRoute = '#{defaultRoute}';
var hash = window.location.hash;
if (hash.length) {
window.location = hashRoute + hash;
} else {
window.location = defaultRoute;
}