From 8acbae3a62d72e29f2b6817fc5a38c23dba6fc99 Mon Sep 17 00:00:00 2001 From: Matt Apperson Date: Wed, 12 Dec 2018 09:43:01 -0500 Subject: [PATCH] fix incorrect beat name in enroll command, remove translation of command --- .../public/components/enroll_beats.tsx | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/beats_management/public/components/enroll_beats.tsx b/x-pack/plugins/beats_management/public/components/enroll_beats.tsx index dba4e243e16d3..5189a887a41fd 100644 --- a/x-pack/plugins/beats_management/public/components/enroll_beats.tsx +++ b/x-pack/plugins/beats_management/public/components/enroll_beats.tsx @@ -42,7 +42,7 @@ export class EnrollBeat extends React.Component this.state = { enrolledBeat: null, hasPolledForBeat: false, - command: 'sudo filebeat', + command: 'sudo {{beatType}}', beatType: 'filebeat', }; } @@ -144,17 +144,15 @@ export class EnrollBeat extends React.Component value={this.state.command} options={[ { - value: `sudo ${this.state.beatType}`, + value: `sudo {{beatType}}`, text: 'DEB / RPM', }, { - value: `PS C:\\Program Files\\${capitalize(this.state.beatType)}> ${ - this.state.beatType - }.exe`, + value: `PS C:\\Program Files\\{{beatTypeInCaps}}> {{beatType}}.exe`, text: 'Windows', }, { - value: `./${this.state.beatType}`, + value: `./{{beatType}}`, text: 'MacOS', }, ]} @@ -188,17 +186,13 @@ export class EnrollBeat extends React.Component className="euiFieldText euiFieldText--fullWidth" style={{ textAlign: 'left' }} > - - {`//`} - {window.location.host} - {this.props.frameworkBasePath} {this.props.enrollmentToken} + {`$ ${this.state.command + .replace('{{beatType}}', this.state.beatType) + .replace('{{beatTypeInCaps}}', capitalize(this.state.beatType))} enroll ${ + window.location.protocol + }://${window.location.host} ${this.props.frameworkBasePath} ${ + this.props.enrollmentToken + }`}