mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Add KibanaThemeProvider to stack monitoring UI (#139839)
* Add KibanaThemeProvider to stack monitoring UI Fixes https://github.com/elastic/kibana/issues/138211 * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
0f09b0eea3
commit
946466fa3c
1 changed files with 216 additions and 214 deletions
|
@ -10,7 +10,7 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import { Route, Switch, Redirect, Router } from 'react-router-dom';
|
||||
import { Observable } from 'rxjs';
|
||||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import { LoadingPage } from './pages/loading_page';
|
||||
import { LicensePage } from './pages/license_page';
|
||||
import { ClusterOverview } from './pages/cluster/overview_page';
|
||||
|
@ -100,247 +100,249 @@ const MonitoringApp: React.FC<{
|
|||
|
||||
return (
|
||||
<KibanaContextProvider services={{ ...core, ...plugins }}>
|
||||
<ExternalConfigContext.Provider value={externalConfig}>
|
||||
<GlobalStateProvider
|
||||
query={plugins.data.query}
|
||||
toasts={core.notifications.toasts}
|
||||
uiSettings={core.uiSettings}
|
||||
>
|
||||
<HeaderActionMenuContext.Provider value={{ setHeaderActionMenu, theme$ }}>
|
||||
<MonitoringTimeContainer>
|
||||
<BreadcrumbContainer history={history}>
|
||||
<Router history={history}>
|
||||
<Switch>
|
||||
<Route path="/access-denied" component={AccessDeniedPage} />
|
||||
<Route path="/no-data" component={NoDataPage} />
|
||||
<Route path="/loading" component={LoadingPage} />
|
||||
<RouteInit
|
||||
path="/license"
|
||||
component={LicensePage}
|
||||
codePaths={['all']}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/home"
|
||||
component={ClusterListing}
|
||||
codePaths={['all']}
|
||||
fetchAllClusters={true}
|
||||
unsetGlobalState={true}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/overview"
|
||||
component={ClusterOverview}
|
||||
codePaths={['all']}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<KibanaThemeProvider theme$={core.theme.theme$}>
|
||||
<ExternalConfigContext.Provider value={externalConfig}>
|
||||
<GlobalStateProvider
|
||||
query={plugins.data.query}
|
||||
toasts={core.notifications.toasts}
|
||||
uiSettings={core.uiSettings}
|
||||
>
|
||||
<HeaderActionMenuContext.Provider value={{ setHeaderActionMenu, theme$ }}>
|
||||
<MonitoringTimeContainer>
|
||||
<BreadcrumbContainer history={history}>
|
||||
<Router history={history}>
|
||||
<Switch>
|
||||
<Route path="/access-denied" component={AccessDeniedPage} />
|
||||
<Route path="/no-data" component={NoDataPage} />
|
||||
<Route path="/loading" component={LoadingPage} />
|
||||
<RouteInit
|
||||
path="/license"
|
||||
component={LicensePage}
|
||||
codePaths={['all']}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/home"
|
||||
component={ClusterListing}
|
||||
codePaths={['all']}
|
||||
fetchAllClusters={true}
|
||||
unsetGlobalState={true}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/overview"
|
||||
component={ClusterOverview}
|
||||
codePaths={['all']}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
{/* ElasticSearch Views */}
|
||||
<RouteInit
|
||||
path="/elasticsearch/ml_jobs"
|
||||
component={ElasticsearchMLJobsPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
{/* ElasticSearch Views */}
|
||||
<RouteInit
|
||||
path="/elasticsearch/ml_jobs"
|
||||
component={ElasticsearchMLJobsPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch/ccr/:index/shard/:shardId"
|
||||
component={ElasticsearchCcrShardPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch/ccr/:index/shard/:shardId"
|
||||
component={ElasticsearchCcrShardPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch/ccr"
|
||||
component={ElasticsearchCcrPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch/ccr"
|
||||
component={ElasticsearchCcrPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch/indices/:index/advanced"
|
||||
component={ElasticsearchIndexAdvancedPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch/indices/:index/advanced"
|
||||
component={ElasticsearchIndexAdvancedPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch/indices/:index"
|
||||
component={ElasticsearchIndexPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch/indices/:index"
|
||||
component={ElasticsearchIndexPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch/indices"
|
||||
component={ElasticsearchIndicesPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch/indices"
|
||||
component={ElasticsearchIndicesPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch/nodes/:node/advanced"
|
||||
component={ElasticsearchNodeAdvancedPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch/nodes/:node/advanced"
|
||||
component={ElasticsearchNodeAdvancedPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch/nodes/:node"
|
||||
component={ElasticsearchNodePage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch/nodes/:node"
|
||||
component={ElasticsearchNodePage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch/nodes"
|
||||
component={ElasticsearchNodesPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch/nodes"
|
||||
component={ElasticsearchNodesPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/elasticsearch"
|
||||
component={ElasticsearchOverviewPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/elasticsearch"
|
||||
component={ElasticsearchOverviewPage}
|
||||
codePaths={[CODE_PATH_ELASTICSEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
{/* Kibana Views */}
|
||||
<RouteInit
|
||||
path="/kibana/instances/:instance"
|
||||
component={KibanaInstancePage}
|
||||
codePaths={[CODE_PATH_KIBANA]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
{/* Kibana Views */}
|
||||
<RouteInit
|
||||
path="/kibana/instances/:instance"
|
||||
component={KibanaInstancePage}
|
||||
codePaths={[CODE_PATH_KIBANA]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/kibana/instances"
|
||||
component={KibanaInstancesPage}
|
||||
codePaths={[CODE_PATH_KIBANA]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/kibana/instances"
|
||||
component={KibanaInstancesPage}
|
||||
codePaths={[CODE_PATH_KIBANA]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/kibana"
|
||||
component={KibanaOverviewPage}
|
||||
codePaths={[CODE_PATH_KIBANA]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/kibana"
|
||||
component={KibanaOverviewPage}
|
||||
codePaths={[CODE_PATH_KIBANA]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
{/* Beats Views */}
|
||||
<RouteInit
|
||||
path="/beats/beat/:instance"
|
||||
component={BeatsInstancePage}
|
||||
codePaths={[CODE_PATH_BEATS]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
{/* Beats Views */}
|
||||
<RouteInit
|
||||
path="/beats/beat/:instance"
|
||||
component={BeatsInstancePage}
|
||||
codePaths={[CODE_PATH_BEATS]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/beats/beats"
|
||||
component={BeatsInstancesPage}
|
||||
codePaths={[CODE_PATH_BEATS]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/beats/beats"
|
||||
component={BeatsInstancesPage}
|
||||
codePaths={[CODE_PATH_BEATS]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/beats"
|
||||
component={BeatsOverviewPage}
|
||||
codePaths={[CODE_PATH_BEATS]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/beats"
|
||||
component={BeatsOverviewPage}
|
||||
codePaths={[CODE_PATH_BEATS]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
{/* Logstash Routes */}
|
||||
<RouteInit
|
||||
path="/logstash/nodes"
|
||||
component={LogStashNodesPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
{/* Logstash Routes */}
|
||||
<RouteInit
|
||||
path="/logstash/nodes"
|
||||
component={LogStashNodesPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/logstash/node/:uuid/advanced"
|
||||
component={LogStashNodeAdvancedPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/logstash/node/:uuid/advanced"
|
||||
component={LogStashNodeAdvancedPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/logstash/node/:uuid/pipelines"
|
||||
component={LogStashNodePipelinesPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/logstash/node/:uuid/pipelines"
|
||||
component={LogStashNodePipelinesPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/logstash/node/:uuid"
|
||||
component={LogStashNodePage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/logstash/node/:uuid"
|
||||
component={LogStashNodePage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/logstash/pipelines/:id/:hash?"
|
||||
component={LogStashPipelinePage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/logstash/pipelines/:id/:hash?"
|
||||
component={LogStashPipelinePage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/logstash/pipelines"
|
||||
component={LogStashPipelinesPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/logstash/pipelines"
|
||||
component={LogStashPipelinesPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/logstash"
|
||||
component={LogStashOverviewPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/logstash"
|
||||
component={LogStashOverviewPage}
|
||||
codePaths={[CODE_PATH_LOGSTASH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
{/* APM Views */}
|
||||
<RouteInit
|
||||
path="/apm/instances/:instance"
|
||||
component={ApmInstancePage}
|
||||
codePaths={[CODE_PATH_APM]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
{/* APM Views */}
|
||||
<RouteInit
|
||||
path="/apm/instances/:instance"
|
||||
component={ApmInstancePage}
|
||||
codePaths={[CODE_PATH_APM]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/apm/instances"
|
||||
component={ApmInstancesPage}
|
||||
codePaths={[CODE_PATH_APM]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/apm/instances"
|
||||
component={ApmInstancesPage}
|
||||
codePaths={[CODE_PATH_APM]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/apm"
|
||||
component={ApmOverviewPage}
|
||||
codePaths={[CODE_PATH_APM]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/apm"
|
||||
component={ApmOverviewPage}
|
||||
codePaths={[CODE_PATH_APM]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<RouteInit
|
||||
path="/enterprise_search"
|
||||
component={EntSearchOverviewPage}
|
||||
codePaths={[CODE_PATH_ENTERPRISE_SEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
<RouteInit
|
||||
path="/enterprise_search"
|
||||
component={EntSearchOverviewPage}
|
||||
codePaths={[CODE_PATH_ENTERPRISE_SEARCH]}
|
||||
fetchAllClusters={false}
|
||||
/>
|
||||
|
||||
<Redirect
|
||||
to={{
|
||||
pathname: '/loading',
|
||||
search: history.location.search,
|
||||
}}
|
||||
/>
|
||||
</Switch>
|
||||
</Router>
|
||||
</BreadcrumbContainer>
|
||||
</MonitoringTimeContainer>
|
||||
</HeaderActionMenuContext.Provider>
|
||||
</GlobalStateProvider>
|
||||
</ExternalConfigContext.Provider>
|
||||
<Redirect
|
||||
to={{
|
||||
pathname: '/loading',
|
||||
search: history.location.search,
|
||||
}}
|
||||
/>
|
||||
</Switch>
|
||||
</Router>
|
||||
</BreadcrumbContainer>
|
||||
</MonitoringTimeContainer>
|
||||
</HeaderActionMenuContext.Provider>
|
||||
</GlobalStateProvider>
|
||||
</ExternalConfigContext.Provider>
|
||||
</KibanaThemeProvider>
|
||||
</KibanaContextProvider>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue