diff --git a/x-pack/plugins/fleet/kibana.json b/x-pack/plugins/fleet/kibana.json index 4a4019e3e9e47f..ca1407be2008a1 100644 --- a/x-pack/plugins/fleet/kibana.json +++ b/x-pack/plugins/fleet/kibana.json @@ -4,14 +4,8 @@ "server": true, "ui": true, "configPath": ["xpack", "fleet"], - "requiredPlugins": ["licensing", "data", "encryptedSavedObjects"], - "optionalPlugins": [ - "security", - "features", - "cloud", - "usageCollection", - "home" - ], + "requiredPlugins": ["licensing", "data", "encryptedSavedObjects", "navigation"], + "optionalPlugins": ["security", "features", "cloud", "usageCollection", "home"], "extraPublicDirs": ["common"], "requiredBundles": ["kibanaReact", "esUiShared", "home", "infra", "kibanaUtils"] } diff --git a/x-pack/plugins/fleet/public/applications/fleet/app.tsx b/x-pack/plugins/fleet/public/applications/fleet/app.tsx index 1398e121c68700..1072a6b66419eb 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/app.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/app.tsx @@ -7,7 +7,7 @@ import React, { memo, useEffect, useState } from 'react'; import type { AppMountParameters } from 'kibana/public'; -import { EuiCode, EuiEmptyPrompt, EuiErrorBoundary, EuiPanel } from '@elastic/eui'; +import { EuiCode, EuiEmptyPrompt, EuiErrorBoundary, EuiPanel, EuiPortal } from '@elastic/eui'; import type { History } from 'history'; import { createHashHistory } from 'history'; import { Router, Redirect, Route, Switch } from 'react-router-dom'; @@ -16,11 +16,13 @@ import { i18n } from '@kbn/i18n'; import styled from 'styled-components'; import useObservable from 'react-use/lib/useObservable'; +import type { TopNavMenuData } from 'src/plugins/navigation/public'; + import type { FleetConfigType, FleetStartServices } from '../../plugin'; import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; import { EuiThemeProvider } from '../../../../../../src/plugins/kibana_react/common'; -import { PackageInstallProvider } from '../integrations/hooks'; +import { PackageInstallProvider, useUrlModal } from '../integrations/hooks'; import { ConfigContext, @@ -30,25 +32,25 @@ import { sendGetPermissionsCheck, sendSetup, useBreadcrumbs, - useConfig, useStartServices, UIExtensionsContext, } from './hooks'; -import { Error, Loading } from './components'; +import { Error, Loading, SettingFlyout } from './components'; import type { UIExtensionsStorage } from './types'; import { FLEET_ROUTING_PATHS } from './constants'; import { DefaultLayout, WithoutHeaderLayout } from './layouts'; import { AgentPolicyApp } from './sections/agent_policy'; import { DataStreamApp } from './sections/data_stream'; -import { FleetApp } from './sections/agents'; -import { IngestManagerOverview } from './sections/overview'; -import { ProtectedRoute } from './index'; +import { AgentsApp } from './sections/agents'; import { CreatePackagePolicyPage } from './sections/agent_policy/create_package_policy_page'; +import { EnrollmentTokenListPage } from './sections/agents/enrollment_token_list_page'; + +const FEEDBACK_URL = 'https://ela.st/fleet-feedback'; const ErrorLayout = ({ children }: { children: JSX.Element }) => ( - + {children} @@ -233,37 +235,82 @@ export const FleetAppContext: React.FC<{ } ); -export const AppRoutes = memo(() => { - const { agents } = useConfig(); +const FleetTopNav = memo( + ({ setHeaderActionMenu }: { setHeaderActionMenu: AppMountParameters['setHeaderActionMenu'] }) => { + const { getModalHref } = useUrlModal(); + const services = useStartServices(); - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}); + const { TopNavMenu } = services.navigation.ui; + + const topNavConfig: TopNavMenuData[] = [ + { + label: i18n.translate('xpack.fleet.appNavigation.sendFeedbackButton', { + defaultMessage: 'Send Feedback', + }), + iconType: 'popout', + run: () => window.open(FEEDBACK_URL), + }, + + { + label: i18n.translate('xpack.fleet.appNavigation.settingsButton', { + defaultMessage: 'Fleet settings', + }), + iconType: 'gear', + run: () => (window.location.href = getModalHref('settings')), + }, + ]; + return ( + + ); + } +); + +export const AppRoutes = memo( + ({ setHeaderActionMenu }: { setHeaderActionMenu: AppMountParameters['setHeaderActionMenu'] }) => { + const { modal, setModal } = useUrlModal(); + + return ( + <> + + + {modal === 'settings' && ( + + { + setModal(null); + }} + /> + + )} + + + + + + + + + + + + + + + + {/* TODO: Move this route to the Integrations app */} + + + + + + + + + + ); + } +); diff --git a/x-pack/plugins/fleet/public/applications/fleet/hooks/use_breadcrumbs.tsx b/x-pack/plugins/fleet/public/applications/fleet/hooks/use_breadcrumbs.tsx index fd980475dc9194..254885ea71b1e4 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/hooks/use_breadcrumbs.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/hooks/use_breadcrumbs.tsx @@ -20,7 +20,7 @@ interface AdditionalBreadcrumbOptions { type Breadcrumb = ChromeBreadcrumb & Partial; const BASE_BREADCRUMB: Breadcrumb = { - href: pagePathGetters.overview()[1], + href: pagePathGetters.base()[1], text: i18n.translate('xpack.fleet.breadcrumbs.appTitle', { defaultMessage: 'Fleet', }), @@ -38,15 +38,6 @@ const breadcrumbGetters: { [key in Page]?: (values: DynamicPagePathValues) => Breadcrumb[]; } = { base: () => [BASE_BREADCRUMB], - overview: () => [ - BASE_BREADCRUMB, - { - text: i18n.translate('xpack.fleet.breadcrumbs.overviewPageTitle', { - defaultMessage: 'Overview', - }), - }, - ], - policies: () => [ BASE_BREADCRUMB, { @@ -122,15 +113,7 @@ const breadcrumbGetters: { }), }, ], - fleet: () => [ - BASE_BREADCRUMB, - { - text: i18n.translate('xpack.fleet.breadcrumbs.agentsPageTitle', { - defaultMessage: 'Agents', - }), - }, - ], - fleet_agent_list: () => [ + agent_list: () => [ BASE_BREADCRUMB, { text: i18n.translate('xpack.fleet.breadcrumbs.agentsPageTitle', { @@ -138,24 +121,18 @@ const breadcrumbGetters: { }), }, ], - fleet_agent_details: ({ agentHost }) => [ + agent_details: ({ agentHost }) => [ BASE_BREADCRUMB, { - href: pagePathGetters.fleet()[1], + href: pagePathGetters.agent_list({})[1], text: i18n.translate('xpack.fleet.breadcrumbs.agentsPageTitle', { defaultMessage: 'Agents', }), }, { text: agentHost }, ], - fleet_enrollment_tokens: () => [ + enrollment_tokens: () => [ BASE_BREADCRUMB, - { - href: pagePathGetters.fleet()[1], - text: i18n.translate('xpack.fleet.breadcrumbs.agentsPageTitle', { - defaultMessage: 'Agents', - }), - }, { text: i18n.translate('xpack.fleet.breadcrumbs.enrollmentTokensPageTitle', { defaultMessage: 'Enrollment tokens', diff --git a/x-pack/plugins/fleet/public/applications/fleet/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/index.tsx index 7d31fb31b36a43..8942c13a0a69db 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/index.tsx @@ -37,6 +37,7 @@ interface FleetAppProps { history: AppMountParameters['history']; kibanaVersion: string; extensions: UIExtensionsStorage; + setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; } const FleetApp = ({ basepath, @@ -45,6 +46,7 @@ const FleetApp = ({ history, kibanaVersion, extensions, + setHeaderActionMenu, }: FleetAppProps) => { return ( - + ); @@ -64,7 +66,7 @@ const FleetApp = ({ export function renderApp( startServices: FleetStartServices, - { element, appBasePath, history }: AppMountParameters, + { element, appBasePath, history, setHeaderActionMenu }: AppMountParameters, config: FleetConfigType, kibanaVersion: string, extensions: UIExtensionsStorage @@ -77,6 +79,7 @@ export function renderApp( history={history} kibanaVersion={kibanaVersion} extensions={extensions} + setHeaderActionMenu={setHeaderActionMenu} />, element ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/layouts/default.tsx b/x-pack/plugins/fleet/public/applications/fleet/layouts/default.tsx index d707fd162ae020..f312ff374d792c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/layouts/default.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/layouts/default.tsx @@ -6,145 +6,98 @@ */ import React from 'react'; -import styled from 'styled-components'; -import { - EuiTabs, - EuiTab, - EuiFlexGroup, - EuiFlexItem, - EuiButtonEmpty, - EuiPortal, -} from '@elastic/eui'; +import { EuiText, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import type { Section } from '../sections'; -import { SettingFlyout } from '../components'; -import { useLink, useConfig, useUrlModal } from '../hooks'; +import { useLink, useConfig } from '../hooks'; +import { WithHeaderLayout } from '../../../layouts'; interface Props { - showNav?: boolean; - showSettings?: boolean; section?: Section; children?: React.ReactNode; } -const Container = styled.div` - min-height: calc( - 100vh - ${(props) => parseFloat(props.theme.eui.euiHeaderHeightCompensation) * 2}px - ); - background: ${(props) => props.theme.eui.euiColorEmptyShade}; - display: flex; - flex-direction: column; -`; - -const Wrapper = styled.div` - display: flex; - flex-direction: column; - flex: 1; -`; - -const Nav = styled.nav` - background: ${(props) => props.theme.eui.euiColorEmptyShade}; - border-bottom: ${(props) => props.theme.eui.euiBorderThin}; - padding: ${(props) => - `${props.theme.eui.euiSize} ${props.theme.eui.euiSizeL} ${props.theme.eui.euiSize} ${props.theme.eui.euiSizeL}`}; - .euiTabs { - padding-left: 3px; - margin-left: -3px; - } -`; - -export const DefaultLayout: React.FunctionComponent = ({ - showNav = true, - showSettings = true, - section, - children, -}) => { +export const DefaultLayout: React.FunctionComponent = ({ section, children }) => { const { getHref } = useLink(); const { agents } = useConfig(); - const { modal, setModal, getModalHref } = useUrlModal(); return ( - <> - {modal === 'settings' && ( - - { - setModal(null); - }} - /> - - )} - - - - {showNav ? ( - - ) : null} - {children} - - - + + + + + +

+ +

+
+
+
+
+ + +

+ +

+
+
+ + } + tabs={[ + { + name: ( + + ), + isSelected: section === 'agents', + href: getHref('agent_list'), + disabled: !agents?.enabled, + 'data-test-subj': 'fleet-agents-tab', + }, + { + name: ( + + ), + isSelected: section === 'agent_policies', + href: getHref('policies_list'), + 'data-test-subj': 'fleet-agent-policies-tab', + }, + { + name: ( + + ), + isSelected: section === 'enrollment_tokens', + href: getHref('enrollment_tokens'), + 'data-test-subj': 'fleet-enrollment-tokens-tab', + }, + { + name: ( + + ), + isSelected: section === 'data_streams', + href: getHref('data_streams'), + 'data-test-subj': 'fleet-datastreams-tab', + }, + ]} + > + {children} +
); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/index.tsx index c0ec811ce2bcd5..d8db44e28e4af9 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/index.tsx @@ -11,6 +11,8 @@ import { HashRouter as Router, Switch, Route } from 'react-router-dom'; import { FLEET_ROUTING_PATHS } from '../../constants'; import { useBreadcrumbs } from '../../hooks'; +import { DefaultLayout } from '../../layouts'; + import { AgentPolicyListPage } from './list_page'; import { AgentPolicyDetailsPage } from './details_page'; import { CreatePackagePolicyPage } from './create_package_policy_page'; @@ -32,7 +34,9 @@ export const AgentPolicyApp: React.FunctionComponent = () => { - + + + diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx index 48b9118d115666..10859e32f00805 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx @@ -9,7 +9,6 @@ import React, { useCallback, useMemo, useState } from 'react'; import type { EuiTableActionsColumnType, EuiTableFieldDataColumnType } from '@elastic/eui'; import { EuiSpacer, - EuiText, EuiFlexGroup, EuiFlexItem, EuiButton, @@ -25,7 +24,6 @@ import { useHistory } from 'react-router-dom'; import type { AgentPolicy } from '../../../types'; import { AGENT_POLICY_SAVED_OBJECT_TYPE } from '../../../constants'; -import { WithHeaderLayout } from '../../../layouts'; import { useCapabilities, useGetAgentPolicies, @@ -41,37 +39,6 @@ import { LinkedAgentCount, AgentPolicyActionMenu } from '../components'; import { CreateAgentPolicyFlyout } from './components'; -const AgentPolicyListPageLayout: React.FunctionComponent = ({ children }) => ( - - - -

- -

-
-
- - -

- -

-
-
- - } - > - {children} -
-); - export const AgentPolicyListPage: React.FunctionComponent<{}> = () => { useBreadcrumbs('policies_list'); const { getPath } = useLink(); @@ -246,7 +213,7 @@ export const AgentPolicyListPage: React.FunctionComponent<{}> = () => { }; return ( - + <> {isCreateAgentPolicyFlyoutOpen ? ( { @@ -322,6 +289,6 @@ export const AgentPolicyListPage: React.FunctionComponent<{}> = () => { sorting={{ sort: sorting }} onChange={onTableChange} /> - + ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_integrations.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_integrations.tsx index 6e0206603a458e..a599d726cedefe 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_integrations.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_integrations.tsx @@ -101,7 +101,7 @@ export const AgentDetailsIntegration: React.FunctionComponent<{ })} > { () => ( - + { name: i18n.translate('xpack.fleet.agentDetails.subTabs.detailsTab', { defaultMessage: 'Agent details', }), - href: getHref('fleet_agent_details', { agentId, tabId: 'details' }), + href: getHref('agent_details', { agentId, tabId: 'details' }), isSelected: !tabId || tabId === 'details', }, { @@ -240,7 +235,7 @@ export const AgentDetailsPage: React.FunctionComponent = () => { name: i18n.translate('xpack.fleet.agentDetails.subTabs.logsTab', { defaultMessage: 'Logs', }), - href: getHref('fleet_agent_details', { agentId, tabId: 'logs' }), + href: getHref('agent_details_logs', { agentId, tabId: 'logs' }), isSelected: tabId === 'logs', }, ]; @@ -299,7 +294,7 @@ const AgentDetailsPageContent: React.FunctionComponent<{ agent: Agent; agentPolicy?: AgentPolicy; }> = ({ agent, agentPolicy }) => { - useBreadcrumbs('fleet_agent_details', { + useBreadcrumbs('agent_list', { agentHost: typeof agent.local_metadata.host === 'object' && typeof agent.local_metadata.host.hostname === 'string' @@ -309,13 +304,13 @@ const AgentDetailsPageContent: React.FunctionComponent<{ return ( { return ; }} /> { return ; }} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx index 1beaf437ceb0e9..1d7b44ceefb7c6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx @@ -7,18 +7,20 @@ import React, { useState } from 'react'; import { + EuiButton, EuiFilterButton, EuiFilterGroup, EuiFilterSelectItem, EuiFlexGroup, EuiFlexItem, EuiPopover, + EuiPortal, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import type { AgentPolicy } from '../../../../types'; -import { SearchBar } from '../../../../components'; +import { AgentEnrollmentFlyout, SearchBar } from '../../../../components'; import { AGENTS_INDEX } from '../../../../constants'; const statusFilters = [ @@ -77,6 +79,8 @@ export const SearchAndFilterBar: React.FunctionComponent<{ showUpgradeable, onShowUpgradeableChange, }) => { + const [isEnrollmentFlyoutOpen, setIsEnrollmentFlyoutOpen] = useState(false); + // Policies state for filtering const [isAgentPoliciesFilterOpen, setIsAgentPoliciesFilterOpen] = useState(false); @@ -97,6 +101,15 @@ export const SearchAndFilterBar: React.FunctionComponent<{ return ( <> + {isEnrollmentFlyoutOpen ? ( + + setIsEnrollmentFlyoutOpen(false)} + /> + + ) : null} + {/* Search and filter bar */} @@ -207,6 +220,15 @@ export const SearchAndFilterBar: React.FunctionComponent<{ + + setIsEnrollmentFlyoutOpen(true)} + > + + + diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx index 672b8718c9cbe7..431c4da3efb5b2 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx @@ -73,7 +73,7 @@ const RowActions = React.memo<{ const menuItems = [ @@ -146,7 +146,7 @@ function safeMetadata(val: any) { export const AgentListPage: React.FunctionComponent<{}> = () => { const { notifications } = useStartServices(); - useBreadcrumbs('fleet_agent_list'); + useBreadcrumbs('agent_list'); const { getHref } = useLink(); const defaultKuery: string = (useUrlParams().urlParams.kuery as string) || ''; const hasWriteCapabilites = useCapabilities().write; @@ -358,7 +358,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { defaultMessage: 'Host', }), render: (host: string, agent: Agent) => ( - + {safeMetadata(host)} ), diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/list_layout.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/list_layout.tsx deleted file mode 100644 index 67758282521b79..00000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/list_layout.tsx +++ /dev/null @@ -1,101 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiText, EuiFlexGroup, EuiFlexItem, EuiButton, EuiPortal } from '@elastic/eui'; -import type { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab'; -import { useRouteMatch } from 'react-router-dom'; - -import { FLEET_ROUTING_PATHS } from '../../../constants'; -import { WithHeaderLayout } from '../../../layouts'; -import { useCapabilities, useLink, useGetAgentPolicies } from '../../../hooks'; -import { AgentEnrollmentFlyout } from '../../../components'; - -export const ListLayout: React.FunctionComponent<{}> = ({ children }) => { - const { getHref } = useLink(); - const hasWriteCapabilites = useCapabilities().write; - - // Agent enrollment flyout state - const [isEnrollmentFlyoutOpen, setIsEnrollmentFlyoutOpen] = React.useState(false); - - const headerRightColumn = hasWriteCapabilites ? ( - - - setIsEnrollmentFlyoutOpen(true)}> - - - - - ) : undefined; - const headerLeftColumn = ( - - - -

- -

-
-
- - -

- -

-
-
-
- ); - - const agentPoliciesRequest = useGetAgentPolicies({ - page: 1, - perPage: 1000, - }); - - const agentPolicies = agentPoliciesRequest.data ? agentPoliciesRequest.data.items : []; - - const routeMatch = useRouteMatch(); - - return ( - , - isSelected: routeMatch.path === FLEET_ROUTING_PATHS.fleet_agent_list, - href: getHref('fleet_agent_list'), - }, - { - name: ( - - ), - isSelected: routeMatch.path === FLEET_ROUTING_PATHS.fleet_enrollment_tokens, - href: getHref('fleet_enrollment_tokens'), - }, - ] as unknown) as EuiTabProps[] - } - > - {isEnrollmentFlyoutOpen ? ( - - setIsEnrollmentFlyoutOpen(false)} - /> - - ) : null} - {children} - - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx index 8dc9ad33962e0d..666d0887fe5103 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx @@ -34,6 +34,7 @@ import { } from '../../../hooks'; import type { EnrollmentAPIKey, GetAgentPoliciesResponseItem } from '../../../types'; import { SearchBar } from '../../../components/search_bar'; +import { DefaultLayout } from '../../../layouts'; import { ConfirmEnrollmentTokenDelete } from './components/confirm_delete_modal'; @@ -155,7 +156,7 @@ const DeleteButton: React.FunctionComponent<{ apiKey: EnrollmentAPIKey; refresh: }; export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => { - useBreadcrumbs('fleet_enrollment_tokens'); + useBreadcrumbs('enrollment_tokens'); const [isModalOpen, setModalOpen] = useState(false); const [search, setSearch] = useState(''); const { pagination, setPagination, pageSizeOptions } = usePagination(); @@ -269,7 +270,7 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => { ]; return ( - <> + {isModalOpen && ( = () => { setPagination(newPagination); }} /> - + ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx index dcb33e7662dc45..79b19b443cca14 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { HashRouter as Router, Route, Switch, Redirect } from 'react-router-dom'; +import { HashRouter as Router, Route, Switch } from 'react-router-dom'; import { FLEET_ROUTING_PATHS } from '../../constants'; import { Loading, Error } from '../../components'; @@ -18,20 +18,18 @@ import { useCapabilities, useGetSettings, } from '../../hooks'; -import { WithoutHeaderLayout } from '../../layouts'; +import { DefaultLayout, WithoutHeaderLayout } from '../../layouts'; import { AgentListPage } from './agent_list_page'; import { FleetServerRequirementPage, MissingESRequirementsPage } from './agent_requirements_page'; import { AgentDetailsPage } from './agent_details_page'; import { NoAccessPage } from './error_pages/no_access'; -import { EnrollmentTokenListPage } from './enrollment_token_list_page'; -import { ListLayout } from './components/list_layout'; import { FleetServerUpgradeModal } from './components/fleet_server_upgrade_modal'; const REFRESH_INTERVAL_MS = 30000; -export const FleetApp: React.FunctionComponent = () => { - useBreadcrumbs('fleet'); +export const AgentsApp: React.FunctionComponent = () => { + useBreadcrumbs('agent_list'); const { agents } = useConfig(); const capabilities = useCapabilities(); @@ -110,16 +108,11 @@ export const FleetApp: React.FunctionComponent = () => { return ( - } - /> - + - - + + {fleetServerModalVisible && ( )} @@ -128,12 +121,7 @@ export const FleetApp: React.FunctionComponent = () => { ) : ( )} - - - - - - + diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/index.tsx index bc3a0229284dbd..c660d3ed297672 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/index.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { HashRouter as Router, Route, Switch } from 'react-router-dom'; import { FLEET_ROUTING_PATHS } from '../../constants'; +import { DefaultLayout } from '../../layouts'; import { DataStreamListPage } from './list_page'; @@ -17,7 +18,9 @@ export const DataStreamApp: React.FunctionComponent = () => { - + + + diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx index e805fb8f6f64ef..ac236578e6f58d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx @@ -10,7 +10,6 @@ import type { EuiTableActionsColumnType, EuiTableFieldDataColumnType } from '@el import { EuiBadge, EuiButton, - EuiText, EuiFlexGroup, EuiFlexItem, EuiEmptyPrompt, @@ -20,43 +19,11 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage, FormattedDate } from '@kbn/i18n/react'; import type { DataStream } from '../../../types'; -import { WithHeaderLayout } from '../../../layouts'; import { useGetDataStreams, useStartServices, usePagination, useBreadcrumbs } from '../../../hooks'; import { PackageIcon } from '../../../components'; import { DataStreamRowActions } from './components/data_stream_row_actions'; -const DataStreamListPageLayout: React.FunctionComponent = ({ children }) => ( - - - -

- -

-
-
- - -

- -

-
-
- - } - > - {children} -
-); - export const DataStreamListPage: React.FunctionComponent<{}> = () => { useBreadcrumbs('data_streams'); @@ -232,97 +199,95 @@ export const DataStreamListPage: React.FunctionComponent<{}> = () => { } return ( - - - ) : dataStreamsData && !dataStreamsData.data_streams.length ? ( - emptyPrompt - ) : ( + + ) : dataStreamsData && !dataStreamsData.data_streams.length ? ( + emptyPrompt + ) : ( + + ) + } + items={dataStreamsData ? dataStreamsData.data_streams : []} + itemId="index" + columns={columns} + pagination={{ + initialPageSize: pagination.pageSize, + pageSizeOptions, + }} + sorting={true} + search={{ + toolsRight: [ + resendRequest()} + > - ) - } - items={dataStreamsData ? dataStreamsData.data_streams : []} - itemId="index" - columns={columns} - pagination={{ - initialPageSize: pagination.pageSize, - pageSizeOptions, - }} - sorting={true} - search={{ - toolsRight: [ - resendRequest()} - > - - , - ], - box: { - placeholder: i18n.translate('xpack.fleet.dataStreamList.searchPlaceholderTitle', { - defaultMessage: 'Filter data streams', + , + ], + box: { + placeholder: i18n.translate('xpack.fleet.dataStreamList.searchPlaceholderTitle', { + defaultMessage: 'Filter data streams', + }), + incremental: true, + }, + filters: [ + { + type: 'field_value_selection', + field: 'dataset', + name: i18n.translate('xpack.fleet.dataStreamList.datasetColumnTitle', { + defaultMessage: 'Dataset', }), - incremental: true, + multiSelect: 'or', + operator: 'exact', + options: filterOptions.dataset, }, - filters: [ - { - type: 'field_value_selection', - field: 'dataset', - name: i18n.translate('xpack.fleet.dataStreamList.datasetColumnTitle', { - defaultMessage: 'Dataset', - }), - multiSelect: 'or', - operator: 'exact', - options: filterOptions.dataset, - }, - { - type: 'field_value_selection', - field: 'type', - name: i18n.translate('xpack.fleet.dataStreamList.typeColumnTitle', { - defaultMessage: 'Type', - }), - multiSelect: 'or', - operator: 'exact', - options: filterOptions.type, - }, - { - type: 'field_value_selection', - field: 'namespace', - name: i18n.translate('xpack.fleet.dataStreamList.namespaceColumnTitle', { - defaultMessage: 'Namespace', - }), - multiSelect: 'or', - operator: 'exact', - options: filterOptions.namespace, - }, - { - type: 'field_value_selection', - field: 'package', - name: i18n.translate('xpack.fleet.dataStreamList.integrationColumnTitle', { - defaultMessage: 'Integration', - }), - multiSelect: 'or', - operator: 'exact', - options: filterOptions.package, - }, - ], - }} - /> - + { + type: 'field_value_selection', + field: 'type', + name: i18n.translate('xpack.fleet.dataStreamList.typeColumnTitle', { + defaultMessage: 'Type', + }), + multiSelect: 'or', + operator: 'exact', + options: filterOptions.type, + }, + { + type: 'field_value_selection', + field: 'namespace', + name: i18n.translate('xpack.fleet.dataStreamList.namespaceColumnTitle', { + defaultMessage: 'Namespace', + }), + multiSelect: 'or', + operator: 'exact', + options: filterOptions.namespace, + }, + { + type: 'field_value_selection', + field: 'package', + name: i18n.translate('xpack.fleet.dataStreamList.integrationColumnTitle', { + defaultMessage: 'Integration', + }), + multiSelect: 'or', + operator: 'exact', + options: filterOptions.package, + }, + ], + }} + /> ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/index.tsx index 810334e2df9ce6..b36fbf4bb815e7 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/index.tsx @@ -5,9 +5,8 @@ * 2.0. */ -export { IngestManagerOverview } from './overview'; export { AgentPolicyApp } from './agent_policy'; export { DataStreamApp } from './data_stream'; -export { FleetApp } from './agents'; +export { AgentsApp } from './agents'; -export type Section = 'overview' | 'agent_policy' | 'fleet' | 'data_stream'; +export type Section = 'agents' | 'agent_policies' | 'enrollment_tokens' | 'data_streams'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/agent_policy_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/agent_policy_section.tsx deleted file mode 100644 index 79a4f08faa7522..00000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/agent_policy_section.tsx +++ /dev/null @@ -1,78 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import { - EuiFlexItem, - EuiI18nNumber, - EuiDescriptionListTitle, - EuiDescriptionListDescription, -} from '@elastic/eui'; - -import { SO_SEARCH_LIMIT } from '../../../constants'; -import { useLink, useGetPackagePolicies } from '../../../hooks'; -import type { AgentPolicy } from '../../../types'; -import { Loading } from '../../agents/components'; - -import { OverviewStats } from './overview_stats'; -import { OverviewPanel } from './overview_panel'; - -export const OverviewPolicySection: React.FC<{ agentPolicies: AgentPolicy[] }> = ({ - agentPolicies, -}) => { - const { getHref } = useLink(); - const packagePoliciesRequest = useGetPackagePolicies({ - page: 1, - perPage: SO_SEARCH_LIMIT, - }); - - return ( - - - - {packagePoliciesRequest.isLoading ? ( - - ) : ( - <> - - - - - - - - - - - - - - )} - - - - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/agent_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/agent_section.tsx deleted file mode 100644 index d69306969c78c3..00000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/agent_section.tsx +++ /dev/null @@ -1,87 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import { - EuiI18nNumber, - EuiDescriptionListTitle, - EuiDescriptionListDescription, - EuiFlexItem, -} from '@elastic/eui'; - -import { useLink, useGetAgentStatus } from '../../../hooks'; -import { Loading } from '../../agents/components'; - -import { OverviewPanel } from './overview_panel'; -import { OverviewStats } from './overview_stats'; - -export const OverviewAgentSection = () => { - const { getHref } = useLink(); - const agentStatusRequest = useGetAgentStatus({}); - - return ( - - - - {agentStatusRequest.isLoading ? ( - - ) : ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - )} - - - - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/datastream_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/datastream_section.tsx deleted file mode 100644 index b51be3fdd20e56..00000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/datastream_section.tsx +++ /dev/null @@ -1,99 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import { - EuiFlexItem, - EuiI18nNumber, - EuiDescriptionListTitle, - EuiDescriptionListDescription, -} from '@elastic/eui'; - -import { useLink, useGetDataStreams, useStartServices } from '../../../hooks'; -import { Loading } from '../../agents/components'; - -import { OverviewPanel } from './overview_panel'; -import { OverviewStats } from './overview_stats'; - -export const OverviewDatastreamSection: React.FC = () => { - const { getHref } = useLink(); - const datastreamRequest = useGetDataStreams(); - const { - data: { fieldFormats }, - } = useStartServices(); - - const total = datastreamRequest.data?.data_streams?.length ?? 0; - let sizeBytes = 0; - const namespaces = new Set(); - if (datastreamRequest.data) { - datastreamRequest.data.data_streams.forEach((val) => { - namespaces.add(val.namespace); - sizeBytes += val.size_in_bytes; - }); - } - - let size: string; - try { - const formatter = fieldFormats.getInstance('bytes'); - size = formatter.convert(sizeBytes); - } catch (e) { - size = `${sizeBytes}b`; - } - - return ( - - - - {datastreamRequest.isLoading ? ( - - ) : ( - <> - - - - - - - - - - - - - - - - {size} - - )} - - - - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/integration_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/integration_section.tsx deleted file mode 100644 index 5ada8e298507cb..00000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/integration_section.tsx +++ /dev/null @@ -1,88 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import { - EuiFlexItem, - EuiI18nNumber, - EuiDescriptionListTitle, - EuiDescriptionListDescription, -} from '@elastic/eui'; - -import { useLink, useGetPackages } from '../../../hooks'; -import { Loading } from '../../agents/components'; -import { installationStatuses } from '../../../../../../common/constants'; - -import { OverviewStats } from './overview_stats'; -import { OverviewPanel } from './overview_panel'; - -export const OverviewIntegrationSection: React.FC = () => { - const { getHref } = useLink(); - const packagesRequest = useGetPackages(); - const res = packagesRequest.data?.response; - const total = res?.length ?? 0; - const installed = res?.filter((p) => p.status === installationStatuses.Installed)?.length ?? 0; - const updatablePackages = - res?.filter( - (item) => 'savedObject' in item && item.version > item.savedObject.attributes.version - )?.length ?? 0; - return ( - - - - {packagesRequest.isLoading ? ( - - ) : ( - <> - - - - - - - - - - - - - - - - - - - - )} - - - - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/overview_panel.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/overview_panel.tsx deleted file mode 100644 index c402bc15f7b026..00000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/overview_panel.tsx +++ /dev/null @@ -1,74 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import styled from 'styled-components'; -import { - EuiPanel, - EuiFlexGroup, - EuiFlexItem, - EuiTitle, - EuiIconTip, - EuiButtonEmpty, -} from '@elastic/eui'; - -const StyledPanel = styled(EuiPanel).attrs((props) => ({ - paddingSize: 'm', -}))` - header { - display: flex; - align-items: center; - justify-content: space-between; - border-bottom: 1px solid ${(props) => props.theme.eui.euiColorLightShade}; - margin: -${(props) => props.theme.eui.paddingSizes.m} -${(props) => - props.theme.eui.paddingSizes.m} - ${(props) => props.theme.eui.paddingSizes.m}; - padding: ${(props) => props.theme.eui.paddingSizes.s} - ${(props) => props.theme.eui.paddingSizes.m}; - } - - h2 { - padding: ${(props) => props.theme.eui.paddingSizes.xs} 0; - } -`; - -interface OverviewPanelProps { - title: string; - tooltip: string; - linkToText: string; - linkTo: string; - children: React.ReactNode; -} - -export const OverviewPanel = ({ - title, - tooltip, - linkToText, - linkTo, - children, -}: OverviewPanelProps) => { - return ( - -
- - - -

{title}

-
-
- - - -
- - {linkToText} - -
- {children} -
- ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/overview_stats.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/overview_stats.tsx deleted file mode 100644 index acb94e4b05695d..00000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/components/overview_stats.tsx +++ /dev/null @@ -1,24 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import styled from 'styled-components'; -import { EuiDescriptionList } from '@elastic/eui'; - -export const OverviewStats = styled(EuiDescriptionList).attrs((props) => ({ - compressed: true, - textStyle: 'reverse', - type: 'column', -}))` - & > * { - margin-top: ${(props) => props.theme.eui.paddingSizes.s} !important; - - &:first-child, - &:nth-child(2) { - margin-top: 0 !important; - } - } -`; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/overview/index.tsx deleted file mode 100644 index f905fd1c89da27..00000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/overview/index.tsx +++ /dev/null @@ -1,110 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useState } from 'react'; -import { - EuiButton, - EuiBetaBadge, - EuiText, - EuiTitle, - EuiFlexGrid, - EuiFlexGroup, - EuiFlexItem, -} from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; - -import { WithHeaderLayout } from '../../layouts'; -import { useGetAgentPolicies, useBreadcrumbs } from '../../hooks'; -import { AgentEnrollmentFlyout } from '../../components'; - -import { OverviewAgentSection } from './components/agent_section'; -import { OverviewPolicySection } from './components/agent_policy_section'; -import { OverviewIntegrationSection } from './components/integration_section'; -import { OverviewDatastreamSection } from './components/datastream_section'; - -export const IngestManagerOverview: React.FunctionComponent = () => { - useBreadcrumbs('overview'); - - // Agent enrollment flyout state - const [isEnrollmentFlyoutOpen, setIsEnrollmentFlyoutOpen] = useState(false); - - // Agent policies required for enrollment flyout - const agentPoliciesRequest = useGetAgentPolicies({ - page: 1, - perPage: 1000, - }); - const agentPolicies = agentPoliciesRequest.data ? agentPoliciesRequest.data.items : []; - - return ( - - - - - -

- -

-
-
- - - - -
-
- - -

- -

-
-
- - } - rightColumn={ - - - setIsEnrollmentFlyoutOpen(true)}> - - - - - } - > - {isEnrollmentFlyoutOpen && ( - setIsEnrollmentFlyoutOpen(false)} - /> - )} - - - - - - - -
- ); -}; diff --git a/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx b/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx index 4c1ff4972b89e2..98b8e9515e689c 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React, { memo } from 'react'; -import { EuiText, EuiBetaBadge } from '@elastic/eui'; +import { EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { useLink } from '../../../hooks'; @@ -30,15 +30,6 @@ export const DefaultLayout: React.FunctionComponent = memo(({ section, ch

{' '} - } - tooltipContent={ - - } - />

} diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx index 2bb8586a11503d..e7045173f1257e 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx @@ -36,7 +36,7 @@ const DefaultMissingRequirements = () => { defaultMessage="Before enrolling agents, {link}." values={{ link: ( - + 0 ? ( diff --git a/x-pack/plugins/fleet/public/constants/page_paths.ts b/x-pack/plugins/fleet/public/constants/page_paths.ts index 3c9c0e57596151..326cfd804bd570 100644 --- a/x-pack/plugins/fleet/public/constants/page_paths.ts +++ b/x-pack/plugins/fleet/public/constants/page_paths.ts @@ -13,8 +13,7 @@ export type StaticPage = | 'integrations_installed' | 'policies' | 'policies_list' - | 'fleet' - | 'fleet_enrollment_tokens' + | 'enrollment_tokens' | 'data_streams'; export type DynamicPage = @@ -27,8 +26,9 @@ export type DynamicPage = | 'add_integration_from_policy' | 'add_integration_to_policy' | 'edit_integration' - | 'fleet_agent_list' - | 'fleet_agent_details'; + | 'agent_list' + | 'agent_details' + | 'agent_details_logs'; export type Page = StaticPage | DynamicPage; @@ -42,20 +42,21 @@ export const INTEGRATIONS_BASE_PATH = '/app/integrations'; // If routing paths are changed here, please also check to see if // `pagePathGetters()`, below, needs any modifications export const FLEET_ROUTING_PATHS = { - overview: '/', + fleet: '/:tabId', + agents: '/agents', + agent_details: '/agents/:agentId/:tabId?', + agent_details_logs: '/agents/:agentId/logs', policies: '/policies', policies_list: '/policies', policy_details: '/policies/:policyId/:tabId?', policy_details_settings: '/policies/:policyId/settings', - add_integration_from_policy: '/policies/:policyId/add-integration', - add_integration_to_policy: '/integrations/:pkgkey/add-integration/:integration?', edit_integration: '/policies/:policyId/edit-integration/:packagePolicyId', - fleet: '/fleet', - fleet_agent_list: '/fleet/agents', - fleet_agent_details: '/fleet/agents/:agentId/:tabId?', - fleet_agent_details_logs: '/fleet/agents/:agentId/logs', - fleet_enrollment_tokens: '/fleet/enrollment-tokens', + add_integration_from_policy: '/policies/:policyId/add-integration', + enrollment_tokens: '/enrollment-tokens', data_streams: '/data-streams', + + // TODO: Move this to the integrations app + add_integration_to_policy: '/integrations/:pkgkey/add-integration/:integration?', }; export const INTEGRATIONS_ROUTING_PATHS = { @@ -120,15 +121,12 @@ export const pagePathGetters: { FLEET_BASE_PATH, `/policies/${policyId}/edit-integration/${packagePolicyId}`, ], - fleet: () => [FLEET_BASE_PATH, '/fleet'], - fleet_agent_list: ({ kuery }) => [ - FLEET_BASE_PATH, - `/fleet/agents${kuery ? `?kuery=${kuery}` : ''}`, - ], - fleet_agent_details: ({ agentId, tabId, logQuery }) => [ + agent_list: ({ kuery }) => [FLEET_BASE_PATH, `/agents${kuery ? `?kuery=${kuery}` : ''}`], + agent_details: ({ agentId, tabId, logQuery }) => [ FLEET_BASE_PATH, - `/fleet/agents/${agentId}${tabId ? `/${tabId}` : ''}${logQuery ? `?_q=${logQuery}` : ''}`, + `/agents/${agentId}${tabId ? `/${tabId}` : ''}${logQuery ? `?_q=${logQuery}` : ''}`, ], - fleet_enrollment_tokens: () => [FLEET_BASE_PATH, '/fleet/enrollment-tokens'], + agent_details_logs: ({ agentId }) => [FLEET_BASE_PATH, `/agents/${agentId}/logs`], + enrollment_tokens: () => [FLEET_BASE_PATH, '/enrollment-tokens'], data_streams: () => [FLEET_BASE_PATH, '/data-streams'], }; diff --git a/x-pack/plugins/fleet/public/layouts/without_header.tsx b/x-pack/plugins/fleet/public/layouts/without_header.tsx index 220ee592d7d07a..d9481d44359c25 100644 --- a/x-pack/plugins/fleet/public/layouts/without_header.tsx +++ b/x-pack/plugins/fleet/public/layouts/without_header.tsx @@ -11,6 +11,13 @@ import { EuiPage, EuiPageBody, EuiSpacer } from '@elastic/eui'; export const Wrapper = styled.div` background-color: ${(props) => props.theme.eui.euiColorEmptyShade}; + + // HACK: Kibana introduces a div element around the app component that results in us + // being unable to stretch this Wrapper to full height via flex: 1. This calc sets + // the min height to the viewport size minus the height of the two global Kibana headers. + min-height: calc( + 100vh - ${(props) => parseFloat(props.theme.eui.euiHeaderHeightCompensation) * 2}px + ); `; export const Page = styled(EuiPage)` diff --git a/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts b/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts index 16fa34e2d0b3d7..5d1567936bcb00 100644 --- a/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts +++ b/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts @@ -8,6 +8,7 @@ import { dataPluginMock } from '../../../../../src/plugins/data/public/mocks'; import { licensingMock } from '../../../licensing/public/mocks'; import { homePluginMock } from '../../../../../src/plugins/home/public/mocks'; +import { navigationPluginMock } from '../../../../../src/plugins/navigation/public/mocks'; import type { MockedFleetSetupDeps, MockedFleetStartDeps } from './types'; @@ -22,5 +23,6 @@ export const createSetupDepsMock = (): MockedFleetSetupDeps => { export const createStartDepsMock = (): MockedFleetStartDeps => { return { data: dataPluginMock.createStartContract(), + navigation: navigationPluginMock.createStartContract(), }; }; diff --git a/x-pack/plugins/fleet/public/plugin.ts b/x-pack/plugins/fleet/public/plugin.ts index f9515ca925a4ab..7b71b210068648 100644 --- a/x-pack/plugins/fleet/public/plugin.ts +++ b/x-pack/plugins/fleet/public/plugin.ts @@ -14,6 +14,8 @@ import type { } from 'src/core/public'; import { i18n } from '@kbn/i18n'; +import type { NavigationPublicPluginStart } from 'src/plugins/navigation/public'; + import { DEFAULT_APP_CATEGORIES, AppNavLinkStatus } from '../../../../src/core/public'; import type { DataPublicPluginSetup, @@ -64,6 +66,7 @@ export interface FleetSetupDeps { export interface FleetStartDeps { data: DataPublicPluginStart; + navigation: NavigationPublicPluginStart; } export interface FleetStartServices extends CoreStart, FleetStartDeps { diff --git a/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx b/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx index 23277976968a98..23eaaeac1439d4 100644 --- a/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx +++ b/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx @@ -132,7 +132,7 @@ const ActionResultsSummaryComponent: React.FC = ({ diff --git a/x-pack/plugins/osquery/public/results/results_table.tsx b/x-pack/plugins/osquery/public/results/results_table.tsx index affc600847284c..6ff60d30d23bf7 100644 --- a/x-pack/plugins/osquery/public/results/results_table.tsx +++ b/x-pack/plugins/osquery/public/results/results_table.tsx @@ -66,7 +66,7 @@ const ResultsTableComponent: React.FC = ({ const getFleetAppUrl = useCallback( (agentId) => getUrlForApp('fleet', { - path: `#` + pagePathGetters.fleet_agent_details({ agentId }), + path: `#` + pagePathGetters.agent_details({ agentId }), }), [getUrlForApp] ); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx index 31069b1939ce98..e03427671798da 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx @@ -138,13 +138,13 @@ export const useEndpointActionItems = ( navigateAppId: 'fleet', navigateOptions: { path: `#${ - pagePathGetters.fleet_agent_details({ + pagePathGetters.agent_details({ agentId: fleetAgentId, })[1] }`, }, href: `${getUrlForApp('fleet')}#${ - pagePathGetters.fleet_agent_details({ + pagePathGetters.agent_details({ agentId: fleetAgentId, })[1] }`, @@ -162,13 +162,13 @@ export const useEndpointActionItems = ( navigateAppId: 'fleet', navigateOptions: { path: `#${ - pagePathGetters.fleet_agent_details({ + pagePathGetters.agent_details({ agentId: fleetAgentId, })[1] }/activity?openReassignFlyout=true`, }, href: `${getUrlForApp('fleet')}#${ - pagePathGetters.fleet_agent_details({ + pagePathGetters.agent_details({ agentId: fleetAgentId, })[1] }/activity?openReassignFlyout=true`, diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx index 86f1e32e751eeb..1ac5c289c87cf7 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx @@ -1108,13 +1108,13 @@ describe('when on the endpoint list page', () => { }); it('navigates to the Ingest Agent Details page', async () => { const agentDetailsLink = await renderResult.findByTestId('agentDetailsLink'); - expect(agentDetailsLink.getAttribute('href')).toEqual(`/app/fleet#/fleet/agents/${agentId}`); + expect(agentDetailsLink.getAttribute('href')).toEqual(`/app/fleet#/agents/${agentId}`); }); it('navigates to the Ingest Agent Details page with policy reassign', async () => { const agentPolicyReassignLink = await renderResult.findByTestId('agentPolicyReassignLink'); expect(agentPolicyReassignLink.getAttribute('href')).toEqual( - `/app/fleet#/fleet/agents/${agentId}/activity?openReassignFlyout=true` + `/app/fleet#/agents/${agentId}/activity?openReassignFlyout=true` ); }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx index 410afb4684cd54..d1dab3dd07a7e3 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx @@ -515,12 +515,12 @@ export const EndpointList = () => { agentsLink: ( diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.ts index c3ff143c2f4b4c..1424d5146950f1 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.ts @@ -156,9 +156,7 @@ export const isolationRequestHandler = function ( commentLines.push(`${isolate ? 'I' : 'Uni'}solate action was sent to the following Agents:`); // lines of markdown links, inside a code block - commentLines.push( - `${agentIDs.map((a) => `- [${a}](/app/fleet#/fleet/agents/${a})`).join('\n')}` - ); + commentLines.push(`${agentIDs.map((a) => `- [${a}](/app/fleet#/agents/${a})`).join('\n')}`); if (req.body.comment) { commentLines.push(`\n\nWith Comment:\n> ${req.body.comment}`); } diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index a3b04253a14c3c..40fe599cef6387 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -8835,7 +8835,6 @@ "xpack.fleet.agentList.addButton": "エージェントの追加", "xpack.fleet.agentList.agentUpgradeLabel": "アップグレードが利用可能です", "xpack.fleet.agentList.clearFiltersLinkText": "フィルターを消去", - "xpack.fleet.agentList.enrollButton": "エージェントの追加", "xpack.fleet.agentList.errorFetchingDataTitle": "エージェントの取り込みエラー", "xpack.fleet.agentList.forceUnenrollOneButton": "強制的に登録解除する", "xpack.fleet.agentList.hostColumnTitle": "ホスト", @@ -8909,8 +8908,6 @@ "xpack.fleet.agentPolicyList.noAgentPoliciesPrompt": "エージェントポリシーがありません", "xpack.fleet.agentPolicyList.noFilteredAgentPoliciesPrompt": "エージェントポリシーが見つかりません。{clearFiltersLink}", "xpack.fleet.agentPolicyList.packagePoliciesCountColumnTitle": "統合", - "xpack.fleet.agentPolicyList.pageSubtitle": "エージェントポリシーを使用すると、エージェントとエージェントが収集するデータを管理できます。", - "xpack.fleet.agentPolicyList.pageTitle": "エージェントポリシー", "xpack.fleet.agentPolicyList.reloadAgentPoliciesButtonText": "再読み込み", "xpack.fleet.agentPolicyList.updatedOnColumnTitle": "最終更新日", "xpack.fleet.agentPolicySummaryLine.hostedPolicyTooltip": "このポリシーはFleet外で管理されます。このポリシーに関連するほとんどのアクションは使用できません。", @@ -8920,8 +8917,6 @@ "xpack.fleet.agentReassignPolicy.flyoutTitle": "新しいエージェントポリシーを割り当てる", "xpack.fleet.agentReassignPolicy.selectPolicyLabel": "エージェントポリシー", "xpack.fleet.agentReassignPolicy.successSingleNotificationTitle": "エージェントポリシーが再割り当てされました", - "xpack.fleet.agents.pageSubtitle": "ポリシーの更新を管理し、任意のサイズのエージェントのグループにデプロイします。", - "xpack.fleet.agents.pageTitle": "エージェント", "xpack.fleet.agentsInitializationErrorMessageTitle": "Elasticエージェントの集中管理を初期化できません", "xpack.fleet.agentStatus.healthyLabel": "正常", "xpack.fleet.agentStatus.inactiveLabel": "非アクティブ", @@ -8930,13 +8925,10 @@ "xpack.fleet.agentStatus.updatingLabel": "更新中", "xpack.fleet.appNavigation.agentsLinkText": "エージェント", "xpack.fleet.appNavigation.dataStreamsLinkText": "データストリーム", - "xpack.fleet.appNavigation.overviewLinkText": "概要", "xpack.fleet.appNavigation.policiesLinkText": "ポリシー", "xpack.fleet.appNavigation.sendFeedbackButton": "フィードバックを送信", "xpack.fleet.appNavigation.settingsButton": "Fleet 設定", "xpack.fleet.appTitle": "Fleet", - "xpack.fleet.betaBadge.labelText": "ベータ", - "xpack.fleet.betaBadge.tooltipText": "このプラグインは本番環境用ではありません。バグについてはディスカッションフォーラムで報告してください。", "xpack.fleet.breadcrumbs.addPackagePolicyPageTitle": "統合の追加", "xpack.fleet.breadcrumbs.agentsPageTitle": "エージェント", "xpack.fleet.breadcrumbs.allIntegrationsPageTitle": "すべて", @@ -8945,8 +8937,6 @@ "xpack.fleet.breadcrumbs.editPackagePolicyPageTitle": "統合の編集", "xpack.fleet.breadcrumbs.enrollmentTokensPageTitle": "登録トークン", "xpack.fleet.breadcrumbs.installedIntegrationsPageTitle": "インストール済み", - "xpack.fleet.breadcrumbs.integrationsPageTitle": "統合", - "xpack.fleet.breadcrumbs.overviewPageTitle": "概要", "xpack.fleet.breadcrumbs.policiesPageTitle": "ポリシー", "xpack.fleet.config.invalidPackageVersionError": "有効なサーバーまたはキーワード「latest」でなければなりません", "xpack.fleet.copyAgentPolicy.confirmModal.cancelButtonLabel": "キャンセル", @@ -9005,8 +8995,6 @@ "xpack.fleet.dataStreamList.namespaceColumnTitle": "名前空間", "xpack.fleet.dataStreamList.noDataStreamsPrompt": "データストリームがありません", "xpack.fleet.dataStreamList.noFilteredDataStreamsMessage": "一致するデータストリームが見つかりません", - "xpack.fleet.dataStreamList.pageSubtitle": "エージェントが作成したデータを管理します。", - "xpack.fleet.dataStreamList.pageTitle": "データストリーム", "xpack.fleet.dataStreamList.reloadDataStreamsButtonText": "再読み込み", "xpack.fleet.dataStreamList.searchPlaceholderTitle": "データストリームをフィルター", "xpack.fleet.dataStreamList.sizeColumnTitle": "サイズ", @@ -9195,8 +9183,6 @@ "xpack.fleet.integrations.updatePackage.updatePackageButtonLabel": "最新バージョンに更新", "xpack.fleet.invalidLicenseDescription": "現在のライセンスは期限切れです。登録されたビートエージェントは引き続き動作しますが、Elastic Fleet インターフェイスにアクセスするには有効なライセンスが必要です。", "xpack.fleet.invalidLicenseTitle": "ライセンスの期限切れ", - "xpack.fleet.listTabs.agentTitle": "エージェント", - "xpack.fleet.listTabs.enrollmentTokensTitle": "登録トークン", "xpack.fleet.namespaceValidation.invalidCharactersErrorMessage": "名前空間に無効な文字が含まれています", "xpack.fleet.namespaceValidation.lowercaseErrorMessage": "名前空間は小文字で指定する必要があります", "xpack.fleet.namespaceValidation.requiredErrorMessage": "名前空間は必須です", @@ -9209,33 +9195,8 @@ "xpack.fleet.noAccess.accessDeniedDescription": "Elastic Fleet にアクセスする権限がありません。Elastic Fleet を使用するには、このアプリケーションの読み取り権または全権を含むユーザーロールが必要です。", "xpack.fleet.noAccess.accessDeniedTitle": "アクセスが拒否されました", "xpack.fleet.oldAppTitle": "Ingest Manager", - "xpack.fleet.overviewAgentActiveTitle": "アクティブ", - "xpack.fleet.overviewAgentErrorTitle": "エラー", - "xpack.fleet.overviewAgentOfflineTitle": "オフライン", - "xpack.fleet.overviewAgentTotalTitle": "合計エージェント数", - "xpack.fleet.overviewDatastreamNamespacesTitle": "名前空間", - "xpack.fleet.overviewDatastreamSizeTitle": "合計サイズ", - "xpack.fleet.overviewDatastreamTotalTitle": "データストリーム", - "xpack.fleet.overviewIntegrationsInstalledTitle": "インストール済み", - "xpack.fleet.overviewIntegrationsTotalTitle": "合計利用可能数", - "xpack.fleet.overviewIntegrationsUpdatesAvailableTitle": "更新が可能です", - "xpack.fleet.overviewPackagePolicyTitle": "使用済みの統合", - "xpack.fleet.overviewPageAgentsPanelTitle": "エージェント", - "xpack.fleet.overviewPageDataStreamsPanelAction": "データストリームを表示", - "xpack.fleet.overviewPageDataStreamsPanelTitle": "データストリーム", - "xpack.fleet.overviewPageDataStreamsPanelTooltip": "エージェントが収集するデータはさまざまなデータストリームに整理されます。", - "xpack.fleet.overviewPageEnrollAgentButton": "エージェントの追加", - "xpack.fleet.overviewPageFleetPanelAction": "エージェントを表示", - "xpack.fleet.overviewPageFleetPanelTooltip": "Fleetを使用して、中央の場所からエージェントを登録し、ポリシーを管理します。", - "xpack.fleet.overviewPageIntegrationsPanelAction": "統合を表示", - "xpack.fleet.overviewPageIntegrationsPanelTitle": "統合", - "xpack.fleet.overviewPageIntegrationsPanelTooltip": "Elastic Stackの統合を参照し、インストールします。統合をエージェントポリシーに追加し、データの送信を開始します。", - "xpack.fleet.overviewPagePoliciesPanelAction": "ポリシーを表示", - "xpack.fleet.overviewPagePoliciesPanelTitle": "エージェントポリシー", - "xpack.fleet.overviewPagePoliciesPanelTooltip": "エージェントポリシーを使用すると、エージェントが収集するデータを管理できます。", "xpack.fleet.overviewPageSubtitle": "Elasticエージェントとポリシーを中央の場所で管理します。", "xpack.fleet.overviewPageTitle": "Fleet", - "xpack.fleet.overviewPolicyTotalTitle": "合計利用可能数", "xpack.fleet.packagePolicyInputOverrideError": "パッケージ{packageName}には入力タイプ{inputType}が存在しません。", "xpack.fleet.packagePolicyStreamOverrideError": "パッケージ{packageName}の{inputType}にはデータストリーム{streamSet}が存在しません", "xpack.fleet.packagePolicyStreamVarOverrideError": "パッケージ{packageName}の{inputType}の{streamSet}にはVar {varName}が存在しません", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 67bcf727bca6db..e4a0a6bae0b1ac 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -8912,7 +8912,6 @@ "xpack.fleet.agentList.addButton": "添加代理", "xpack.fleet.agentList.agentUpgradeLabel": "升级可用", "xpack.fleet.agentList.clearFiltersLinkText": "清除筛选", - "xpack.fleet.agentList.enrollButton": "添加代理", "xpack.fleet.agentList.errorFetchingDataTitle": "获取代理时出错", "xpack.fleet.agentList.forceUnenrollOneButton": "强制取消注册", "xpack.fleet.agentList.hostColumnTitle": "主机", @@ -8987,8 +8986,6 @@ "xpack.fleet.agentPolicyList.noAgentPoliciesPrompt": "无代理策略", "xpack.fleet.agentPolicyList.noFilteredAgentPoliciesPrompt": "找不到任何代理策略。{clearFiltersLink}", "xpack.fleet.agentPolicyList.packagePoliciesCountColumnTitle": "集成", - "xpack.fleet.agentPolicyList.pageSubtitle": "使用代理策略管理代理及其收集的数据。", - "xpack.fleet.agentPolicyList.pageTitle": "代理策略", "xpack.fleet.agentPolicyList.reloadAgentPoliciesButtonText": "重新加载", "xpack.fleet.agentPolicyList.updatedOnColumnTitle": "上次更新时间", "xpack.fleet.agentPolicySummaryLine.hostedPolicyTooltip": "此策略是在 Fleet 外进行管理的。与此策略相关的操作多数不可用。", @@ -9000,8 +8997,6 @@ "xpack.fleet.agentReassignPolicy.policyDescription": "选定代理策略将收集 {count, plural, other {{countValue} 个集成} }的数据:", "xpack.fleet.agentReassignPolicy.selectPolicyLabel": "代理策略", "xpack.fleet.agentReassignPolicy.successSingleNotificationTitle": "代理策略已重新分配", - "xpack.fleet.agents.pageSubtitle": "管理策略更新并将其部署到一组任意大小的代理。", - "xpack.fleet.agents.pageTitle": "代理", "xpack.fleet.agentsInitializationErrorMessageTitle": "无法为 Elastic 代理初始化集中管理", "xpack.fleet.agentStatus.healthyLabel": "运行正常", "xpack.fleet.agentStatus.inactiveLabel": "非活动", @@ -9010,13 +9005,10 @@ "xpack.fleet.agentStatus.updatingLabel": "正在更新", "xpack.fleet.appNavigation.agentsLinkText": "代理", "xpack.fleet.appNavigation.dataStreamsLinkText": "数据流", - "xpack.fleet.appNavigation.overviewLinkText": "概览", "xpack.fleet.appNavigation.policiesLinkText": "策略", "xpack.fleet.appNavigation.sendFeedbackButton": "发送反馈", "xpack.fleet.appNavigation.settingsButton": "Fleet 设置", "xpack.fleet.appTitle": "Fleet", - "xpack.fleet.betaBadge.labelText": "公测版", - "xpack.fleet.betaBadge.tooltipText": "不推荐在生产环境中使用此插件。请在我们讨论论坛中报告错误。", "xpack.fleet.breadcrumbs.addPackagePolicyPageTitle": "添加集成", "xpack.fleet.breadcrumbs.agentsPageTitle": "代理", "xpack.fleet.breadcrumbs.allIntegrationsPageTitle": "全部", @@ -9025,8 +9017,6 @@ "xpack.fleet.breadcrumbs.editPackagePolicyPageTitle": "编辑集成", "xpack.fleet.breadcrumbs.enrollmentTokensPageTitle": "注册令牌", "xpack.fleet.breadcrumbs.installedIntegrationsPageTitle": "已安装", - "xpack.fleet.breadcrumbs.integrationsPageTitle": "集成", - "xpack.fleet.breadcrumbs.overviewPageTitle": "概览", "xpack.fleet.breadcrumbs.policiesPageTitle": "策略", "xpack.fleet.config.invalidPackageVersionError": "必须是有效的 semver 或关键字 `latest`", "xpack.fleet.copyAgentPolicy.confirmModal.cancelButtonLabel": "取消", @@ -9087,8 +9077,6 @@ "xpack.fleet.dataStreamList.namespaceColumnTitle": "命名空间", "xpack.fleet.dataStreamList.noDataStreamsPrompt": "无数据流", "xpack.fleet.dataStreamList.noFilteredDataStreamsMessage": "找不到匹配的数据流", - "xpack.fleet.dataStreamList.pageSubtitle": "管理您的代理创建的数据。", - "xpack.fleet.dataStreamList.pageTitle": "数据流", "xpack.fleet.dataStreamList.reloadDataStreamsButtonText": "重新加载", "xpack.fleet.dataStreamList.searchPlaceholderTitle": "筛选数据流", "xpack.fleet.dataStreamList.sizeColumnTitle": "大小", @@ -9281,8 +9269,6 @@ "xpack.fleet.integrations.updatePackage.updatePackageButtonLabel": "更新到最新版本", "xpack.fleet.invalidLicenseDescription": "您当前的许可证已过期。已注册 Beats 代理将继续工作,但您需要有效的许可证,才能访问 Elastic Fleet 界面。", "xpack.fleet.invalidLicenseTitle": "已过期许可证", - "xpack.fleet.listTabs.agentTitle": "代理", - "xpack.fleet.listTabs.enrollmentTokensTitle": "注册令牌", "xpack.fleet.namespaceValidation.invalidCharactersErrorMessage": "命名空间包含无效字符", "xpack.fleet.namespaceValidation.lowercaseErrorMessage": "命名空间必须小写", "xpack.fleet.namespaceValidation.requiredErrorMessage": "“命名空间”必填", @@ -9295,33 +9281,8 @@ "xpack.fleet.noAccess.accessDeniedDescription": "您无权访问 Elastic Fleet。要使用 Elastic Fleet,您需要包含此应用程序读取权限或所有权限的用户角色。", "xpack.fleet.noAccess.accessDeniedTitle": "访问被拒绝", "xpack.fleet.oldAppTitle": "采集管理器", - "xpack.fleet.overviewAgentActiveTitle": "活动", - "xpack.fleet.overviewAgentErrorTitle": "错误", - "xpack.fleet.overviewAgentOfflineTitle": "脱机", - "xpack.fleet.overviewAgentTotalTitle": "代理总数", - "xpack.fleet.overviewDatastreamNamespacesTitle": "命名空间", - "xpack.fleet.overviewDatastreamSizeTitle": "总大小", - "xpack.fleet.overviewDatastreamTotalTitle": "数据流", - "xpack.fleet.overviewIntegrationsInstalledTitle": "已安装", - "xpack.fleet.overviewIntegrationsTotalTitle": "可用总计", - "xpack.fleet.overviewIntegrationsUpdatesAvailableTitle": "可用更新", - "xpack.fleet.overviewPackagePolicyTitle": "已使用的集成", - "xpack.fleet.overviewPageAgentsPanelTitle": "代理", - "xpack.fleet.overviewPageDataStreamsPanelAction": "查看数据流", - "xpack.fleet.overviewPageDataStreamsPanelTitle": "数据流", - "xpack.fleet.overviewPageDataStreamsPanelTooltip": "您的代理收集的数据组织到各种数据流中。", - "xpack.fleet.overviewPageEnrollAgentButton": "添加代理", - "xpack.fleet.overviewPageFleetPanelAction": "查看代理", - "xpack.fleet.overviewPageFleetPanelTooltip": "使用 Fleet 注册代理并从中央位置管理其策略。", - "xpack.fleet.overviewPageIntegrationsPanelAction": "查看集成", - "xpack.fleet.overviewPageIntegrationsPanelTitle": "集成", - "xpack.fleet.overviewPageIntegrationsPanelTooltip": "浏览并安装适用于 Elastic Stack 的集成。将集成添加到您的代理策略,以开始发送数据。", - "xpack.fleet.overviewPagePoliciesPanelAction": "查看策略", - "xpack.fleet.overviewPagePoliciesPanelTitle": "代理策略", - "xpack.fleet.overviewPagePoliciesPanelTooltip": "使用代理策略控制您的代理收集的数据。", "xpack.fleet.overviewPageSubtitle": "在集中位置管理 Elastic 代理及其策略。", "xpack.fleet.overviewPageTitle": "Fleet", - "xpack.fleet.overviewPolicyTotalTitle": "可用总计", "xpack.fleet.packagePolicyInputOverrideError": "输入类型 {inputType} 在软件包 {packageName} 上不存在", "xpack.fleet.packagePolicyStreamOverrideError": "数据流 {streamSet} 在软件包 {packageName} 的 {inputType} 上不存在", "xpack.fleet.packagePolicyStreamVarOverrideError": "变量 {varName} 在软件包 {packageName} 的 {inputType} 的 {streamSet} 上不存在", diff --git a/x-pack/test/fleet_functional/apps/fleet/agents_page.ts b/x-pack/test/fleet_functional/apps/fleet/agents_page.ts new file mode 100644 index 00000000000000..515eaa65f5310a --- /dev/null +++ b/x-pack/test/fleet_functional/apps/fleet/agents_page.ts @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getPageObjects, getService }: FtrProviderContext) { + const { agentsPage } = getPageObjects(['agentsPage']); + + describe('When in the Fleet application', function () { + this.tags(['ciGroup7']); + + describe('and on the agents page', () => { + before(async () => { + await agentsPage.navigateToAgentsPage(); + }); + + it('should show the agents tab', async () => { + await agentsPage.agentsTabExistsOrFail(); + }); + + it('should show the agent policies tab', async () => { + await agentsPage.agentPoliciesTabExistsOrFail(); + }); + + it('should show the enrollment tokens tab', async () => { + await agentsPage.enrollmentTokensTabExistsOrFail(); + }); + + it('should show the data streams tab', async () => { + await agentsPage.dataStreamsTabExistsOrFail(); + }); + }); + }); +} diff --git a/x-pack/test/fleet_functional/apps/fleet/index.ts b/x-pack/test/fleet_functional/apps/fleet/index.ts index 23a070cb799340..ec16e2d8571831 100644 --- a/x-pack/test/fleet_functional/apps/fleet/index.ts +++ b/x-pack/test/fleet_functional/apps/fleet/index.ts @@ -12,6 +12,6 @@ export default function (providerContext: FtrProviderContext) { describe('endpoint', function () { this.tags('ciGroup7'); - loadTestFile(require.resolve('./overview_page')); + loadTestFile(require.resolve('./agents_page')); }); } diff --git a/x-pack/test/fleet_functional/apps/fleet/overview_page.ts b/x-pack/test/fleet_functional/apps/fleet/overview_page.ts deleted file mode 100644 index 3d3b069665448b..00000000000000 --- a/x-pack/test/fleet_functional/apps/fleet/overview_page.ts +++ /dev/null @@ -1,38 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { overviewPage } = getPageObjects(['overviewPage']); - - describe('When in the Fleet application', function () { - this.tags(['ciGroup7']); - - describe('and on the Overview page', () => { - before(async () => { - await overviewPage.navigateToOverview(); - }); - - it('should show the Integrations section', async () => { - await overviewPage.integrationsSectionExistsOrFail(); - }); - - it('should show the Agents section', async () => { - await overviewPage.agentSectionExistsOrFail(); - }); - - it('should show the Agent policies section', async () => { - await overviewPage.agentPolicySectionExistsOrFail(); - }); - - it('should show the Data streams section', async () => { - await overviewPage.datastreamSectionExistsOrFail(); - }); - }); - }); -} diff --git a/x-pack/test/fleet_functional/page_objects/overview_page.ts b/x-pack/test/fleet_functional/page_objects/agents_page.ts similarity index 55% rename from x-pack/test/fleet_functional/page_objects/overview_page.ts rename to x-pack/test/fleet_functional/page_objects/agents_page.ts index 2fd351184c7fe9..99e9ebfdcc15a5 100644 --- a/x-pack/test/fleet_functional/page_objects/overview_page.ts +++ b/x-pack/test/fleet_functional/page_objects/agents_page.ts @@ -11,31 +11,32 @@ import { PLUGIN_ID } from '../../../plugins/fleet/common'; // NOTE: import path below should be the deep path to the actual module - else we get CI errors import { pagePathGetters } from '../../../plugins/fleet/public/constants/page_paths'; -export function OverviewPage({ getService, getPageObjects }: FtrProviderContext) { +export function AgentsPage({ getService, getPageObjects }: FtrProviderContext) { const pageObjects = getPageObjects(['common']); const testSubjects = getService('testSubjects'); return { - async navigateToOverview() { + async navigateToAgentsPage() { await pageObjects.common.navigateToApp(PLUGIN_ID, { - hash: pagePathGetters.overview()[1], + // Fleet's "/" route should redirect to "/agents" + hash: pagePathGetters.base()[1], }); }, - async integrationsSectionExistsOrFail() { - await testSubjects.existOrFail('fleet-integrations-section'); + async agentsTabExistsOrFail() { + await testSubjects.existOrFail('fleet-agents-tab'); }, - async agentPolicySectionExistsOrFail() { - await testSubjects.existOrFail('fleet-agent-policy-section'); + async agentPoliciesTabExistsOrFail() { + await testSubjects.existOrFail('fleet-agent-policies-tab'); }, - async agentSectionExistsOrFail() { - await testSubjects.existOrFail('fleet-agent-section'); + async enrollmentTokensTabExistsOrFail() { + await testSubjects.existOrFail('fleet-enrollment-tokens-tab'); }, - async datastreamSectionExistsOrFail() { - await testSubjects.existOrFail('fleet-datastream-section'); + async dataStreamsTabExistsOrFail() { + await testSubjects.existOrFail('fleet-datastreams-tab'); }, }; } diff --git a/x-pack/test/fleet_functional/page_objects/index.ts b/x-pack/test/fleet_functional/page_objects/index.ts index 2c534285146e54..f0543aa3c7e89e 100644 --- a/x-pack/test/fleet_functional/page_objects/index.ts +++ b/x-pack/test/fleet_functional/page_objects/index.ts @@ -6,9 +6,9 @@ */ import { pageObjects as xpackFunctionalPageObjects } from '../../functional/page_objects'; -import { OverviewPage } from './overview_page'; +import { AgentsPage } from './agents_page'; export const pageObjects = { ...xpackFunctionalPageObjects, - overviewPage: OverviewPage, + agentsPage: AgentsPage, };