From f4fc3b87770a508b5cc36e01f747ed7fce901db2 Mon Sep 17 00:00:00 2001 From: Jared Scheib Date: Wed, 14 Jun 2017 14:01:38 -0700 Subject: [PATCH] Make /status the default home page --- ui/src/CheckSources.js | 4 +++- ui/src/shared/constants/index.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/src/CheckSources.js b/ui/src/CheckSources.js index d671c1a2a4..6d2cfd03cc 100644 --- a/ui/src/CheckSources.js +++ b/ui/src/CheckSources.js @@ -9,6 +9,8 @@ import {showDatabases} from 'shared/apis/metaQuery' import {loadSources as loadSourcesAction} from 'shared/actions/sources' import {errorThrown as errorThrownAction} from 'shared/actions/errors' +import {DEFAULT_HOME_PAGE} from 'shared/constants' + // Acts as a 'router middleware'. The main `App` component is responsible for // getting the list of data nodes, but not every page requires them to function. // Routes that do require data nodes can be nested under this component. @@ -88,7 +90,7 @@ const CheckSources = React.createClass({ if (!isFetching && !source) { const rest = location.pathname.match(/\/sources\/\d+?\/(.+)/) - const restString = rest === null ? 'hosts' : rest[1] + const restString = rest === null ? DEFAULT_HOME_PAGE : rest[1] if (defaultSource) { return router.push(`/sources/${defaultSource.id}/${restString}`) diff --git a/ui/src/shared/constants/index.js b/ui/src/shared/constants/index.js index ac31413347..d5135e842a 100644 --- a/ui/src/shared/constants/index.js +++ b/ui/src/shared/constants/index.js @@ -399,3 +399,5 @@ export const AUTOREFRESH_DEFAULT = 15000 // in milliseconds export const GRAPH = 'graph' export const TABLE = 'table' export const VIS_VIEWS = [GRAPH, TABLE] + +export const DEFAULT_HOME_PAGE = 'status'