Skip to content

Commit

Permalink
[Stack Monitoring ] Migrate kibana instances page to react (elastic#1…
Browse files Browse the repository at this point in the history
…13874)

* kibana instances page component

* kibana instances route

* extract SetupModeProps to remove duplication
# Conflicts:
#	x-pack/plugins/monitoring/public/application/index.tsx
#	x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx
#	x-pack/plugins/monitoring/public/application/setup_mode/setup_mode_renderer.d.ts
  • Loading branch information
klacabane committed Oct 13, 2021
1 parent f4bbb37 commit 5d1a827
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 46 deletions.
8 changes: 8 additions & 0 deletions x-pack/plugins/monitoring/public/application/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
import { BeatsInstancePage } from './pages/beats/instance';
import { ApmOverviewPage, ApmInstancesPage, ApmInstancePage } from './pages/apm';
import { KibanaOverviewPage } from './pages/kibana/overview';
import { KibanaInstancesPage } from './pages/kibana/instances';
import { ElasticsearchNodesPage } from './pages/elasticsearch/nodes_page';
import { ElasticsearchIndicesPage } from './pages/elasticsearch/indices_page';
import { ElasticsearchIndexPage } from './pages/elasticsearch/index_page';
Expand Down Expand Up @@ -186,6 +187,13 @@ const MonitoringApp: React.FC<{
/>

{/* Kibana Views */}
<RouteInit
path="/kibana/instances"
component={KibanaInstancesPage}
codePaths={[CODE_PATH_KIBANA]}
fetchAllClusters={false}
/>

<RouteInit
path="/kibana"
component={KibanaOverviewPage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ import { useTable } from '../../hooks/use_table';
import { BeatsTemplate } from './beats_template';
// @ts-ignore
import { Listing } from '../../../components/beats/listing';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';

interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const BeatsInstancesPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
const { services } = useKibana<{ data: any }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { GlobalStateContext } from '../../contexts/global_state_context';
import { TabMenuItem } from '../page_template';
import { Overview } from '../../../components/cluster/overview';
import { ExternalConfigContext } from '../../contexts/external_config_context';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
import { fetchClusters } from '../../../lib/fetch_clusters';
Expand All @@ -23,11 +23,6 @@ import { fetchAlerts } from '../../../lib/fetch_alerts';
import { EnableAlertsModal } from '../../../alerts/enable_alerts_modal';

const CODE_PATHS = [CODE_PATH_ALL];
interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const ClusterOverview: React.FC<{}> = () => {
const state = useContext(GlobalStateContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ import { useParams } from 'react-router-dom';
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public';
import { GlobalStateContext } from '../../contexts/global_state_context';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useCharts } from '../../hooks/use_charts';
import { ItemTemplate } from './item_template';
// @ts-ignore
import { AdvancedIndex } from '../../../components/elasticsearch/index/advanced';

interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}
import { AlertsByName } from '../../../alerts/types';
import { fetchAlerts } from '../../../lib/fetch_alerts';
import { RULE_LARGE_SHARD_SIZE } from '../../../../common/constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { GlobalStateContext } from '../../contexts/global_state_context';
// @ts-ignore
import { IndexReact } from '../../../components/elasticsearch/index/index_react';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useCharts } from '../../hooks/use_charts';
import { ItemTemplate } from './item_template';
Expand All @@ -25,11 +25,6 @@ import { AlertsByName } from '../../../alerts/types';
import { fetchAlerts } from '../../../lib/fetch_alerts';
import { RULE_LARGE_SHARD_SIZE } from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const ElasticsearchIndexPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'
import { GlobalStateContext } from '../../contexts/global_state_context';
import { ElasticsearchIndices } from '../../../components/elasticsearch';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useTable } from '../../hooks/use_table';
import { useLocalStorage } from '../../hooks/use_local_storage';
Expand All @@ -21,12 +21,6 @@ import { fetchAlerts } from '../../../lib/fetch_alerts';
import { RULE_LARGE_SHARD_SIZE } from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';

interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const ElasticsearchIndicesPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'
import { GlobalStateContext } from '../../contexts/global_state_context';
import { NodeReact } from '../../../components/elasticsearch';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useLocalStorage } from '../../hooks/use_local_storage';
import { useCharts } from '../../hooks/use_charts';
Expand All @@ -31,11 +31,6 @@ import {
RULE_MEMORY_USAGE,
} from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const ElasticsearchNodePage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { GlobalStateContext } from '../../contexts/global_state_context';
import { ExternalConfigContext } from '../../contexts/external_config_context';
import { ElasticsearchNodes } from '../../../components/elasticsearch';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useTable } from '../../hooks/use_table';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
Expand All @@ -28,12 +28,6 @@ import {
RULE_MISSING_MONITORING_DATA,
} from '../../../../common/constants';

interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const ElasticsearchNodesPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
const { showCgroupMetricsElasticsearch } = useContext(ExternalConfigContext);
Expand Down

0 comments on commit 5d1a827

Please sign in to comment.