forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Infra UI] Node Details using Asset Details component (elastic#164077)
part of [elastic#162898](elastic#162898) ## Summary This PR implements the new node details page for hosts. It uses the Asset Details component, which is the same used in the Hosts View flyout. https://github.com/elastic/kibana/assets/2767137/0d3d2b2d-ed82-4275-b424-ddae82cdbddc It **does not** change the behaviour of other asset types (kubernetes, container, aws...). The main change this PR introduces is internalizing the Data Views logic so that clients don't have to worry about passing it to the Asset Details. The fundamental change between flyout and page is the template. Everything else is shared. Functional tests will be added in a separate PR. ### How to test this PR - Setup a local Kibana instance - Navigate to `Infrastructure` > `Hosts` - Click on a host name and check if the new Node Details page opened - Return to the hosts page and open a flyout - Click on `Open as page` and check if the new Node Details page opened - Navigate to `Infrastructure` > `Inventory` - With `Show: Host` selected, click on a waffle item to open the flyout, click on `Open as page` and check if the new Node Details page opened - Select another asset type in `Show` , open the flyout and check if the old version of the Node Details Page will show #### Storybook `yarn storybook infra` ### For reviewers Errors in the new page will be handled differently from what the current Node Details page. i.e: accessing the page with invalid asset id, won't show this page <img width="1443" alt="image" src="https://github.com/elastic/kibana/assets/2767137/93de3caf-ac63-4a34-a90d-226b212096fe"> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
2e854d6
commit 2ca1081
Showing
47 changed files
with
1,141 additions
and
691 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
...infra/public/components/asset_details/__stories__/context/fixtures/asset_details_props.ts
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,72 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import { type AssetDetailsProps, FlyoutTabIds, type Tab } from '../../../types'; | ||
|
||
const links: AssetDetailsProps['links'] = ['alertRule', 'nodeDetails', 'apmServices']; | ||
const tabs: Tab[] = [ | ||
{ | ||
id: FlyoutTabIds.OVERVIEW, | ||
name: i18n.translate('xpack.infra.nodeDetails.tabs.overview.title', { | ||
defaultMessage: 'Overview', | ||
}), | ||
}, | ||
{ | ||
id: FlyoutTabIds.LOGS, | ||
name: i18n.translate('xpack.infra.nodeDetails.tabs.logs', { | ||
defaultMessage: 'Logs', | ||
}), | ||
}, | ||
{ | ||
id: FlyoutTabIds.METADATA, | ||
name: i18n.translate('xpack.infra.metrics.nodeDetails.tabs.metadata', { | ||
defaultMessage: 'Metadata', | ||
}), | ||
}, | ||
{ | ||
id: FlyoutTabIds.PROCESSES, | ||
name: i18n.translate('xpack.infra.metrics.nodeDetails.tabs.processes', { | ||
defaultMessage: 'Processes', | ||
}), | ||
}, | ||
{ | ||
id: FlyoutTabIds.ANOMALIES, | ||
name: i18n.translate('xpack.infra.nodeDetails.tabs.anomalies', { | ||
defaultMessage: 'Anomalies', | ||
}), | ||
}, | ||
{ | ||
id: FlyoutTabIds.LINK_TO_APM, | ||
name: i18n.translate('xpack.infra.infra.nodeDetails.apmTabLabel', { | ||
defaultMessage: 'APM', | ||
}), | ||
}, | ||
]; | ||
|
||
export const assetDetailsProps: AssetDetailsProps = { | ||
asset: { | ||
name: 'host1', | ||
id: 'host1', | ||
}, | ||
overrides: { | ||
metadata: { | ||
showActionsColumn: true, | ||
}, | ||
}, | ||
assetType: 'host', | ||
renderMode: { | ||
mode: 'page', | ||
}, | ||
dateRange: { | ||
from: '2023-04-09T11:07:49Z', | ||
to: '2023-04-09T11:23:49Z', | ||
}, | ||
tabs, | ||
links, | ||
metricAlias: 'metrics-*', | ||
}; |
37 changes: 0 additions & 37 deletions
37
...infra/public/components/asset_details/__stories__/context/fixtures/asset_details_state.ts
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.