diff --git a/x-pack/legacy/plugins/infra/common/inventory_models/host/detail_page.tsx b/x-pack/legacy/plugins/infra/common/inventory_models/host/detail_page.tsx deleted file mode 100644 index 7ff69af87aa3a..0000000000000 --- a/x-pack/legacy/plugins/infra/common/inventory_models/host/detail_page.tsx +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import React, { FunctionComponent, useEffect, useMemo } from 'react'; -import { EuiSideNav, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { InfraMetricData } from '../../../public/graphql/types'; -import { Section } from '../../../public/pages/metrics/components/section'; -import { SubSection } from '../../../public/pages/metrics/components/sub_section'; -import { NavItem, SideNavContext } from '../../../public/pages/metrics/lib/side_nav_context'; - -interface VisSectionProps { - metric?: InfraMetricData; -} - -const VisSection: FunctionComponent = ({ metric }) => { - if (metric) { - return ( -
-
VISUALIZATION GOES HERE
-
- ); - } - return
Gauges without Metric (you should never see this)
; -}; - -interface WithMetricsDataProps { - source: string; - ids: string[]; - children: (props: LayoutProps) => React.ReactElement; -} - -const WithMetricsData = ({ ids, children }: WithMetricsDataProps) => { - if (!children) { - return null; - } - - // eslint-disable-next-line no-console - useEffect(() => console.log('Fetching', ids), [ids]); - - const metrics = useMemo(() => { - return ids.map(m => ({ id: m, series: [] })); - }, [ids]) as InfraMetricData[]; - - return children({ metrics }); -}; - -interface LayoutProps { - metrics: InfraMetricData[]; -} - -interface MetricsLayout { - requiredMetrics: string[]; - Layout: FunctionComponent; -} - -const Aws: MetricsLayout = { - requiredMetrics: ['awsOverview', 'awsCpuUsage'], - Layout: ({ metrics }) => ( -
- - - - - - -
- ), -}; -const Nginx: MetricsLayout = { - requiredMetrics: ['nginxOverview'], - Layout: ({ metrics }) => ( -
- - - -
- ), -}; - -export const Host: MetricsLayout = { - requiredMetrics: [ - 'hostSystemOverview', - 'hostSystemCPU', - ...Aws.requiredMetrics, - ...Nginx.requiredMetrics, - ], - Layout: ({ metrics }) => ( - -
- - - - - - -
- - -
- ), -}; - -export const DetailPage: FunctionComponent = () => { - const [sideNav, setSideNav] = React.useState([]); - - const addNavItem = React.useCallback( - (item: NavItem) => { - if (!sideNav.some(n => n.id === item.id)) { - setSideNav([item, ...sideNav]); - } - }, - [sideNav] - ); - - return ( -
- - - - - - - - {({ metrics }) => } - - - - -
- ); -};