diff --git a/.circleci/config.yml b/.circleci/config.yml index df82df9fa801c..23414436bf8f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ version: 2 jobs: mysql-integration-test: docker: - - image: circleci/golang:1.11.5 + - image: circleci/golang:1.12.4 - image: circleci/mysql:5.6-ram environment: MYSQL_ROOT_PASSWORD: rootpass @@ -39,7 +39,7 @@ jobs: postgres-integration-test: docker: - - image: circleci/golang:1.11.5 + - image: circleci/golang:1.12.4 - image: circleci/postgres:9.3-ram environment: POSTGRES_USER: grafanatest @@ -58,7 +58,7 @@ jobs: cache-server-test: docker: - - image: circleci/golang:1.11.5 + - image: circleci/golang:1.12.4 - image: circleci/redis:4-alpine - image: memcached working_directory: /go/src/github.com/grafana/grafana @@ -88,7 +88,7 @@ jobs: backend-lint: docker: - - image: circleci/golang:1.11.5 + - image: circleci/golang:1.12.4 environment: # we need CGO because of go-sqlite3 CGO_ENABLED: 1 @@ -120,7 +120,7 @@ jobs: test-backend: docker: - - image: circleci/golang:1.11.5 + - image: circleci/golang:1.12.4 working_directory: /go/src/github.com/grafana/grafana steps: - checkout @@ -130,7 +130,7 @@ jobs: build-all: docker: - - image: grafana/build-container:1.2.4 + - image: grafana/build-container:1.2.6 working_directory: /go/src/github.com/grafana/grafana steps: - checkout @@ -174,7 +174,7 @@ jobs: build: docker: - - image: grafana/build-container:1.2.4 + - image: grafana/build-container:1.2.6 working_directory: /go/src/github.com/grafana/grafana steps: - checkout @@ -243,7 +243,7 @@ jobs: build-enterprise: docker: - - image: grafana/build-container:1.2.4 + - image: grafana/build-container:1.2.6 working_directory: /go/src/github.com/grafana/grafana steps: - checkout @@ -275,7 +275,7 @@ jobs: build-all-enterprise: docker: - - image: grafana/build-container:1.2.4 + - image: grafana/build-container:1.2.6 working_directory: /go/src/github.com/grafana/grafana steps: - checkout diff --git a/Dockerfile b/Dockerfile index 9f07dc79c1d16..e1ae6a7508f3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Golang build container -FROM golang:1.11.5 +FROM golang:1.12.4 WORKDIR $GOPATH/src/github.com/grafana/grafana @@ -53,7 +53,7 @@ ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi WORKDIR $GF_PATHS_HOME RUN apt-get update && apt-get upgrade -y && \ - apt-get install -qq -y libfontconfig ca-certificates && \ + apt-get install -qq -y libfontconfig1 ca-certificates && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* diff --git a/build.go b/build.go index 3a9a7598b7272..378c38b6c059c 100644 --- a/build.go +++ b/build.go @@ -270,7 +270,7 @@ func createDebPackages() { defaultFileSrc: "packaging/deb/default/grafana-server", systemdFileSrc: "packaging/deb/systemd/grafana-server.service", - depends: []string{"adduser", "libfontconfig"}, + depends: []string{"adduser", "libfontconfig1"}, }) } diff --git a/devenv/dashboards.yaml b/devenv/dashboards.yaml index c59d712776921..3e0e21ef4fefa 100644 --- a/devenv/dashboards.yaml +++ b/devenv/dashboards.yaml @@ -4,6 +4,6 @@ providers: - name: 'gdev dashboards' folder: 'gdev dashboards' type: file - updateIntervalSeconds: 15 + updateIntervalSeconds: 60 options: path: devenv/dev-dashboards diff --git a/devenv/datasources.yaml b/devenv/datasources.yaml index f50fdeeb5c41c..d138f6ed325be 100644 --- a/devenv/datasources.yaml +++ b/devenv/datasources.yaml @@ -22,10 +22,11 @@ datasources: access: proxy database: site user: grafana - password: grafana url: http://localhost:8086 jsonData: timeInterval: "15s" + secureJsonData: + password: grafana - name: gdev-opentsdb type: opentsdb @@ -110,14 +111,16 @@ datasources: url: localhost:3306 database: grafana user: grafana - password: password + secureJsonData: + password: password - name: gdev-mysql-ds-tests type: mysql url: localhost:3306 database: grafana_ds_tests user: grafana - password: password + secureJsonData: + password: password - name: gdev-mssql type: mssql diff --git a/devenv/dev-dashboards/testdata_alerts.json b/devenv/dev-dashboards/alerting/testdata_alerts.json similarity index 92% rename from devenv/dev-dashboards/testdata_alerts.json rename to devenv/dev-dashboards/alerting/testdata_alerts.json index 9f36638c0128d..d3b70f0052b23 100644 --- a/devenv/dev-dashboards/testdata_alerts.json +++ b/devenv/dev-dashboards/alerting/testdata_alerts.json @@ -22,17 +22,11 @@ "conditions": [ { "evaluator": { - "params": [ - 60 - ], + "params": [60], "type": "gt" }, "query": { - "params": [ - "A", - "5m", - "now" - ] + "params": ["A", "5m", "now"] }, "reducer": { "params": [], @@ -149,17 +143,11 @@ "conditions": [ { "evaluator": { - "params": [ - 177 - ], + "params": [177], "type": "gt" }, "query": { - "params": [ - "A", - "5m", - "now" - ] + "params": ["A", "5m", "now"] }, "reducer": { "params": [], @@ -278,20 +266,14 @@ "conditions": [ { "evaluator": { - "params": [ - 1 - ], + "params": [1], "type": "gt" }, "operator": { "type": "and" }, "query": { - "params": [ - "A", - "15m", - "now" - ] + "params": ["A", "15m", "now"] }, "reducer": { "params": [], @@ -409,20 +391,14 @@ "conditions": [ { "evaluator": { - "params": [ - 177 - ], + "params": [177], "type": "gt" }, "operator": { "type": "and" }, "query": { - "params": [ - "A", - "15m", - "now" - ] + "params": ["A", "15m", "now"] }, "reducer": { "params": [], @@ -540,20 +516,14 @@ "conditions": [ { "evaluator": { - "params": [ - 100 - ], + "params": [100], "type": "gt" }, "operator": { "type": "and" }, "query": { - "params": [ - "A", - "5m", - "now" - ] + "params": ["A", "5m", "now"] }, "reducer": { "params": [], @@ -670,9 +640,7 @@ "revision": 2, "schemaVersion": 16, "style": "dark", - "tags": [ - "grafana-test" - ], + "tags": ["gdev", "alerting"], "templating": { "list": [] }, @@ -681,32 +649,11 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "browser", "title": "Alerting with TestData", "uid": "7MeksYbmk", "version": 7 -} \ No newline at end of file +} diff --git a/devenv/dev-dashboards/datasource_tests_elasticsearch_compare.json b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_compare.json similarity index 99% rename from devenv/dev-dashboards/datasource_tests_elasticsearch_compare.json rename to devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_compare.json index c631ea0a1518d..5a83ffc08af14 100644 --- a/devenv/dev-dashboards/datasource_tests_elasticsearch_compare.json +++ b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_compare.json @@ -21,10 +21,7 @@ "links": [ { "icon": "external link", - "tags": [ - "gdev", - "elasticsearch" - ], + "tags": ["gdev", "elasticsearch", "datasource-test"], "type": "dashboards" } ], @@ -1824,13 +1821,7 @@ "id": "1", "meta": {}, "settings": { - "percents": [ - 25, - 50, - 75, - 95, - 99 - ] + "percents": [25, 50, 75, 95, 99] }, "type": "percentiles" } @@ -1941,13 +1932,7 @@ "meta": {}, "settings": { "missing": null, - "percents": [ - 25, - 50, - 75, - 95, - 99 - ] + "percents": [25, 50, 75, 95, 99] }, "type": "percentiles" } @@ -5858,10 +5843,7 @@ "refresh": false, "schemaVersion": 16, "style": "dark", - "tags": [ - "gdev", - "elasticsearch" - ], + "tags": ["gdev", "elasticsearch"], "templating": { "list": [ { @@ -5901,32 +5883,11 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Datasource tests - Elasticsearch comparison", "uid": "fuFWehBmk", "version": 4 -} \ No newline at end of file +} diff --git a/devenv/dev-dashboards/datasource_tests_elasticsearch_v2.json b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v2.json similarity index 99% rename from devenv/dev-dashboards/datasource_tests_elasticsearch_v2.json rename to devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v2.json index c7daf286e6954..f297ebfe8928c 100644 --- a/devenv/dev-dashboards/datasource_tests_elasticsearch_v2.json +++ b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v2.json @@ -645,7 +645,7 @@ ], "schemaVersion": 18, "style": "dark", - "tags": ["elasticsearch", "gdev"], + "tags": ["elasticsearch", "gdev", "datasource-test"], "templating": { "list": [ { diff --git a/devenv/dev-dashboards/datasource_tests_elasticsearch_v5.json b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v5.json similarity index 99% rename from devenv/dev-dashboards/datasource_tests_elasticsearch_v5.json rename to devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v5.json index 015898df10713..8e987ef5a1802 100644 --- a/devenv/dev-dashboards/datasource_tests_elasticsearch_v5.json +++ b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v5.json @@ -648,7 +648,7 @@ ], "schemaVersion": 18, "style": "dark", - "tags": ["elasticsearch", "gdev"], + "tags": ["elasticsearch", "gdev", "datasource-test"], "templating": { "list": [ { diff --git a/devenv/dev-dashboards/datasource_tests_elasticsearch_v6.json b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v6.json similarity index 99% rename from devenv/dev-dashboards/datasource_tests_elasticsearch_v6.json rename to devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v6.json index 6856c8ac1bb16..252e90cc5b6e5 100644 --- a/devenv/dev-dashboards/datasource_tests_elasticsearch_v6.json +++ b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v6.json @@ -645,7 +645,7 @@ ], "schemaVersion": 18, "style": "dark", - "tags": ["elasticsearch", "gdev"], + "tags": ["elasticsearch", "gdev", "datasource-test"], "templating": { "list": [ { diff --git a/devenv/dev-dashboards/datasource_tests_elasticsearch_v6_filebeat.json b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v6_filebeat.json similarity index 99% rename from devenv/dev-dashboards/datasource_tests_elasticsearch_v6_filebeat.json rename to devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v6_filebeat.json index 6682f09d8e1fd..69bb8b432bc25 100644 --- a/devenv/dev-dashboards/datasource_tests_elasticsearch_v6_filebeat.json +++ b/devenv/dev-dashboards/datasource-elasticsearch/elasticsearch_v6_filebeat.json @@ -226,7 +226,7 @@ ], "schemaVersion": 18, "style": "dark", - "tags": ["gdev", "elasticsearch"], + "tags": ["gdev", "elasticsearch", "datasource-test"], "templating": { "list": [ { diff --git a/devenv/dev-dashboards/datasource_tests_mssql_fakedata.json b/devenv/dev-dashboards/datasource-mssql/mssql_fakedata.json similarity index 96% rename from devenv/dev-dashboards/datasource_tests_mssql_fakedata.json rename to devenv/dev-dashboards/datasource-mssql/mssql_fakedata.json index e810a686134bc..5522b0d0e2d5c 100644 --- a/devenv/dev-dashboards/datasource_tests_mssql_fakedata.json +++ b/devenv/dev-dashboards/datasource-mssql/mssql_fakedata.json @@ -319,11 +319,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -346,7 +342,7 @@ ], "schemaVersion": 16, "style": "dark", - "tags": ["gdev", "mssql", "fake-data-gen"], + "tags": ["gdev", "mssql", "datasource-test"], "templating": { "list": [ { @@ -486,32 +482,11 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Datasource tests - MSSQL", "uid": "86Js1xRmk", "version": 1 -} \ No newline at end of file +} diff --git a/devenv/dev-dashboards/datasource_tests_mssql_unittest.json b/devenv/dev-dashboards/datasource-mssql/mssql_unittest.json similarity index 97% rename from devenv/dev-dashboards/datasource_tests_mssql_unittest.json rename to devenv/dev-dashboards/datasource-mssql/mssql_unittest.json index b2d757ae188fc..e37fb3dce17d4 100644 --- a/devenv/dev-dashboards/datasource_tests_mssql_unittest.json +++ b/devenv/dev-dashboards/datasource-mssql/mssql_unittest.json @@ -90,11 +90,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -143,11 +139,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -197,11 +189,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -251,11 +239,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -305,11 +289,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -2124,9 +2104,7 @@ "mode": "series", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2212,9 +2190,7 @@ "mode": "series", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2299,9 +2275,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2387,9 +2361,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2474,9 +2446,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2562,9 +2532,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2649,9 +2617,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2737,9 +2703,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2768,10 +2732,7 @@ "refresh": false, "schemaVersion": 16, "style": "dark", - "tags": [ - "gdev", - "mssql" - ], + "tags": ["gdev", "mssql", "datasource-test"], "templating": { "list": [ { @@ -2871,32 +2832,11 @@ "to": "2018-03-15T13:55:01.000Z" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Datasource tests - MSSQL (unit test)", "uid": "GlAqcPgmz", "version": 2 -} \ No newline at end of file +} diff --git a/devenv/dev-dashboards/datasource_tests_mysql_fakedata.json b/devenv/dev-dashboards/datasource-mysql/mysql_fakedata.json similarity index 95% rename from devenv/dev-dashboards/datasource_tests_mysql_fakedata.json rename to devenv/dev-dashboards/datasource-mysql/mysql_fakedata.json index ebeb452fc4c79..31de0a8100585 100644 --- a/devenv/dev-dashboards/datasource_tests_mysql_fakedata.json +++ b/devenv/dev-dashboards/datasource-mysql/mysql_fakedata.json @@ -323,11 +323,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -352,11 +348,7 @@ ], "schemaVersion": 16, "style": "dark", - "tags": [ - "gdev", - "fake-data-gen", - "mysql" - ], + "tags": ["gdev", "mysql", "datasource-tags"], "templating": { "list": [ { @@ -502,32 +494,11 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Datasource tests - MySQL", "uid": "DGsCac3kz", "version": 8 -} \ No newline at end of file +} diff --git a/devenv/dev-dashboards/datasource_tests_mysql_unittest.json b/devenv/dev-dashboards/datasource-mysql/mysql_unittest.json similarity index 97% rename from devenv/dev-dashboards/datasource_tests_mysql_unittest.json rename to devenv/dev-dashboards/datasource-mysql/mysql_unittest.json index 0255f3c0c914c..420e1c6ba30f3 100644 --- a/devenv/dev-dashboards/datasource_tests_mysql_unittest.json +++ b/devenv/dev-dashboards/datasource-mysql/mysql_unittest.json @@ -90,11 +90,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -143,11 +139,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -197,11 +189,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -251,11 +239,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -305,11 +289,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -1938,9 +1918,7 @@ "mode": "series", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2026,9 +2004,7 @@ "mode": "series", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2113,9 +2089,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2201,9 +2175,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2288,9 +2260,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2376,9 +2346,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2463,9 +2431,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2551,9 +2517,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2582,10 +2546,7 @@ "refresh": false, "schemaVersion": 16, "style": "dark", - "tags": [ - "gdev", - "mysql" - ], + "tags": ["gdev", "mysql", "datasource-test"], "templating": { "list": [ { @@ -2683,32 +2644,11 @@ "to": "2018-03-15T13:55:01.000Z" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Datasource tests - MySQL (unittest)", "uid": "Hmf8FDkmz", "version": 2 -} \ No newline at end of file +} diff --git a/devenv/dev-dashboards/datasource_tests_postgres_fakedata.json b/devenv/dev-dashboards/datasource-postgres/postgres_fakedata.json similarity index 99% rename from devenv/dev-dashboards/datasource_tests_postgres_fakedata.json rename to devenv/dev-dashboards/datasource-postgres/postgres_fakedata.json index 962e522c802fd..5efa5536adf82 100644 --- a/devenv/dev-dashboards/datasource_tests_postgres_fakedata.json +++ b/devenv/dev-dashboards/datasource-postgres/postgres_fakedata.json @@ -347,7 +347,7 @@ ], "schemaVersion": 16, "style": "dark", - "tags": ["gdev", "fake-data-gen", "postgres"], + "tags": ["gdev", "postgres", "datasource-test"], "templating": { "list": [ { diff --git a/devenv/dev-dashboards/datasource_tests_postgres_unittest.json b/devenv/dev-dashboards/datasource-postgres/postgres_unittest.json similarity index 97% rename from devenv/dev-dashboards/datasource_tests_postgres_unittest.json rename to devenv/dev-dashboards/datasource-postgres/postgres_unittest.json index 3c56868e9ffc0..600a3e917e395 100644 --- a/devenv/dev-dashboards/datasource_tests_postgres_unittest.json +++ b/devenv/dev-dashboards/datasource-postgres/postgres_unittest.json @@ -90,11 +90,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -143,11 +139,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -197,11 +189,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -251,11 +239,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -305,11 +289,7 @@ { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -1914,9 +1894,7 @@ "mode": "series", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2002,9 +1980,7 @@ "mode": "series", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2089,9 +2065,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2177,9 +2151,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2264,9 +2236,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2352,9 +2322,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2439,9 +2407,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "current" - ] + "values": ["current"] }, "yaxes": [ { @@ -2527,9 +2493,7 @@ "mode": "histogram", "name": null, "show": true, - "values": [ - "total" - ] + "values": ["total"] }, "yaxes": [ { @@ -2558,10 +2522,7 @@ "refresh": false, "schemaVersion": 16, "style": "dark", - "tags": [ - "gdev", - "postgres" - ], + "tags": ["gdev", "postgres", "datasource-test"], "templating": { "list": [ { @@ -2570,9 +2531,7 @@ "selected": true, "tags": [], "text": "All", - "value": [ - "$__all" - ] + "value": ["$__all"] }, "datasource": "gdev-postgres-ds-tests", "hide": 0, @@ -2663,32 +2622,11 @@ "to": "2018-03-15T13:55:01.000Z" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Datasource tests - Postgres (unittest)", "uid": "vHQdlVziz", "version": 1 -} \ No newline at end of file +} diff --git a/devenv/dev-dashboards/datasource-testdata/demo1.json b/devenv/dev-dashboards/datasource-testdata/demo1.json new file mode 100644 index 0000000000000..12895214b277d --- /dev/null +++ b/devenv/dev-dashboards/datasource-testdata/demo1.json @@ -0,0 +1,1103 @@ +{ + "annotations": { + "enable": false, + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 1, + "links": [], + "panels": [ + { + "aliasColors": { + "cpu": "#E24D42", + "memory": "#1f78c1", + "statsd.fakesite.counters.session_start.desktop.count": "#6ED0E0" + }, + "annotate": { + "enable": false + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "editable": true, + "fill": 3, + "grid": { + "max": null, + "min": 0 + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 0 + }, + "id": 4, + "interactive": true, + "legend": { + "avg": false, + "current": true, + "max": false, + "min": true, + "show": true, + "total": false, + "values": false + }, + "legend_counts": true, + "lines": true, + "linewidth": 2, + "nullPointMode": "connected", + "options": false, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "resolution": 100, + "scale": 1, + "seriesOverrides": [ + { + "alias": "cpu", + "fill": 0, + "lines": true, + "yaxis": 2, + "zindex": 2 + }, + { + "alias": "memory", + "pointradius": 2, + "points": true + } + ], + "spaceLength": 10, + "spyable": true, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "memory", + "hide": false, + "refId": "A", + "scenarioId": "random_walk", + "target": "alias(movingAverage(scaleToSeconds(apps.fakesite.web_server_01.counters.request_status.code_302.count, 10), 20), 'cpu')" + }, + { + "alias": "cpu", + "refId": "B", + "scenarioId": "random_walk", + "target": "alias(statsd.fakesite.counters.session_start.desktop.count, 'memory')" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "timezone": "browser", + "title": "Memory / CPU", + "tooltip": { + "msResolution": false, + "query_as_alias": true, + "shared": false, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "percent", + "logBase": 1, + "max": null, + "min": 0, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + }, + "zerofill": true + }, + { + "aliasColors": { + "logins": "#5195ce", + "logins (-1 day)": "#447EBC", + "logins (-1 hour)": "#705da0" + }, + "annotate": { + "enable": false + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "editable": true, + "fill": 1, + "grid": { + "max": null, + "min": 0 + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 0 + }, + "id": 3, + "interactive": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "legend_counts": true, + "lines": true, + "linewidth": 1, + "nullPointMode": "connected", + "options": false, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "resolution": 100, + "scale": 1, + "seriesOverrides": [], + "spaceLength": 10, + "spyable": true, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "logins", + "refId": "A", + "scenarioId": "random_walk", + "target": "alias(movingAverage(scaleToSeconds(apps.fakesite.web_server_01.counters.requests.count, 1), 2), 'logins')" + }, + { + "alias": "logins (-1h)", + "refId": "B", + "scenarioId": "random_walk", + "target": "alias(movingAverage(timeShift(scaleToSeconds(apps.fakesite.web_server_01.counters.requests.count, 1), '1h'), 2), 'logins (-1 hour)')" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": "1h", + "timezone": "browser", + "title": "logins", + "tooltip": { + "msResolution": false, + "query_as_alias": true, + "shared": false, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + }, + "zerofill": true + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": ["#629e51", "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)"], + "editable": true, + "error": false, + "format": "bytes", + "gauge": { + "maxValue": 300, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 0 + }, + "id": 22, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "target": "scale(apps.backend.backend_01.counters.requests.count, 0.4)" + } + ], + "thresholds": "200,270", + "title": "Memory", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 0 + }, + "id": 16, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "target": "apps.backend.backend_02.counters.requests.count" + } + ], + "thresholds": "100,270", + "title": "Sign ups", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": ["#629e51", "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)"], + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 300, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 4 + }, + "id": 21, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "target": "scale(apps.backend.backend_01.counters.requests.count, 0.8)" + } + ], + "thresholds": "200,270", + "title": "Logouts", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 4 + }, + "id": 17, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "target": "apps.backend.backend_04.counters.requests.count" + } + ], + "thresholds": "100,270", + "title": "Sign outs", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": { + "web_server_01": "#badff4", + "web_server_02": "#5195ce", + "web_server_03": "#1f78c1", + "web_server_04": "#0a437c" + }, + "annotate": { + "enable": false + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "editable": true, + "fill": 6, + "grid": { + "max": null, + "min": 0 + }, + "gridPos": { + "h": 11, + "w": 16, + "x": 0, + "y": 7 + }, + "id": 2, + "interactive": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "legend_counts": true, + "lines": true, + "linewidth": 1, + "nullPointMode": "connected", + "options": false, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "resolution": 100, + "scale": 1, + "seriesOverrides": [], + "spaceLength": 10, + "spyable": true, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "web_server_01", + "refId": "A", + "scenarioId": "random_walk", + "target": "aliasByNode(movingAverage(scaleToSeconds(apps.fakesite.*.counters.requests.count, 1), 2), 2)" + }, + { + "alias": "web_server_02", + "refId": "B", + "scenarioId": "random_walk" + }, + { + "alias": "web_server_03", + "refId": "C", + "scenarioId": "random_walk" + }, + { + "alias": "web_server_04", + "refId": "D", + "scenarioId": "random_walk" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "timezone": "browser", + "title": "server requests", + "tooltip": { + "msResolution": false, + "query_as_alias": true, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + }, + "zerofill": true + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": ["#629e51", "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)"], + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 300, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 16, + "y": 7 + }, + "id": 26, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "target": "scale(apps.backend.backend_01.counters.requests.count, 0.2)" + } + ], + "thresholds": "200,270", + "title": "Google hits", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 7 + }, + "id": 15, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "target": "scale(apps.backend.backend_01.counters.requests.count, 0.7)" + } + ], + "thresholds": "100,270", + "title": "Logins", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 10 + }, + "id": 18, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "target": "scale(apps.backend.backend_03.counters.requests.count, 0.3)" + } + ], + "thresholds": "100,270", + "title": "Support calls", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": ["#629e51", "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)"], + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 300, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 16, + "y": 13 + }, + "id": 24, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "target": "scale(apps.backend.backend_01.counters.requests.count, 0.2)" + } + ], + "thresholds": "200,270", + "title": "Google hits", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": { + "upper_25": "#F9E2D2", + "upper_50": "#F2C96D", + "upper_75": "#EAB839" + }, + "annotate": { + "enable": false + }, + "bars": true, + "dashLength": 10, + "dashes": false, + "editable": true, + "fill": 1, + "grid": { + "max": null, + "min": 0 + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 5, + "interactive": true, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "legend_counts": true, + "lines": false, + "linewidth": 2, + "nullPointMode": "connected", + "options": false, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "resolution": 100, + "scale": 1, + "seriesOverrides": [], + "spaceLength": 10, + "spyable": true, + "stack": true, + "steppedLine": false, + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "", + "target": "aliasByNode(summarize(statsd.fakesite.timers.ads_timer.*, '4min', 'avg'), 4)" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "timezone": "browser", + "title": "client side full page load", + "tooltip": { + "msResolution": false, + "query_as_alias": true, + "shared": false, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ms", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + }, + "zerofill": true + } + ], + "refresh": false, + "schemaVersion": 18, + "style": "dark", + "tags": ["gdev", "demo"], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "collapse": false, + "enable": true, + "notice": false, + "now": true, + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "status": "Stable", + "time_options": ["5m", "15m", "1h", "2h", " 6h", "12h", "24h", "2d", "7d", "30d"], + "type": "timepicker" + }, + "timezone": "browser", + "title": "TestData - Demo Dashboard", + "uid": "000000003", + "version": 2 +} diff --git a/devenv/dev-dashboards/feature-templating/testdata-repeating.json b/devenv/dev-dashboards/feature-templating/testdata-repeating.json new file mode 100644 index 0000000000000..7335ed34e0117 --- /dev/null +++ b/devenv/dev-dashboards/feature-templating/testdata-repeating.json @@ -0,0 +1,1365 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "iteration": 1554990747424, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], + "datasource": "gdev-testdata", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 7, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "maxPerRow": 4, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "Servers", + "repeatDirection": "h", + "scopedVars": { + "Servers": { + "selected": false, + "text": "server1", + "value": "server1" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "" + } + ], + "thresholds": "50,90", + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], + "datasource": "gdev-testdata", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 8, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "maxPerRow": 4, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 7, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server2", + "value": "server2" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "" + } + ], + "thresholds": "50,90", + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], + "datasource": "gdev-testdata", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 9, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "maxPerRow": 4, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 7, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server3", + "value": "server3" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "" + } + ], + "thresholds": "50,90", + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], + "datasource": "gdev-testdata", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 10, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "maxPerRow": 4, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 7, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server4", + "value": "server4" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "" + } + ], + "thresholds": "50,90", + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], + "datasource": "gdev-testdata", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 4 + }, + "id": 11, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "maxPerRow": 4, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 7, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server5", + "value": "server5" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "" + } + ], + "thresholds": "50,90", + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], + "datasource": "gdev-testdata", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 6, + "y": 4 + }, + "id": 12, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "maxPerRow": 4, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 7, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server6", + "value": "server6" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "" + } + ], + "thresholds": "50,90", + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], + "datasource": "gdev-testdata", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 12, + "y": 4 + }, + "id": 13, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "maxPerRow": 4, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 7, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server7", + "value": "server7" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "" + } + ], + "thresholds": "50,90", + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], + "datasource": "gdev-testdata", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 18, + "y": 4 + }, + "id": 14, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "maxPerRow": 4, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 7, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server8", + "value": "server8" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk", + "stringInput": "" + } + ], + "thresholds": "50,90", + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "datasource": "gdev-testdata", + "gridPos": { + "h": 5, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 2, + "links": [], + "maxPerRow": 4, + "nullPointMode": "null", + "options": { + "baseColor": "#299c46", + "maxValue": 100, + "minValue": 0, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "thresholds": [ + { + "color": "#7EB26D", + "index": 0, + "value": null + }, + { + "color": "#ef843c", + "index": 1, + "value": 75 + }, + { + "color": "#e24d42", + "index": 2, + "value": 90 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": "2", + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "ms" + } + }, + "pluginVersion": "6.1.0-pre", + "repeat": "Servers", + "repeatDirection": "h", + "scopedVars": { + "Servers": { + "selected": false, + "text": "server1", + "value": "server1" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "gauge" + }, + { + "datasource": "gdev-testdata", + "gridPos": { + "h": 5, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 15, + "links": [], + "maxPerRow": 4, + "nullPointMode": "null", + "options": { + "baseColor": "#299c46", + "maxValue": 100, + "minValue": 0, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "thresholds": [ + { + "color": "#7EB26D", + "index": 0, + "value": null + }, + { + "color": "#ef843c", + "index": 1, + "value": 75 + }, + { + "color": "#e24d42", + "index": 2, + "value": 90 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": "2", + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "ms" + } + }, + "pluginVersion": "6.1.0-pre", + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 2, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server2", + "value": "server2" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "gauge" + }, + { + "datasource": "gdev-testdata", + "gridPos": { + "h": 5, + "w": 6, + "x": 12, + "y": 8 + }, + "id": 16, + "links": [], + "maxPerRow": 4, + "nullPointMode": "null", + "options": { + "baseColor": "#299c46", + "maxValue": 100, + "minValue": 0, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "thresholds": [ + { + "color": "#7EB26D", + "index": 0, + "value": null + }, + { + "color": "#ef843c", + "index": 1, + "value": 75 + }, + { + "color": "#e24d42", + "index": 2, + "value": 90 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": "2", + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "ms" + } + }, + "pluginVersion": "6.1.0-pre", + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 2, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server3", + "value": "server3" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "gauge" + }, + { + "datasource": "gdev-testdata", + "gridPos": { + "h": 5, + "w": 6, + "x": 18, + "y": 8 + }, + "id": 17, + "links": [], + "maxPerRow": 4, + "nullPointMode": "null", + "options": { + "baseColor": "#299c46", + "maxValue": 100, + "minValue": 0, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "thresholds": [ + { + "color": "#7EB26D", + "index": 0, + "value": null + }, + { + "color": "#ef843c", + "index": 1, + "value": 75 + }, + { + "color": "#e24d42", + "index": 2, + "value": 90 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": "2", + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "ms" + } + }, + "pluginVersion": "6.1.0-pre", + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 2, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server4", + "value": "server4" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "gauge" + }, + { + "datasource": "gdev-testdata", + "gridPos": { + "h": 5, + "w": 6, + "x": 0, + "y": 13 + }, + "id": 18, + "links": [], + "maxPerRow": 4, + "nullPointMode": "null", + "options": { + "baseColor": "#299c46", + "maxValue": 100, + "minValue": 0, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "thresholds": [ + { + "color": "#7EB26D", + "index": 0, + "value": null + }, + { + "color": "#ef843c", + "index": 1, + "value": 75 + }, + { + "color": "#e24d42", + "index": 2, + "value": 90 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": "2", + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "ms" + } + }, + "pluginVersion": "6.1.0-pre", + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 2, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server5", + "value": "server5" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "gauge" + }, + { + "datasource": "gdev-testdata", + "gridPos": { + "h": 5, + "w": 6, + "x": 6, + "y": 13 + }, + "id": 19, + "links": [], + "maxPerRow": 4, + "nullPointMode": "null", + "options": { + "baseColor": "#299c46", + "maxValue": 100, + "minValue": 0, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "thresholds": [ + { + "color": "#7EB26D", + "index": 0, + "value": null + }, + { + "color": "#ef843c", + "index": 1, + "value": 75 + }, + { + "color": "#e24d42", + "index": 2, + "value": 90 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": "2", + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "ms" + } + }, + "pluginVersion": "6.1.0-pre", + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 2, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server6", + "value": "server6" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "gauge" + }, + { + "datasource": "gdev-testdata", + "gridPos": { + "h": 5, + "w": 6, + "x": 12, + "y": 13 + }, + "id": 20, + "links": [], + "maxPerRow": 4, + "nullPointMode": "null", + "options": { + "baseColor": "#299c46", + "maxValue": 100, + "minValue": 0, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "thresholds": [ + { + "color": "#7EB26D", + "index": 0, + "value": null + }, + { + "color": "#ef843c", + "index": 1, + "value": 75 + }, + { + "color": "#e24d42", + "index": 2, + "value": 90 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": "2", + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "ms" + } + }, + "pluginVersion": "6.1.0-pre", + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 2, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server7", + "value": "server7" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "gauge" + }, + { + "datasource": "gdev-testdata", + "gridPos": { + "h": 5, + "w": 6, + "x": 18, + "y": 13 + }, + "id": 21, + "links": [], + "maxPerRow": 4, + "nullPointMode": "null", + "options": { + "baseColor": "#299c46", + "maxValue": 100, + "minValue": 0, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "thresholds": [ + { + "color": "#7EB26D", + "index": 0, + "value": null + }, + { + "color": "#ef843c", + "index": 1, + "value": 75 + }, + { + "color": "#e24d42", + "index": 2, + "value": 90 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": "2", + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "ms" + } + }, + "pluginVersion": "6.1.0-pre", + "repeat": null, + "repeatDirection": "h", + "repeatIteration": 1554990747424, + "repeatPanelId": 2, + "scopedVars": { + "Servers": { + "selected": false, + "text": "server8", + "value": "server8" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "csv_metric_values", + "stringInput": "1,20,90,30,5,0" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Servers", + "type": "gauge" + } + ], + "refresh": false, + "schemaVersion": 18, + "style": "dark", + "tags": ["gdev", "templating"], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "tags": [], + "text": "All", + "value": ["$__all"] + }, + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "Servers", + "options": [ + { + "selected": true, + "text": "All", + "value": "$__all" + }, + { + "selected": false, + "text": "server1", + "value": "server1" + }, + { + "selected": false, + "text": "server2", + "value": "server2" + }, + { + "selected": false, + "text": "server3", + "value": "server3" + }, + { + "selected": false, + "text": "server4", + "value": "server4" + }, + { + "selected": false, + "text": "server5", + "value": "server5" + }, + { + "selected": false, + "text": "server6", + "value": "server6" + }, + { + "selected": false, + "text": "server7", + "value": "server7" + }, + { + "selected": false, + "text": "server8", + "value": "server8" + } + ], + "query": "server1,server2,server3,server4,server5,server6,server7,server8", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] + }, + "timezone": "", + "title": "TestData Repeating Panels", + "uid": "Ei74RD9mz", + "version": 1 +} diff --git a/devenv/dev-dashboards/home.json b/devenv/dev-dashboards/home.json new file mode 100644 index 0000000000000..94751adf71faf --- /dev/null +++ b/devenv/dev-dashboards/home.json @@ -0,0 +1,171 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "folderId": null, + "gridPos": { + "h": 26, + "w": 6, + "x": 0, + "y": 0 + }, + "headings": false, + "id": 7, + "limit": 100, + "links": [], + "query": "", + "recent": false, + "search": false, + "starred": true, + "tags": [], + "timeFrom": null, + "timeShift": null, + "title": "Starred", + "type": "dashlist" + }, + { + "folderId": null, + "gridPos": { + "h": 13, + "w": 6, + "x": 6, + "y": 0 + }, + "headings": false, + "id": 8, + "limit": 1000, + "links": [], + "query": "", + "recent": false, + "search": true, + "starred": false, + "tags": ["panel-demo"], + "timeFrom": null, + "timeShift": null, + "title": "tag: panel-demo", + "type": "dashlist" + }, + { + "folderId": null, + "gridPos": { + "h": 13, + "w": 6, + "x": 12, + "y": 0 + }, + "headings": false, + "id": 2, + "limit": 1000, + "links": [], + "query": "", + "recent": false, + "search": true, + "starred": false, + "tags": ["panel-tests"], + "timeFrom": null, + "timeShift": null, + "title": "tag: panel-tests", + "type": "dashlist" + }, + { + "folderId": null, + "gridPos": { + "h": 26, + "w": 6, + "x": 18, + "y": 0 + }, + "headings": false, + "id": 5, + "limit": 1000, + "links": [], + "query": "", + "recent": false, + "search": true, + "starred": false, + "tags": ["gdev", "datasource-test"], + "timeFrom": null, + "timeShift": null, + "title": "Data source tests", + "type": "dashlist" + }, + { + "folderId": null, + "gridPos": { + "h": 13, + "w": 6, + "x": 6, + "y": 13 + }, + "headings": false, + "id": 3, + "limit": 1000, + "links": [], + "query": "", + "recent": false, + "search": true, + "starred": false, + "tags": ["gdev", "demo"], + "timeFrom": null, + "timeShift": null, + "title": "tag: dashboard-demo", + "type": "dashlist" + }, + { + "folderId": null, + "gridPos": { + "h": 13, + "w": 6, + "x": 12, + "y": 13 + }, + "headings": false, + "id": 4, + "limit": 1000, + "links": [], + "query": "", + "recent": false, + "search": true, + "starred": false, + "tags": ["templating", "gdev"], + "timeFrom": null, + "timeShift": null, + "title": "tag: templating", + "type": "dashlist" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] + }, + "timezone": "", + "title": "Grafana Dev Overview & Home", + "uid": "j6T00KRZz", + "version": 5 +} diff --git a/devenv/dev-dashboards/panel-bargauge/animated_demo.json b/devenv/dev-dashboards/panel-bargauge/animated_demo.json new file mode 100644 index 0000000000000..1a215d2767798 --- /dev/null +++ b/devenv/dev-dashboards/panel-bargauge/animated_demo.json @@ -0,0 +1,475 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "gridPos": { + "h": 7, + "w": 18, + "x": 0, + "y": 0 + }, + "id": 7, + "links": [], + "options": { + "displayMode": "gradient", + "maxValue": 100, + "minValue": 0, + "orientation": "vertical", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "orange", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "watt" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk" + }, + { + "refId": "B", + "scenarioId": "random_walk" + }, + { + "refId": "C", + "scenarioId": "random_walk" + }, + { + "refId": "D", + "scenarioId": "random_walk" + }, + { + "refId": "E", + "scenarioId": "csv_metric_values", + "stringInput": "10003,33333" + }, + { + "refId": "F", + "scenarioId": "random_walk" + }, + { + "refId": "G", + "scenarioId": "random_walk" + }, + { + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + }, + { + "refId": "M", + "scenarioId": "random_walk" + }, + { + "refId": "N", + "scenarioId": "random_walk" + }, + { + "refId": "O", + "scenarioId": "random_walk" + }, + { + "refId": "P", + "scenarioId": "random_walk" + }, + { + "refId": "Q", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Usage", + "type": "bargauge" + }, + { + "gridPos": { + "h": 22, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 8, + "links": [], + "options": { + "displayMode": "gradient", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "orange", + "index": 1, + "value": 55 + }, + { + "color": "red", + "index": 2, + "value": 95 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "watt" + } + }, + "targets": [ + { + "refId": "E", + "scenarioId": "random_walk" + }, + { + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "refId": "A", + "scenarioId": "random_walk" + }, + { + "refId": "B", + "scenarioId": "random_walk" + }, + { + "refId": "C", + "scenarioId": "random_walk" + }, + { + "refId": "D", + "scenarioId": "random_walk" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + }, + { + "refId": "M", + "scenarioId": "random_walk" + }, + { + "refId": "N", + "scenarioId": "random_walk" + }, + { + "refId": "O", + "scenarioId": "random_walk" + }, + { + "refId": "P", + "scenarioId": "random_walk" + }, + { + "refId": "Q", + "scenarioId": "random_walk" + }, + { + "refId": "F", + "scenarioId": "random_walk" + }, + { + "refId": "G", + "scenarioId": "random_walk" + }, + { + "refId": "R", + "scenarioId": "random_walk" + }, + { + "refId": "S", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Usage", + "type": "bargauge" + }, + { + "gridPos": { + "h": 15, + "w": 11, + "x": 0, + "y": 7 + }, + "id": 6, + "links": [], + "options": { + "displayMode": "gradient", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "blue", + "index": 0, + "value": null + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "celsius" + } + }, + "targets": [ + { + "alias": "Inside", + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "alias": "Outhouse", + "refId": "A", + "scenarioId": "random_walk" + }, + { + "alias": "Area B", + "refId": "B", + "scenarioId": "random_walk" + }, + { + "alias": "Basement", + "refId": "C", + "scenarioId": "random_walk" + }, + { + "alias": "Garage", + "refId": "D", + "scenarioId": "random_walk" + }, + { + "alias": "Attic", + "refId": "E", + "scenarioId": "random_walk" + }, + { + "refId": "F", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Temperature", + "type": "bargauge" + }, + { + "gridPos": { + "h": 15, + "w": 7, + "x": 11, + "y": 7 + }, + "id": 9, + "links": [], + "options": { + "displayMode": "basic", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "blue", + "index": 0, + "value": null + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "celsius" + } + }, + "targets": [ + { + "alias": "Inside", + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "alias": "Outhouse", + "refId": "A", + "scenarioId": "random_walk" + }, + { + "alias": "Area B", + "refId": "B", + "scenarioId": "random_walk" + }, + { + "alias": "Basement", + "refId": "C", + "scenarioId": "random_walk" + }, + { + "alias": "Garage", + "refId": "D", + "scenarioId": "random_walk" + }, + { + "alias": "Attic", + "refId": "E", + "scenarioId": "random_walk" + }, + { + "refId": "F", + "scenarioId": "random_walk" + }, + { + "refId": "G", + "scenarioId": "random_walk" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Temperature", + "type": "bargauge" + } + ], + "refresh": false, + "schemaVersion": 18, + "style": "dark", + "tags": ["gdev", "bargauge", "panel-demo"], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": ["1s", "5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] + }, + "timezone": "", + "title": "Bar Gauge Animated Demo", + "uid": "k5IUwQeikaa", + "version": 4 +} diff --git a/devenv/dev-dashboards/panel-bargauge/gradient_demo.json b/devenv/dev-dashboards/panel-bargauge/gradient_demo.json new file mode 100644 index 0000000000000..3e5c224db4527 --- /dev/null +++ b/devenv/dev-dashboards/panel-bargauge/gradient_demo.json @@ -0,0 +1,367 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "gridPos": { + "h": 7, + "w": 18, + "x": 0, + "y": 0 + }, + "id": 7, + "links": [], + "options": { + "displayMode": "gradient", + "maxValue": 100, + "minValue": 0, + "orientation": "vertical", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "orange", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "watt" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk" + }, + { + "refId": "B", + "scenarioId": "random_walk" + }, + { + "refId": "C", + "scenarioId": "random_walk" + }, + { + "refId": "D", + "scenarioId": "random_walk" + }, + { + "refId": "E", + "scenarioId": "csv_metric_values", + "stringInput": "10003,33333" + }, + { + "refId": "F", + "scenarioId": "random_walk" + }, + { + "refId": "G", + "scenarioId": "random_walk" + }, + { + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + }, + { + "refId": "M", + "scenarioId": "random_walk" + }, + { + "refId": "N", + "scenarioId": "random_walk" + }, + { + "refId": "O", + "scenarioId": "random_walk" + }, + { + "refId": "P", + "scenarioId": "random_walk" + }, + { + "refId": "Q", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Usage", + "type": "bargauge" + }, + { + "gridPos": { + "h": 20, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 8, + "links": [], + "options": { + "displayMode": "gradient", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "orange", + "index": 1, + "value": 65 + }, + { + "color": "red", + "index": 2, + "value": 95 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "watt" + } + }, + "targets": [ + { + "refId": "E", + "scenarioId": "random_walk" + }, + { + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "refId": "A", + "scenarioId": "random_walk" + }, + { + "refId": "B", + "scenarioId": "random_walk" + }, + { + "refId": "C", + "scenarioId": "random_walk" + }, + { + "refId": "D", + "scenarioId": "random_walk" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + }, + { + "refId": "M", + "scenarioId": "random_walk" + }, + { + "refId": "N", + "scenarioId": "random_walk" + }, + { + "refId": "O", + "scenarioId": "random_walk" + }, + { + "refId": "P", + "scenarioId": "random_walk" + }, + { + "refId": "Q", + "scenarioId": "random_walk" + }, + { + "refId": "F", + "scenarioId": "random_walk" + }, + { + "refId": "G", + "scenarioId": "random_walk" + }, + { + "refId": "R", + "scenarioId": "random_walk" + }, + { + "refId": "S", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Usage", + "type": "bargauge" + }, + { + "gridPos": { + "h": 13, + "w": 18, + "x": 0, + "y": 7 + }, + "id": 6, + "links": [], + "options": { + "displayMode": "gradient", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "blue", + "index": 0, + "value": null + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "celsius" + } + }, + "targets": [ + { + "alias": "Inside", + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "alias": "Outhouse", + "refId": "A", + "scenarioId": "random_walk" + }, + { + "alias": "Area B", + "refId": "B", + "scenarioId": "random_walk" + }, + { + "alias": "Basement", + "refId": "C", + "scenarioId": "random_walk" + }, + { + "alias": "Garage", + "refId": "D", + "scenarioId": "random_walk" + }, + { + "alias": "Attic", + "refId": "E", + "scenarioId": "random_walk" + }, + { + "refId": "F", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Temperature", + "type": "bargauge" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": ["gdev", "bargauge", "panel-demo"], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] + }, + "timezone": "", + "title": "Bar Gauge Gradient Demo", + "uid": "RndRQw6mz", + "version": 3 +} diff --git a/devenv/dev-dashboards/panel-bargauge/many_modes_demo.json b/devenv/dev-dashboards/panel-bargauge/many_modes_demo.json new file mode 100644 index 0000000000000..fb08950538f00 --- /dev/null +++ b/devenv/dev-dashboards/panel-bargauge/many_modes_demo.json @@ -0,0 +1,393 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "gridPos": { + "h": 7, + "w": 22, + "x": 0, + "y": 0 + }, + "id": 7, + "links": [], + "options": { + "displayMode": "lcd", + "maxValue": 100, + "minValue": 0, + "orientation": "vertical", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "orange", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "watt" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk" + }, + { + "refId": "B", + "scenarioId": "random_walk" + }, + { + "refId": "C", + "scenarioId": "random_walk" + }, + { + "refId": "D", + "scenarioId": "random_walk" + }, + { + "refId": "E", + "scenarioId": "csv_metric_values", + "stringInput": "10003,33333" + }, + { + "refId": "F", + "scenarioId": "random_walk" + }, + { + "refId": "G", + "scenarioId": "random_walk" + }, + { + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + }, + { + "refId": "M", + "scenarioId": "random_walk" + }, + { + "refId": "N", + "scenarioId": "random_walk" + }, + { + "refId": "O", + "scenarioId": "random_walk" + }, + { + "refId": "P", + "scenarioId": "random_walk" + }, + { + "refId": "Q", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Usage", + "type": "bargauge" + }, + { + "gridPos": { + "h": 20, + "w": 2, + "x": 22, + "y": 0 + }, + "id": 11, + "links": [], + "options": { + "displayMode": "lcd", + "maxValue": 100, + "minValue": 0, + "orientation": "vertical", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "red", + "index": 1, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "percent" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Progress", + "type": "bargauge" + }, + { + "gridPos": { + "h": 13, + "w": 10, + "x": 0, + "y": 7 + }, + "id": 6, + "links": [], + "options": { + "displayMode": "gradient", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "blue", + "index": 0, + "value": null + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "celsius" + } + }, + "targets": [ + { + "alias": "Inside", + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "alias": "Outhouse", + "refId": "A", + "scenarioId": "random_walk" + }, + { + "alias": "Area B", + "refId": "B", + "scenarioId": "random_walk" + }, + { + "alias": "Basement", + "refId": "C", + "scenarioId": "random_walk" + }, + { + "alias": "Garage", + "refId": "D", + "scenarioId": "random_walk" + }, + { + "alias": "Attic", + "refId": "E", + "scenarioId": "random_walk" + }, + { + "refId": "F", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Temperature", + "type": "bargauge" + }, + { + "gridPos": { + "h": 13, + "w": 12, + "x": 10, + "y": 7 + }, + "id": 8, + "links": [], + "options": { + "displayMode": "basic", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "purple", + "index": 1, + "value": 50 + }, + { + "color": "blue", + "index": 2, + "value": 70 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "watt" + } + }, + "targets": [ + { + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "refId": "A", + "scenarioId": "random_walk" + }, + { + "refId": "B", + "scenarioId": "random_walk" + }, + { + "refId": "C", + "scenarioId": "random_walk" + }, + { + "refId": "D", + "scenarioId": "random_walk" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + }, + { + "refId": "M", + "scenarioId": "random_walk" + }, + { + "refId": "N", + "scenarioId": "random_walk" + }, + { + "refId": "O", + "scenarioId": "random_walk" + }, + { + "refId": "P", + "scenarioId": "random_walk" + }, + { + "refId": "Q", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Usage", + "type": "bargauge" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": ["gdev", "bargauge", "panel-demo"], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] + }, + "timezone": "", + "title": "Bar Gauge All Modes Demo", + "uid": "zt2f6NgZzaa", + "version": 1 +} diff --git a/devenv/dev-dashboards/panel-bargauge/retro_led_demo.json b/devenv/dev-dashboards/panel-bargauge/retro_led_demo.json new file mode 100644 index 0000000000000..4f2e22f73304d --- /dev/null +++ b/devenv/dev-dashboards/panel-bargauge/retro_led_demo.json @@ -0,0 +1,388 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "gridPos": { + "h": 8, + "w": 22, + "x": 0, + "y": 0 + }, + "id": 7, + "links": [], + "options": { + "displayMode": "lcd", + "maxValue": 100, + "minValue": 0, + "orientation": "vertical", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "orange", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "watt" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk" + }, + { + "refId": "B", + "scenarioId": "random_walk" + }, + { + "refId": "C", + "scenarioId": "random_walk" + }, + { + "refId": "D", + "scenarioId": "random_walk" + }, + { + "refId": "E", + "scenarioId": "csv_metric_values", + "stringInput": "10003,33333" + }, + { + "refId": "F", + "scenarioId": "random_walk" + }, + { + "refId": "G", + "scenarioId": "random_walk" + }, + { + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + }, + { + "refId": "M", + "scenarioId": "random_walk" + }, + { + "refId": "N", + "scenarioId": "random_walk" + }, + { + "refId": "O", + "scenarioId": "random_walk" + }, + { + "refId": "P", + "scenarioId": "random_walk" + }, + { + "refId": "Q", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Usage", + "type": "bargauge" + }, + { + "gridPos": { + "h": 21, + "w": 2, + "x": 22, + "y": 0 + }, + "id": 11, + "links": [], + "options": { + "displayMode": "lcd", + "maxValue": 100, + "minValue": 0, + "orientation": "vertical", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "red", + "index": 1, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "percent" + } + }, + "targets": [ + { + "refId": "A", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Progress", + "type": "bargauge" + }, + { + "gridPos": { + "h": 13, + "w": 10, + "x": 0, + "y": 8 + }, + "id": 6, + "links": [], + "options": { + "displayMode": "lcd", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "orange", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "celsius" + } + }, + "targets": [ + { + "alias": "Inside", + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "alias": "Outhouse", + "refId": "A", + "scenarioId": "random_walk" + }, + { + "alias": "Area B", + "refId": "B", + "scenarioId": "random_walk" + }, + { + "alias": "Basement", + "refId": "C", + "scenarioId": "random_walk" + }, + { + "alias": "Garage", + "refId": "D", + "scenarioId": "random_walk" + }, + { + "alias": "Attic", + "refId": "E", + "scenarioId": "random_walk" + }, + { + "refId": "F", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Temperature", + "type": "bargauge" + }, + { + "gridPos": { + "h": 13, + "w": 12, + "x": 10, + "y": 8 + }, + "id": 8, + "links": [], + "options": { + "displayMode": "lcd", + "maxValue": 100, + "minValue": 0, + "orientation": "horizontal", + "thresholds": [ + { + "color": "green", + "index": 0, + "value": null + }, + { + "color": "orange", + "index": 1, + "value": 85 + }, + { + "color": "red", + "index": 2, + "value": 95 + } + ], + "valueMappings": [], + "valueOptions": { + "decimals": null, + "prefix": "", + "stat": "mean", + "suffix": "", + "unit": "watt" + } + }, + "targets": [ + { + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "refId": "A", + "scenarioId": "random_walk" + }, + { + "refId": "B", + "scenarioId": "random_walk" + }, + { + "refId": "C", + "scenarioId": "random_walk" + }, + { + "refId": "D", + "scenarioId": "random_walk" + }, + { + "refId": "I", + "scenarioId": "random_walk" + }, + { + "refId": "J", + "scenarioId": "random_walk" + }, + { + "refId": "K", + "scenarioId": "random_walk" + }, + { + "refId": "L", + "scenarioId": "random_walk" + }, + { + "refId": "M", + "scenarioId": "random_walk" + }, + { + "refId": "N", + "scenarioId": "random_walk" + }, + { + "refId": "O", + "scenarioId": "random_walk" + }, + { + "refId": "P", + "scenarioId": "random_walk" + }, + { + "refId": "Q", + "scenarioId": "random_walk" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Usage", + "type": "bargauge" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": ["gdev", "bargauge", "panel-demo"], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] + }, + "timezone": "", + "title": "Bar Gauge LED Demo", + "uid": "0G3rbkqmkaa", + "version": 42 +} diff --git a/devenv/dev-dashboards/panel_tests_multiseries_gauge.json b/devenv/dev-dashboards/panel-gauge/gauge-multi-series.json similarity index 98% rename from devenv/dev-dashboards/panel_tests_multiseries_gauge.json rename to devenv/dev-dashboards/panel-gauge/gauge-multi-series.json index 91313b7d4391f..2f89d3ea9f313 100644 --- a/devenv/dev-dashboards/panel_tests_multiseries_gauge.json +++ b/devenv/dev-dashboards/panel-gauge/gauge-multi-series.json @@ -277,7 +277,7 @@ ], "schemaVersion": 17, "style": "dark", - "tags": [], + "tags": ["panel-tests", "gdev", "gauge"], "templating": { "list": [] }, @@ -290,7 +290,7 @@ "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", - "title": "Multi series gauges", + "title": "Panel Tests - Gauge Multi Series", "uid": "szkuR1umk", "version": 7 } diff --git a/devenv/dev-dashboards/panel_tests_gauge.json b/devenv/dev-dashboards/panel-gauge/gauge_tests.json similarity index 98% rename from devenv/dev-dashboards/panel_tests_gauge.json rename to devenv/dev-dashboards/panel-gauge/gauge_tests.json index c6e81ececc810..abcde39bd630f 100644 --- a/devenv/dev-dashboards/panel_tests_gauge.json +++ b/devenv/dev-dashboards/panel-gauge/gauge_tests.json @@ -1160,10 +1160,7 @@ "refresh": false, "schemaVersion": 17, "style": "dark", - "tags": [ - "gdev", - "panel-tests" - ], + "tags": ["gdev", "panel-tests"], "templating": { "list": [ { @@ -1172,9 +1169,7 @@ "selected": true, "tags": [], "text": "All", - "value": [ - "$__all" - ] + "value": ["$__all"] }, "hide": 0, "includeAll": true, @@ -1219,29 +1214,8 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Panel Tests - Gauge", diff --git a/devenv/dev-dashboards/panel_tests_graph_time_regions.json b/devenv/dev-dashboards/panel-graph/graph-time-regions.json similarity index 99% rename from devenv/dev-dashboards/panel_tests_graph_time_regions.json rename to devenv/dev-dashboards/panel-graph/graph-time-regions.json index 7803303c9b29c..6832b5adc27ce 100644 --- a/devenv/dev-dashboards/panel_tests_graph_time_regions.json +++ b/devenv/dev-dashboards/panel-graph/graph-time-regions.json @@ -561,7 +561,7 @@ "refresh": false, "schemaVersion": 18, "style": "dark", - "tags": ["gdev", "panel-tests"], + "tags": ["gdev", "panel-tests", "graph"], "templating": { "list": [] }, @@ -574,7 +574,7 @@ "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "browser", - "title": "Panel Tests - Graph (Time Regions)", + "title": "Panel Tests - Graph Time Regions", "uid": "XMjIZPmik", "version": 9 } diff --git a/devenv/dev-dashboards/panel_tests_graph.json b/devenv/dev-dashboards/panel-graph/graph_tests.json similarity index 99% rename from devenv/dev-dashboards/panel_tests_graph.json rename to devenv/dev-dashboards/panel-graph/graph_tests.json index ba677764a43bf..0cc42ce42be0e 100644 --- a/devenv/dev-dashboards/panel_tests_graph.json +++ b/devenv/dev-dashboards/panel-graph/graph_tests.json @@ -1632,10 +1632,7 @@ "revision": 8, "schemaVersion": 16, "style": "dark", - "tags": [ - "gdev", - "panel-tests" - ], + "tags": ["gdev", "panel-tests", "graph"], "templating": { "list": [] }, @@ -1644,29 +1641,8 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "browser", "title": "Panel Tests - Graph", diff --git a/devenv/dev-dashboards/panel_tests_polystat.json b/devenv/dev-dashboards/panel-polystat/polystat_test.json similarity index 98% rename from devenv/dev-dashboards/panel_tests_polystat.json rename to devenv/dev-dashboards/panel-polystat/polystat_test.json index 51d3085c4384d..5ec741eff89e6 100644 --- a/devenv/dev-dashboards/panel_tests_polystat.json +++ b/devenv/dev-dashboards/panel-polystat/polystat_test.json @@ -28,11 +28,7 @@ "value": "triggered" } ], - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], "d3DivId": "d3_svg_4", "datasource": "gdev-testdata", "decimals": 2, @@ -115,11 +111,7 @@ }, "id": 4, "links": [], - "notcolors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "notcolors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "operatorName": "avg", "operatorOptions": [ { @@ -1114,11 +1106,7 @@ "value": "triggered" } ], - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], "d3DivId": "d3_svg_5", "datasource": "gdev-testdata", "decimals": 2, @@ -1201,11 +1189,7 @@ }, "id": 5, "links": [], - "notcolors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "notcolors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "operatorName": "avg", "operatorOptions": [ { @@ -2221,11 +2205,7 @@ "value": "triggered" } ], - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], "d3DivId": "d3_svg_2", "datasource": "gdev-testdata", "decimals": 2, @@ -2308,11 +2288,7 @@ }, "id": 2, "links": [], - "notcolors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "notcolors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "operatorName": "avg", "operatorOptions": [ { @@ -3300,10 +3276,7 @@ ], "schemaVersion": 16, "style": "dark", - "tags": [ - "panel-test", - "gdev" - ], + "tags": ["panel-test", "gdev", "polystat"], "templating": { "list": [] }, @@ -3312,29 +3285,8 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Panel Tests - Polystat", diff --git a/devenv/dev-dashboards/panel_tests_singlestat.json b/devenv/dev-dashboards/panel-singlestat/singlestat_test.json similarity index 92% rename from devenv/dev-dashboards/panel_tests_singlestat.json rename to devenv/dev-dashboards/panel-singlestat/singlestat_test.json index 2d69f27bcb6bb..773c36b130374 100644 --- a/devenv/dev-dashboards/panel_tests_singlestat.json +++ b/devenv/dev-dashboards/panel-singlestat/singlestat_test.json @@ -21,11 +21,7 @@ "cacheTimeout": null, "colorBackground": false, "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], "datasource": "gdev-testdata", "decimals": null, "description": "", @@ -106,11 +102,7 @@ "colorBackground": false, "colorPrefix": false, "colorValue": true, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], + "colors": ["#d44a3a", "rgba(237, 129, 40, 0.89)", "#299c46"], "datasource": "gdev-testdata", "decimals": null, "description": "", @@ -191,11 +183,7 @@ "colorBackground": true, "colorPrefix": false, "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], + "colors": ["#d44a3a", "rgba(237, 129, 40, 0.89)", "#299c46"], "datasource": "gdev-testdata", "decimals": null, "description": "", @@ -276,11 +264,7 @@ "colorBackground": false, "colorPrefix": false, "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], "datasource": "gdev-testdata", "decimals": null, "description": "", @@ -361,11 +345,7 @@ "colorBackground": false, "colorPrefix": false, "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], "datasource": "gdev-testdata", "decimals": null, "description": "", @@ -446,11 +426,7 @@ "colorBackground": false, "colorPrefix": false, "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], + "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], "datasource": "gdev-testdata", "decimals": null, "description": "", @@ -531,10 +507,7 @@ "revision": 8, "schemaVersion": 16, "style": "dark", - "tags": [ - "gdev", - "panel-tests" - ], + "tags": ["gdev", "panel-tests"], "templating": { "list": [] }, @@ -543,29 +516,8 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "browser", "title": "Panel Tests - Singlestat", diff --git a/devenv/dev-dashboards/panel_tests_table.json b/devenv/dev-dashboards/panel-table/table_tests.json similarity index 75% rename from devenv/dev-dashboards/panel_tests_table.json rename to devenv/dev-dashboards/panel-table/table_tests.json index ff0288c340ae5..c301dd23b6a59 100644 --- a/devenv/dev-dashboards/panel_tests_table.json +++ b/devenv/dev-dashboards/panel-table/table_tests.json @@ -46,49 +46,31 @@ { "alias": "", "colorMode": "cell", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "mappingType": 1, "pattern": "ColorCell", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "currencyUSD" }, { "alias": "", "colorMode": "value", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "mappingType": 1, "pattern": "ColorValue", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "Bps" }, { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -159,49 +141,31 @@ { "alias": "", "colorMode": "cell", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "mappingType": 1, "pattern": "ColorCell", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "currencyUSD" }, { "alias": "", "colorMode": "value", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "mappingType": 1, "pattern": "ColorValue", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "Bps" }, { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -259,30 +223,19 @@ { "alias": "", "colorMode": "row", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "mappingType": 1, "pattern": "/Color/", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "currencyUSD" }, { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -334,49 +287,31 @@ { "alias": "", "colorMode": "cell", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "mappingType": 1, "pattern": "ColorCell", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "currencyUSD" }, { "alias": "", "colorMode": "value", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "mappingType": 1, "pattern": "ColorValue", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "Bps" }, { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -434,11 +369,7 @@ { "alias": "", "colorMode": "cell", - "colors": [ - "rgba(245, 54, 54, 0.5)", - "rgba(237, 129, 40, 0.5)", - "rgba(50, 172, 45, 0.5)" - ], + "colors": ["rgba(245, 54, 54, 0.5)", "rgba(237, 129, 40, 0.5)", "rgba(50, 172, 45, 0.5)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "link": true, @@ -447,42 +378,28 @@ "linkUrl": "http://www.grafana.com", "mappingType": 1, "pattern": "ColorCell", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "currencyUSD" }, { "alias": "", "colorMode": "value", - "colors": [ - "rgba(245, 54, 54, 0.5)", - "rgba(237, 129, 40, 0.5)", - "rgba(50, 172, 45, 0.5)" - ], + "colors": ["rgba(245, 54, 54, 0.5)", "rgba(237, 129, 40, 0.5)", "rgba(50, 172, 45, 0.5)"], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "link": true, "linkUrl": "http://www.grafana.com", "mappingType": 1, "pattern": "ColorValue", - "thresholds": [ - "5", - "10" - ], + "thresholds": ["5", "10"], "type": "number", "unit": "Bps" }, { "alias": "", "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], + "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"], "decimals": 2, "pattern": "/.*/", "thresholds": [], @@ -516,10 +433,7 @@ "revision": 8, "schemaVersion": 16, "style": "dark", - "tags": [ - "gdev", - "panel-tests" - ], + "tags": ["gdev", "panel-tests"], "templating": { "list": [] }, @@ -528,32 +442,11 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "browser", "title": "Panel Tests - Table", "uid": "pttable", "version": 2 -} \ No newline at end of file +} diff --git a/devenv/dev-dashboards/panel_tests_slow_queries_and_annotations.json b/devenv/dev-dashboards/scenarios/slow_queries_and_annotations.json similarity index 98% rename from devenv/dev-dashboards/panel_tests_slow_queries_and_annotations.json rename to devenv/dev-dashboards/scenarios/slow_queries_and_annotations.json index 08bf6dce9d010..c0b0ab8425d06 100644 --- a/devenv/dev-dashboards/panel_tests_slow_queries_and_annotations.json +++ b/devenv/dev-dashboards/scenarios/slow_queries_and_annotations.json @@ -19,9 +19,7 @@ "matchAny": false, "name": "annotations", "showIn": 0, - "tags": [ - "asd" - ], + "tags": ["asd"], "type": "tags" } ] @@ -1135,29 +1133,8 @@ "to": "now" }, "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Panel tests - Slow Queries & Annotations", diff --git a/docs/sources/administration/provisioning.md b/docs/sources/administration/provisioning.md index d34def097018c..b1513940ef216 100644 --- a/docs/sources/administration/provisioning.md +++ b/docs/sources/administration/provisioning.md @@ -107,7 +107,7 @@ datasources: orgId: 1 # url url: http://localhost:8080 - # database password, if used + # Deprecated, use secureJsonData.password password: # database user, if used user: @@ -117,7 +117,7 @@ datasources: basicAuth: # basic auth username basicAuthUser: - # basic auth password + # Deprecated, use secureJsonData.basicAuthPassword basicAuthPassword: # enable/disable with credentials headers withCredentials: @@ -133,6 +133,10 @@ datasources: tlsCACert: "..." tlsClientCert: "..." tlsClientKey: "..." + # database password, if used + password: + # basic auth password + basicAuthPassword: version: 1 # allow users to edit datasources from the UI. editable: false @@ -184,8 +188,8 @@ Secure json data is a map of settings that will be encrypted with [secret key](/ | tlsCACert | string | *All* |CA cert for out going requests | | tlsClientCert | string | *All* |TLS Client cert for outgoing requests | | tlsClientKey | string | *All* |TLS Client key for outgoing requests | -| password | string | PostgreSQL | password | -| user | string | PostgreSQL | user | +| password | string | *All* | password | +| basicAuthPassword | string | *All* | password for basic authentication | | accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch | | secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch | diff --git a/docs/sources/alerting/notifications.md b/docs/sources/alerting/notifications.md index 8aafdb0362cae..91b80962c831d 100644 --- a/docs/sources/alerting/notifications.md +++ b/docs/sources/alerting/notifications.md @@ -27,7 +27,7 @@ can configure and setup a new Notification Channel. You specify a name and a type, and type specific options. You can also test the notification to make sure it's setup correctly. -### Send on all alerts +### Default (send on all alerts) When checked, this option will notify for all alert rules - existing and new. diff --git a/docs/sources/index.md b/docs/sources/index.md index a0b1ff42ea031..744b04203e432 100644 --- a/docs/sources/index.md +++ b/docs/sources/index.md @@ -3,7 +3,7 @@ title = "Grafana documentation" description = "Guides, Installation & Feature Documentation" keywords = ["grafana", "installation", "documentation"] type = "docs" -aliases = ["v1.1", "guides/reference/admin"] +aliases = ["v1.1", "guides/reference/admin", "v3.1"] +++ # Grafana Documentation diff --git a/docs/sources/installation/debian.md b/docs/sources/installation/debian.md index dc522ce6111f4..c22d7814cb661 100644 --- a/docs/sources/installation/debian.md +++ b/docs/sources/installation/debian.md @@ -27,7 +27,7 @@ installation. ```bash wget -sudo apt-get install -y adduser libfontconfig +sudo apt-get install -y adduser libfontconfig1 sudo dpkg -i grafana__amd64.deb ``` @@ -35,7 +35,7 @@ Example: ```bash wget https://dl.grafana.com/oss/release/grafana_5.4.2_amd64.deb -sudo apt-get install -y adduser libfontconfig +sudo apt-get install -y adduser libfontconfig1 sudo dpkg -i grafana_5.4.2_amd64.deb ``` diff --git a/docs/sources/installation/index.md b/docs/sources/installation/index.md index a86f426dc13c6..62736311e6a33 100644 --- a/docs/sources/installation/index.md +++ b/docs/sources/installation/index.md @@ -3,7 +3,7 @@ title = "Installation" description = "Install guide for Grafana" keywords = ["grafana", "installation", "documentation"] type = "docs" -aliases = ["installation/installation/", "v2.1/installation/install/"] +aliases = ["installation/installation/", "v2.1/installation/install/", "install"] [menu.docs] name = "Installation" identifier = "installation" diff --git a/docs/sources/installation/upgrading.md b/docs/sources/installation/upgrading.md index 511d6117eb3d0..74de4ae8873ed 100644 --- a/docs/sources/installation/upgrading.md +++ b/docs/sources/installation/upgrading.md @@ -123,7 +123,18 @@ If you're using systemd and have a large amount of annotations consider temporar If you have text panels with script tags they will no longer work due to a new setting that per default disallow unsanitized HTML. Read more [here](/installation/configuration/#disable-sanitize-html) about this new setting. -### Authentication and security +## Upgrading to v6.2 + +Datasources store passwords and basic auth passwords in secureJsonData encrypted by default. Existing datasource +will keep working with unencrypted passwords. If you want to migrate to encrypted storage for your existing datasources +you can do that by: +- For datasources created through UI, you need to go to datasource config, re enter the password or basic auth +password and save the datasource. +- For datasources created by provisioning, you need to update your config file and use secureJsonData.password or +secureJsonData.basicAuthPassword field. See [provisioning docs](/administration/provisioning) for example of current +configuration. + +## Authentication and security If your using Grafana's builtin, LDAP (without Auth Proxy) or OAuth authentication all users will be required to login upon the next visit after the upgrade. diff --git a/docs/sources/reference/sharing.md b/docs/sources/reference/sharing.md index 209f69e26ddc5..aebf76090f3a3 100644 --- a/docs/sources/reference/sharing.md +++ b/docs/sources/reference/sharing.md @@ -39,7 +39,7 @@ Click a panel title to open the panel menu, then click share in the panel menu t ### Direct Link Rendered Image -You also get a link to service side rendered PNG of the panel. Useful if you want to share an image of the panel. Please note that for OSX and Windows, you will need to ensure that a `phantomjs` binary is available under `tools/phantomjs/phantomjs`. For Linux, a `phantomjs` binary is included - however, you should ensure that any requisite libraries (e.g. libfontconfig) are available. +You also get a link to service side rendered PNG of the panel. Useful if you want to share an image of the panel. Please note that for OSX and Windows, you will need to ensure that a `phantomjs` binary is available under `tools/phantomjs/phantomjs`. For Linux, a `phantomjs` binary is included - however, you should ensure that any requisite libraries (e.g. libfontconfig1) are available. Example of a link to a server-side rendered PNG: diff --git a/package.json b/package.json index 8e58fc7e4c890..b3988b0d294e1 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@types/inquirer": "^0.0.43", "@types/jest": "^24.0.11", "@types/jquery": "^1.10.35", + "@types/lodash": "4.14.123", "@types/node": "^8.0.31", "@types/papaparse": "^4.5.9", "@types/react": "^16.8.8", diff --git a/packages/grafana-ui/src/types/data.ts b/packages/grafana-ui/src/types/data.ts index a251398b981c2..2485fb0b652d6 100644 --- a/packages/grafana-ui/src/types/data.ts +++ b/packages/grafana-ui/src/types/data.ts @@ -72,6 +72,7 @@ export enum NullValueMode { } export interface AnnotationEvent { + id?: string; annotation?: any; dashboardId?: number; panelId?: number; @@ -82,5 +83,5 @@ export interface AnnotationEvent { title?: string; text?: string; type?: string; - tags?: string; + tags?: string[]; } diff --git a/packaging/conf/nfpm.yaml b/packaging/conf/nfpm.yaml index 6eafe22e2507c..891cae233c754 100644 --- a/packaging/conf/nfpm.yaml +++ b/packaging/conf/nfpm.yaml @@ -11,7 +11,7 @@ provides: - grafana-cli depends: - adduser -- libfontconfig +- libfontconfig1 maintainer: "" description: | Grafana diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile index 58fa8dae64c0e..3980e4bf5d8d5 100644 --- a/packaging/docker/Dockerfile +++ b/packaging/docker/Dockerfile @@ -29,7 +29,7 @@ ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi WORKDIR $GF_PATHS_HOME RUN apt-get update && apt-get -y upgrade && \ - apt-get install -qq -y libfontconfig ca-certificates curl && \ + apt-get install -qq -y libfontconfig1 ca-certificates curl && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index ca9221f1f59ab..a9d78383045b8 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -407,8 +407,15 @@ func GetDashboardVersion(c *m.ReqContext) Response { } dashVersionMeta := &m.DashboardVersionMeta{ - DashboardVersion: *query.Result, - CreatedBy: creator, + Id: query.Result.Id, + DashboardId: query.Result.DashboardId, + Data: query.Result.Data, + ParentVersion: query.Result.ParentVersion, + RestoredFrom: query.Result.RestoredFrom, + Version: query.Result.Version, + Created: query.Result.Created, + Message: query.Result.Message, + CreatedBy: creator, } return JSON(200, dashVersionMeta) diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index 847ed6b936681..1fceca12bfa12 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -1,6 +1,7 @@ package api import ( + "github.com/grafana/grafana/pkg/util" "strconv" "github.com/grafana/grafana/pkg/bus" @@ -8,9 +9,9 @@ import ( m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/setting" - "github.com/grafana/grafana/pkg/util" ) +// getFrontendSettingsMap returns a json object with all the settings needed for front end initialisation. func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interface{}, error) { orgDataSources := make([]*m.DataSource, 0) @@ -92,7 +93,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf if ds.Access == m.DS_ACCESS_DIRECT { if ds.BasicAuth { - dsMap["basicAuth"] = util.GetBasicAuthHeader(ds.BasicAuthUser, ds.BasicAuthPassword) + dsMap["basicAuth"] = util.GetBasicAuthHeader(ds.BasicAuthUser, ds.DecryptedBasicAuthPassword()) } if ds.WithCredentials { dsMap["withCredentials"] = ds.WithCredentials @@ -100,14 +101,13 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf if ds.Type == m.DS_INFLUXDB_08 { dsMap["username"] = ds.User - dsMap["password"] = ds.Password + dsMap["password"] = ds.DecryptedPassword() dsMap["url"] = url + "/db/" + ds.Database } if ds.Type == m.DS_INFLUXDB { dsMap["username"] = ds.User - dsMap["password"] = ds.Password - dsMap["database"] = ds.Database + dsMap["password"] = ds.DecryptedPassword() dsMap["url"] = url } } diff --git a/pkg/api/pluginproxy/ds_proxy.go b/pkg/api/pluginproxy/ds_proxy.go index 5f314bc2421fb..b86d1834844f7 100644 --- a/pkg/api/pluginproxy/ds_proxy.go +++ b/pkg/api/pluginproxy/ds_proxy.go @@ -146,21 +146,21 @@ func (proxy *DataSourceProxy) getDirector() func(req *http.Request) { if proxy.ds.Type == m.DS_INFLUXDB_08 { req.URL.Path = util.JoinURLFragments(proxy.targetUrl.Path, "db/"+proxy.ds.Database+"/"+proxy.proxyPath) reqQueryVals.Add("u", proxy.ds.User) - reqQueryVals.Add("p", proxy.ds.Password) + reqQueryVals.Add("p", proxy.ds.DecryptedPassword()) req.URL.RawQuery = reqQueryVals.Encode() } else if proxy.ds.Type == m.DS_INFLUXDB { req.URL.Path = util.JoinURLFragments(proxy.targetUrl.Path, proxy.proxyPath) req.URL.RawQuery = reqQueryVals.Encode() if !proxy.ds.BasicAuth { req.Header.Del("Authorization") - req.Header.Add("Authorization", util.GetBasicAuthHeader(proxy.ds.User, proxy.ds.Password)) + req.Header.Add("Authorization", util.GetBasicAuthHeader(proxy.ds.User, proxy.ds.DecryptedPassword())) } } else { req.URL.Path = util.JoinURLFragments(proxy.targetUrl.Path, proxy.proxyPath) } if proxy.ds.BasicAuth { req.Header.Del("Authorization") - req.Header.Add("Authorization", util.GetBasicAuthHeader(proxy.ds.BasicAuthUser, proxy.ds.BasicAuthPassword)) + req.Header.Add("Authorization", util.GetBasicAuthHeader(proxy.ds.BasicAuthUser, proxy.ds.DecryptedBasicAuthPassword())) } // Lookup and use custom headers diff --git a/pkg/api/pluginproxy/ds_proxy_test.go b/pkg/api/pluginproxy/ds_proxy_test.go index 368acb3a6429f..e9e526fb7c39d 100644 --- a/pkg/api/pluginproxy/ds_proxy_test.go +++ b/pkg/api/pluginproxy/ds_proxy_test.go @@ -3,6 +3,7 @@ package pluginproxy import ( "bytes" "fmt" + "github.com/grafana/grafana/pkg/components/securejsondata" "io/ioutil" "net/http" "net/url" @@ -274,12 +275,6 @@ func TestDSRouteRule(t *testing.T) { Convey("Should add db to url", func() { So(req.URL.Path, ShouldEqual, "/db/site/") }) - - Convey("Should add username and password", func() { - queryVals := req.URL.Query() - So(queryVals["u"][0], ShouldEqual, "user") - So(queryVals["p"][0], ShouldEqual, "password") - }) }) Convey("When proxying a data source with no keepCookies specified", func() { @@ -481,6 +476,26 @@ func TestDSRouteRule(t *testing.T) { So(req.Header.Get("X-Grafana-User"), ShouldEqual, "") }) }) + + Convey("When proxying data source proxy should handle authentication", func() { + tests := []*Test{ + createAuthTest(m.DS_INFLUXDB_08, AUTHTYPE_PASSWORD, AUTHCHECK_QUERY, false), + createAuthTest(m.DS_INFLUXDB_08, AUTHTYPE_PASSWORD, AUTHCHECK_QUERY, true), + createAuthTest(m.DS_INFLUXDB, AUTHTYPE_PASSWORD, AUTHCHECK_HEADER, true), + createAuthTest(m.DS_INFLUXDB, AUTHTYPE_PASSWORD, AUTHCHECK_HEADER, false), + createAuthTest(m.DS_INFLUXDB, AUTHTYPE_BASIC, AUTHCHECK_HEADER, true), + createAuthTest(m.DS_INFLUXDB, AUTHTYPE_BASIC, AUTHCHECK_HEADER, false), + + // These two should be enough for any other datasource at the moment. Proxy has special handling + // only for Influx, others have the same path and only BasicAuth. Non BasicAuth datasources + // do not go through proxy but through TSDB API which is not tested here. + createAuthTest(m.DS_ES, AUTHTYPE_BASIC, AUTHCHECK_HEADER, false), + createAuthTest(m.DS_ES, AUTHTYPE_BASIC, AUTHCHECK_HEADER, true), + } + for _, test := range tests { + runDatasourceAuthTest(test) + } + }) }) } @@ -524,3 +539,90 @@ func newFakeHTTPClient(fakeBody []byte) httpClient { fakeBody: fakeBody, } } + +type Test struct { + datasource *m.DataSource + checkReq func(req *http.Request) +} + +const ( + AUTHTYPE_PASSWORD = "password" + AUTHTYPE_BASIC = "basic" +) + +const ( + AUTHCHECK_QUERY = "query" + AUTHCHECK_HEADER = "header" +) + +func createAuthTest(dsType string, authType string, authCheck string, useSecureJsonData bool) *Test { + // Basic user:password + base64AthHeader := "Basic dXNlcjpwYXNzd29yZA==" + + test := &Test{ + datasource: &m.DataSource{ + Type: dsType, + JsonData: simplejson.New(), + }, + } + var message string + if authType == AUTHTYPE_PASSWORD { + message = fmt.Sprintf("%v should add username and password", dsType) + test.datasource.User = "user" + if useSecureJsonData { + test.datasource.SecureJsonData = securejsondata.GetEncryptedJsonData(map[string]string{ + "password": "password", + }) + } else { + test.datasource.Password = "password" + } + } else { + message = fmt.Sprintf("%v should add basic auth username and password", dsType) + test.datasource.BasicAuth = true + test.datasource.BasicAuthUser = "user" + if useSecureJsonData { + test.datasource.SecureJsonData = securejsondata.GetEncryptedJsonData(map[string]string{ + "basicAuthPassword": "password", + }) + } else { + test.datasource.BasicAuthPassword = "password" + } + } + + if useSecureJsonData { + message += " from securejsondata" + } + + if authCheck == AUTHCHECK_QUERY { + message += " to query params" + test.checkReq = func(req *http.Request) { + Convey(message, func() { + queryVals := req.URL.Query() + So(queryVals["u"][0], ShouldEqual, "user") + So(queryVals["p"][0], ShouldEqual, "password") + }) + } + } else { + message += " to auth header" + test.checkReq = func(req *http.Request) { + Convey(message, func() { + So(req.Header.Get("Authorization"), ShouldEqual, base64AthHeader) + }) + } + } + + return test +} + +func runDatasourceAuthTest(test *Test) { + plugin := &plugins.DataSourcePlugin{} + ctx := &m.ReqContext{} + proxy := NewDataSourceProxy(test.datasource, plugin, ctx, "", &setting.Cfg{}) + + req, err := http.NewRequest(http.MethodGet, "http://grafana.com/sub", nil) + So(err, ShouldBeNil) + + proxy.getDirector()(req) + + test.checkReq(req) +} diff --git a/pkg/components/securejsondata/securejsondata.go b/pkg/components/securejsondata/securejsondata.go index caf4b36948346..4e7f636017395 100644 --- a/pkg/components/securejsondata/securejsondata.go +++ b/pkg/components/securejsondata/securejsondata.go @@ -6,8 +6,25 @@ import ( "github.com/grafana/grafana/pkg/util" ) +// SecureJsonData is used to store encrypted data (for example in data_source table). Only values are separately +// encrypted. type SecureJsonData map[string][]byte +// DecryptedValue returns single decrypted value from SecureJsonData. Similar to normal map access second return value +// is true if the key exists and false if not. +func (s SecureJsonData) DecryptedValue(key string) (string, bool) { + if value, ok := s[key]; ok { + decryptedData, err := util.Decrypt(value, setting.SecretKey) + if err != nil { + log.Fatal(4, err.Error()) + } + return string(decryptedData), true + } + return "", false +} + +// Decrypt returns map of the same type but where the all the values are decrypted. Opposite of what +// GetEncryptedJsonData is doing. func (s SecureJsonData) Decrypt() map[string]string { decrypted := make(map[string]string) for key, data := range s { @@ -21,6 +38,7 @@ func (s SecureJsonData) Decrypt() map[string]string { return decrypted } +// GetEncryptedJsonData returns map where all keys are encrypted. func GetEncryptedJsonData(sjd map[string]string) SecureJsonData { encrypted := make(SecureJsonData) for key, data := range sjd { diff --git a/pkg/models/dashboard_version.go b/pkg/models/dashboard_version.go index 9f5f18cb26373..304a81e41c8b2 100644 --- a/pkg/models/dashboard_version.go +++ b/pkg/models/dashboard_version.go @@ -32,8 +32,15 @@ type DashboardVersion struct { // associated with the UserIds, overriding the field with the same name from // the DashboardVersion model. type DashboardVersionMeta struct { - DashboardVersion - CreatedBy string `json:"createdBy"` + Id int64 `json:"id"` + DashboardId int64 `json:"dashboardId"` + ParentVersion int `json:"parentVersion"` + RestoredFrom int `json:"restoredFrom"` + Version int `json:"version"` + Created time.Time `json:"created"` + Message string `json:"message"` + Data *simplejson.Json `json:"data"` + CreatedBy string `json:"createdBy"` } // DashboardVersionDTO represents a dashboard version, without the dashboard diff --git a/pkg/models/datasource.go b/pkg/models/datasource.go index 22c53dfa0dd42..491126e4fc6c4 100644 --- a/pkg/models/datasource.go +++ b/pkg/models/datasource.go @@ -61,6 +61,26 @@ type DataSource struct { Updated time.Time } +// DecryptedBasicAuthPassword returns data source basic auth password in plain text. It uses either deprecated +// basic_auth_password field or encrypted secure_json_data[basicAuthPassword] variable. +func (ds *DataSource) DecryptedBasicAuthPassword() string { + return ds.decryptedValue("basicAuthPassword", ds.BasicAuthPassword) +} + +// DecryptedPassword returns data source password in plain text. It uses either deprecated password field +// or encrypted secure_json_data[password] variable. +func (ds *DataSource) DecryptedPassword() string { + return ds.decryptedValue("password", ds.Password) +} + +// decryptedValue returns decrypted value from secureJsonData +func (ds *DataSource) decryptedValue(field string, fallback string) string { + if value, ok := ds.SecureJsonData.DecryptedValue(field); ok { + return value + } + return fallback +} + var knownDatasourcePlugins = map[string]bool{ DS_ES: true, DS_GRAPHITE: true, diff --git a/pkg/services/provisioning/datasources/config_reader.go b/pkg/services/provisioning/datasources/config_reader.go index 34c1418aa98eb..334ce879e5ade 100644 --- a/pkg/services/provisioning/datasources/config_reader.go +++ b/pkg/services/provisioning/datasources/config_reader.go @@ -62,8 +62,8 @@ func (cr *configReader) parseDatasourceConfig(path string, file os.FileInfo) (*D } if apiVersion.ApiVersion > 0 { - var v1 *DatasourcesAsConfigV1 - err = yaml.Unmarshal(yamlFile, &v1) + v1 := &DatasourcesAsConfigV1{log: cr.log} + err = yaml.Unmarshal(yamlFile, v1) if err != nil { return nil, err } diff --git a/pkg/services/provisioning/datasources/types.go b/pkg/services/provisioning/datasources/types.go index 8e2443a016998..f619fd5f0054b 100644 --- a/pkg/services/provisioning/datasources/types.go +++ b/pkg/services/provisioning/datasources/types.go @@ -1,9 +1,10 @@ package datasources import ( + "github.com/grafana/grafana/pkg/components/simplejson" + "github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/models" ) -import "github.com/grafana/grafana/pkg/components/simplejson" type ConfigVersion struct { ApiVersion int64 `json:"apiVersion" yaml:"apiVersion"` @@ -51,6 +52,7 @@ type DatasourcesAsConfigV0 struct { type DatasourcesAsConfigV1 struct { ConfigVersion + log log.Logger Datasources []*DataSourceFromConfigV1 `json:"datasources" yaml:"datasources"` DeleteDatasources []*DeleteDatasourceConfigV1 `json:"deleteDatasources" yaml:"deleteDatasources"` @@ -135,6 +137,12 @@ func (cfg *DatasourcesAsConfigV1) mapToDatasourceFromConfig(apiVersion int64) *D Editable: ds.Editable, Version: ds.Version, }) + if ds.Password != "" { + cfg.log.Warn("[Deprecated] the use of password field is deprecated. Please use secureJsonData.password", "datasource name", ds.Name) + } + if ds.BasicAuthPassword != "" { + cfg.log.Warn("[Deprecated] the use of basicAuthPassword field is deprecated. Please use secureJsonData.basicAuthPassword", "datasource name", ds.Name) + } } for _, ds := range cfg.DeleteDatasources { diff --git a/pkg/services/sqlstore/datasource.go b/pkg/services/sqlstore/datasource.go index 071577eb6d6be..495e3cee93fb7 100644 --- a/pkg/services/sqlstore/datasource.go +++ b/pkg/services/sqlstore/datasource.go @@ -178,6 +178,10 @@ func UpdateDataSource(cmd *m.UpdateDataSourceCommand) error { sess.UseBool("basic_auth") sess.UseBool("with_credentials") sess.UseBool("read_only") + // Make sure password are zeroed out if empty. We do this as we want to migrate passwords from + // plain text fields to SecureJsonData. + sess.MustCols("password") + sess.MustCols("basic_auth_password") var updateSession *xorm.Session if cmd.Version != 0 { diff --git a/pkg/tsdb/elasticsearch/client/client.go b/pkg/tsdb/elasticsearch/client/client.go index f5a200f60ceb8..22e34a12b65d3 100644 --- a/pkg/tsdb/elasticsearch/client/client.go +++ b/pkg/tsdb/elasticsearch/client/client.go @@ -172,12 +172,12 @@ func (c *baseClientImpl) executeRequest(method, uriPath string, body []byte) (*h if c.ds.BasicAuth { clientLog.Debug("Request configured to use basic authentication") - req.SetBasicAuth(c.ds.BasicAuthUser, c.ds.BasicAuthPassword) + req.SetBasicAuth(c.ds.BasicAuthUser, c.ds.DecryptedBasicAuthPassword()) } if !c.ds.BasicAuth && c.ds.User != "" { clientLog.Debug("Request configured to use basic authentication") - req.SetBasicAuth(c.ds.User, c.ds.Password) + req.SetBasicAuth(c.ds.User, c.ds.DecryptedPassword()) } httpClient, err := newDatasourceHttpClient(c.ds) diff --git a/pkg/tsdb/graphite/graphite.go b/pkg/tsdb/graphite/graphite.go index 108e918832984..9a5de205a23a7 100644 --- a/pkg/tsdb/graphite/graphite.go +++ b/pkg/tsdb/graphite/graphite.go @@ -149,7 +149,7 @@ func (e *GraphiteExecutor) createRequest(dsInfo *models.DataSource, data url.Val req.Header.Set("Content-Type", "application/x-www-form-urlencoded") if dsInfo.BasicAuth { - req.SetBasicAuth(dsInfo.BasicAuthUser, dsInfo.BasicAuthPassword) + req.SetBasicAuth(dsInfo.BasicAuthUser, dsInfo.DecryptedBasicAuthPassword()) } return req, err diff --git a/pkg/tsdb/influxdb/influxdb.go b/pkg/tsdb/influxdb/influxdb.go index 3502f1ac19645..d199211575a56 100644 --- a/pkg/tsdb/influxdb/influxdb.go +++ b/pkg/tsdb/influxdb/influxdb.go @@ -125,11 +125,11 @@ func (e *InfluxDBExecutor) createRequest(dsInfo *models.DataSource, query string req.Header.Set("User-Agent", "Grafana") if dsInfo.BasicAuth { - req.SetBasicAuth(dsInfo.BasicAuthUser, dsInfo.BasicAuthPassword) + req.SetBasicAuth(dsInfo.BasicAuthUser, dsInfo.DecryptedBasicAuthPassword()) } if !dsInfo.BasicAuth && dsInfo.User != "" { - req.SetBasicAuth(dsInfo.User, dsInfo.Password) + req.SetBasicAuth(dsInfo.User, dsInfo.DecryptedPassword()) } glog.Debug("Influxdb request", "url", req.URL.String()) diff --git a/pkg/tsdb/mssql/mssql.go b/pkg/tsdb/mssql/mssql.go index c740d6cbe777f..6503632aea3ad 100644 --- a/pkg/tsdb/mssql/mssql.go +++ b/pkg/tsdb/mssql/mssql.go @@ -44,14 +44,6 @@ func newMssqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin } func generateConnectionString(datasource *models.DataSource) (string, error) { - password := "" - for key, value := range datasource.SecureJsonData.Decrypt() { - if key == "password" { - password = value - break - } - } - server, port := util.SplitHostPortDefault(datasource.Url, "localhost", "1433") encrypt := datasource.JsonData.Get("encrypt").MustString("false") @@ -60,7 +52,7 @@ func generateConnectionString(datasource *models.DataSource) (string, error) { port, datasource.Database, datasource.User, - password, + datasource.DecryptedPassword(), ) if encrypt != "false" { connStr += fmt.Sprintf("encrypt=%s;", encrypt) diff --git a/pkg/tsdb/mysql/mysql.go b/pkg/tsdb/mysql/mysql.go index 0451f8f0dc156..95a9e02598f0c 100644 --- a/pkg/tsdb/mysql/mysql.go +++ b/pkg/tsdb/mysql/mysql.go @@ -28,7 +28,7 @@ func newMysqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin } cnnstr := fmt.Sprintf("%s:%s@%s(%s)/%s?collation=utf8mb4_unicode_ci&parseTime=true&loc=UTC&allowNativePasswords=true", datasource.User, - datasource.Password, + datasource.DecryptedPassword(), protocol, datasource.Url, datasource.Database, diff --git a/pkg/tsdb/opentsdb/opentsdb.go b/pkg/tsdb/opentsdb/opentsdb.go index a810d3c733837..d0f61e052335b 100644 --- a/pkg/tsdb/opentsdb/opentsdb.go +++ b/pkg/tsdb/opentsdb/opentsdb.go @@ -96,7 +96,7 @@ func (e *OpenTsdbExecutor) createRequest(dsInfo *models.DataSource, data OpenTsd req.Header.Set("Content-Type", "application/json") if dsInfo.BasicAuth { - req.SetBasicAuth(dsInfo.BasicAuthUser, dsInfo.BasicAuthPassword) + req.SetBasicAuth(dsInfo.BasicAuthUser, dsInfo.DecryptedBasicAuthPassword()) } return req, err diff --git a/pkg/tsdb/postgres/postgres.go b/pkg/tsdb/postgres/postgres.go index ae6b165e7314b..7840a47fb187e 100644 --- a/pkg/tsdb/postgres/postgres.go +++ b/pkg/tsdb/postgres/postgres.go @@ -41,18 +41,10 @@ func newPostgresQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndp } func generateConnectionString(datasource *models.DataSource) string { - password := "" - for key, value := range datasource.SecureJsonData.Decrypt() { - if key == "password" { - password = value - break - } - } - sslmode := datasource.JsonData.Get("sslmode").MustString("verify-full") u := &url.URL{ Scheme: "postgres", - User: url.UserPassword(datasource.User, password), + User: url.UserPassword(datasource.User, datasource.DecryptedPassword()), Host: datasource.Url, Path: datasource.Database, RawQuery: "sslmode=" + url.QueryEscape(sslmode), } diff --git a/pkg/tsdb/prometheus/prometheus.go b/pkg/tsdb/prometheus/prometheus.go index 83bb683fccf45..bb343aea26e7e 100644 --- a/pkg/tsdb/prometheus/prometheus.go +++ b/pkg/tsdb/prometheus/prometheus.go @@ -70,7 +70,7 @@ func (e *PrometheusExecutor) getClient(dsInfo *models.DataSource) (apiv1.API, er cfg.RoundTripper = basicAuthTransport{ Transport: e.Transport, username: dsInfo.BasicAuthUser, - password: dsInfo.BasicAuthPassword, + password: dsInfo.DecryptedBasicAuthPassword(), } } diff --git a/public/app/app.ts b/public/app/app.ts index 7e898e523392b..c72d17bbf5a24 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -24,6 +24,7 @@ import { addClassIfNoOverlayScrollbar } from 'app/core/utils/scrollbar'; import { importPluginModule } from 'app/features/plugins/plugin_loader'; // add move to lodash for backward compatabiltiy +// @ts-ignore _.move = (array: [], fromIndex: number, toIndex: number) => { array.splice(toIndex, 0, array.splice(fromIndex, 1)[0]); return array; diff --git a/public/app/core/angular_wrappers.ts b/public/app/core/angular_wrappers.ts index 60e292cc24b2c..4460d104f6b1b 100644 --- a/public/app/core/angular_wrappers.ts +++ b/public/app/core/angular_wrappers.ts @@ -63,6 +63,7 @@ export function registerAngularDirectives() { 'value', 'isConfigured', 'inputWidth', + 'labelWidth', ['onReset', { watchDepth: 'reference', wrapApply: true }], ['onChange', { watchDepth: 'reference', wrapApply: true }], ]); diff --git a/public/app/core/components/form_dropdown/form_dropdown.ts b/public/app/core/components/form_dropdown/form_dropdown.ts index b0c3e48b8353d..0e03e6fa560e3 100644 --- a/public/app/core/components/form_dropdown/form_dropdown.ts +++ b/public/app/core/components/form_dropdown/form_dropdown.ts @@ -120,12 +120,12 @@ export class FormDropdownCtrl { modelChanged() { if (_.isObject(this.model)) { - this.updateDisplay(this.model.text); + this.updateDisplay((this.model as any).text); } else { // if we have text use it if (this.lookupText) { this.getOptionsInternal('').then((options: any) => { - const item = _.find(options, { value: this.model }); + const item: any = _.find(options, { value: this.model }); this.updateDisplay(item ? item.text : this.model); }); } else { @@ -193,7 +193,7 @@ export class FormDropdownCtrl { } this.$scope.$apply(() => { - const option = _.find(this.optionCache, { text: text }); + const option: any = _.find(this.optionCache, { text: text }); if (option) { if (_.isObject(this.model)) { @@ -204,7 +204,7 @@ export class FormDropdownCtrl { this.text = option.text; } else if (this.allowCustom) { if (_.isObject(this.model)) { - this.model.text = this.model.value = text; + (this.model as any).text = (this.model as any).value = text; } else { this.model = text; } diff --git a/public/app/core/components/manage_dashboards/manage_dashboards.ts b/public/app/core/components/manage_dashboards/manage_dashboards.ts index 5b5e299b1af6e..c57554ec4846d 100644 --- a/public/app/core/components/manage_dashboards/manage_dashboards.ts +++ b/public/app/core/components/manage_dashboards/manage_dashboards.ts @@ -1,4 +1,3 @@ -// @ts-ignore import _ from 'lodash'; import coreModule from 'app/core/core_module'; import appEvents from 'app/core/app_events'; @@ -149,7 +148,7 @@ export class ManageDashboardsCtrl { let selectedDashboards = 0; for (const section of this.sections) { - selectedDashboards += _.filter(section.items, { checked: true }).length; + selectedDashboards += _.filter(section.items, { checked: true } as any).length; } const selectedFolders = _.filter(this.sections, { checked: true }).length; @@ -167,7 +166,7 @@ export class ManageDashboardsCtrl { if (section.checked && section.id !== 0) { selectedDashboards.folderUids.push(section.uid); } else { - const selected = _.filter(section.items, { checked: true }); + const selected = _.filter(section.items, { checked: true } as any); selectedDashboards.dashboardUids.push(..._.map(selected, 'uid')); } } @@ -223,7 +222,7 @@ export class ManageDashboardsCtrl { const selectedDashboards = []; for (const section of this.sections) { - const selected = _.filter(section.items, { checked: true }); + const selected = _.filter(section.items, { checked: true } as any); selectedDashboards.push(..._.map(selected, 'uid')); } diff --git a/public/app/core/components/query_part/query_part_editor.ts b/public/app/core/components/query_part/query_part_editor.ts index 2cab966ed4635..4e6b82e151be0 100644 --- a/public/app/core/components/query_part/query_part_editor.ts +++ b/public/app/core/components/query_part/query_part_editor.ts @@ -148,7 +148,7 @@ export function queryPartEditorDirective($compile, templateSrv) { }; function addElementsAndCompile() { - _.each(partDef.params, (param, index) => { + _.each(partDef.params, (param: any, index: number) => { if (param.optional && part.params.length <= index) { return; } diff --git a/public/app/core/components/sidemenu/BottomSection.tsx b/public/app/core/components/sidemenu/BottomSection.tsx index ee5175ca763e0..85754a910fa03 100644 --- a/public/app/core/components/sidemenu/BottomSection.tsx +++ b/public/app/core/components/sidemenu/BottomSection.tsx @@ -6,13 +6,13 @@ import { contextSrv } from 'app/core/services/context_srv'; import config from '../../config'; export default function BottomSection() { - const navTree = _.cloneDeep(config.bootData.navTree); - const bottomNav = _.filter(navTree, item => item.hideFromMenu); + const navTree: any = _.cloneDeep(config.bootData.navTree); + const bottomNav: any = _.filter(navTree, item => item.hideFromMenu); const isSignedIn = contextSrv.isSignedIn; const user = contextSrv.user; if (user && user.orgCount > 1) { - const profileNode = _.find(bottomNav, { id: 'profile' }); + const profileNode: any = _.find(bottomNav, { id: 'profile' }); if (profileNode) { profileNode.showOrgSwitcher = true; } diff --git a/public/app/core/components/sql_part/sql_part_editor.ts b/public/app/core/components/sql_part/sql_part_editor.ts index 1d29c577560c0..b095f5fefed78 100644 --- a/public/app/core/components/sql_part/sql_part_editor.ts +++ b/public/app/core/components/sql_part/sql_part_editor.ts @@ -162,7 +162,7 @@ export function sqlPartEditorDirective($compile, templateSrv) { }; function addElementsAndCompile() { - _.each(partDef.params, (param, index) => { + _.each(partDef.params, (param: any, index: number) => { if (param.optional && part.params.length <= index) { return; } diff --git a/public/app/core/directives/array_join.ts b/public/app/core/directives/array_join.ts index c906319e98557..137689ab7d283 100644 --- a/public/app/core/directives/array_join.ts +++ b/public/app/core/directives/array_join.ts @@ -14,7 +14,7 @@ export function arrayJoin() { function join_array(text) { if (_.isArray(text)) { - return (text || '').join(','); + return ((text || '') as any).join(','); } else { return text; } diff --git a/public/app/core/directives/metric_segment.ts b/public/app/core/directives/metric_segment.ts index 85576dcffeef0..03bb8209b54b9 100644 --- a/public/app/core/directives/metric_segment.ts +++ b/public/app/core/directives/metric_segment.ts @@ -42,7 +42,7 @@ export function metricSegment($compile, $sce, templateSrv) { } $scope.$apply(() => { - const selected = _.find($scope.altSegments, { value: value }); + const selected: any = _.find($scope.altSegments, { value: value }); if (selected) { segment.value = selected.value; segment.html = selected.html || $sce.trustAsHtml(templateSrv.highlightVariablesAsHtml(selected.value)); @@ -202,7 +202,7 @@ export function metricSegmentModel(uiSegmentSrv, $q) { let cachedOptions; $scope.valueToSegment = value => { - const option = _.find($scope.options, { value: value }); + const option: any = _.find($scope.options, { value: value }); const segment = { cssClass: attrs.cssClass, custom: attrs.custom, @@ -236,7 +236,7 @@ export function metricSegmentModel(uiSegmentSrv, $q) { $scope.onSegmentChange = () => { if (cachedOptions) { - const option = _.find(cachedOptions, { text: $scope.segment.value }); + const option: any = _.find(cachedOptions, { text: $scope.segment.value }); if (option && option.value !== $scope.property) { $scope.property = option.value; } else if (attrs.custom !== 'false') { diff --git a/public/app/core/nav_model_srv.ts b/public/app/core/nav_model_srv.ts index 300a7f0e208c3..661cdbe77a3e4 100644 --- a/public/app/core/nav_model_srv.ts +++ b/public/app/core/nav_model_srv.ts @@ -48,7 +48,7 @@ export class NavModelSrv { break; } - const node = _.find(children, { id: id }); + const node: any = _.find(children, { id: id }); nav.breadcrumbs.push(node); nav.node = node; nav.main = node; diff --git a/public/app/core/services/backend_srv.ts b/public/app/core/services/backend_srv.ts index 31db2a4bdeefa..96e7a2cc258e9 100644 --- a/public/app/core/services/backend_srv.ts +++ b/public/app/core/services/backend_srv.ts @@ -1,4 +1,3 @@ -// @ts-ignore import _ from 'lodash'; import angular from 'angular'; import coreModule from 'app/core/core_module'; diff --git a/public/app/core/services/search_srv.ts b/public/app/core/services/search_srv.ts index 068fe3ffbc36e..f5648ef50031b 100644 --- a/public/app/core/services/search_srv.ts +++ b/public/app/core/services/search_srv.ts @@ -1,4 +1,3 @@ -// @ts-ignore import _ from 'lodash'; // @ts-ignore import { IQService } from 'angular'; @@ -41,7 +40,7 @@ export class SearchSrv { }); } - private queryForRecentDashboards(): Promise { + private queryForRecentDashboards(): Promise { const dashIds: number[] = _.take(impressionSrv.getDashboardOpened(), 30); if (dashIds.length === 0) { return Promise.resolve([]); diff --git a/public/app/core/specs/rangeutil.test.ts b/public/app/core/specs/rangeutil.test.ts index 4c0d3dc90c843..7c5a74b3ef0ca 100644 --- a/public/app/core/specs/rangeutil.test.ts +++ b/public/app/core/specs/rangeutil.test.ts @@ -5,7 +5,7 @@ import moment from 'moment'; describe('rangeUtil', () => { describe('Can get range grouped list of ranges', () => { it('when custom settings should return default range list', () => { - const groups = rangeUtil.getRelativeTimesList({ time_options: [] }, 'Last 5 minutes'); + const groups: any = rangeUtil.getRelativeTimesList({ time_options: [] }, 'Last 5 minutes'); expect(_.keys(groups).length).toBe(4); expect(groups[3][0].active).toBe(true); }); diff --git a/public/app/core/utils/reselect.ts b/public/app/core/utils/reselect.ts index 7c8fc7727b071..8c8e3e6f34a71 100644 --- a/public/app/core/utils/reselect.ts +++ b/public/app/core/utils/reselect.ts @@ -2,4 +2,4 @@ import { memoize } from 'lodash'; import { createSelectorCreator } from 'reselect'; const hashFn = (...args) => args.reduce((acc, val) => acc + '-' + JSON.stringify(val), ''); -export const createLodashMemoizedSelector = createSelectorCreator(memoize, hashFn); +export const createLodashMemoizedSelector = createSelectorCreator(memoize as any, hashFn); diff --git a/public/app/features/admin/AdminEditUserCtrl.ts b/public/app/features/admin/AdminEditUserCtrl.ts index a5dcae52d5036..4b7dc9d21e591 100644 --- a/public/app/features/admin/AdminEditUserCtrl.ts +++ b/public/app/features/admin/AdminEditUserCtrl.ts @@ -98,7 +98,7 @@ export default class AdminEditUserCtrl { return; } - const orgInfo = _.find($scope.orgsSearchCache, { + const orgInfo: any = _.find($scope.orgsSearchCache, { name: $scope.newOrg.name, }); if (!orgInfo) { diff --git a/public/app/features/alerting/AlertTabCtrl.ts b/public/app/features/alerting/AlertTabCtrl.ts index e46303f10a4fa..7820d938433eb 100644 --- a/public/app/features/alerting/AlertTabCtrl.ts +++ b/public/app/features/alerting/AlertTabCtrl.ts @@ -129,7 +129,7 @@ export class AlertTabCtrl { } notificationAdded() { - const model = _.find(this.notifications, { + const model: any = _.find(this.notifications, { name: this.addNotificationSegment.value, }); if (!model) { @@ -157,8 +157,8 @@ export class AlertTabCtrl { removeNotification(an) { // remove notifiers refeered to by id and uid to support notifiers added // before and after we added support for uid - _.remove(this.alert.notifications, n => n.uid === an.uid || n.id === an.id); - _.remove(this.alertNotifications, n => n.uid === an.uid || n.id === an.id); + _.remove(this.alert.notifications, (n: any) => n.uid === an.uid || n.id === an.id); + _.remove(this.alertNotifications, (n: any) => n.uid === an.uid || n.id === an.id); } initModel() { @@ -195,7 +195,7 @@ export class AlertTabCtrl { for (const addedNotification of alert.notifications) { // lookup notifier type by uid - let model = _.find(this.notifications, { uid: addedNotification.uid }); + let model: any = _.find(this.notifications, { uid: addedNotification.uid }); // fallback to using id if uid is missing if (!model) { diff --git a/public/app/features/alerting/partials/notification_edit.html b/public/app/features/alerting/partials/notification_edit.html index 5e7201cdfdd9a..176e29f8514b6 100644 --- a/public/app/features/alerting/partials/notification_edit.html +++ b/public/app/features/alerting/partials/notification_edit.html @@ -20,7 +20,7 @@

New Notification Channel

diff --git a/public/app/features/annotations/annotations_srv.ts b/public/app/features/annotations/annotations_srv.ts index d728adfca2e08..a5ed686e02c0d 100644 --- a/public/app/features/annotations/annotations_srv.ts +++ b/public/app/features/annotations/annotations_srv.ts @@ -38,7 +38,7 @@ export class AnnotationsSrv { .all([this.getGlobalAnnotations(options), this.getAlertStates(options)]) .then(results => { // combine the annotations and flatten results - let annotations = _.flattenDeep(results[0]); + let annotations: any[] = _.flattenDeep(results[0]); // filter out annotations that do not belong to requesting panel annotations = _.filter(annotations, item => { @@ -53,7 +53,7 @@ export class AnnotationsSrv { annotations = makeRegions(annotations, options); // look for alert state for this panel - const alertState = _.find(results[1], { panelId: options.panel.id }); + const alertState: any = _.find(results[1], { panelId: options.panel.id }); return { annotations: annotations, diff --git a/public/app/features/annotations/editor_ctrl.ts b/public/app/features/annotations/editor_ctrl.ts index c12e442f6d30d..33b613081f4cc 100644 --- a/public/app/features/annotations/editor_ctrl.ts +++ b/public/app/features/annotations/editor_ctrl.ts @@ -74,6 +74,7 @@ export class AnnotationsEditorCtrl { } move(index, dir) { + // @ts-ignore _.move(this.annotations, index, index + dir); } diff --git a/public/app/features/annotations/events_processing.ts b/public/app/features/annotations/events_processing.ts index 1180b2a098903..3bf69d1fca4b1 100644 --- a/public/app/features/annotations/events_processing.ts +++ b/public/app/features/annotations/events_processing.ts @@ -17,10 +17,10 @@ function getRegions(events, range) { const regionEvents = _.filter(events, event => { return event.regionId; }); - let regions = _.groupBy(regionEvents, 'regionId'); + let regions: any = _.groupBy(regionEvents, 'regionId'); regions = _.compact( _.map(regions, regionEvents => { - const regionObj = _.head(regionEvents); + const regionObj: any = _.head(regionEvents); if (regionEvents && regionEvents.length > 1) { regionObj.timeEnd = regionEvents[1].time; regionObj.isRegion = true; diff --git a/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx b/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx index bdcc3c9d165ad..dcb71cadbe0df 100644 --- a/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx +++ b/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx @@ -45,7 +45,7 @@ export class AddPanelWidget extends React.Component { const copiedPanelJson = store.get(LS_PANEL_COPY_KEY); if (copiedPanelJson) { const copiedPanel = JSON.parse(copiedPanelJson); - const pluginInfo = _.find(panels, { id: copiedPanel.type }); + const pluginInfo: any = _.find(panels, { id: copiedPanel.type }); if (pluginInfo) { const pluginCopy = _.cloneDeep(pluginInfo); pluginCopy.name = copiedPanel.title; diff --git a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.test.ts b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.test.ts index 1562953fd1b4b..61e0ca93c38c2 100644 --- a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.test.ts +++ b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.test.ts @@ -4,7 +4,6 @@ jest.mock('app/core/store', () => { }; }); -// @ts-ignore import _ from 'lodash'; import config from 'app/core/config'; import { DashboardExporter } from './DashboardExporter'; @@ -148,7 +147,7 @@ describe('given dashboard with repeated panels', () => { }); it('should add datasource to required', () => { - const require = _.find(exported.__requires, { name: 'TestDB' }); + const require: any = _.find(exported.__requires, { name: 'TestDB' }); expect(require.name).toBe('TestDB'); expect(require.id).toBe('testdb'); expect(require.type).toBe('datasource'); @@ -156,52 +155,52 @@ describe('given dashboard with repeated panels', () => { }); it('should not add built in datasources to required', () => { - const require = _.find(exported.__requires, { name: 'Mixed' }); + const require: any = _.find(exported.__requires, { name: 'Mixed' }); expect(require).toBe(undefined); }); it('should add datasources used in mixed mode', () => { - const require = _.find(exported.__requires, { name: 'OtherDB' }); + const require: any = _.find(exported.__requires, { name: 'OtherDB' }); expect(require).not.toBe(undefined); }); it('should add graph panel to required', () => { - const require = _.find(exported.__requires, { name: 'Graph' }); + const require: any = _.find(exported.__requires, { name: 'Graph' }); expect(require.name).toBe('Graph'); expect(require.id).toBe('graph'); expect(require.version).toBe('1.1.0'); }); it('should add table panel to required', () => { - const require = _.find(exported.__requires, { name: 'Table' }); + const require: any = _.find(exported.__requires, { name: 'Table' }); expect(require.name).toBe('Table'); expect(require.id).toBe('table'); expect(require.version).toBe('1.1.1'); }); it('should add heatmap panel to required', () => { - const require = _.find(exported.__requires, { name: 'Heatmap' }); + const require: any = _.find(exported.__requires, { name: 'Heatmap' }); expect(require.name).toBe('Heatmap'); expect(require.id).toBe('heatmap'); expect(require.version).toBe('1.1.2'); }); it('should add grafana version', () => { - const require = _.find(exported.__requires, { name: 'Grafana' }); + const require: any = _.find(exported.__requires, { name: 'Grafana' }); expect(require.type).toBe('grafana'); expect(require.id).toBe('grafana'); expect(require.version).toBe('3.0.2'); }); it('should add constant template variables as inputs', () => { - const input = _.find(exported.__inputs, { name: 'VAR_PREFIX' }); + const input: any = _.find(exported.__inputs, { name: 'VAR_PREFIX' }); expect(input.type).toBe('constant'); expect(input.label).toBe('prefix'); expect(input.value).toBe('collectd'); }); it('should templatize constant variables', () => { - const variable = _.find(exported.templating.list, { name: 'prefix' }); + const variable: any = _.find(exported.templating.list, { name: 'prefix' }); expect(variable.query).toBe('${VAR_PREFIX}'); expect(variable.current.text).toBe('${VAR_PREFIX}'); expect(variable.current.value).toBe('${VAR_PREFIX}'); @@ -210,7 +209,7 @@ describe('given dashboard with repeated panels', () => { }); it('should add datasources only use via datasource variable to requires', () => { - const require = _.find(exported.__requires, { name: 'OtherDB_2' }); + const require: any = _.find(exported.__requires, { name: 'OtherDB_2' }); expect(require.id).toBe('other2'); }); }); diff --git a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts index 4150cb9a84875..6be4dd2e28081 100644 --- a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts +++ b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts @@ -1,4 +1,3 @@ -// @ts-ignore import _ from 'lodash'; import config from 'app/core/config'; diff --git a/public/app/features/dashboard/components/DashLinks/DashLinksEditorCtrl.ts b/public/app/features/dashboard/components/DashLinks/DashLinksEditorCtrl.ts index 339c8e7de4c7d..629b590cd0971 100644 --- a/public/app/features/dashboard/components/DashLinks/DashLinksEditorCtrl.ts +++ b/public/app/features/dashboard/components/DashLinks/DashLinksEditorCtrl.ts @@ -55,6 +55,7 @@ export class DashLinksEditorCtrl { } moveLink(index, dir) { + // @ts-ignore _.move(this.dashboard.links, index, index + dir); } diff --git a/public/app/features/dashboard/components/DashboardSettings/SettingsCtrl.ts b/public/app/features/dashboard/components/DashboardSettings/SettingsCtrl.ts index 014921a30bc0e..c0332e619507f 100755 --- a/public/app/features/dashboard/components/DashboardSettings/SettingsCtrl.ts +++ b/public/app/features/dashboard/components/DashboardSettings/SettingsCtrl.ts @@ -126,7 +126,7 @@ export class SettingsCtrl { this.viewId = 'make_editable'; } - const currentSection = _.find(this.sections, { id: this.viewId }); + const currentSection: any = _.find(this.sections, { id: this.viewId } as any); if (!currentSection) { this.sections.unshift({ title: 'Not found', @@ -174,7 +174,7 @@ export class SettingsCtrl { this.viewId = 'settings'; this.buildSectionList(); - const currentSection = _.find(this.sections, { id: this.viewId }); + const currentSection: any = _.find(this.sections, { id: this.viewId } as any); this.$location.url(currentSection.url); } diff --git a/public/app/features/dashboard/components/ShareModal/ShareSnapshotCtrl.ts b/public/app/features/dashboard/components/ShareModal/ShareSnapshotCtrl.ts index 7dcf0469e77d2..c459504d296b7 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareSnapshotCtrl.ts +++ b/public/app/features/dashboard/components/ShareModal/ShareSnapshotCtrl.ts @@ -99,7 +99,7 @@ export class ShareSnapshotCtrl { .filter(annotation => { return annotation.enable; }) - .map(annotation => { + .map((annotation: any) => { return { name: annotation.name, enable: annotation.enable, diff --git a/public/app/features/dashboard/panel_editor/QueriesTab.tsx b/public/app/features/dashboard/panel_editor/QueriesTab.tsx index b44b123d5b893..dacfcc6b84d0e 100644 --- a/public/app/features/dashboard/panel_editor/QueriesTab.tsx +++ b/public/app/features/dashboard/panel_editor/QueriesTab.tsx @@ -122,6 +122,7 @@ export class QueriesTab extends PureComponent { const { panel } = this.props; const index = _.indexOf(panel.targets, query); + // @ts-ignore _.move(panel.targets, index, index + direction); this.forceUpdate(); @@ -193,7 +194,7 @@ export class QueriesTab extends PureComponent { return ( p.repeat); + const hasRepeat = _.some(row.panels as PanelModel[], (p: PanelModel) => p.repeat); if (row.panels.length > 0) { // Use first panel to figure out if it was moved or pushed diff --git a/public/app/features/datasources/partials/http_settings.html b/public/app/features/datasources/partials/http_settings.html index 755284bf7a8eb..3c078f4befee3 100644 --- a/public/app/features/datasources/partials/http_settings.html +++ b/public/app/features/datasources/partials/http_settings.html @@ -99,8 +99,14 @@
Basic Auth Details
- Password - +
diff --git a/public/app/features/datasources/settings/HttpSettingsCtrl.ts b/public/app/features/datasources/settings/HttpSettingsCtrl.ts index 5cdebe7b9abc4..5b23311805717 100644 --- a/public/app/features/datasources/settings/HttpSettingsCtrl.ts +++ b/public/app/features/datasources/settings/HttpSettingsCtrl.ts @@ -1,4 +1,5 @@ import { coreModule } from 'app/core/core'; +import { createChangeHandler, createResetHandler, PasswordFieldEnum } from '../utils/passwordHandlers'; coreModule.directive('datasourceHttpSettings', () => { return { @@ -20,6 +21,9 @@ coreModule.directive('datasourceHttpSettings', () => { $scope.getSuggestUrls = () => { return [$scope.suggestUrl]; }; + + $scope.onBasicAuthPasswordReset = createResetHandler($scope, PasswordFieldEnum.BasicAuthPassword); + $scope.onBasicAuthPasswordChange = createChangeHandler($scope, PasswordFieldEnum.BasicAuthPassword); }, }, }; diff --git a/public/app/features/datasources/utils/passwordHandlers.test.ts b/public/app/features/datasources/utils/passwordHandlers.test.ts new file mode 100644 index 0000000000000..f1bf86f34eb4c --- /dev/null +++ b/public/app/features/datasources/utils/passwordHandlers.test.ts @@ -0,0 +1,35 @@ +import { createResetHandler, PasswordFieldEnum, Ctrl } from './passwordHandlers'; + +describe('createResetHandler', () => { + Object.keys(PasswordFieldEnum).forEach(fieldKey => { + const field: any = PasswordFieldEnum[fieldKey as any]; + + it(`should reset existing ${field} field`, () => { + const event: any = { + preventDefault: () => {}, + }; + const ctrl: Ctrl = { + current: { + [field]: 'set', + secureJsonData: { + [field]: 'set', + }, + secureJsonFields: {}, + }, + }; + + createResetHandler(ctrl, field)(event); + expect(ctrl).toEqual({ + current: { + [field]: null, + secureJsonData: { + [field]: '', + }, + secureJsonFields: { + [field]: false, + }, + }, + }); + }); + }); +}); diff --git a/public/app/features/datasources/utils/passwordHandlers.ts b/public/app/features/datasources/utils/passwordHandlers.ts new file mode 100644 index 0000000000000..25f9298fb3d1c --- /dev/null +++ b/public/app/features/datasources/utils/passwordHandlers.ts @@ -0,0 +1,45 @@ +/** + * Set of handlers for secure password field in Angular components. They handle backward compatibility with + * passwords stored in plain text fields. + */ + +import { SyntheticEvent } from 'react'; + +export enum PasswordFieldEnum { + Password = 'password', + BasicAuthPassword = 'basicAuthPassword', +} + +/** + * Basic shape for settings controllers in at the moment mostly angular datasource plugins. + */ +export type Ctrl = { + current: { + secureJsonFields: { + [key: string]: boolean; + }; + secureJsonData?: { + [key: string]: string; + }; + password?: string; + basicAuthPassword?: string; + }; +}; + +export const createResetHandler = (ctrl: Ctrl, field: PasswordFieldEnum) => ( + event: SyntheticEvent +) => { + event.preventDefault(); + // Reset also normal plain text password to remove it and only save it in secureJsonData. + ctrl.current[field] = null; + ctrl.current.secureJsonFields[field] = false; + ctrl.current.secureJsonData = ctrl.current.secureJsonData || {}; + ctrl.current.secureJsonData[field] = ''; +}; + +export const createChangeHandler = (ctrl: any, field: PasswordFieldEnum) => ( + event: SyntheticEvent +) => { + ctrl.current.secureJsonData = ctrl.current.secureJsonData || {}; + ctrl.current.secureJsonData[field] = event.currentTarget.value; +}; diff --git a/public/app/features/explore/Explore.tsx b/public/app/features/explore/Explore.tsx index 24d186cbbba68..8e577dac1e1cb 100644 --- a/public/app/features/explore/Explore.tsx +++ b/public/app/features/explore/Explore.tsx @@ -3,7 +3,6 @@ import React, { ComponentClass } from 'react'; import { hot } from 'react-hot-loader'; // @ts-ignore import { connect } from 'react-redux'; -// @ts-ignore import _ from 'lodash'; import { AutoSizer } from 'react-virtualized'; diff --git a/public/app/features/explore/QueryField.tsx b/public/app/features/explore/QueryField.tsx index dd453faf7ddb4..97ff0958d56e4 100644 --- a/public/app/features/explore/QueryField.tsx +++ b/public/app/features/explore/QueryField.tsx @@ -1,4 +1,3 @@ -// @ts-ignore import _ from 'lodash'; import React, { Context } from 'react'; import ReactDOM from 'react-dom'; diff --git a/public/app/features/explore/QueryRow.tsx b/public/app/features/explore/QueryRow.tsx index 64920cc1fb7e1..ef5dda9b1da03 100644 --- a/public/app/features/explore/QueryRow.tsx +++ b/public/app/features/explore/QueryRow.tsx @@ -1,6 +1,5 @@ // Libraries import React, { PureComponent } from 'react'; -// @ts-ignore import _ from 'lodash'; import { hot } from 'react-hot-loader'; // @ts-ignore diff --git a/public/app/features/explore/TimePicker.tsx b/public/app/features/explore/TimePicker.tsx index 7735c63d58c47..27e1afe43645a 100644 --- a/public/app/features/explore/TimePicker.tsx +++ b/public/app/features/explore/TimePicker.tsx @@ -241,7 +241,7 @@ export default class TimePicker extends PureComponent - {group.map(option => ( + {group.map((option: any) => (
  • this.handleClickRelativeOption(option)}>{option.display}
  • diff --git a/public/app/features/explore/Typeahead.tsx b/public/app/features/explore/Typeahead.tsx index 76647720c4dac..b28ab4a610d35 100644 --- a/public/app/features/explore/Typeahead.tsx +++ b/public/app/features/explore/Typeahead.tsx @@ -1,5 +1,4 @@ import React, { createRef } from 'react'; -// @ts-ignore import _ from 'lodash'; import { FixedSizeList } from 'react-window'; diff --git a/public/app/features/explore/state/actions.ts b/public/app/features/explore/state/actions.ts index 9c724ed1fb169..a247d90e2f2c7 100644 --- a/public/app/features/explore/state/actions.ts +++ b/public/app/features/explore/state/actions.ts @@ -1,5 +1,4 @@ // Libraries -// @ts-ignore import _ from 'lodash'; // Services & Utils @@ -196,11 +195,14 @@ export function loadExploreDatasourcesAndSetDatasource( return dispatch => { const exploreDatasources: DataSourceSelectItem[] = getDatasourceSrv() .getExternal() - .map((ds: any) => ({ - value: ds.name, - name: ds.name, - meta: ds.meta, - })); + .map( + (ds: any) => + ({ + value: ds.name, + name: ds.name, + meta: ds.meta, + } as DataSourceSelectItem) + ); dispatch(loadExploreDatasources({ exploreId, exploreDatasources })); diff --git a/public/app/features/explore/state/reducers.ts b/public/app/features/explore/state/reducers.ts index e71b5903b1fb3..04793f3aa1c69 100644 --- a/public/app/features/explore/state/reducers.ts +++ b/public/app/features/explore/state/reducers.ts @@ -1,4 +1,3 @@ -// @ts-ignore import _ from 'lodash'; import { calculateResultsFromQueryTransactions, diff --git a/public/app/features/panel/panellinks/module.ts b/public/app/features/panel/panellinks/module.ts index 99a6975811e73..5fdb30748e56e 100644 --- a/public/app/features/panel/panellinks/module.ts +++ b/public/app/features/panel/panellinks/module.ts @@ -37,7 +37,7 @@ export class PanelLinksEditorCtrl { $scope.dashboardChanged = link => { backendSrv.search({ query: link.dashboard }).then(hits => { - const dashboard = _.find(hits, { title: link.dashboard }); + const dashboard: any = _.find(hits, { title: link.dashboard }); if (dashboard) { if (dashboard.url) { link.url = dashboard.url; diff --git a/public/app/features/plugins/plugin_edit_ctrl.ts b/public/app/features/plugins/plugin_edit_ctrl.ts index 44d3d31f99645..177986cb331cb 100644 --- a/public/app/features/plugins/plugin_edit_ctrl.ts +++ b/public/app/features/plugins/plugin_edit_ctrl.ts @@ -53,7 +53,7 @@ export class PluginEditCtrl { url: `plugins/${this.model.id}/edit?tab=config`, }); - const hasDashboards = _.find(model.includes, { type: 'dashboard' }); + const hasDashboards: any = _.find(model.includes, { type: 'dashboard' }); if (hasDashboards) { this.navModel.main.children.push({ diff --git a/public/app/features/plugins/state/navModel.ts b/public/app/features/plugins/state/navModel.ts index 1e7ed0cdf27fe..19ce6dd905dc2 100644 --- a/public/app/features/plugins/state/navModel.ts +++ b/public/app/features/plugins/state/navModel.ts @@ -34,7 +34,7 @@ export function buildNavModel(ds: DataSourceSettings, plugin: PluginMeta, curren ], }; - const hasDashboards = _.find(plugin.includes, { type: 'dashboard' }) !== undefined; + const hasDashboards: any = _.find(plugin.includes, { type: 'dashboard' }) !== undefined; if (hasDashboards && ds.id) { main.children.push({ active: currentPage === 'datasource-dashboards', diff --git a/public/app/features/templating/editor_ctrl.ts b/public/app/features/templating/editor_ctrl.ts index c47c42a4aad58..6d70be63771af 100644 --- a/public/app/features/templating/editor_ctrl.ts +++ b/public/app/features/templating/editor_ctrl.ts @@ -64,7 +64,7 @@ export class VariableEditorCtrl { return false; } - const sameName = _.find($scope.variables, { name: $scope.current.name }); + const sameName: any = _.find($scope.variables, { name: $scope.current.name }); if (sameName && sameName !== $scope.current) { appEvents.emit('alert-warning', ['Validation', 'Variable with the same name already exists']); return false; @@ -151,7 +151,7 @@ export class VariableEditorCtrl { $scope.datasourceTypes = _($scope.datasources) .uniqBy('meta.id') - .map(ds => { + .map((ds: any) => { return { text: ds.meta.name, value: ds.meta.id }; }) .value(); diff --git a/public/app/features/templating/template_srv.ts b/public/app/features/templating/template_srv.ts index e0d35295556b7..e7f21eb4ce74c 100644 --- a/public/app/features/templating/template_srv.ts +++ b/public/app/features/templating/template_srv.ts @@ -309,7 +309,7 @@ export class TemplateSrv { } distributeVariable(value, variable) { - value = _.map(value, (val, index) => { + value = _.map(value, (val: any, index: number) => { if (index !== 0) { return variable + '=' + val; } else { diff --git a/public/app/features/templating/variable_srv.ts b/public/app/features/templating/variable_srv.ts index f4d9572184693..b69ad3c3075ef 100644 --- a/public/app/features/templating/variable_srv.ts +++ b/public/app/features/templating/variable_srv.ts @@ -200,7 +200,7 @@ export class VariableSrv { return variable.setValue(selected); } else { - const currentOption = _.find(variable.options, { + const currentOption: any = _.find(variable.options, { text: variable.current.text, }); if (currentOption) { @@ -222,7 +222,7 @@ export class VariableSrv { } return promise.then(() => { - let option = _.find(variable.options, op => { + let option: any = _.find(variable.options, op => { return op.text === urlValue || op.value === urlValue; }); @@ -233,7 +233,7 @@ export class VariableSrv { defaultText = []; for (let n = 0; n < urlValue.length; n++) { - const t = _.find(variable.options, op => { + const t: any = _.find(variable.options, op => { return op.value === urlValue[n]; }); @@ -279,10 +279,10 @@ export class VariableSrv { } setAdhocFilter(options) { - let variable = _.find(this.variables, { + let variable: any = _.find(this.variables, { type: 'adhoc', datasource: options.datasource, - }); + } as any); if (!variable) { variable = this.createVariableFromModel({ name: 'Filters', @@ -293,7 +293,7 @@ export class VariableSrv { } const filters = variable.filters; - let filter = _.find(filters, { key: options.key, value: options.value }); + let filter: any = _.find(filters, { key: options.key, value: options.value }); if (!filter) { filter = { key: options.key, value: options.value }; diff --git a/public/app/plugins/datasource/cloudwatch/datasource.ts b/public/app/plugins/datasource/cloudwatch/datasource.ts index 9362c3b239eed..510d54ec35d01 100644 --- a/public/app/plugins/datasource/cloudwatch/datasource.ts +++ b/public/app/plugins/datasource/cloudwatch/datasource.ts @@ -410,7 +410,7 @@ export default class CloudWatchDatasource implements DataSourceApi { if (allSelected) { return v.text !== 'All'; @@ -427,7 +427,7 @@ export default class CloudWatchDatasource implements DataSourceApi { + selectedVariables.some((s: any) => { return s.value === currentVariables[0].value; }) || currentVariables[0].value === '$__all'; return (useSelectedVariables ? selectedVariables : currentVariables).map(v => { diff --git a/public/app/plugins/datasource/elasticsearch/config_ctrl.ts b/public/app/plugins/datasource/elasticsearch/config_ctrl.ts index 8a90d2dc3bd45..cae0bb2c41e8a 100644 --- a/public/app/plugins/datasource/elasticsearch/config_ctrl.ts +++ b/public/app/plugins/datasource/elasticsearch/config_ctrl.ts @@ -33,7 +33,7 @@ export class ElasticConfigCtrl { this.current.database.length === 0 || this.current.database.startsWith('[logstash-]') ) { - const def = _.find(this.indexPatternTypes, { + const def: any = _.find(this.indexPatternTypes, { value: this.current.jsonData.interval, }); this.current.database = def.example || 'es-index-name'; diff --git a/public/app/plugins/datasource/elasticsearch/datasource.ts b/public/app/plugins/datasource/elasticsearch/datasource.ts index 0e510470db94c..e1fcd9715da3f 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.ts +++ b/public/app/plugins/datasource/elasticsearch/datasource.ts @@ -204,7 +204,7 @@ export class ElasticDatasource { // validate that the index exist and has date field return this.getFields({ type: 'date' }).then( dateFields => { - const timeField = _.find(dateFields, { text: this.timeField }); + const timeField: any = _.find(dateFields, { text: this.timeField }); if (!timeField) { return { status: 'error', diff --git a/public/app/plugins/datasource/elasticsearch/elastic_response.ts b/public/app/plugins/datasource/elasticsearch/elastic_response.ts index 52fecd79e8b6f..7e3e247b18d15 100644 --- a/public/app/plugins/datasource/elasticsearch/elastic_response.ts +++ b/public/app/plugins/datasource/elasticsearch/elastic_response.ts @@ -222,7 +222,7 @@ export class ElasticResponse { } private getMetricName(metric) { - let metricDef = _.find(queryDef.metricAggTypes, { value: metric }); + let metricDef: any = _.find(queryDef.metricAggTypes, { value: metric }); if (!metricDef) { metricDef = _.find(queryDef.extendedStats, { value: metric }); } @@ -258,12 +258,12 @@ export class ElasticResponse { if (series.field && queryDef.isPipelineAgg(series.metric)) { if (series.metric && queryDef.isPipelineAggWithMultipleBucketPaths(series.metric)) { - const agg = _.find(target.metrics, { id: series.metricId }); + const agg: any = _.find(target.metrics, { id: series.metricId }); if (agg && agg.settings.script) { metricName = agg.settings.script; for (const pv of agg.pipelineVariables) { - const appliedAgg = _.find(target.metrics, { id: pv.pipelineAgg }); + const appliedAgg: any = _.find(target.metrics, { id: pv.pipelineAgg }); if (appliedAgg) { metricName = metricName.replace('params.' + pv.name, queryDef.describeMetric(appliedAgg)); } @@ -272,7 +272,7 @@ export class ElasticResponse { metricName = 'Unset'; } } else { - const appliedAgg = _.find(target.metrics, { id: series.field }); + const appliedAgg: any = _.find(target.metrics, { id: series.field }); if (appliedAgg) { metricName += ' ' + queryDef.describeMetric(appliedAgg); } else { @@ -343,7 +343,7 @@ export class ElasticResponse { } trimDatapoints(aggregations, target) { - const histogram = _.find(target.bucketAggs, { type: 'date_histogram' }); + const histogram: any = _.find(target.bucketAggs, { type: 'date_histogram' }); const shouldDropFirstAndLast = histogram && histogram.settings && histogram.settings.trimEdges; if (shouldDropFirstAndLast) { diff --git a/public/app/plugins/datasource/elasticsearch/metric_agg.ts b/public/app/plugins/datasource/elasticsearch/metric_agg.ts index 735b4b4f7f9b7..15a3808282948 100644 --- a/public/app/plugins/datasource/elasticsearch/metric_agg.ts +++ b/public/app/plugins/datasource/elasticsearch/metric_agg.ts @@ -81,7 +81,7 @@ export class ElasticMetricAggCtrl { $scope.agg.meta, (memo, val, key) => { if (val) { - const def = _.find($scope.extendedStats, { value: key }); + const def: any = _.find($scope.extendedStats, { value: key }); memo.push(def.text); } return memo; diff --git a/public/app/plugins/datasource/elasticsearch/query_ctrl.ts b/public/app/plugins/datasource/elasticsearch/query_ctrl.ts index 40420d7c6a3de..73a262427f449 100644 --- a/public/app/plugins/datasource/elasticsearch/query_ctrl.ts +++ b/public/app/plugins/datasource/elasticsearch/query_ctrl.ts @@ -66,7 +66,7 @@ export class ElasticQueryCtrl extends QueryCtrl { text += 'Metrics: '; _.each(metricAggs, (metric, index) => { - const aggDef = _.find(metricAggTypes, { value: metric.type }); + const aggDef: any = _.find(metricAggTypes, { value: metric.type }); text += aggDef.text + '('; if (aggDef.requiresField) { text += metric.field; @@ -77,12 +77,12 @@ export class ElasticQueryCtrl extends QueryCtrl { text += '), '; }); - _.each(bucketAggs, (bucketAgg, index) => { + _.each(bucketAggs, (bucketAgg: any, index: number) => { if (index === 0) { text += ' Group by: '; } - const aggDef = _.find(bucketAggTypes, { value: bucketAgg.type }); + const aggDef: any = _.find(bucketAggTypes, { value: bucketAgg.type }); text += aggDef.text + '('; if (aggDef.requiresField) { text += bucketAgg.field; diff --git a/public/app/plugins/datasource/elasticsearch/query_def.ts b/public/app/plugins/datasource/elasticsearch/query_def.ts index 13797853a77ef..e429183e4ac7a 100644 --- a/public/app/plugins/datasource/elasticsearch/query_def.ts +++ b/public/app/plugins/datasource/elasticsearch/query_def.ts @@ -224,12 +224,12 @@ export function getOrderByOptions(target) { } export function describeOrder(order) { - const def = _.find(orderOptions, { value: order }); + const def: any = _.find(orderOptions, { value: order }); return def.text; } export function describeMetric(metric) { - const def = _.find(metricAggTypes, { value: metric.type }); + const def: any = _.find(metricAggTypes, { value: metric.type }); if (!def.requiresField && !isPipelineAgg(metric.type)) { return def.text; } @@ -237,11 +237,11 @@ export function describeMetric(metric) { } export function describeOrderBy(orderBy, target) { - const def = _.find(orderByOptions, { value: orderBy }); + const def: any = _.find(orderByOptions, { value: orderBy }); if (def) { return def.text; } - const metric = _.find(target.metrics, { id: orderBy }); + const metric: any = _.find(target.metrics, { id: orderBy }); if (metric) { return describeMetric(metric); } else { diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/app_insights/response_parser.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/app_insights/response_parser.ts index 6b5f006ca301f..a4a98edb031be 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/app_insights/response_parser.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/app_insights/response_parser.ts @@ -144,7 +144,7 @@ export default class ResponseParser { } static findOrCreateBucket(data, target) { - let dataTarget = _.find(data, ['target', target]); + let dataTarget: any = _.find(data, ['target', target]); if (!dataTarget) { dataTarget = { target: target, datapoints: [] }; data.push(dataTarget); diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/response_parser.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/response_parser.ts index e747c2e4d7091..610dfc61b8477 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/response_parser.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/response_parser.ts @@ -254,7 +254,7 @@ export default class ResponseParser { } static findOrCreateBucket(data, target): DataTarget { - let dataTarget = _.find(data, ['target', target]); + let dataTarget: any = _.find(data, ['target', target]); if (!dataTarget) { dataTarget = { target: target, datapoints: [], refId: '', query: '' }; data.push(dataTarget); diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_monitor/response_parser.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_monitor/response_parser.ts index ef882efbf994c..5ae2560999623 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_monitor/response_parser.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_monitor/response_parser.ts @@ -136,7 +136,7 @@ export default class ResponseParser { } static parseMetadata(result: any, metricName: string) { - const metricData = _.find(result.data.value, o => { + const metricData: any = _.find(result.data.value, o => { return _.get(o, 'name.value') === metricName; }); diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/editor/query_field.tsx b/public/app/plugins/datasource/grafana-azure-monitor-datasource/editor/query_field.tsx index 9162a56e3eac0..3427bb5662d23 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/editor/query_field.tsx +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/editor/query_field.tsx @@ -245,7 +245,7 @@ class QueryField extends React.Component { // Get the currently selected suggestion const flattenedSuggestions = flattenSuggestions(suggestions); - const suggestion = _.find( + const suggestion: any = _.find( flattenedSuggestions, suggestion => suggestion.display === item || suggestion.text === item ); diff --git a/public/app/plugins/datasource/graphite/add_graphite_func.ts b/public/app/plugins/datasource/graphite/add_graphite_func.ts index ea3dfe8ff5e34..8a7b49b01c6de 100644 --- a/public/app/plugins/datasource/graphite/add_graphite_func.ts +++ b/public/app/plugins/datasource/graphite/add_graphite_func.ts @@ -35,7 +35,7 @@ export function graphiteAddFunc($compile) { minLength: 1, items: 10, updater: value => { - let funcDef = ctrl.datasource.getFuncDef(value); + let funcDef: any = ctrl.datasource.getFuncDef(value); if (!funcDef) { // try find close match value = value.toLowerCase(); diff --git a/public/app/plugins/datasource/graphite/func_editor.ts b/public/app/plugins/datasource/graphite/func_editor.ts index 25c007fcb198b..6f2b23a73892d 100644 --- a/public/app/plugins/datasource/graphite/func_editor.ts +++ b/public/app/plugins/datasource/graphite/func_editor.ts @@ -77,7 +77,7 @@ export function graphiteFuncEditor($compile, templateSrv, popoverSrv) { if (index < func.def.params.length) { return func.def.params[index]; } - if (_.last(func.def.params).multiple) { + if ((_.last(func.def.params) as any).multiple) { return _.assign({}, _.last(func.def.params), { optional: true }); } return {}; @@ -170,14 +170,14 @@ export function graphiteFuncEditor($compile, templateSrv, popoverSrv) { function addElementsAndCompile() { $funcLink.appendTo(elem); - const defParams = _.clone(func.def.params); - const lastParam = _.last(func.def.params); + const defParams: any = _.clone(func.def.params); + const lastParam: any = _.last(func.def.params); while (func.params.length >= defParams.length && lastParam && lastParam.multiple) { defParams.push(_.assign({}, lastParam, { optional: true })); } - _.each(defParams, (param, index) => { + _.each(defParams, (param: any, index: number) => { if (param.optional && func.params.length < index) { return false; } diff --git a/public/app/plugins/datasource/graphite/graphite_query.ts b/public/app/plugins/datasource/graphite/graphite_query.ts index fb3cb69f6ceb0..57157dc0701b5 100644 --- a/public/app/plugins/datasource/graphite/graphite_query.ts +++ b/public/app/plugins/datasource/graphite/graphite_query.ts @@ -61,7 +61,7 @@ export default class GraphiteQuery { } checkForSeriesByTag() { - const seriesByTagFunc = _.find(this.functions, func => func.def.name === 'seriesByTag'); + const seriesByTagFunc: any = _.find(this.functions, func => func.def.name === 'seriesByTag'); if (seriesByTagFunc) { this.seriesByTagUsed = true; seriesByTagFunc.hidden = true; @@ -135,7 +135,7 @@ export default class GraphiteQuery { } moveAliasFuncLast() { - const aliasFunc = _.find(this.functions, func => { + const aliasFunc: any = _.find(this.functions, func => { return func.def.name.startsWith('alias'); }); @@ -158,6 +158,7 @@ export default class GraphiteQuery { moveFunction(func, offset) { const index = this.functions.indexOf(func); + // @ts-ignore _.move(this.functions, index, index + offset); } diff --git a/public/app/plugins/datasource/graphite/query_ctrl.ts b/public/app/plugins/datasource/graphite/query_ctrl.ts index 80ddc0f5e072b..90c2c24829718 100644 --- a/public/app/plugins/datasource/graphite/query_ctrl.ts +++ b/public/app/plugins/datasource/graphite/query_ctrl.ts @@ -182,7 +182,7 @@ export class GraphiteQueryCtrl extends QueryCtrl { }); } - removeTaggedEntry(altSegments) { + removeTaggedEntry(altSegments: any[]) { altSegments = _.remove(altSegments, s => s.value === '_tagged'); } diff --git a/public/app/plugins/datasource/influxdb/influx_series.ts b/public/app/plugins/datasource/influxdb/influx_series.ts index 106f895787598..15b2a89c6f754 100644 --- a/public/app/plugins/datasource/influxdb/influx_series.ts +++ b/public/app/plugins/datasource/influxdb/influx_series.ts @@ -151,7 +151,7 @@ export default class InfluxSeries { return table; } - _.each(this.series, (series, seriesIndex) => { + _.each(this.series, (series: any, seriesIndex: number) => { if (seriesIndex === 0) { j = 0; // Check that the first column is indeed 'time' diff --git a/public/app/plugins/datasource/influxdb/module.ts b/public/app/plugins/datasource/influxdb/module.ts index 5997a7d061b8e..b25c15101c123 100644 --- a/public/app/plugins/datasource/influxdb/module.ts +++ b/public/app/plugins/datasource/influxdb/module.ts @@ -1,8 +1,21 @@ import InfluxDatasource from './datasource'; import { InfluxQueryCtrl } from './query_ctrl'; +import { + createChangeHandler, + createResetHandler, + PasswordFieldEnum, +} from '../../../features/datasources/utils/passwordHandlers'; class InfluxConfigCtrl { static templateUrl = 'partials/config.html'; + current: any; + onPasswordReset: ReturnType; + onPasswordChange: ReturnType; + + constructor() { + this.onPasswordReset = createResetHandler(this, PasswordFieldEnum.Password); + this.onPasswordChange = createChangeHandler(this, PasswordFieldEnum.Password); + } } class InfluxAnnotationsQueryCtrl { diff --git a/public/app/plugins/datasource/influxdb/partials/config.html b/public/app/plugins/datasource/influxdb/partials/config.html index 0229d01e8c8ab..0143163969043 100644 --- a/public/app/plugins/datasource/influxdb/partials/config.html +++ b/public/app/plugins/datasource/influxdb/partials/config.html @@ -16,9 +16,14 @@

    InfluxDB Details

    User -
    - Password - +
    +
    diff --git a/public/app/plugins/datasource/influxdb/response_parser.ts b/public/app/plugins/datasource/influxdb/response_parser.ts index 6ed9919f6800a..5c4fb1fc20efd 100644 --- a/public/app/plugins/datasource/influxdb/response_parser.ts +++ b/public/app/plugins/datasource/influxdb/response_parser.ts @@ -44,7 +44,9 @@ export default class ResponseParser { }); }); + // @ts-ignore problems with typings for this _.map only accepts [] but this needs to be object return _.map(res, value => { + // @ts-ignore return { text: value.toString() }; }); } diff --git a/public/app/plugins/datasource/loki/language_provider.ts b/public/app/plugins/datasource/loki/language_provider.ts index e914b1d8dd0d2..c137deace1cb9 100644 --- a/public/app/plugins/datasource/loki/language_provider.ts +++ b/public/app/plugins/datasource/loki/language_provider.ts @@ -1,5 +1,4 @@ // Libraries -// @ts-ignore import _ from 'lodash'; import moment from 'moment'; diff --git a/public/app/plugins/datasource/mixed/datasource.ts b/public/app/plugins/datasource/mixed/datasource.ts index d8c6aab24b81d..482cd27ab7b74 100644 --- a/public/app/plugins/datasource/mixed/datasource.ts +++ b/public/app/plugins/datasource/mixed/datasource.ts @@ -9,7 +9,7 @@ class MixedDatasource implements DataSourceApi { query(options: DataQueryOptions) { const sets = _.groupBy(options.targets, 'datasource'); - const promises = _.map(sets, (targets: DataQuery[]) => { + const promises: any = _.map(sets, (targets: DataQuery[]) => { const dsName = targets[0].datasource; if (dsName === '-- Mixed --') { return Promise.resolve([]); diff --git a/public/app/plugins/datasource/mssql/config_ctrl.ts b/public/app/plugins/datasource/mssql/config_ctrl.ts index 4555e6f67d81e..27e1d59ba24bd 100644 --- a/public/app/plugins/datasource/mssql/config_ctrl.ts +++ b/public/app/plugins/datasource/mssql/config_ctrl.ts @@ -1,24 +1,20 @@ -import { SyntheticEvent } from 'react'; +import { + createChangeHandler, + createResetHandler, + PasswordFieldEnum, +} from '../../../features/datasources/utils/passwordHandlers'; export class MssqlConfigCtrl { static templateUrl = 'partials/config.html'; current: any; + onPasswordReset: ReturnType; + onPasswordChange: ReturnType; /** @ngInject */ constructor($scope) { this.current.jsonData.encrypt = this.current.jsonData.encrypt || 'false'; + this.onPasswordReset = createResetHandler(this, PasswordFieldEnum.Password); + this.onPasswordChange = createChangeHandler(this, PasswordFieldEnum.Password); } - - onPasswordReset = (event: SyntheticEvent) => { - event.preventDefault(); - this.current.secureJsonFields.password = false; - this.current.secureJsonData = this.current.secureJsonData || {}; - this.current.secureJsonData.password = ''; - }; - - onPasswordChange = (event: SyntheticEvent) => { - this.current.secureJsonData = this.current.secureJsonData || {}; - this.current.secureJsonData.password = event.currentTarget.value; - }; } diff --git a/public/app/plugins/datasource/mssql/query_ctrl.ts b/public/app/plugins/datasource/mssql/query_ctrl.ts index 7598ca292fe11..c3eab93d4267d 100644 --- a/public/app/plugins/datasource/mssql/query_ctrl.ts +++ b/public/app/plugins/datasource/mssql/query_ctrl.ts @@ -59,7 +59,7 @@ export class MssqlQueryCtrl extends QueryCtrl { this.lastQueryMeta = null; this.lastQueryError = null; - const anySeriesFromQuery = _.find(dataList, { refId: this.target.refId }); + const anySeriesFromQuery: any = _.find(dataList, { refId: this.target.refId }); if (anySeriesFromQuery) { this.lastQueryMeta = anySeriesFromQuery.meta; } diff --git a/public/app/plugins/datasource/mysql/module.ts b/public/app/plugins/datasource/mysql/module.ts index 2d8caf17af435..f5181d3be8232 100644 --- a/public/app/plugins/datasource/mysql/module.ts +++ b/public/app/plugins/datasource/mysql/module.ts @@ -1,8 +1,21 @@ import { MysqlDatasource } from './datasource'; import { MysqlQueryCtrl } from './query_ctrl'; +import { + createChangeHandler, + createResetHandler, + PasswordFieldEnum, +} from '../../../features/datasources/utils/passwordHandlers'; class MysqlConfigCtrl { static templateUrl = 'partials/config.html'; + current: any; + onPasswordReset: ReturnType; + onPasswordChange: ReturnType; + + constructor() { + this.onPasswordReset = createResetHandler(this, PasswordFieldEnum.Password); + this.onPasswordChange = createChangeHandler(this, PasswordFieldEnum.Password); + } } const defaultQuery = `SELECT diff --git a/public/app/plugins/datasource/mysql/mysql_query.ts b/public/app/plugins/datasource/mysql/mysql_query.ts index 9494d867fad3c..88cef929aaae9 100644 --- a/public/app/plugins/datasource/mysql/mysql_query.ts +++ b/public/app/plugins/datasource/mysql/mysql_query.ts @@ -149,17 +149,17 @@ export default class MysqlQuery { buildValueColumn(column) { let query = ''; - const columnName = _.find(column, (g: any) => g.type === 'column'); + const columnName: any = _.find(column, (g: any) => g.type === 'column'); query = columnName.params[0]; - const aggregate = _.find(column, (g: any) => g.type === 'aggregate'); + const aggregate: any = _.find(column, (g: any) => g.type === 'aggregate'); if (aggregate) { const func = aggregate.params[0]; query = func + '(' + query + ')'; } - const alias = _.find(column, (g: any) => g.type === 'alias'); + const alias: any = _.find(column, (g: any) => g.type === 'alias'); if (alias) { query += ' AS ' + this.quoteIdentifier(alias.params[0]); } diff --git a/public/app/plugins/datasource/mysql/partials/config.html b/public/app/plugins/datasource/mysql/partials/config.html index f08d9b3da1529..4ec8101a227f0 100644 --- a/public/app/plugins/datasource/mysql/partials/config.html +++ b/public/app/plugins/datasource/mysql/partials/config.html @@ -16,9 +16,14 @@

    MySQL Connection

    User -
    - Password - +
    +
    diff --git a/public/app/plugins/datasource/mysql/query_ctrl.ts b/public/app/plugins/datasource/mysql/query_ctrl.ts index 8161404a1269c..06419c791c7f4 100644 --- a/public/app/plugins/datasource/mysql/query_ctrl.ts +++ b/public/app/plugins/datasource/mysql/query_ctrl.ts @@ -253,7 +253,7 @@ export class MysqlQueryCtrl extends QueryCtrl { this.lastQueryMeta = null; this.lastQueryError = null; - const anySeriesFromQuery = _.find(dataList, { refId: this.target.refId }); + const anySeriesFromQuery: any = _.find(dataList, { refId: this.target.refId }); if (anySeriesFromQuery) { this.lastQueryMeta = anySeriesFromQuery.meta; } diff --git a/public/app/plugins/datasource/opentsdb/datasource.ts b/public/app/plugins/datasource/opentsdb/datasource.ts index bab86a0476597..e6e81c1ebe9f6 100644 --- a/public/app/plugins/datasource/opentsdb/datasource.ts +++ b/public/app/plugins/datasource/opentsdb/datasource.ts @@ -72,7 +72,7 @@ export default class OpenTsDatasource { return this.performTimeSeriesQuery(queries, start, end).then(response => { const metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion); - const result = _.map(response.data, (metricData, index) => { + const result = _.map(response.data, (metricData: any, index: number) => { index = metricToTargetMapping[index]; if (index === -1) { index = 0; @@ -347,7 +347,7 @@ export default class OpenTsDatasource { // TSDB returns datapoints has a hash of ts => value. // Can't use _.pairs(invert()) because it stringifies keys/values - _.each(md.dps, (v, k) => { + _.each(md.dps, (v: any, k: number) => { if (tsdbResolution === 2) { dps.push([v, k * 1]); } else { @@ -466,7 +466,7 @@ export default class OpenTsDatasource { if (tsdbVersion === 3) { return metricData.query.index; } else { - return _.findIndex(options.targets, target => { + return _.findIndex(options.targets as any[], target => { if (target.filters && target.filters.length > 0) { return target.metric === metricData.metric; } else { diff --git a/public/app/plugins/datasource/postgres/config_ctrl.ts b/public/app/plugins/datasource/postgres/config_ctrl.ts index e547f5697a21b..1a12deafa4603 100644 --- a/public/app/plugins/datasource/postgres/config_ctrl.ts +++ b/public/app/plugins/datasource/postgres/config_ctrl.ts @@ -1,5 +1,9 @@ import _ from 'lodash'; -import { SyntheticEvent } from 'react'; +import { + createChangeHandler, + createResetHandler, + PasswordFieldEnum, +} from '../../../features/datasources/utils/passwordHandlers'; export class PostgresConfigCtrl { static templateUrl = 'partials/config.html'; @@ -7,6 +11,8 @@ export class PostgresConfigCtrl { current: any; datasourceSrv: any; showTimescaleDBHelp: boolean; + onPasswordReset: ReturnType; + onPasswordChange: ReturnType; /** @ngInject */ constructor($scope, datasourceSrv) { @@ -15,6 +21,8 @@ export class PostgresConfigCtrl { this.current.jsonData.postgresVersion = this.current.jsonData.postgresVersion || 903; this.showTimescaleDBHelp = false; this.autoDetectFeatures(); + this.onPasswordReset = createResetHandler(this, PasswordFieldEnum.Password); + this.onPasswordChange = createChangeHandler(this, PasswordFieldEnum.Password); } autoDetectFeatures() { @@ -53,18 +61,6 @@ export class PostgresConfigCtrl { this.showTimescaleDBHelp = !this.showTimescaleDBHelp; } - onPasswordReset = (event: SyntheticEvent) => { - event.preventDefault(); - this.current.secureJsonFields.password = false; - this.current.secureJsonData = this.current.secureJsonData || {}; - this.current.secureJsonData.password = ''; - }; - - onPasswordChange = (event: SyntheticEvent) => { - this.current.secureJsonData = this.current.secureJsonData || {}; - this.current.secureJsonData.password = event.currentTarget.value; - }; - // the value portion is derived from postgres server_version_num/100 postgresVersions = [ { name: '9.3', value: 903 }, diff --git a/public/app/plugins/datasource/postgres/postgres_query.ts b/public/app/plugins/datasource/postgres/postgres_query.ts index e315f1fecd26e..200a3ebd0bb01 100644 --- a/public/app/plugins/datasource/postgres/postgres_query.ts +++ b/public/app/plugins/datasource/postgres/postgres_query.ts @@ -149,11 +149,11 @@ export default class PostgresQuery { buildValueColumn(column) { let query = ''; - const columnName = _.find(column, (g: any) => g.type === 'column'); + const columnName: any = _.find(column, (g: any) => g.type === 'column'); query = columnName.params[0]; - const aggregate = _.find(column, (g: any) => g.type === 'aggregate' || g.type === 'percentile'); - const windows = _.find(column, (g: any) => g.type === 'window' || g.type === 'moving_window'); + const aggregate: any = _.find(column, (g: any) => g.type === 'aggregate' || g.type === 'percentile'); + const windows: any = _.find(column, (g: any) => g.type === 'window' || g.type === 'moving_window'); if (aggregate) { const func = aggregate.params[0]; @@ -218,7 +218,7 @@ export default class PostgresQuery { } } - const alias = _.find(column, (g: any) => g.type === 'alias'); + const alias: any = _.find(column, (g: any) => g.type === 'alias'); if (alias) { query += ' AS ' + this.quoteIdentifier(alias.params[0]); } diff --git a/public/app/plugins/datasource/postgres/query_ctrl.ts b/public/app/plugins/datasource/postgres/query_ctrl.ts index aa66a1594cb60..89050ce0ada3d 100644 --- a/public/app/plugins/datasource/postgres/query_ctrl.ts +++ b/public/app/plugins/datasource/postgres/query_ctrl.ts @@ -284,7 +284,7 @@ export class PostgresQueryCtrl extends QueryCtrl { this.lastQueryMeta = null; this.lastQueryError = null; - const anySeriesFromQuery = _.find(dataList, { refId: this.target.refId }); + const anySeriesFromQuery: any = _.find(dataList, { refId: this.target.refId }); if (anySeriesFromQuery) { this.lastQueryMeta = anySeriesFromQuery.meta; } diff --git a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx index 9a9a3b90223bb..f34e8a54ecd4c 100644 --- a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx @@ -1,4 +1,3 @@ -// @ts-ignore import _ from 'lodash'; import React from 'react'; // @ts-ignore diff --git a/public/app/plugins/datasource/prometheus/language_provider.ts b/public/app/plugins/datasource/prometheus/language_provider.ts index c071617fb6d93..71ff5bf5f72a1 100644 --- a/public/app/plugins/datasource/prometheus/language_provider.ts +++ b/public/app/plugins/datasource/prometheus/language_provider.ts @@ -1,4 +1,3 @@ -// @ts-ignore import _ from 'lodash'; import moment from 'moment'; diff --git a/public/app/plugins/datasource/prometheus/specs/datasource.test.ts b/public/app/plugins/datasource/prometheus/specs/datasource.test.ts index 4f90bd381da08..5c747eae74f0f 100644 --- a/public/app/plugins/datasource/prometheus/specs/datasource.test.ts +++ b/public/app/plugins/datasource/prometheus/specs/datasource.test.ts @@ -23,7 +23,7 @@ describe('PrometheusDatasource', () => { directUrl: 'direct', user: 'test', password: 'mupp', - jsonData: {}, + jsonData: {} as any, }; ctx.backendSrvMock = {}; diff --git a/public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts b/public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts index f8fc2e796ce0e..106940c277710 100644 --- a/public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts +++ b/public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts @@ -42,7 +42,7 @@ export default class StackdriverMetricFindQuery { async handleServiceQuery() { const metricDescriptors = await this.datasource.getMetricTypes(this.datasource.projectName); - const services = extractServicesFromMetricDescriptors(metricDescriptors); + const services: any[] = extractServicesFromMetricDescriptors(metricDescriptors); return services.map(s => ({ text: s.serviceShortName, value: s.service, diff --git a/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx b/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx index 5c8eaf5b5b8f2..cd8a2185df992 100644 --- a/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx +++ b/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx @@ -34,7 +34,7 @@ export class StackdriverVariableQueryEditor extends PureComponent ({ + const services = extractServicesFromMetricDescriptors(metricDescriptors).map((m: any) => ({ value: m.service, name: m.serviceShortName, })); diff --git a/public/app/plugins/datasource/testdata/QueryEditor.tsx b/public/app/plugins/datasource/testdata/QueryEditor.tsx index 811d6f217ff44..7f7afd67f7749 100644 --- a/public/app/plugins/datasource/testdata/QueryEditor.tsx +++ b/public/app/plugins/datasource/testdata/QueryEditor.tsx @@ -35,7 +35,7 @@ export class QueryEditor extends PureComponent { // const scenarioList = await this.backendSrv.get('/api/tsdb/testdata/scenarios'); const scenarioList = await datasource.getScenarios(); - const current = _.find(scenarioList, { id: query.scenarioId }); + const current: any = _.find(scenarioList, { id: query.scenarioId }); this.setState({ scenarioList: scenarioList, current: current }); } diff --git a/public/app/plugins/datasource/testdata/types.ts b/public/app/plugins/datasource/testdata/types.ts index 02347249655a6..1a05b3eac27bb 100644 --- a/public/app/plugins/datasource/testdata/types.ts +++ b/public/app/plugins/datasource/testdata/types.ts @@ -3,6 +3,8 @@ import { DataQuery } from '@grafana/ui/src/types'; export interface TestDataQuery extends DataQuery { alias?: string; scenarioId: string; + stringInput: string; + points: any; } export interface Scenario { diff --git a/public/app/plugins/panel/graph/Legend/Legend.tsx b/public/app/plugins/panel/graph/Legend/Legend.tsx index 161975eda9f7c..8702bdac85934 100644 --- a/public/app/plugins/panel/graph/Legend/Legend.tsx +++ b/public/app/plugins/panel/graph/Legend/Legend.tsx @@ -88,7 +88,7 @@ export class GraphLegend extends PureComponent { } sortLegend() { - let seriesList = [...this.props.seriesList] || []; + let seriesList: TimeSeries[] = [...this.props.seriesList] || []; if (this.props.sort) { seriesList = _.sortBy(seriesList, series => { let sort = series.stats[this.props.sort]; @@ -96,7 +96,7 @@ export class GraphLegend extends PureComponent { sort = -Infinity; } return sort; - }); + }) as TimeSeries[]; if (this.props.sortDesc) { seriesList = seriesList.reverse(); } diff --git a/public/app/plugins/panel/graph/data_processor.ts b/public/app/plugins/panel/graph/data_processor.ts index f148cc9e0b360..4b57934824cc2 100644 --- a/public/app/plugins/panel/graph/data_processor.ts +++ b/public/app/plugins/panel/graph/data_processor.ts @@ -156,7 +156,7 @@ export class DataProcessor { } const validOptions = this.getXAxisValueOptions({}); - const found = _.find(validOptions, { value: this.panel.xaxis.values[0] }); + const found: any = _.find(validOptions, { value: this.panel.xaxis.values[0] }); if (!found) { this.panel.xaxis.values = ['total']; } diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts index e3eed6fc382be..abed226f9d623 100755 --- a/public/app/plugins/panel/graph/graph.ts +++ b/public/app/plugins/panel/graph/graph.ts @@ -574,6 +574,7 @@ class GraphElement { return [tickIndex + 1, point[1]]; }); }); + // @ts-ignore, potential bug? is this _.flattenDeep? ticks = _.flatten(ticks, true); options.xaxis = { diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index 5a8789ed5d24a..2412224eca6b6 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -262,7 +262,7 @@ class GraphCtrl extends MetricsPanelCtrl { }; onToggleAxis = info => { - let override = _.find(this.panel.seriesOverrides, { alias: info.alias }); + let override: any = _.find(this.panel.seriesOverrides, { alias: info.alias }); if (!override) { override = { alias: info.alias }; this.panel.seriesOverrides.push(override); diff --git a/public/app/plugins/panel/heatmap/color_legend.ts b/public/app/plugins/panel/heatmap/color_legend.ts index a1c80629c7e76..3629bce1b5efe 100644 --- a/public/app/plugins/panel/heatmap/color_legend.ts +++ b/public/app/plugins/panel/heatmap/color_legend.ts @@ -36,7 +36,7 @@ coreModule.directive('colorLegend', () => { const legendWidth = Math.floor(legendElem.outerWidth()); if (panel.color.mode === 'spectrum') { - const colorScheme = _.find(ctrl.colorSchemes, { + const colorScheme: any = _.find(ctrl.colorSchemes, { value: panel.color.colorScheme, }); const colorScale = getColorScale(colorScheme, contextSrv.user.lightTheme, legendWidth); @@ -76,7 +76,7 @@ coreModule.directive('heatmapLegend', () => { const minValue = cardStats.min; if (panel.color.mode === 'spectrum') { - const colorScheme = _.find(ctrl.colorSchemes, { + const colorScheme: any = _.find(ctrl.colorSchemes, { value: panel.color.colorScheme, }); drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue); diff --git a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts index 07960f68ae315..baa8305e23343 100644 --- a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts +++ b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts @@ -253,7 +253,7 @@ function convertToHeatMap(seriesList, yBucketSize, xBucketSize, logBase = 1) { // |* | --/ |1|, // |____| |0| // - _.forEach(heatmap, xBucket => { + _.forEach(heatmap, (xBucket: any) => { if (logBase !== 1) { xBucket.buckets = convertToLogScaleValueBuckets(xBucket, yBucketSize, logBase); } else { diff --git a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts index 90cbecd665736..62f1514aac4e3 100644 --- a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts +++ b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts @@ -81,7 +81,7 @@ export class HeatmapTooltip { let boundBottom, boundTop, valuesNumber; const xData = data.buckets[xBucketIndex]; // Search in special 'zero' bucket also - const yData = _.find(xData.buckets, (bucket, bucketIndex) => { + const yData: any = _.find(xData.buckets, (bucket, bucketIndex) => { return bucket.bounds.bottom === yBucketIndex || bucketIndex === yBucketIndex.toString(); }); @@ -161,7 +161,7 @@ export class HeatmapTooltip { getXBucketIndex(x, data) { // First try to find X bucket by checking x pos is in the // [bucket.x, bucket.x + xBucketSize] interval - const xBucket = _.find(data.buckets, bucket => { + const xBucket: any = _.find(data.buckets, bucket => { return x > bucket.x && x - bucket.x <= data.xBucketSize; }); return xBucket ? xBucket.x : getValueBucketBound(x, data.xBucketSize, 1); diff --git a/public/app/plugins/panel/heatmap/rendering.ts b/public/app/plugins/panel/heatmap/rendering.ts index 41ba7d98e1f39..91bf5ae85bbfd 100644 --- a/public/app/plugins/panel/heatmap/rendering.ts +++ b/public/app/plugins/panel/heatmap/rendering.ts @@ -529,7 +529,7 @@ export class HeatmapRenderer { const minValueAuto = Math.min(cardStats.min, 0); const maxValue = _.isNil(this.panel.color.max) ? maxValueAuto : this.panel.color.max; const minValue = _.isNil(this.panel.color.min) ? minValueAuto : this.panel.color.min; - const colorScheme = _.find(this.ctrl.colorSchemes, { + const colorScheme: any = _.find(this.ctrl.colorSchemes, { value: this.panel.color.colorScheme, }); this.colorScale = getColorScale(colorScheme, contextSrv.user.lightTheme, maxValue, minValue); diff --git a/public/app/plugins/panel/table/editor.ts b/public/app/plugins/panel/table/editor.ts index 30938a03b85f7..2b6741acb1318 100644 --- a/public/app/plugins/panel/table/editor.ts +++ b/public/app/plugins/panel/table/editor.ts @@ -52,7 +52,7 @@ export class TablePanelEditorCtrl { addColumn() { const columns = transformers[this.panel.transform].getColumns(this.panelCtrl.dataRaw); - const column = _.find(columns, { text: this.addColumnSegment.value }); + const column: any = _.find(columns, { text: this.addColumnSegment.value }); if (column) { this.panel.columns.push(column); diff --git a/public/app/plugins/panel/table/renderer.ts b/public/app/plugins/panel/table/renderer.ts index 59cb0941b4c79..c14e031273774 100644 --- a/public/app/plugins/panel/table/renderer.ts +++ b/public/app/plugins/panel/table/renderer.ts @@ -101,7 +101,7 @@ export class TableRenderer { } // if is an epoch (numeric string and len > 12) - if (_.isString(v) && !isNaN(v) && v.length > 12) { + if (_.isString(v) && !isNaN(v as any) && v.length > 12) { v = parseInt(v, 10); } diff --git a/public/app/plugins/panel/table/transformers.ts b/public/app/plugins/panel/table/transformers.ts index c56d385505b69..dac63a935a095 100644 --- a/public/app/plugins/panel/table/transformers.ts +++ b/public/app/plugins/panel/table/transformers.ts @@ -154,7 +154,7 @@ transformers['table'] = { return columns; }, - transform: (data, panel, model) => { + transform: (data: any[], panel, model) => { if (!data || data.length === 0) { return; } diff --git a/scripts/build/ci-build/Dockerfile b/scripts/build/ci-build/Dockerfile index f41c6edea9297..bf4a70982b008 100644 --- a/scripts/build/ci-build/Dockerfile +++ b/scripts/build/ci-build/Dockerfile @@ -69,7 +69,7 @@ RUN apt-get update && \ # base image to crossbuild grafana FROM ubuntu:14.04 -ENV GOVERSION=1.11.5 \ +ENV GOVERSION=1.12.4 \ PATH=/usr/local/go/bin:$PATH \ GOPATH=/go \ NODEVERSION=10.14.2 diff --git a/scripts/build/ci-build/build-deploy.sh b/scripts/build/ci-build/build-deploy.sh index ce3cb21b5d8b5..e145322790afd 100755 --- a/scripts/build/ci-build/build-deploy.sh +++ b/scripts/build/ci-build/build-deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash -_version="1.2.4" +_version="1.2.6" _tag="grafana/build-container:${_version}" docker build -t $_tag . diff --git a/scripts/ci-frontend-metrics.sh b/scripts/ci-frontend-metrics.sh index d93c94774999d..007f5e6448657 100755 --- a/scripts/ci-frontend-metrics.sh +++ b/scripts/ci-frontend-metrics.sh @@ -2,7 +2,7 @@ echo -e "Collecting code stats (typescript errors & more)" -ERROR_COUNT_LIMIT=6816 +ERROR_COUNT_LIMIT=5977 DIRECTIVES_LIMIT=175 CONTROLLERS_LIMIT=138 diff --git a/yarn.lock b/yarn.lock index 301b900960209..9142454b2cc3a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2333,6 +2333,11 @@ resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-1.10.35.tgz#4e5c2b1e5b3bf0b863efb8c5e70081f52e6c9518" integrity sha512-SVtqEcudm7yjkTwoRA1gC6CNMhGDdMx4Pg8BPdiqI7bXXdCn1BPmtxgeWYQOgDxrq53/5YTlhq5ULxBEAlWIBg== +"@types/lodash@4.14.123": + version "4.14.123" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.123.tgz#39be5d211478c8dd3bdae98ee75bb7efe4abfe4d" + integrity sha512-pQvPkc4Nltyx7G1Ww45OjVqUsJP4UsZm+GWJpigXgkikZqJgRm4c48g027o6tdgubWHwFRF15iFd+Y4Pmqv6+Q== + "@types/lodash@^4.14.119": version "4.14.119" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.119.tgz#be847e5f4bc3e35e46d041c394ead8b603ad8b39"