Skip to content

Commit

Permalink
Fix broken "Download" logs button
Browse files Browse the repository at this point in the history
It doesn't compute the path to the Go backend properly, as
`window.NOMAD_ENDPOINT`, set by backend/main.go should already contain all
the necessary elements to have a proper URL.
  • Loading branch information
multani committed May 17, 2017
1 parent 7c4c164 commit 657a6de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/AllocationFiles/AllocationFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ class AllocationFiles extends Component {
</span>
)

const baseUrl = `${location.protocol}//${window.NOMAD_ENDPOINT}`
const downloadPath = `nomad/${this.props.router.params.region}/download${this.props.file.File}`

const downloadBtn = this.props.file.File.indexOf('<') >= 0
? ''
: (
<form
style={{ display: 'inline', float: 'right' }} method='get' action={ `${baseUrl}/${downloadPath}` } >
style={{ display: 'inline', float: 'right' }} method='get'
action={ `${window.NOMAD_ENDPOINT}/${downloadPath}` } >
<input type='hidden' name='client' value={ this.props.node.HTTPAddr } />
<input type='hidden' name='allocID' value={ this.props.allocation.ID } />
{ oversizedWarning }
Expand Down

0 comments on commit 657a6de

Please sign in to comment.