From 48f3db024d774d807becfdf9df3902eedaee94e6 Mon Sep 17 00:00:00 2001 From: Jade McGough Date: Thu, 8 Dec 2016 15:12:39 -0800 Subject: [PATCH 1/3] removing unimplemented endpoint from swagger --- server/swagger.json | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/server/swagger.json b/server/swagger.json index 5e6bab7311..b9bb404c76 100644 --- a/server/swagger.json +++ b/server/swagger.json @@ -273,26 +273,6 @@ } }, "/users": { - "get": { - "tags": [ - "users" - ], - "summary": "List of all users on this data source", - "responses": { - "200": { - "description": "An array of users", - "schema": { - "$ref": "#/definitions/Users" - } - }, - "default": { - "description": "Unexpected internal service error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, "post": { "tags": [ "users" From 3937c5554639d63b8476413b0f88cf7f2a83fd2f Mon Sep 17 00:00:00 2001 From: Chris Goller Date: Thu, 8 Dec 2016 21:03:11 -0600 Subject: [PATCH 2/3] Fix Content-Type of the index.html page to be text/html --- dist/dist.go | 21 +++++++++++++++++---- server/assets.go | 7 +++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/dist/dist.go b/dist/dist.go index 8d447041e6..07b9d0ab41 100644 --- a/dist/dist.go +++ b/dist/dist.go @@ -19,14 +19,24 @@ func (d *DebugAssets) Handler() http.Handler { return http.FileServer(NewDir(d.Dir, d.Default)) } -// BindataAssets serves assets from go-bindata +// BindataAssets serves assets from go-bindata, but, also serves Default if assent doesn't exist +// This is to support single-page react-apps with its own router. type BindataAssets struct { - Prefix string // Prefix is prepended to the http file request - Default string // Default is the file to serve if the file is not found + Prefix string // Prefix is prepended to the http file request + Default string // Default is the file to serve if the file is not found + DefaultContentType string // DefaultContentType is the content type of the default file } // Handler serves go-bindata using a go-bindata-assetfs façade func (b *BindataAssets) Handler() http.Handler { + return b +} + +// ServeHTTP wraps http.FileServer by returning a default asset if the asset +// doesn't exist. This supports single-page react-apps with its own +// built-in router. Additionally, we override the content-type if the +// Default file is used. +func (b *BindataAssets) ServeHTTP(w http.ResponseWriter, r *http.Request) { // def wraps the assets to return the default file if the file doesn't exist def := func(name string) ([]byte, error) { // If the named asset exists, then return it directly. @@ -39,6 +49,9 @@ func (b *BindataAssets) Handler() http.Handler { } // If this is anything other than slash, we just return the default // asset. This default asset will handle the routing. + // Additionally, because we know we are returning the default asset, + // we need to set the default asset's content-type. + w.Header().Set("Content-Type", b.DefaultContentType) return Asset(b.Default) } return octets, nil @@ -49,5 +62,5 @@ func (b *BindataAssets) Handler() http.Handler { AssetInfo: AssetInfo, Prefix: b.Prefix, } - return http.FileServer(dir) + http.FileServer(dir).ServeHTTP(w, r) } diff --git a/server/assets.go b/server/assets.go index c18b25ef0b..cd55983588 100644 --- a/server/assets.go +++ b/server/assets.go @@ -16,6 +16,8 @@ const ( DebugDir = "ui/build" // DebugDefault is the default item to load if 404 DebugDefault = "ui/build/index.html" + // DefaultContentType is the content-type to return for the Default file + DefaultContentType = "text/html; charset=utf-8" ) // AssetsOpts configures the asset middleware @@ -36,8 +38,9 @@ func Assets(opts AssetsOpts) http.Handler { } } else { assets = &dist.BindataAssets{ - Prefix: Dir, - Default: Default, + Prefix: Dir, + Default: Default, + DefaultContentType: DefaultContentType, } } From 21d6d11f6599a8c46f874b2131a5a4cb1d9d7e02 Mon Sep 17 00:00:00 2001 From: Chris Goller Date: Thu, 8 Dec 2016 21:17:05 -0600 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6bc1625a7..b680548fcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,25 @@ ## v1.1.0 [unreleased] +## v1.1.0-beta2 [] + +### Bug Fixes + 1. [#664](https://github.com/influxdata/chronograf/issues/664): Fix Content-Type of single-page app to always be text/html + 1. [#671](https://github.com/influxdata/chronograf/issues/671): Fix multiple influxdb source freezing page + ## v1.1.0-beta1 [2016-12-06] -- Layouts +### Layouts 1. [#575](https://github.com/influxdata/chronograf/issues/556): Varnish Layout 2. [#535](https://github.com/influxdata/chronograf/issues/535): Elasticsearch Layout -- Features + +### Features 1. [#565](https://github.com/influxdata/chronograf/issues/565) [#246](https://github.com/influxdata/chronograf/issues/246) [#234](https://github.com/influxdata/chronograf/issues/234) [#311](https://github.com/influxdata/chronograf/issues/311) Github Oauth login 2. [#487](https://github.com/influxdata/chronograf/issues/487): Warn users if they are using a kapacitor instance that is configured to use an influxdb instance that does not match the current source 3. [#597](https://github.com/influxdata/chronograf/issues/597): Filter host by series tags 4. [#568](https://github.com/influxdata/chronograf/issues/568): [#569](https://github.com/influxdata/chronograf/issues/569): Add support for multiple y-axis, labels, and ranges 5. [#605](https://github.com/influxdata/chronograf/issues/605): Number visualization type in host view 5. [#607](https://github.com/influxdata/chronograf/issues/607): Number and line graph visualization type in host view -- Bug Fixes + +### Bug Fixes 1. [#536](https://github.com/influxdata/chronograf/issues/536) Redirect the user to the kapacitor config screen if they are attempting to view or edit alerts without a configured kapacitor 2. [#539](https://github.com/influxdata/chronograf/issues/539) Zoom works only on the first graph of a layout 3. [#494](https://github.com/influxdata/chronograf/issues/494) Layouts should only be displayed when the measurement is present