diff --git a/CHANGELOG.md b/CHANGELOG.md index afdf52c47c7..225e1db96ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,9 @@ * **InfluxDB**: Support for policy selection in query editor, closes [#2018](https://github.com/grafana/grafana/issues/2018) ### Breaking changes -**Plugin API**: Both datasource and panel plugin api (and plugin.json schema) as been updated, requiring a minor update to plugins. See [plugin api](https://github.com/grafana/grafana/blob/master/public/app/plugins/plugin_api.md) for more info. -**InfluxDB 0.8.x** The data source for the old version of influxdb (0.8.x) is no longer included in default builds. Can easily be installed via improved plugin system, closes #3523 -**KairosDB** The data source is no longer included in default builds. Can easily be installed via improved plugin system, closes #3524 +* **Plugin API**: Both datasource and panel plugin api (and plugin.json schema) have been updated, requiring a minor update to plugins. See [plugin api](https://github.com/grafana/grafana/blob/master/public/app/plugins/plugin_api.md) for more info. +* **InfluxDB 0.8.x** The data source for the old version of influxdb (0.8.x) is no longer included in default builds, but can easily be installed via improved plugin system, closes [#3523](https://github.com/grafana/grafana/issues/3523) +* **KairosDB** The data source is no longer included in default builds, but can easily be installed via improved plugin system, closes [#3524](https://github.com/grafana/grafana/issues/3524) ### Enhancements * **Sessions**: Support for memcached as session storage, closes [#3458](https://github.com/grafana/grafana/pull/3458) diff --git a/pkg/services/sqlstore/stats.go b/pkg/services/sqlstore/stats.go index fbd22ac0f5c..92efab2015d 100644 --- a/pkg/services/sqlstore/stats.go +++ b/pkg/services/sqlstore/stats.go @@ -83,7 +83,7 @@ func GetAdminStats(query *m.GetAdminStatsQuery) error { FROM ` + dialect.Quote("playlist") + ` ) AS playlist_count, ( - SELECT COUNT (DISTINCT ` + dialect.Quote("dashboard_id") + ` ) + SELECT COUNT(DISTINCT ` + dialect.Quote("dashboard_id") + ` ) FROM ` + dialect.Quote("star") + ` ) AS starred_db_count, ( diff --git a/pkg/util/url.go b/pkg/util/url.go index 758e6864fe4..ba452596a2b 100644 --- a/pkg/util/url.go +++ b/pkg/util/url.go @@ -27,6 +27,11 @@ func (r *UrlQueryReader) Get(name string, def string) string { func JoinUrlFragments(a, b string) string { aslash := strings.HasSuffix(a, "/") bslash := strings.HasPrefix(b, "/") + + if len(b) == 0 { + return a + } + switch { case aslash && bslash: return a + b[1:] diff --git a/pkg/util/url_test.go b/pkg/util/url_test.go new file mode 100644 index 00000000000..4dd221b9e0b --- /dev/null +++ b/pkg/util/url_test.go @@ -0,0 +1,46 @@ +package util + +import ( + "testing" + + . "github.com/smartystreets/goconvey/convey" +) + +func TestUrl(t *testing.T) { + + Convey("When joining two urls where right hand side is empty", t, func() { + result := JoinUrlFragments("http://localhost:8080", "") + + So(result, ShouldEqual, "http://localhost:8080") + }) + + Convey("When joining two urls where right hand side is empty and lefthand side has a trailing slash", t, func() { + result := JoinUrlFragments("http://localhost:8080/", "") + + So(result, ShouldEqual, "http://localhost:8080/") + }) + + Convey("When joining two urls where neither has a trailing slash", t, func() { + result := JoinUrlFragments("http://localhost:8080", "api") + + So(result, ShouldEqual, "http://localhost:8080/api") + }) + + Convey("When joining two urls where lefthand side has a trailing slash", t, func() { + result := JoinUrlFragments("http://localhost:8080/", "api") + + So(result, ShouldEqual, "http://localhost:8080/api") + }) + + Convey("When joining two urls where righthand side has preceding slash", t, func() { + result := JoinUrlFragments("http://localhost:8080", "/api") + + So(result, ShouldEqual, "http://localhost:8080/api") + }) + + Convey("When joining two urls where righthand side has trailing slash", t, func() { + result := JoinUrlFragments("http://localhost:8080", "api/") + + So(result, ShouldEqual, "http://localhost:8080/api/") + }) +} diff --git a/public/app/core/components/navbar/navbar.html b/public/app/core/components/navbar/navbar.html index 588b1c81b9a..2a21ee9b5f9 100644 --- a/public/app/core/components/navbar/navbar.html +++ b/public/app/core/components/navbar/navbar.html @@ -3,7 +3,7 @@
- + diff --git a/public/app/features/dashboard/dashnav/dashnav.html b/public/app/features/dashboard/dashnav/dashnav.html index bd084050c77..22478f47ec4 100644 --- a/public/app/features/dashboard/dashnav/dashnav.html +++ b/public/app/features/dashboard/dashnav/dashnav.html @@ -10,7 +10,7 @@
- + {{dashboard.title}}   (snapshot) diff --git a/public/app/features/dashboard/partials/shareModal.html b/public/app/features/dashboard/partials/shareModal.html index a8db481ca91..9bd64dd0bef 100644 --- a/public/app/features/dashboard/partials/shareModal.html +++ b/public/app/features/dashboard/partials/shareModal.html @@ -110,7 +110,7 @@