Merge pull request #4794 from influxdata/fixes/basepath-fix

Handle basepath issue with missing slash
pull/4798/head
Brandon Farmer 2018-11-09 16:32:18 -08:00 committed by GitHub
commit 93429b3d20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View File

@ -7,6 +7,7 @@
### Bug Fixes
1. [#4786](https://github.com/influxdata/chronograf/pull/4786): Get protoboards from multistore if not able to find from ProtoboardsPath
1. [#4794](https://github.com/influxdata/chronograf/pull/4794): Handle basepath issue with missing slash
## v1.7.2 [2018-11-08]

View File

@ -47,8 +47,9 @@ func NewMux(opts MuxOpts, service Service) http.Handler {
})
if opts.Basepath != "" {
basePath := fmt.Sprintf("%s/", opts.Basepath)
// Prefix any URLs found in the React assets with any configured basepath
assets = NewDefaultURLPrefixer(opts.Basepath, assets, opts.Logger)
assets = NewDefaultURLPrefixer(basePath, assets, opts.Logger)
}
// Compress the assets with gzip if an accepted encoding

View File

@ -871,7 +871,8 @@ export const functions: FluxToolbarFunction[] = [
],
desc:
'Collects values stored vertically (column-wise) in a table and aligns them horizontally (row-wise) into logical sets.',
example: 'pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")',
example:
'pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")',
category: 'Transformations',
link:
'https://docs.influxdata.com/flux/latest/functions/transformations/pivot',

View File

@ -6,7 +6,12 @@ export const getBasepath = () => {
return ''
}
return rootNode.getAttribute('data-basepath') || ''
let basepath = rootNode.getAttribute('data-basepath') || ''
if (basepath !== '') {
basepath = basepath.slice(0, basepath.length - 1)
}
return basepath
}
export const stripPrefix = (pathname, basepath = getBasepath()) => {