-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Beats/basic use cases #21660
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
Merged
mattapperson
merged 6 commits into
elastic:feature/x-pack/management/beats
from
mattapperson:beats/basic-use-cases
Aug 3, 2018
Merged
Beats/basic use cases #21660
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
56d2af0
tweak adapter responses / types. re-add enroll ui
mattapperson 707a53e
routes enabled, enroll now pings the server
mattapperson 8a86639
full enrollment path now working
mattapperson 88df27b
improved pinging for beat enrollment
mattapperson edcebc3
fix location of history call
mattapperson d45c8af
reload beats list on beat enrollment completion
mattapperson 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -7,25 +7,19 @@ | |
| import { | ||
| // @ts-ignore typings for EuiBadge not present in current version | ||
| EuiBadge, | ||
| EuiButton, | ||
| EuiButtonEmpty, | ||
| EuiFlexItem, | ||
| EuiModal, | ||
| EuiModalBody, | ||
| EuiModalFooter, | ||
| EuiModalHeader, | ||
| EuiModalHeaderTitle, | ||
| EuiOverlayMask, | ||
| } from '@elastic/eui'; | ||
|
|
||
| import React from 'react'; | ||
| import { BeatTag, CMBeat, CMPopulatedBeat } from '../../../common/domain_types'; | ||
| import { BeatsTagAssignment } from '../../../server/lib/adapters/beats/adapter_types'; | ||
| import { BeatsTableType, Table } from '../../components/table'; | ||
| import { FrontendLibs } from '../../lib/lib'; | ||
| import { BeatsActionArea } from './beats_action_area'; | ||
|
|
||
| interface BeatsPageProps { | ||
| libs: FrontendLibs; | ||
| location: any; | ||
| } | ||
|
|
||
| interface BeatsPageState { | ||
|
|
@@ -35,45 +29,7 @@ interface BeatsPageState { | |
| } | ||
|
|
||
| export class BeatsPage extends React.PureComponent<BeatsPageProps, BeatsPageState> { | ||
| public static ActionArea = ({ match, history }: { match: any; history: any }) => ( | ||
| <div> | ||
| <EuiButtonEmpty | ||
| onClick={() => { | ||
| window.alert('This will later go to more general beats install instructions.'); | ||
| window.location.href = '#/home/tutorial/dockerMetrics'; | ||
| }} | ||
| > | ||
| Learn how to install beats | ||
| </EuiButtonEmpty> | ||
| <EuiButton | ||
| size="s" | ||
| color="primary" | ||
| onClick={() => { | ||
| history.push('/beats/enroll/foobar'); | ||
| }} | ||
| > | ||
| Enroll Beats | ||
| </EuiButton> | ||
|
|
||
| {match.params.enrollmentToken != null && ( | ||
| <EuiOverlayMask> | ||
| <EuiModal onClose={() => history.push('/beats')} style={{ width: '800px' }}> | ||
| <EuiModalHeader> | ||
| <EuiModalHeaderTitle>Enroll Beats</EuiModalHeaderTitle> | ||
| </EuiModalHeader> | ||
|
|
||
| <EuiModalBody> | ||
| Enrollment UI here for enrollment token of: {match.params.enrollmentToken} | ||
| </EuiModalBody> | ||
|
|
||
| <EuiModalFooter> | ||
| <EuiButtonEmpty onClick={() => history.push('/beats')}>Cancel</EuiButtonEmpty> | ||
| </EuiModalFooter> | ||
| </EuiModal> | ||
| </EuiOverlayMask> | ||
| )} | ||
| </div> | ||
| ); | ||
| public static ActionArea = BeatsActionArea; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| constructor(props: BeatsPageProps) { | ||
| super(props); | ||
|
|
||
|
|
@@ -85,13 +41,18 @@ export class BeatsPage extends React.PureComponent<BeatsPageProps, BeatsPageStat | |
|
|
||
| this.loadBeats(); | ||
| } | ||
| public componentDidUpdate(prevProps: any) { | ||
| if (this.props.location !== prevProps.location) { | ||
| this.loadBeats(); | ||
| } | ||
| } | ||
| public render() { | ||
| return ( | ||
| <Table | ||
| actionHandler={this.handleBeatsActions} | ||
| assignmentOptions={this.state.tags} | ||
| assignmentTitle="Set tags" | ||
| items={this.state.beats} | ||
| items={this.state.beats || []} | ||
| ref={this.state.tableRef} | ||
| type={BeatsTableType} | ||
| /> | ||
|
|
||
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.
Isn't
full_tagsa required prop onCMPopulatedBeats? Shouldn't it default to an[]wherever it's being instantiated? Or am I showing my lack of TypeScript expertise by asking this?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.
yes, but we are not loading those tags yet, this needs to be done yet in a future PR