From 91e8468fb4bb9f0f521cb306960deec7bb9006eb Mon Sep 17 00:00:00 2001 From: victorclaessen Date: Thu, 22 Feb 2018 19:21:08 +0100 Subject: [PATCH 1/6] Added radiation units Add common units in radiation and health physics monitoring, Bq, Ci, Gy, rad, Sv, rem. C/kg, R, Sv/h. --- public/app/core/utils/kbn.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/public/app/core/utils/kbn.ts b/public/app/core/utils/kbn.ts index 329b415f1fe..6f0d3ca9895 100644 --- a/public/app/core/utils/kbn.ts +++ b/public/app/core/utils/kbn.ts @@ -571,6 +571,17 @@ kbn.valueFormats.degree = kbn.formatBuilders.fixedUnit('°'); kbn.valueFormats.radian = kbn.formatBuilders.fixedUnit('rad'); kbn.valueFormats.grad = kbn.formatBuilders.fixedUnit('grad'); +// Radiation +kbn.valueFormats.radbq = kbn.formatBuilders.decimalSIPrefix('Bq'); +kbn.valueFormats.radci = kbn.formatBuilders.decimalSIPrefix('Ci'); +kbn.valueFormats.radgy = kbn.formatBuilders.decimalSIPrefix('Gy'); +kbn.valueFormats.radrad = kbn.formatBuilders.decimalSIPrefix('rad'); +kbn.valueFormats.radsv = kbn.formatBuilders.decimalSIPrefix('Sv'); +kbn.valueFormats.radrem = kbn.formatBuilders.decimalSIPrefix('rem'); +kbn.valueFormats.radexpckg = kbn.formatBuilders.decimalSIPrefix('C/kg'); +kbn.valueFormats.radr = kbn.formatBuilders.decimalSIPrefix('R'); +kbn.valueFormats.radsvh = kbn.formatBuilders.decimalSIPrefix('Sv/h'); + // Time kbn.valueFormats.hertz = kbn.formatBuilders.decimalSIPrefix('Hz'); @@ -1036,6 +1047,20 @@ kbn.getUnitFormats = function() { { text: 'G unit', value: 'accG' }, ], }, + { + text: 'radiation', + submenu: [ + { text: 'Becquerel (Bq)', value: 'radbq' }, + { text: 'curie (Ci)', value: 'radci' }, + { text: 'Gray (Gy)', value: 'radgy' }, + { text: 'rad', value: 'radrad' }, + { text: 'Sievert (Sv)', value: 'radsv' }, + { text: 'rem', value: 'radrem' }, + { text: 'Exposure (C/kg)', value: 'radexpckg' }, + { text: 'roentgen (R)', value: 'radr' }, + { text: 'Sievert/hour (Sv/h)', value: 'radsvh' }, + ], + }, ]; }; From 4904a051cf31b414a954a1f4780ebaa5a12a3bbe Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Mon, 5 Mar 2018 16:06:04 +0100 Subject: [PATCH 2/6] use net/url to generate postgres connection url --- pkg/tsdb/postgres/postgres.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tsdb/postgres/postgres.go b/pkg/tsdb/postgres/postgres.go index 21ce006edb6..6a084ad1237 100644 --- a/pkg/tsdb/postgres/postgres.go +++ b/pkg/tsdb/postgres/postgres.go @@ -54,7 +54,8 @@ func generateConnectionString(datasource *models.DataSource) string { } sslmode := datasource.JsonData.Get("sslmode").MustString("verify-full") - return fmt.Sprintf("postgres://%s:%s@%s/%s?sslmode=%s", url.PathEscape(datasource.User), url.PathEscape(password), url.PathEscape(datasource.Url), url.PathEscape(datasource.Database), url.QueryEscape(sslmode)) + u := &url.URL{Scheme: "postgres", User: url.UserPassword(datasource.User, password), Host: datasource.Url, Path: datasource.Database, RawQuery: "sslmode=" + sslmode} + return u.String() } func (e *PostgresQueryEndpoint) Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) { From 1a16e588f71ef96e518ce966e09b9094243d7a3a Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 5 Mar 2018 19:44:09 +0100 Subject: [PATCH 3/6] changelog: notes for #11055 and #9487 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5916f960e7f..1c5b9fe3751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# 5.1.0 (unreleased) + +* **Postgres/MySQL**: Ability to insert 0s or nulls for missing intervals [#9487](https://github.com/grafana/grafana/issues/9487), thanks [@svenklemm](https://github.com/svenklemm) + + +# 5.0.1 (unreleased) + +* **Postgres**: PostgreSQL error when using ipv6 address as hostname in connection string [#11055](https://github.com/grafana/grafana/issues/11055), thanks [@svenklemm](https://github.com/svenklemm) + # 5.0.0-stable (2018-03-01) ### Fixes From a7d62f44d3e422ba6b982d2beeb4bc9a303683bc Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 5 Mar 2018 22:03:26 +0100 Subject: [PATCH 4/6] ignore iteration property when checking for unsaved changes closes #11063 --- .../features/dashboard/specs/unsaved_changes_srv_specs.ts | 5 +++++ public/app/features/dashboard/unsaved_changes_srv.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts b/public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts index 4d720945553..8bd639de681 100644 --- a/public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts +++ b/public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts @@ -66,6 +66,11 @@ describe('unsavedChangesSrv', function() { expect(tracker.hasChanges()).to.be(false); }); + it('Should ignore .iteration changes', () => { + dash.iteration = new Date().getTime() + 1; + expect(tracker.hasChanges()).to.be(false); + }); + it.skip('Should ignore row collapse change', function() { dash.rows[0].collapse = true; expect(tracker.hasChanges()).to.be(false); diff --git a/public/app/features/dashboard/unsaved_changes_srv.ts b/public/app/features/dashboard/unsaved_changes_srv.ts index 12eebb1077f..ebf0101cee0 100644 --- a/public/app/features/dashboard/unsaved_changes_srv.ts +++ b/public/app/features/dashboard/unsaved_changes_srv.ts @@ -97,6 +97,9 @@ export class Tracker { dash.refresh = 0; dash.schemaVersion = 0; + // ignore iteration property + delete dash.iteration; + // filter row and panels properties that should be ignored dash.rows = _.filter(dash.rows, function(row) { if (row.repeatRowId) { From 4d434d9845af8ba045099ae010ec05472df4ece3 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 6 Mar 2018 09:27:40 +0100 Subject: [PATCH 5/6] docs: add v5.1 to versions --- docs/versions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/versions.json b/docs/versions.json index 4685360cc29..2dcc7ebe776 100644 --- a/docs/versions.json +++ b/docs/versions.json @@ -1,4 +1,5 @@ [ + { "version": "v5.1", "path": "/v5.1", "archived": false }, { "version": "v5.0", "path": "/", "archived": false, "current": true }, { "version": "v4.6", "path": "/v4.6", "archived": true }, { "version": "v4.5", "path": "/v4.5", "archived": true }, From 96504940a8ae3d04e90746fa33bb183d8cab6804 Mon Sep 17 00:00:00 2001 From: Tony Dong Date: Tue, 6 Mar 2018 01:36:06 -0800 Subject: [PATCH 6/6] fix typo in heatmap rendering.ts (#11101) --- public/app/plugins/panel/heatmap/rendering.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/heatmap/rendering.ts b/public/app/plugins/panel/heatmap/rendering.ts index 90dac42dc8d..0977279809a 100644 --- a/public/app/plugins/panel/heatmap/rendering.ts +++ b/public/app/plugins/panel/heatmap/rendering.ts @@ -649,13 +649,13 @@ export default function link(scope, elem, attrs, ctrl) { selection.x2 = limitSelection(event.offsetX); drawSelection(selection.x1, selection.x2); } else { - emitGraphHoverEvet(event); + emitGraphHoverEvent(event); drawCrosshair(event.offsetX); tooltip.show(event, data); } } - function emitGraphHoverEvet(event) { + function emitGraphHoverEvent(event) { let x = xScale.invert(event.offsetX - yAxisWidth).valueOf(); let y = yScale.invert(event.offsetY); let pos = {