Skip to content

Commit 8878a55

Browse files
committed
Merge branch 'master' into alerting
2 parents 95c1a4a + da6ac07 commit 8878a55

File tree

6 files changed

+55
-4
lines changed

6 files changed

+55
-4
lines changed

docs/sources/installation/mac.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,17 @@ brew update
2424
brew reinstall grafana
2525
```
2626

27+
-------------
2728

29+
You can also install the latest unstable grafana from git:
30+
31+
32+
```
33+
brew install --HEAD grafana/grafana/grafana
34+
```
35+
36+
To upgrade grafana if you've installed from HEAD:
37+
38+
```
39+
brew reinstall --HEAD grafana/grafana/grafana
40+
```

docs/sources/plugins/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ page_keywords: grafana, plugins, documentation
99
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.
1010

1111
### Grafana plugin directory
12-
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 --path flag. On Windows systems this parameter have to be specified for every call.
12+
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.
1313

1414
### Grafana-cli commands
1515

packaging/mac/bin/grafana

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
DAEMON=grafana-server
3+
EXECUTABLE=/usr/local/bin/grafana-server
4+
CONFIG=/usr/local/etc/grafana/grafana.ini
5+
HOMEPATH=/usr/local/share/grafana
6+
LOGPATH=/usr/local/var/log/grafana
7+
DATAPATH=/usr/local/var/lib/grafana
8+
PLUGINPATH=/usr/local/var/lib/grafana/plugins
9+
10+
case "$1" in
11+
start)
12+
$EXECUTABLE --config=$CONFIG --homepath=$HOMEPATH cfg:default.paths.logs=$LOGPATH cfg:default.paths.data=$DATAPATH cfg:default.paths.plugins=$PLUGINPATH 2> /dev/null &
13+
[ $? -eq 0 ] && echo "$DAEMON started"
14+
;;
15+
stop)
16+
killall $DAEMON
17+
[ $? -eq 0 ] && echo "$DAEMON stopped"
18+
;;
19+
restart)
20+
$0 stop
21+
$0 start
22+
;;
23+
*)
24+
echo "Usage: $0 (start|stop|restart)"
25+
;;
26+
esac

public/app/core/services/alert_srv.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,21 @@ export class AlertSrv {
2727
this.set(alert[0], alert[1], 'success', 3000);
2828
}, this.$rootScope);
2929

30+
appEvents.on('alert-error', options => {
31+
this.set(options[0], options[1], 'error', 7000);
32+
});
33+
3034
appEvents.on('confirm-modal', this.showConfirmModal.bind(this));
3135
}
3236

3337
set(title, text, severity, timeout) {
38+
if (_.isObject(text)) {
39+
console.log('alert error', text);
40+
if (text.statusText) {
41+
text = `HTTP Error (${text.status}) ${text.statusText}`;
42+
}
43+
}
44+
3445
var newAlert = {
3546
title: title || '',
3647
text: text || '',

public/app/features/dashboard/dashnav/dashnav.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export class DashNavCtrl {
209209
$scope.viewJson = function() {
210210
var clone = $scope.dashboard.getSaveModelClone();
211211
var html = angular.toJson(clone, true);
212-
var uri = "data:application/json," + encodeURIComponent(html);
212+
var uri = "data:application/json;charset=utf-8," + encodeURIComponent(html);
213213
var newWindow = window.open(uri);
214214
};
215215

public/app/plugins/datasource/graphite/query_ctrl.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import moment from 'moment';
99
import gfunc from './gfunc';
1010
import {Parser} from './parser';
1111
import {QueryCtrl} from 'app/plugins/sdk';
12+
import appEvents from 'app/core/app_events';
1213

1314
export class GraphiteQueryCtrl extends QueryCtrl {
1415
static templateUrl = 'partials/query.editor.html';
@@ -141,7 +142,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
141142
}
142143
}
143144
}).catch(err => {
144-
this.error = err.message || 'Failed to issue metric query';
145+
appEvents.emit('alert-error', ['Error', err]);
145146
});
146147
}
147148

@@ -178,7 +179,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
178179
altSegments.unshift(this.uiSegmentSrv.newSegment('*'));
179180
return altSegments;
180181
}).catch(err => {
181-
this.error = err.message || 'Failed to issue metric query';
182+
appEvents.emit('alert-error', ['Error', err]);
182183
return [];
183184
});
184185
}

0 commit comments

Comments
 (0)