From 41171f8a5c45430f046bfb28c699f7a2569c53ac Mon Sep 17 00:00:00 2001 From: Alfred Krohmer Date: Mon, 10 Apr 2017 09:17:37 +0200 Subject: [PATCH 1/6] Add a link to a graph image in Pushover notifications (#8075) --- pkg/services/alerting/notifiers/pushover.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/services/alerting/notifiers/pushover.go b/pkg/services/alerting/notifiers/pushover.go index c68ad421c62..7a2297f9e89 100644 --- a/pkg/services/alerting/notifiers/pushover.go +++ b/pkg/services/alerting/notifiers/pushover.go @@ -139,8 +139,12 @@ func (this *PushoverNotifier) Notify(evalContext *alerting.EvalContext) error { } } if evalContext.Error != nil { - message += fmt.Sprintf("\nError message %s", evalContext.Error.Error()) + message += fmt.Sprintf("\nError message: %s", evalContext.Error.Error()) } + if evalContext.ImagePublicUrl != "" { + message += fmt.Sprintf("\nShow graph image", evalContext.ImagePublicUrl) + } + q := url.Values{} q.Add("user", this.UserKey) q.Add("token", this.ApiToken) From 21ae987bcd404e98cb3de6d255bb34f371e2b48e Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Mon, 10 Apr 2017 09:43:35 +0200 Subject: [PATCH 2/6] If earlier dashboard refresh was supressed, force a new one on page becoming visible (#8076) --- public/app/features/dashboard/time_srv.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/app/features/dashboard/time_srv.ts b/public/app/features/dashboard/time_srv.ts index 38577982953..7891232d53b 100644 --- a/public/app/features/dashboard/time_srv.ts +++ b/public/app/features/dashboard/time_srv.ts @@ -15,6 +15,7 @@ class TimeSrv { oldRefresh: boolean; dashboard: any; timeAtLoad: any; + private autoRefreshBlocked: boolean; /** @ngInject **/ constructor(private $rootScope, private $timeout, private $location, private timer, private contextSrv) { @@ -23,6 +24,14 @@ class TimeSrv { $rootScope.$on('zoom-out', this.zoomOut.bind(this)); $rootScope.$on('$routeUpdate', this.routeUpdated.bind(this)); + + document.addEventListener('visibilitychange', () => { + if (this.autoRefreshBlocked && document.visibilityState === 'visible') { + this.autoRefreshBlocked = false; + + this.refreshDashboard(); + } + }); } init(dashboard) { @@ -137,6 +146,8 @@ class TimeSrv { this.startNextRefreshTimer(afterMs); if (this.contextSrv.isGrafanaVisible()) { this.refreshDashboard(); + } else { + this.autoRefreshBlocked = true; } }, afterMs)); } From 337b3295bdfd3a24bbaf8234b9cfc980934d9179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 10 Apr 2017 09:45:44 +0200 Subject: [PATCH 3/6] docs: updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2b6cfc187..024bc39d2dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ ## Fixes * **Table Panel**: Fixed annotation display in table panel, [#8023](https://github.com/grafana/grafana/issues/8023) +* **Dashboard**: If refresh is blocked due to tab not visible, then refresh when it becomes visible [#8076](https://github.com/grafana/grafana/issues/8076) thanks [@SimenB](https://github.com/SimenB) # 4.2.0 (2017-03-22) ## Minor Enhancements From 997da1b26613c854fb3f763cbc2b99b52ff94499 Mon Sep 17 00:00:00 2001 From: Davide Setti Date: Mon, 10 Apr 2017 10:10:32 +0200 Subject: [PATCH 4/6] fix a typo in the shortcut help modal (#8078) Collapse all ros -> Collapse all rows --- public/app/core/components/help/help.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/core/components/help/help.ts b/public/app/core/components/help/help.ts index f7914a73a28..943a21f3c5f 100644 --- a/public/app/core/components/help/help.ts +++ b/public/app/core/components/help/help.ts @@ -27,7 +27,7 @@ export class HelpCtrl { {keys: ['d', 'v'], description: 'Toggle in-active / view mode'}, {keys: ['d', 'k'], description: 'Toggle kiosk mode (hides top nav)'}, {keys: ['d', 'E'], description: 'Expand all rows'}, - {keys: ['d', 'C'], description: 'Collapse all ros'}, + {keys: ['d', 'C'], description: 'Collapse all rows'}, {keys: ['mod+o'], description: 'Toggle shared graph crosshair'}, ], 'Focused Panel': [ From 2877ad1a7ddeba995da18ce7ff4a480b018622c2 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 10 Apr 2017 15:01:40 +0200 Subject: [PATCH 5/6] docs: manual installation of plugins --- docs/sources/plugins/installation.md | 45 ++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/docs/sources/plugins/installation.md b/docs/sources/plugins/installation.md index 745d7ce2304..f136d552f51 100644 --- a/docs/sources/plugins/installation.md +++ b/docs/sources/plugins/installation.md @@ -19,15 +19,15 @@ can grow even stronger and develop new plugins that we would never think about. To discover plugins checkout the official [Plugin Repository](https://grafana.com/plugins). -# Installing plugins +# Installing Plugins The easiest way to install plugins is by using the CLI tool grafana-cli which is bundled with grafana. Before any modification take place after modifying plugins, grafana-server needs to be restarted. -### Grafana plugin directory +### Grafana Plugin Directory On Linux systems the grafana-cli will assume that the grafana plugin directory is `/var/lib/grafana/plugins`. It's possible to override the directory which grafana-cli will operate on by specifying the --pluginsDir flag. On Windows systems this parameter have to be specified for every call. -### Grafana-cli commands +### Grafana-cli Commands List available plugins ``` @@ -63,3 +63,42 @@ Remove one plugin ``` grafana-cli plugins remove ``` + +### Installing Plugins Manually + +If your Grafana Server does not have access to the Internet, then the plugin will have to downloaded and manually copied to your Grafana Server. + +The Download URL from Grafana.com API is in this form: + +`https://grafana.com/api/plugins//versions//download` + +To manually install a Plugin via the Grafana.com API: + +1. Find the plugin you want to download, the plugin id can be found on the Installation Tab on the plugin's page on Grafana.com. In this example, the plugin id is `jdbranham-diagram-panel`: + + {{< imgbox img="/img/docs/installation-tab.png" caption="Installation Tab" >}} + +2. Use the Grafana API to find the plugin using this url `https://grafana.com/api/plugins/`. For example: https://grafana.com/api/plugins/jdbranham-diagram-panel should return: + ``` + { + "id": 145, + "typeId": 3, + "typeName": "Panel", + "typeCode": "panel", + "slug": "jdbranham-diagram-panel", + "name": "Diagram", + "description": "Diagram panel for grafana", + ... + ``` + +3. Find the download link: + ``` + { + "rel": "download", + "href": "/plugins/jdbranham-diagram-panel/versions/1.4.0/download" + } + ``` + +4. Download the plugin with `https://grafana.com/api/plugins//versions//download` (for example: https://grafana.com/api/plugins/jdbranham-diagram-panel/versions/1.4.0/download). Unzip the downloaded file into the Grafana Server's `data/plugins` directory. + +5. Restart the Grafana Server. From 0384eecf5c4118eba331fa44bde448a823253a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 10 Apr 2017 15:25:41 +0200 Subject: [PATCH 6/6] fix: minor fix for bug when saving alert with empty message, fixes #7927 --- pkg/services/sqlstore/alert.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/services/sqlstore/alert.go b/pkg/services/sqlstore/alert.go index 4bf4cb5d0e9..3fccba6267e 100644 --- a/pkg/services/sqlstore/alert.go +++ b/pkg/services/sqlstore/alert.go @@ -171,6 +171,7 @@ func upsertAlerts(existingAlerts []*m.Alert, cmd *m.SaveAlertsCommand, sess *xor if alertToUpdate.ContainsUpdates(alert) { alert.Updated = time.Now() alert.State = alertToUpdate.State + sess.MustCols("message") _, err := sess.Id(alert.Id).Update(alert) if err != nil { return err