-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fleet] Surface new overview dashboards in fleet (#154914)
Closes #153848 ## Summary - Adds two link buttons on top of agent list page to access "Ingest overview" and "Agent Info" dashboards <img width="1444" alt="Screenshot 2023-04-13 at 15 22 53" src="https://user-images.githubusercontent.com/16084106/231772174-00c00a8e-62f1-43ea-a935-bc12f56f3e50.png"> The links are built using the new URL service [locator](https://github.com/elastic/kibana/blob/e80abe810837eeeff7fdcd594c6f8950590b49cd/x-pack/plugins/fleet/public/hooks/use_locator.ts#L14) and the [getRedirectLink](https://github.com/elastic/kibana/blob/main/src/plugins/share/README.mdx#using-locator-of-another-app) method; - Refactoring existing instances of `useKibanaLink` to use the url locator instead; These new dashboards were already accessible from the ` elastic_agent.*` datastreams table actions, however I replaced the `useKibanaLink` hook there as well: <img width="1412" alt="Screenshot 2023-04-13 at 16 03 47" src="https://user-images.githubusercontent.com/16084106/231784273-693c7f36-4545-4c06-a05e-4f09e53bd903.png"> TODO: I don't know where to add the "Integrations" dashboard yet, I'm not sure it should go on the Integrations details page. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
f892fac
commit 970de91
Showing
14 changed files
with
140 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const LOCATORS_IDS = { | ||
APM_LOCATOR: 'APM_LOCATOR', | ||
DASHBOARD_APP: 'DASHBOARD_APP_LOCATOR', | ||
} as const; | ||
|
||
// Dashboards ids | ||
export const DASHBOARD_LOCATORS_IDS = { | ||
ELASTIC_AGENT_OVERVIEW: 'elastic_agent-a148dc70-6b3c-11ed-98de-67bdecd21824', | ||
ELASTIC_AGENT_AGENT_INFO: 'elastic_agent-0600ffa0-6b5e-11ed-98de-67bdecd21824', | ||
ELASTIC_AGENT_AGENT_METRICS: 'elastic_agent-f47f18cc-9c7d-4278-b2ea-a6dee816d395', | ||
ELASTIC_AGENT_INTEGRATIONS: 'elastic_agent-1a4e7280-6b5e-11ed-98de-67bdecd21824', | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...blic/applications/fleet/sections/agents/agent_list_page/components/dashboards_buttons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* 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 { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
|
||
import { DASHBOARD_LOCATORS_IDS } from '../../../../../../../common/constants'; | ||
|
||
import { useDashboardLocator } from '../../../../hooks'; | ||
|
||
export const DashboardsButtons: React.FunctionComponent = () => { | ||
const dashboardLocator = useDashboardLocator(); | ||
|
||
const getDashboardHref = (dashboardId: string) => { | ||
return dashboardLocator?.getRedirectUrl({ dashboardId }) || ''; | ||
}; | ||
|
||
return ( | ||
<> | ||
<EuiFlexGroup gutterSize="s" justifyContent="flexStart"> | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonEmpty | ||
iconType="dashboardApp" | ||
href={getDashboardHref(DASHBOARD_LOCATORS_IDS.ELASTIC_AGENT_OVERVIEW)} | ||
data-test-subj="ingestOverviewLinkButton" | ||
> | ||
<FormattedMessage | ||
id="xpack.fleet.agentList.ingestOverviewlinkButton" | ||
defaultMessage="Ingest Overview Metrics" | ||
/> | ||
</EuiButtonEmpty> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonEmpty | ||
iconType="dashboardApp" | ||
href={getDashboardHref(DASHBOARD_LOCATORS_IDS.ELASTIC_AGENT_AGENT_INFO)} | ||
data-test-subj="agentInfoLinkButton" | ||
> | ||
<FormattedMessage | ||
id="xpack.fleet.agentList.agentInfoLinkButton" | ||
defaultMessage="Agent Info Metrics" | ||
/> | ||
</EuiButtonEmpty> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters