-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Metrics UI] Add metadata tab to node details flyout #84454
Merged
phillipb
merged 20 commits into
elastic:master
from
phillipb:add-metadata-to-node-details
Dec 3, 2020
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2e5954b
Add properties tab to flyout
phillipb 05c7a3b
Better id for i18n title
phillipb 2fbd2b2
Update i18n ids
phillipb 638223c
Merge branch 'master' into add-metadata-to-node-details
kibanamachine b09a778
Fix test and styling
phillipb 29b87ad
Merge branch 'add-metadata-to-node-details' of github.com:phillipb/ki…
phillipb 3bf8172
Style changes, add support for collapsing array fields
phillipb 2a9621f
Merge branch 'master' into add-metadata-to-node-details
kibanamachine 2a6b58b
Add loading indicators
phillipb 6a491e8
Merge branch 'add-metadata-to-node-details' of github.com:phillipb/ki…
phillipb d55787e
Fix type check
phillipb c6e1d99
Fix another test
phillipb 84e95ae
Fix tests for pods
phillipb ceaac8c
Add link to node details page
phillipb 25e23ed
Only show the overlay when viewing hosts
phillipb 161a80e
Take into account cores when showing cpu
phillipb a7a7f13
Make it easier to read
phillipb c2da6f5
Remove unnecessary cast
phillipb 8b70611
Merge branch 'master' into add-metadata-to-node-details
kibanamachine 4f6b8db
Fix PR feedback
phillipb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually like doing
filter(Boolean)
for added clarity, since!!
can sometimes be mistaken for a typo, but this is fine