Skip to content

Commit

Permalink
[BeatsCM] fix incorrect beat name in enroll command, remove translati…
Browse files Browse the repository at this point in the history
…on of command (elastic#27036)
  • Loading branch information
mattapperson committed Dec 14, 2018
1 parent 401476f commit 72a78ea
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions x-pack/plugins/beats_management/public/components/enroll_beats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class EnrollBeat extends React.Component<ComponentProps, ComponentState>
this.state = {
enrolledBeat: null,
hasPolledForBeat: false,
command: 'sudo filebeat',
command: 'sudo {{beatType}}',
beatType: 'filebeat',
};
}
Expand Down Expand Up @@ -144,17 +144,15 @@ export class EnrollBeat extends React.Component<ComponentProps, ComponentState>
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',
},
]}
Expand Down Expand Up @@ -188,17 +186,13 @@ export class EnrollBeat extends React.Component<ComponentProps, ComponentState>
className="euiFieldText euiFieldText--fullWidth"
style={{ textAlign: 'left' }}
>
<FormattedMessage
id="xpack.beatsManagement.enrollBeat.stateCommandEnrollLocationProtocolTitle"
defaultMessage="$ {stateCommand} enroll {locationProtocol}"
values={{
stateCommand: this.state.command,
locationProtocol: window.location.protocol,
}}
/>
{`//`}
{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
}`}
</div>
</div>
<br />
Expand Down

0 comments on commit 72a78ea

Please sign in to comment.