From 651103bdda26e248c427a16b49a54e8313c28150 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 15 Feb 2018 14:56:52 +0100 Subject: [PATCH 1/9] chore: adds comment for exported function --- pkg/util/shortid_generator.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/util/shortid_generator.go b/pkg/util/shortid_generator.go index ca65902e869..f2d9faa61c8 100644 --- a/pkg/util/shortid_generator.go +++ b/pkg/util/shortid_generator.go @@ -14,6 +14,12 @@ var validUidPattern = regexp.MustCompile(`^[a-zA-Z0-9\-\_]*$`).MatchString var ErrDashboardInvalidUid = errors.New("uid contains illegal characters") var ErrDashboardUidToLong = errors.New("uid to long. max 40 characters") +func init() { + gen, _ := shortid.New(1, allowedChars, 1) + shortid.SetDefault(gen) +} + +// VerifyUid verifies the size and content of the uid func VerifyUid(uid string) error { if len(uid) > 40 { return ErrDashboardUidToLong @@ -26,11 +32,6 @@ func VerifyUid(uid string) error { return nil } -func init() { - gen, _ := shortid.New(1, allowedChars, 1) - shortid.SetDefault(gen) -} - // GenerateShortUid generates a short unique identifier. func GenerateShortUid() string { return shortid.MustGenerate() From 3ddfd8bd09bb52dda2b7f4dd30a43eb350b19c12 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Thu, 15 Feb 2018 16:47:30 +0100 Subject: [PATCH 2/9] alert notifiers: better error messages. --- .../alerting/notification_edit_ctrl.ts | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/public/app/features/alerting/notification_edit_ctrl.ts b/public/app/features/alerting/notification_edit_ctrl.ts index 5cada3035a4..bca6f6e8137 100644 --- a/public/app/features/alerting/notification_edit_ctrl.ts +++ b/public/app/features/alerting/notification_edit_ctrl.ts @@ -58,15 +58,29 @@ export class AlertNotificationEditCtrl { } if (this.model.id) { - this.backendSrv.put(`/api/alert-notifications/${this.model.id}`, this.model).then(res => { - this.model = res; - appEvents.emit('alert-success', ['Notification updated', '']); - }); + this.backendSrv + .put(`/api/alert-notifications/${this.model.id}`, this.model) + .then(res => { + this.model = res; + appEvents.emit('alert-success', ['Notification updated', '']); + }) + .catch(err => { + if (err.data && err.data.error) { + appEvents.emit('alert-error', [err.data.error]); + } + }); } else { - this.backendSrv.post(`/api/alert-notifications`, this.model).then(res => { - appEvents.emit('alert-success', ['Notification created', '']); - this.$location.path('alerting/notifications'); - }); + this.backendSrv + .post(`/api/alert-notifications`, this.model) + .then(res => { + appEvents.emit('alert-success', ['Notification created', '']); + this.$location.path('alerting/notifications'); + }) + .catch(err => { + if (err.data && err.data.error) { + appEvents.emit('alert-error', [err.data.error]); + } + }); } } From 6fa46d9539eb89fa7c70d29c6c55153985736e4f Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Thu, 15 Feb 2018 15:10:16 +0100 Subject: [PATCH 3/9] plugins: update meta data for all core plugins So that the readme's can be published on Grafana.com --- public/app/plugins/datasource/cloudwatch/README.md | 4 ++-- public/app/plugins/datasource/cloudwatch/plugin.json | 4 +++- public/app/plugins/datasource/elasticsearch/README.md | 2 +- public/app/plugins/datasource/elasticsearch/plugin.json | 2 +- public/app/plugins/datasource/graphite/README.md | 6 +++++- public/app/plugins/datasource/graphite/plugin.json | 8 +++++++- public/app/plugins/datasource/influxdb/README.md | 6 ++---- public/app/plugins/datasource/influxdb/plugin.json | 4 +++- public/app/plugins/datasource/mysql/README.md | 5 +++-- public/app/plugins/datasource/mysql/plugin.json | 4 +++- public/app/plugins/datasource/opentsdb/README.md | 4 ++-- public/app/plugins/datasource/opentsdb/plugin.json | 4 +++- public/app/plugins/datasource/postgres/README.md | 5 +++-- public/app/plugins/datasource/postgres/plugin.json | 4 +++- public/app/plugins/datasource/prometheus/README.md | 2 +- public/app/plugins/datasource/prometheus/plugin.json | 7 ++++++- public/app/plugins/panel/alertlist/README.md | 8 ++++++++ public/app/plugins/panel/alertlist/plugin.json | 6 ++++-- public/app/plugins/panel/dashlist/plugin.json | 4 +++- public/app/plugins/panel/graph/plugin.json | 4 +++- public/app/plugins/panel/heatmap/README.md | 7 +++++++ public/app/plugins/panel/heatmap/plugin.json | 8 +++++++- public/app/plugins/panel/pluginlist/README.md | 1 + public/app/plugins/panel/pluginlist/plugin.json | 4 +++- public/app/plugins/panel/singlestat/plugin.json | 4 +++- public/app/plugins/panel/table/README.md | 2 +- public/app/plugins/panel/table/plugin.json | 4 +++- public/app/plugins/panel/text/plugin.json | 3 ++- 28 files changed, 93 insertions(+), 33 deletions(-) diff --git a/public/app/plugins/datasource/cloudwatch/README.md b/public/app/plugins/datasource/cloudwatch/README.md index a1b7bf5cc50..5e420a4fada 100644 --- a/public/app/plugins/datasource/cloudwatch/README.md +++ b/public/app/plugins/datasource/cloudwatch/README.md @@ -1,7 +1,7 @@ -# CloudWatch Datasource - Native Plugin +# CloudWatch Data Source - Native Plugin Grafana ships with **built in** support for CloudWatch. You just have to add it as a data source and you will be ready to build dashboards for you CloudWatch metrics. Read more about it here: -[http://docs.grafana.org/datasources/cloudwatch/](http://docs.grafana.org/datasources/cloudwatch/) \ No newline at end of file +[http://docs.grafana.org/datasources/cloudwatch/](http://docs.grafana.org/datasources/cloudwatch/) diff --git a/public/app/plugins/datasource/cloudwatch/plugin.json b/public/app/plugins/datasource/cloudwatch/plugin.json index 3af7d8ccb6e..20cfcf661c5 100644 --- a/public/app/plugins/datasource/cloudwatch/plugin.json +++ b/public/app/plugins/datasource/cloudwatch/plugin.json @@ -8,6 +8,7 @@ "annotations": true, "info": { + "description": "Cloudwatch Data Source for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -15,6 +16,7 @@ "logos": { "small": "img/amazon-web-services.png", "large": "img/amazon-web-services.png" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/datasource/elasticsearch/README.md b/public/app/plugins/datasource/elasticsearch/README.md index 22445b022fe..fd1f2f74f7a 100644 --- a/public/app/plugins/datasource/elasticsearch/README.md +++ b/public/app/plugins/datasource/elasticsearch/README.md @@ -1,4 +1,4 @@ -# Elasticsearch Datasource - Native Plugin +# Elasticsearch Data Source - Native Plugin Grafana ships with **advanced support** for Elasticsearch. You can do many types of simple or complex elasticsearch queries to visualize logs or metrics stored in Elasticsearch. You can also annotate your graphs with log events stored in Elasticsearch. diff --git a/public/app/plugins/datasource/elasticsearch/plugin.json b/public/app/plugins/datasource/elasticsearch/plugin.json index f86c2f8f89f..59d26b785ac 100644 --- a/public/app/plugins/datasource/elasticsearch/plugin.json +++ b/public/app/plugins/datasource/elasticsearch/plugin.json @@ -17,7 +17,7 @@ "links": [ {"name": "elastic.co", "url": "https://www.elastic.co/products/elasticsearch"} ], - "version": "3.0.0" + "version": "5.0.0" }, "annotations": true, diff --git a/public/app/plugins/datasource/graphite/README.md b/public/app/plugins/datasource/graphite/README.md index c27c5789bca..68e3a36da63 100644 --- a/public/app/plugins/datasource/graphite/README.md +++ b/public/app/plugins/datasource/graphite/README.md @@ -6,4 +6,8 @@ Grafana has an advanced Graphite query editor that lets you quickly navigate the Read more about it here: -[http://docs.grafana.org/datasources/graphite/](http://docs.grafana.org/datasources/graphite/) \ No newline at end of file +[http://docs.grafana.org/datasources/graphite/](http://docs.grafana.org/datasources/graphite/) + +Graphite 1.1 Release: + +[https://grafana.com/blog/2018/01/11/graphite-1.1-teaching-an-old-dog-new-tricks/](https://grafana.com/blog/2018/01/11/graphite-1.1-teaching-an-old-dog-new-tricks/) diff --git a/public/app/plugins/datasource/graphite/plugin.json b/public/app/plugins/datasource/graphite/plugin.json index 366c56f62c8..1448242ed05 100644 --- a/public/app/plugins/datasource/graphite/plugin.json +++ b/public/app/plugins/datasource/graphite/plugin.json @@ -17,6 +17,7 @@ }, "info": { + "description": "Graphite Data Source for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -24,6 +25,11 @@ "logos": { "small": "img/graphite_logo.png", "large": "img/graphite_logo.png" - } + }, + "links": [ + {"name": "Graphite", "url": "https://graphiteapp.org/"}, + {"name": "Graphite 1.1 Release", "url": "https://grafana.com/blog/2018/01/11/graphite-1.1-teaching-an-old-dog-new-tricks/"} + ], + "version": "5.0.0" } } diff --git a/public/app/plugins/datasource/influxdb/README.md b/public/app/plugins/datasource/influxdb/README.md index aca126db36c..bc75de4feb6 100644 --- a/public/app/plugins/datasource/influxdb/README.md +++ b/public/app/plugins/datasource/influxdb/README.md @@ -1,10 +1,8 @@ # InfluxDB Datasource - Native Plugin -Grafana ships with **built in** support for InfluxDB 0.9. +Grafana ships with **built in** support for InfluxDB (> 0.9.x). -There are currently two separate datasources for InfluxDB in Grafana: InfluxDB 0.8.x and InfluxDB 0.9.x. The API and capabilities of InfluxDB 0.9.x are completely different from InfluxDB 0.8.x which is why Grafana handles them as different data sources. - -This is the plugin for InfluxDB 0.9. It is rapidly evolving and we continue to track its API. +There are currently two separate datasources for InfluxDB in Grafana: InfluxDB 0.8.x and the latest InfluxDB release. The API and capabilities of latest (> 0.9.x) InfluxDB are completely different from InfluxDB 0.8.x which is why Grafana handles them as different data sources. InfluxDB 0.8 is no longer maintained by InfluxDB Inc, but we provide support as a convenience to existing users. You can find it [here](https://grafana.com/plugins/grafana-influxdb-08-datasource). diff --git a/public/app/plugins/datasource/influxdb/plugin.json b/public/app/plugins/datasource/influxdb/plugin.json index 7300940cbb8..973c4ac52cd 100644 --- a/public/app/plugins/datasource/influxdb/plugin.json +++ b/public/app/plugins/datasource/influxdb/plugin.json @@ -13,6 +13,7 @@ }, "info": { + "description": "InfluxDB Data Source for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -20,6 +21,7 @@ "logos": { "small": "img/influxdb_logo.svg", "large": "img/influxdb_logo.svg" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/datasource/mysql/README.md b/public/app/plugins/datasource/mysql/README.md index 4143f69be08..1cdf72f462b 100644 --- a/public/app/plugins/datasource/mysql/README.md +++ b/public/app/plugins/datasource/mysql/README.md @@ -1,8 +1,9 @@ -# Mysql Datasource - Native Plugin +# MySQL Data Source - Native Plugin Grafana ships with a built-in MySQL data source plugin that allow you to query any visualize data from a MySQL compatible database. -##Adding the data source +## Adding the data source + 1. Open the side menu by clicking the Grafana icon in the top header. 2. In the side menu under the Dashboards link you should find a link named Data Sources. 3. Click the + Add data source button in the top header. diff --git a/public/app/plugins/datasource/mysql/plugin.json b/public/app/plugins/datasource/mysql/plugin.json index 5f35b3f709f..363b9364016 100644 --- a/public/app/plugins/datasource/mysql/plugin.json +++ b/public/app/plugins/datasource/mysql/plugin.json @@ -4,6 +4,7 @@ "id": "mysql", "info": { + "description": "MySQL Data Source for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -11,7 +12,8 @@ "logos": { "small": "img/mysql_logo.svg", "large": "img/mysql_logo.svg" - } + }, + "version": "5.0.0" }, "alerting": true, diff --git a/public/app/plugins/datasource/opentsdb/README.md b/public/app/plugins/datasource/opentsdb/README.md index 697ecd5c4dc..4afd5dce1b2 100644 --- a/public/app/plugins/datasource/opentsdb/README.md +++ b/public/app/plugins/datasource/opentsdb/README.md @@ -1,7 +1,7 @@ -# OpenTSDB Datasource - Native Plugin +# OpenTSDB Data Source - Native Plugin Grafana ships with **built in** support for OpenTSDB, a scalable, distributed time series database. Read more about it here: -[http://docs.grafana.org/datasources/opentsdb/](http://docs.grafana.org/datasources/opentsdb/) \ No newline at end of file +[http://docs.grafana.org/datasources/opentsdb/](http://docs.grafana.org/datasources/opentsdb/) diff --git a/public/app/plugins/datasource/opentsdb/plugin.json b/public/app/plugins/datasource/opentsdb/plugin.json index b2f4503b5ff..571c311cbcb 100644 --- a/public/app/plugins/datasource/opentsdb/plugin.json +++ b/public/app/plugins/datasource/opentsdb/plugin.json @@ -9,6 +9,7 @@ "alerting": true, "info": { + "description": "OpenTSDB Data Source for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -16,6 +17,7 @@ "logos": { "small": "img/opentsdb_logo.png", "large": "img/opentsdb_logo.png" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/datasource/postgres/README.md b/public/app/plugins/datasource/postgres/README.md index 16ee86a4c8c..75c36158418 100644 --- a/public/app/plugins/datasource/postgres/README.md +++ b/public/app/plugins/datasource/postgres/README.md @@ -1,8 +1,9 @@ -# Grafana PostgreSQL Datasource - Native Plugin +# Grafana PostgreSQL Data Source - Native Plugin Grafana ships with a built-in PostgreSQL data source plugin that allows you to query and visualize data from a PostgreSQL compatible database. -##Adding the data source +## Adding the data source + 1. Open the side menu by clicking the Grafana icon in the top header. 2. In the side menu under the Dashboards link you should find a link named Data Sources. 3. Click the + Add data source button in the top header. diff --git a/public/app/plugins/datasource/postgres/plugin.json b/public/app/plugins/datasource/postgres/plugin.json index 26d050ba8ed..af2dbc4468e 100644 --- a/public/app/plugins/datasource/postgres/plugin.json +++ b/public/app/plugins/datasource/postgres/plugin.json @@ -4,6 +4,7 @@ "id": "postgres", "info": { + "description": "PostgreSQL Data Source for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -11,7 +12,8 @@ "logos": { "small": "img/postgresql_logo.svg", "large": "img/postgresql_logo.svg" - } + }, + "version": "5.0.0" }, "alerting": true, diff --git a/public/app/plugins/datasource/prometheus/README.md b/public/app/plugins/datasource/prometheus/README.md index 5b188c3393c..2c44605c04c 100644 --- a/public/app/plugins/datasource/prometheus/README.md +++ b/public/app/plugins/datasource/prometheus/README.md @@ -1,4 +1,4 @@ -# Prometheus Datasource - Native Plugin +# Prometheus Data Source - Native Plugin Grafana ships with **built in** support for Prometheus, the open-source service monitoring system and time series database. diff --git a/public/app/plugins/datasource/prometheus/plugin.json b/public/app/plugins/datasource/prometheus/plugin.json index aa48a077b50..88847765159 100644 --- a/public/app/plugins/datasource/prometheus/plugin.json +++ b/public/app/plugins/datasource/prometheus/plugin.json @@ -18,6 +18,7 @@ }, "info": { + "description": "Prometheus Data Source for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -25,6 +26,10 @@ "logos": { "small": "img/prometheus_logo.svg", "large": "img/prometheus_logo.svg" - } + }, + "links": [ + {"name": "Prometheus", "url": "https://prometheus.io/"} + ], + "version": "5.0.0" } } diff --git a/public/app/plugins/panel/alertlist/README.md b/public/app/plugins/panel/alertlist/README.md index bc01e2ff1d1..36c305f3182 100644 --- a/public/app/plugins/panel/alertlist/README.md +++ b/public/app/plugins/panel/alertlist/README.md @@ -1 +1,9 @@ # Alert List Panel - Native plugin + +This Alert List panel is **included** with Grafana. + +The Alert List panel allows you to display alerts on a dashboard. The list can be configured to show either the current state of your alerts or recent alert state changes. You can read more about alerts [here](http://docs.grafana.org/alerting/rules). + +Read more about it here: + +[http://docs.grafana.org/features/panels/alertlist/](http://docs.grafana.org/features/panels/alertlist/) diff --git a/public/app/plugins/panel/alertlist/plugin.json b/public/app/plugins/panel/alertlist/plugin.json index 9fd42bc5ed2..ff36a572f2b 100644 --- a/public/app/plugins/panel/alertlist/plugin.json +++ b/public/app/plugins/panel/alertlist/plugin.json @@ -4,13 +4,15 @@ "id": "alertlist", "info": { + "description": "Shows list of alerts and their current status", "author": { "name": "Grafana Project", "url": "https://grafana.com" -}, + }, "logos": { "small": "img/icn-singlestat-panel.svg", "large": "img/icn-singlestat-panel.svg" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/panel/dashlist/plugin.json b/public/app/plugins/panel/dashlist/plugin.json index 3b8eca5e49d..9dcde08a598 100644 --- a/public/app/plugins/panel/dashlist/plugin.json +++ b/public/app/plugins/panel/dashlist/plugin.json @@ -4,6 +4,7 @@ "id": "dashlist", "info": { + "description": "List of dynamic links to other dashboards", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -11,6 +12,7 @@ "logos": { "small": "img/icn-dashlist-panel.svg", "large": "img/icn-dashlist-panel.svg" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/panel/graph/plugin.json b/public/app/plugins/panel/graph/plugin.json index 102c7d14e56..c0c8e8db290 100644 --- a/public/app/plugins/panel/graph/plugin.json +++ b/public/app/plugins/panel/graph/plugin.json @@ -4,6 +4,7 @@ "id": "graph", "info": { + "description": "Graph Panel for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -11,7 +12,8 @@ "logos": { "small": "img/icn-graph-panel.svg", "large": "img/icn-graph-panel.svg" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/panel/heatmap/README.md b/public/app/plugins/panel/heatmap/README.md index e69de29bb2d..1b95a02c4cb 100644 --- a/public/app/plugins/panel/heatmap/README.md +++ b/public/app/plugins/panel/heatmap/README.md @@ -0,0 +1,7 @@ +# Heatmap Panel - Native Plugin + +The Heatmap panel allows you to view histograms over time and is **included** with Grafana. + +Read more about it here: + +[http://docs.grafana.org/features/panels/heatmap/](http://docs.grafana.org/features/panels/heatmap/) diff --git a/public/app/plugins/panel/heatmap/plugin.json b/public/app/plugins/panel/heatmap/plugin.json index bee509467a7..723d8e886a0 100644 --- a/public/app/plugins/panel/heatmap/plugin.json +++ b/public/app/plugins/panel/heatmap/plugin.json @@ -4,6 +4,7 @@ "id": "heatmap", "info": { + "description": "Heatmap Panel for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -11,6 +12,11 @@ "logos": { "small": "img/icn-heatmap-panel.svg", "large": "img/icn-heatmap-panel.svg" - } + }, + "links": [ + {"name": "Brendan Gregg - Heatmaps", "url": "http://www.brendangregg.com/heatmaps.html"}, + {"name": "Brendan Gregg - Latency Heatmaps", "url": " http://www.brendangregg.com/HeatMaps/latency.html"} + ], + "version": "5.0.0" } } diff --git a/public/app/plugins/panel/pluginlist/README.md b/public/app/plugins/panel/pluginlist/README.md index 463769dad1f..3aacada938b 100644 --- a/public/app/plugins/panel/pluginlist/README.md +++ b/public/app/plugins/panel/pluginlist/README.md @@ -1,2 +1,3 @@ # Plugin List Panel - Native Plugin +The Plugin List plans shows the installed plugins for your Grafana instance and is **included** with Grafana. It is used on the default Home dashboard. diff --git a/public/app/plugins/panel/pluginlist/plugin.json b/public/app/plugins/panel/pluginlist/plugin.json index 0cdc506167c..b955177f1bc 100644 --- a/public/app/plugins/panel/pluginlist/plugin.json +++ b/public/app/plugins/panel/pluginlist/plugin.json @@ -4,6 +4,7 @@ "id": "pluginlist", "info": { + "description": "Plugin List for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -11,6 +12,7 @@ "logos": { "small": "img/icn-dashlist-panel.svg", "large": "img/icn-dashlist-panel.svg" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/panel/singlestat/plugin.json b/public/app/plugins/panel/singlestat/plugin.json index 8bf45d3b690..5e36ab5cf4e 100644 --- a/public/app/plugins/panel/singlestat/plugin.json +++ b/public/app/plugins/panel/singlestat/plugin.json @@ -4,6 +4,7 @@ "id": "singlestat", "info": { + "description": "Singlestat Panel for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -11,7 +12,8 @@ "logos": { "small": "img/icn-singlestat-panel.svg", "large": "img/icn-singlestat-panel.svg" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/panel/table/README.md b/public/app/plugins/panel/table/README.md index 48c4fac641b..98f2c13f75c 100644 --- a/public/app/plugins/panel/table/README.md +++ b/public/app/plugins/panel/table/README.md @@ -6,4 +6,4 @@ The table panel is very flexible, supporting both multiple modes for time series Check out the [Table Panel Showcase in the Grafana Playground](http://play.grafana.org/dashboard/db/table-panel-showcase) or read more about it here: -[http://docs.grafana.org/reference/table_panel/](http://docs.grafana.org/reference/table_panel/) \ No newline at end of file +[http://docs.grafana.org/reference/table_panel/](http://docs.grafana.org/reference/table_panel/) diff --git a/public/app/plugins/panel/table/plugin.json b/public/app/plugins/panel/table/plugin.json index c1d2c43b128..3b6cbaae876 100644 --- a/public/app/plugins/panel/table/plugin.json +++ b/public/app/plugins/panel/table/plugin.json @@ -4,6 +4,7 @@ "id": "table", "info": { + "description": "Table Panel for Grafana", "author": { "name": "Grafana Project", "url": "https://grafana.com" @@ -11,7 +12,8 @@ "logos": { "small": "img/icn-table-panel.svg", "large": "img/icn-table-panel.svg" - } + }, + "version": "5.0.0" } } diff --git a/public/app/plugins/panel/text/plugin.json b/public/app/plugins/panel/text/plugin.json index 9bc604a87bb..6152bd322b5 100644 --- a/public/app/plugins/panel/text/plugin.json +++ b/public/app/plugins/panel/text/plugin.json @@ -11,7 +11,8 @@ "logos": { "small": "img/icn-text-panel.svg", "large": "img/icn-text-panel.svg" - } + }, + "version": "5.0.0" } } From b8b6dc6d6d2fb1006a510ea4de3f804eda3abc44 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Thu, 15 Feb 2018 10:37:23 -0800 Subject: [PATCH 4/9] Minor typo fix --- conf/defaults.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index 3766c829323..86768738171 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -327,7 +327,7 @@ allow_sign_up = true enabled = false host = localhost:25 user = -# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" password = cert_file = key_file = From 43baf20dcd3315147fa0ab40d0e59e6f1c1628c9 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Thu, 15 Feb 2018 10:41:04 -0800 Subject: [PATCH 5/9] Update ldap.md --- docs/sources/installation/ldap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/installation/ldap.md b/docs/sources/installation/ldap.md index 8f6be6e1d8c..85501e51d85 100644 --- a/docs/sources/installation/ldap.md +++ b/docs/sources/installation/ldap.md @@ -43,7 +43,7 @@ ssl_skip_verify = false # Search user bind dn bind_dn = "cn=admin,dc=grafana,dc=org" # Search user bind password -# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" bind_password = 'grafana' # User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)" From 7535cefed9be855164aca58afd1e39c0f9266079 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Thu, 15 Feb 2018 10:41:15 -0800 Subject: [PATCH 6/9] Update ldap.toml --- conf/ldap.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/ldap.toml b/conf/ldap.toml index ae217106cb2..166d85eabb1 100644 --- a/conf/ldap.toml +++ b/conf/ldap.toml @@ -19,7 +19,7 @@ ssl_skip_verify = false # Search user bind dn bind_dn = "cn=admin,dc=grafana,dc=org" # Search user bind password -# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" bind_password = 'grafana' # User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)" From 2d03ab1770608af18431a38484c384bef7abc3be Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Thu, 15 Feb 2018 10:41:26 -0800 Subject: [PATCH 7/9] Update sample.ini --- conf/sample.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/sample.ini b/conf/sample.ini index 784f6b7cfc9..5f13dad4061 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -71,7 +71,7 @@ ;host = 127.0.0.1:3306 ;name = grafana ;user = root -# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" ;password = # Use either URL or the previous fields to configure the database From 2c5f3fbc5b1cec65fca9feb3a5f9072380f55585 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Fri, 16 Feb 2018 11:11:26 +0300 Subject: [PATCH 8/9] repeat row: fix panels placement bug (#10932) --- public/app/features/dashboard/dashboard_model.ts | 3 ++- .../app/features/dashboard/specs/repeat.jest.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/dashboard_model.ts b/public/app/features/dashboard/dashboard_model.ts index 055b59065ae..e35f8f0d430 100644 --- a/public/app/features/dashboard/dashboard_model.ts +++ b/public/app/features/dashboard/dashboard_model.ts @@ -500,11 +500,12 @@ export class DashboardModel { if (!rowPanel.panels || rowPanel.panels.length === 0) { return 0; } + const rowYPos = rowPanel.gridPos.y; const positions = _.map(rowPanel.panels, 'gridPos'); const maxPos = _.maxBy(positions, pos => { return pos.y + pos.h; }); - return maxPos.h + 1; + return maxPos.y + maxPos.h - rowYPos; } removePanel(panel: PanelModel) { diff --git a/public/app/features/dashboard/specs/repeat.jest.ts b/public/app/features/dashboard/specs/repeat.jest.ts index 868db3b7246..09bb3b7c494 100644 --- a/public/app/features/dashboard/specs/repeat.jest.ts +++ b/public/app/features/dashboard/specs/repeat.jest.ts @@ -500,6 +500,22 @@ describe('given dashboard with row repeat', function() { ); expect(panel_ids.length).toEqual(_.uniq(panel_ids).length); }); + + it('should place new panels in proper order', function() { + dashboardJSON.panels = [ + { id: 1, type: 'row', gridPos: { x: 0, y: 0, h: 1, w: 24 }, repeat: 'apps' }, + { id: 2, type: 'graph', gridPos: { x: 0, y: 1, h: 3, w: 12 } }, + { id: 3, type: 'graph', gridPos: { x: 6, y: 1, h: 4, w: 12 } }, + { id: 4, type: 'graph', gridPos: { x: 0, y: 5, h: 2, w: 12 } }, + ]; + dashboard = new DashboardModel(dashboardJSON); + dashboard.processRepeats(); + + const panel_types = _.map(dashboard.panels, 'type'); + expect(panel_types).toEqual(['row', 'graph', 'graph', 'graph', 'row', 'graph', 'graph', 'graph']); + const panel_y_positions = _.map(dashboard.panels, p => p.gridPos.y); + expect(panel_y_positions).toEqual([0, 1, 1, 5, 7, 8, 8, 12]); + }); }); describe('given dashboard with row and panel repeat', () => { From 244ae555d9469d063ed52f7ef134ad522479a9bc Mon Sep 17 00:00:00 2001 From: Patrick O'Carroll Date: Fri, 16 Feb 2018 09:14:32 +0100 Subject: [PATCH 9/9] Close modal with esc (#10929) * added var to check if modal is open and an if for escape fullview * moved showconfirmmodal to utils, showconfirmmodal now uses showmodal, esc works in textinput * made esc global --- package.json | 1 + public/app/core/services/alert_srv.ts | 42 +----------- public/app/core/services/keybindingSrv.ts | 56 +++++++++++----- public/app/core/services/util_srv.ts | 33 +++++++++ yarn.lock | 82 ++--------------------- 5 files changed, 80 insertions(+), 134 deletions(-) diff --git a/package.json b/package.json index 79f7c3f84c0..8cd0468b9c8 100644 --- a/package.json +++ b/package.json @@ -150,6 +150,7 @@ "mobx-state-tree": "^1.3.1", "moment": "^2.18.1", "mousetrap": "^1.6.0", + "mousetrap-global-bind": "^1.1.0", "perfect-scrollbar": "^1.2.0", "prop-types": "^15.6.0", "react": "^16.2.0", diff --git a/public/app/core/services/alert_srv.ts b/public/app/core/services/alert_srv.ts index 35e8e39804f..fc76ef9e371 100644 --- a/public/app/core/services/alert_srv.ts +++ b/public/app/core/services/alert_srv.ts @@ -7,7 +7,7 @@ export class AlertSrv { list: any[]; /** @ngInject */ - constructor(private $timeout, private $rootScope, private $modal) { + constructor(private $timeout, private $rootScope) { this.list = []; } @@ -39,7 +39,6 @@ export class AlertSrv { appEvents.on('alert-warning', options => this.set(options[0], options[1], 'warning', 5000)); appEvents.on('alert-success', options => this.set(options[0], options[1], 'success', 3000)); appEvents.on('alert-error', options => this.set(options[0], options[1], 'error', 7000)); - appEvents.on('confirm-modal', this.showConfirmModal.bind(this)); } getIconForSeverity(severity) { @@ -96,45 +95,6 @@ export class AlertSrv { clearAll() { this.list = []; } - - showConfirmModal(payload) { - var scope = this.$rootScope.$new(); - - scope.onConfirm = function() { - payload.onConfirm(); - scope.dismiss(); - }; - - scope.updateConfirmText = function(value) { - scope.confirmTextValid = payload.confirmText.toLowerCase() === value.toLowerCase(); - }; - - scope.title = payload.title; - scope.text = payload.text; - scope.text2 = payload.text2; - scope.confirmText = payload.confirmText; - - scope.onConfirm = payload.onConfirm; - scope.onAltAction = payload.onAltAction; - scope.altActionText = payload.altActionText; - scope.icon = payload.icon || 'fa-check'; - scope.yesText = payload.yesText || 'Yes'; - scope.noText = payload.noText || 'Cancel'; - scope.confirmTextValid = scope.confirmText ? false : true; - - var confirmModal = this.$modal({ - template: 'public/app/partials/confirm_modal.html', - persist: false, - modalClass: 'confirm-modal', - show: false, - scope: scope, - keyboard: false, - }); - - confirmModal.then(function(modalEl) { - modalEl.modal('show'); - }); - } } coreModule.service('alertSrv', AlertSrv); diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index 36fe73b62ce..ce3657a4299 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -5,9 +5,11 @@ import coreModule from 'app/core/core_module'; import appEvents from 'app/core/app_events'; import Mousetrap from 'mousetrap'; +import 'mousetrap-global-bind'; export class KeybindingSrv { helpModal: boolean; + modalOpen = false; /** @ngInject */ constructor(private $rootScope, private $location) { @@ -19,6 +21,7 @@ export class KeybindingSrv { }); this.setupGlobal(); + appEvents.on('show-modal', () => (this.modalOpen = true)); } setupGlobal() { @@ -30,6 +33,7 @@ export class KeybindingSrv { this.bind('s o', this.openSearch); this.bind('s t', this.openSearchTags); this.bind('f', this.openSearch); + this.bindGlobal('esc', this.exit); } openSearchStarred() { @@ -60,6 +64,28 @@ export class KeybindingSrv { appEvents.emit('show-modal', { templateHtml: '' }); } + exit() { + var popups = $('.popover.in'); + if (popups.length > 0) { + return; + } + + appEvents.emit('hide-modal'); + + if (!this.modalOpen) { + appEvents.emit('panel-change-view', { fullscreen: false, edit: false }); + } else { + this.modalOpen = false; + } + + // close settings view + var search = this.$location.search(); + if (search.editview) { + delete search.editview; + this.$location.search(search); + } + } + bind(keyArg, fn) { Mousetrap.bind( keyArg, @@ -73,6 +99,19 @@ export class KeybindingSrv { ); } + bindGlobal(keyArg, fn) { + Mousetrap.bindGlobal( + keyArg, + evt => { + evt.preventDefault(); + evt.stopPropagation(); + evt.returnValue = false; + return this.$rootScope.$apply(fn.bind(this)); + }, + 'keydown' + ); + } + showDashEditView() { var search = _.extend(this.$location.search(), { editview: 'settings' }); this.$location.search(search); @@ -204,23 +243,6 @@ export class KeybindingSrv { this.bind('d v', () => { appEvents.emit('toggle-view-mode'); }); - - this.bind('esc', () => { - var popups = $('.popover.in'); - if (popups.length > 0) { - return; - } - - scope.appEvent('hide-modal'); - scope.appEvent('panel-change-view', { fullscreen: false, edit: false }); - - // close settings view - var search = this.$location.search(); - if (search.editview) { - delete search.editview; - this.$location.search(search); - } - }); } } diff --git a/public/app/core/services/util_srv.ts b/public/app/core/services/util_srv.ts index 52c934ee9ee..1afae0a02f4 100644 --- a/public/app/core/services/util_srv.ts +++ b/public/app/core/services/util_srv.ts @@ -10,6 +10,7 @@ export class UtilSrv { init() { appEvents.on('show-modal', this.showModal.bind(this), this.$rootScope); appEvents.on('hide-modal', this.hideModal.bind(this), this.$rootScope); + appEvents.on('confirm-modal', this.showConfirmModal.bind(this), this.$rootScope); } hideModal() { @@ -47,6 +48,38 @@ export class UtilSrv { modalEl.modal('show'); }); } + + showConfirmModal(payload) { + var scope = this.$rootScope.$new(); + + scope.onConfirm = function() { + payload.onConfirm(); + scope.dismiss(); + }; + + scope.updateConfirmText = function(value) { + scope.confirmTextValid = payload.confirmText.toLowerCase() === value.toLowerCase(); + }; + + scope.title = payload.title; + scope.text = payload.text; + scope.text2 = payload.text2; + scope.confirmText = payload.confirmText; + + scope.onConfirm = payload.onConfirm; + scope.onAltAction = payload.onAltAction; + scope.altActionText = payload.altActionText; + scope.icon = payload.icon || 'fa-check'; + scope.yesText = payload.yesText || 'Yes'; + scope.noText = payload.noText || 'Cancel'; + scope.confirmTextValid = scope.confirmText ? false : true; + + appEvents.emit('show-modal', { + src: 'public/app/partials/confirm_modal.html', + scope: scope, + modalClass: 'confirm-modal', + }); + } } coreModule.service('utilSrv', UtilSrv); diff --git a/yarn.lock b/yarn.lock index 83a906c919d..a78fcf0c3d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -224,14 +224,6 @@ version "16.0.25" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.25.tgz#bf696b83fe480c5e0eff4335ee39ebc95884a1ed" -"@types/strip-bom@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2" - -"@types/strip-json-comments@0.0.30": - version "0.0.30" - resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" - JSONStream@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a" @@ -1641,14 +1633,6 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" -chalk@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" - dependencies: - ansi-styles "^3.2.0" - escape-string-regexp "^1.0.5" - supports-color "^5.2.0" - chalk@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f" @@ -2799,7 +2783,7 @@ diff@^2.0.2: version "2.2.3" resolved "https://registry.yarnpkg.com/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99" -diff@^3.1.0, diff@^3.2.0: +diff@^3.2.0: version "3.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" @@ -4414,10 +4398,6 @@ has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" @@ -4546,12 +4526,6 @@ home-or-tmp@^2.0.0: os-homedir "^1.0.0" os-tmpdir "^1.0.1" -homedir-polyfill@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" - dependencies: - parse-passwd "^1.0.0" - hooker@^0.2.3, hooker@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/hooker/-/hooker-0.2.3.tgz#b834f723cc4a242aa65963459df6d984c5d3d959" @@ -6250,10 +6224,6 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" -make-error@^1.1.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.3.tgz#a97ae14ffd98b05f543e83ddc395e1b2b6e4cc6a" - make-fetch-happen@^2.4.13, make-fetch-happen@^2.5.0: version "2.6.0" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-2.6.0.tgz#8474aa52198f6b1ae4f3094c04e8370d35ea8a38" @@ -6555,6 +6525,10 @@ moment@^2.18.1: version "2.19.2" resolved "https://registry.yarnpkg.com/moment/-/moment-2.19.2.tgz#8a7f774c95a64550b4c7ebd496683908f9419dbe" +mousetrap-global-bind@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mousetrap-global-bind/-/mousetrap-global-bind-1.1.0.tgz#cd7de9222bd0646fa2e010d54c84a74c26a88edd" + mousetrap@^1.6.0: version "1.6.1" resolved "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz#2a085f5c751294c75e7e81f6ec2545b29cbf42d9" @@ -7414,10 +7388,6 @@ parse-json@^3.0.0: dependencies: error-ex "^1.3.1" -parse-passwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" - parse5@^3.0.1, parse5@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" @@ -9648,7 +9618,7 @@ strip-json-comments@1.0.x, strip-json-comments@~1.0.1, strip-json-comments@~1.0. version "1.0.4" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" -strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: +strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -9680,12 +9650,6 @@ supports-color@^4.0.0, supports-color@^4.2.1, supports-color@^4.4.0: dependencies: has-flag "^2.0.0" -supports-color@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a" - dependencies: - has-flag "^3.0.0" - svgo@^0.7.0: version "0.7.2" resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" @@ -9994,30 +9958,6 @@ ts-loader@^3.2.0: loader-utils "^1.0.2" semver "^5.0.1" -ts-node@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-4.1.0.tgz#36d9529c7b90bb993306c408cd07f7743de20712" - dependencies: - arrify "^1.0.0" - chalk "^2.3.0" - diff "^3.1.0" - make-error "^1.1.1" - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map-support "^0.5.0" - tsconfig "^7.0.0" - v8flags "^3.0.0" - yn "^2.0.0" - -tsconfig@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-7.0.0.tgz#84538875a4dc216e5c4a5432b3a4dec3d54e91b7" - dependencies: - "@types/strip-bom" "^3.0.0" - "@types/strip-json-comments" "0.0.30" - strip-bom "^3.0.0" - strip-json-comments "^2.0.0" - tslib@^1.7.1: version "1.8.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.0.tgz#dc604ebad64bcbf696d613da6c954aa0e7ea1eb6" @@ -10379,12 +10319,6 @@ uuid@^3.0.0, uuid@^3.1.0, uuid@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" -v8flags@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.1.tgz#dce8fc379c17d9f2c9e9ed78d89ce00052b1b76b" - dependencies: - homedir-polyfill "^1.0.1" - validate-npm-package-license@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" @@ -10849,10 +10783,6 @@ yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" -yn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" - zip-stream@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-1.2.0.tgz#a8bc45f4c1b49699c6b90198baacaacdbcd4ba04"