-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metrics UI] Add metadata tab to node details flyout (#84454)
* Add properties tab to flyout * Better id for i18n title * Update i18n ids * Fix test and styling * Style changes, add support for collapsing array fields * Add loading indicators * Fix type check * Fix another test * Fix tests for pods * Add link to node details page * Only show the overlay when viewing hosts * Take into account cores when showing cpu * Make it easier to read * Remove unnecessary cast * Fix PR feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
74ef540
commit 61fdec2
Showing
11 changed files
with
538 additions
and
39 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
21 changes: 0 additions & 21 deletions
21
...ins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties.tsx
This file was deleted.
Oops, something went wrong.
116 changes: 116 additions & 0 deletions
116
...blic/pages/metrics/inventory_view/components/node_details/tabs/properties/build_fields.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,116 @@ | ||
/* | ||
* 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 { InfraMetadata } from '../../../../../../../../common/http_api'; | ||
|
||
export const getFields = (metadata: InfraMetadata, group: 'cloud' | 'host' | 'agent') => { | ||
switch (group) { | ||
case 'host': | ||
return prune([ | ||
{ | ||
name: 'host.architecture', | ||
value: metadata.info?.host?.architecture, | ||
}, | ||
{ | ||
name: 'host.hostname', | ||
value: metadata.info?.host?.name, | ||
}, | ||
{ | ||
name: 'host.id', | ||
value: metadata.info?.host?.id, | ||
}, | ||
{ | ||
name: 'host.ip', | ||
value: metadata.info?.host?.ip, | ||
}, | ||
{ | ||
name: 'host.mac', | ||
value: metadata.info?.host?.mac, | ||
}, | ||
{ | ||
name: 'host.name', | ||
value: metadata.info?.host?.name, | ||
}, | ||
{ | ||
name: 'host.os.build', | ||
value: metadata.info?.host?.os?.build, | ||
}, | ||
{ | ||
name: 'host.os.family', | ||
value: metadata.info?.host?.os?.family, | ||
}, | ||
{ | ||
name: 'host.os.name', | ||
value: metadata.info?.host?.os?.name, | ||
}, | ||
{ | ||
name: 'host.os.kernel', | ||
value: metadata.info?.host?.os?.kernel, | ||
}, | ||
{ | ||
name: 'host.os.platform', | ||
value: metadata.info?.host?.os?.platform, | ||
}, | ||
{ | ||
name: 'host.os.version', | ||
value: metadata.info?.host?.os?.version, | ||
}, | ||
]); | ||
case 'cloud': | ||
return prune([ | ||
{ | ||
name: 'cloud.account.id', | ||
value: metadata.info?.cloud?.account?.id, | ||
}, | ||
{ | ||
name: 'cloud.account.name', | ||
value: metadata.info?.cloud?.account?.name, | ||
}, | ||
{ | ||
name: 'cloud.availability_zone', | ||
value: metadata.info?.cloud?.availability_zone, | ||
}, | ||
{ | ||
name: 'cloud.instance.id', | ||
value: metadata.info?.cloud?.instance?.id, | ||
}, | ||
{ | ||
name: 'cloud.instance.name', | ||
value: metadata.info?.cloud?.instance?.name, | ||
}, | ||
{ | ||
name: 'cloud.machine.type', | ||
value: metadata.info?.cloud?.machine?.type, | ||
}, | ||
{ | ||
name: 'cloud.provider', | ||
value: metadata.info?.cloud?.provider, | ||
}, | ||
{ | ||
name: 'cloud.region', | ||
value: metadata.info?.cloud?.region, | ||
}, | ||
]); | ||
case 'agent': | ||
return prune([ | ||
{ | ||
name: 'agent.id', | ||
value: metadata.info?.agent?.id, | ||
}, | ||
{ | ||
name: 'agent.version', | ||
value: metadata.info?.agent?.version, | ||
}, | ||
{ | ||
name: 'agent.policy', | ||
value: metadata.info?.agent?.policy, | ||
}, | ||
]); | ||
} | ||
}; | ||
|
||
const prune = (fields: Array<{ name: string; value: string | string[] | undefined }>) => | ||
fields.filter((f) => !!f.value); |
Oops, something went wrong.