diff --git a/CHANGELOG.md b/CHANGELOG.md index b1c229216..e9c1964da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/server/mux.go b/server/mux.go index ceb70cac3..45b3e1280 100644 --- a/server/mux.go +++ b/server/mux.go @@ -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 diff --git a/ui/src/flux/constants/functions.ts b/ui/src/flux/constants/functions.ts index 4cab02d0b..da5408fa9 100644 --- a/ui/src/flux/constants/functions.ts +++ b/ui/src/flux/constants/functions.ts @@ -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', diff --git a/ui/src/utils/basepath.ts b/ui/src/utils/basepath.ts index 211b8028c..4b3ddd6fe 100644 --- a/ui/src/utils/basepath.ts +++ b/ui/src/utils/basepath.ts @@ -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()) => {