From 79e7ae44244339ed4b6a9e8239f646fdfb470b2b Mon Sep 17 00:00:00 2001 From: Anthony Woods Date: Fri, 29 Jan 2016 09:38:51 +0800 Subject: [PATCH 1/6] fix sql query in GetAdminStats. fixes #3883 --- pkg/services/sqlstore/stats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, ( From 3ed887036275a98eabe9a4c76b2f0bc85fcdb21f Mon Sep 17 00:00:00 2001 From: Vitaliy Fuks Date: Thu, 28 Jan 2016 22:02:29 -0500 Subject: [PATCH 2/6] Update CHANGELOG.md Minor grammar tweaks and formatting. --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) From 74decb4bdc2a5570ccde44722b9516ae4171dba9 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Fri, 29 Jan 2016 18:31:00 +0100 Subject: [PATCH 3/6] fix(dataproxy): no trailing slash if proxypath is empty The JoinUrlFragments function adds a trailing slash if to the proxy url if the proxy path is an empty string. This fix removes that trailing slash. Fixes #3847 --- pkg/util/url.go | 5 +++++ pkg/util/url_test.go | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 pkg/util/url_test.go 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/") + }) +} From 6ae464f33ad12787ee0fb1c04cc0b28d7eab25ce Mon Sep 17 00:00:00 2001 From: Trent White Date: Fri, 29 Jan 2016 12:46:57 -0500 Subject: [PATCH 4/6] add rt-fonts file and point refs to snapshot icon to it --- .../features/dashboard/dashnav/dashnav.html | 2 +- .../dashboard/partials/shareModal.html | 2 +- public/fonts/raintank-icons.eot | Bin 0 -> 24144 bytes public/fonts/raintank-icons.svg | 57 ++++++ public/fonts/raintank-icons.ttf | Bin 0 -> 23952 bytes public/fonts/raintank-icons.woff | Bin 0 -> 24028 bytes public/img/grafana_icon.svg | 58 ++++++ public/less/grafana.less | 2 +- public/less/rt-fonts.less | 168 ++++++++++++++++++ 9 files changed, 286 insertions(+), 3 deletions(-) create mode 100755 public/fonts/raintank-icons.eot create mode 100755 public/fonts/raintank-icons.svg create mode 100755 public/fonts/raintank-icons.ttf create mode 100755 public/fonts/raintank-icons.woff create mode 100644 public/img/grafana_icon.svg create mode 100644 public/less/rt-fonts.less diff --git a/public/app/features/dashboard/dashnav/dashnav.html b/public/app/features/dashboard/dashnav/dashnav.html index bd084050c77..e41852ea03e 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..e0d5698cd3f 100644 --- a/public/app/features/dashboard/partials/shareModal.html +++ b/public/app/features/dashboard/partials/shareModal.html @@ -110,7 +110,7 @@