-
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.
[Infra UI] Add Node Type Selector to Waffle Map (#23593)
* Adding node type switcher to page; Adding title to page; * Fixing pod logging url * Adding drilldown for apm * Adding labels to pulldowns
- Loading branch information
1 parent
51e68cc
commit faf89e4
Showing
12 changed files
with
151 additions
and
55 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
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
45 changes: 45 additions & 0 deletions
45
x-pack/plugins/infra/public/components/waffle/waffle_node_type_switcher.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,45 @@ | ||
/* | ||
* 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 { EuiKeyPadMenu, EuiKeyPadMenuItem } from '@elastic/eui'; | ||
import React from 'react'; | ||
import { | ||
InfraMetricInput, | ||
InfraMetricType, | ||
InfraNodeType, | ||
InfraPathInput, | ||
} from '../../../common/graphql/types'; | ||
|
||
interface Props { | ||
nodeType: InfraNodeType; | ||
changeNodeType: (nodeType: InfraNodeType) => void; | ||
changeGroupBy: (groupBy: InfraPathInput[]) => void; | ||
changeMetrics: (metric: InfraMetricInput[]) => void; | ||
} | ||
|
||
export class WaffleNodeTypeSwitcher extends React.PureComponent<Props> { | ||
public render() { | ||
return ( | ||
<EuiKeyPadMenu> | ||
<EuiKeyPadMenuItem label="Hosts" onClick={this.handleClick(InfraNodeType.host)}> | ||
<img src="/plugins/infra/images/hosts.svg" className="euiIcon euiIcon--large" /> | ||
</EuiKeyPadMenuItem> | ||
<EuiKeyPadMenuItem label="Kubernetes" onClick={this.handleClick(InfraNodeType.pod)}> | ||
<img src="/plugins/infra/images/k8.svg" className="euiIcon euiIcon--large" /> | ||
</EuiKeyPadMenuItem> | ||
<EuiKeyPadMenuItem label="Docker" onClick={this.handleClick(InfraNodeType.container)}> | ||
<img src="/plugins/infra/images/docker.svg" className="euiIcon euiIcon--large" /> | ||
</EuiKeyPadMenuItem> | ||
</EuiKeyPadMenu> | ||
); | ||
} | ||
|
||
private handleClick = (nodeType: InfraNodeType) => () => { | ||
this.props.changeNodeType(nodeType); | ||
this.props.changeGroupBy([]); | ||
this.props.changeMetrics([{ type: InfraMetricType.cpu }]); | ||
}; | ||
} |
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.