Commit d40cc323 by Torkel Ödegaard

Merge branch 'master' of github.com:grafana/grafana into checkboxv2

parents 530b6a50 90c6b043
......@@ -17,30 +17,30 @@ On Linux systems the grafana-cli will assume that the grafana plugin directory i
List available plugins
```
grafana-cli list-remote
grafana-cli plugins list-remote
```
Install a plugin type
```
grafana-cli install <plugin-id>
grafana-cli plugins install <plugin-id>
```
List installed plugins
```
grafana-cli ls
grafana-cli plugins ls
```
Upgrade all installed plugins
```
grafana-cli upgrade-all
grafana-cli plugins upgrade-all
```
Upgrade one plugin
```
grafana-cli upgrade <plugin-id>
grafana-cli plugins upgrade <plugin-id>
```
Remove one plugin
```
grafana-cli remove <plugin-id>
grafana-cli plugins remove <plugin-id>
```
......@@ -22,7 +22,7 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C
}
}
var Commands = []cli.Command{
var pluginCommands = []cli.Command{
{
Name: "install",
Usage: "install <plugin name>",
......@@ -49,3 +49,11 @@ var Commands = []cli.Command{
Action: runCommand(removeCommand),
},
}
var Commands = []cli.Command{
{
Name: "plugins",
Usage: "Manage plugins for grafana",
Subcommands: pluginCommands,
},
}
......@@ -12,10 +12,6 @@ import (
var version = "master"
func getGrafanaPluginPath() string {
if os.Getenv("GF_PLUGIN_DIR") != "" {
return os.Getenv("GF_PLUGIN_DIR")
}
os := runtime.GOOS
if os == "windows" {
return "C:\\opt\\grafana\\plugins"
......@@ -34,14 +30,16 @@ func main() {
app.Version = version
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "path",
Usage: "path to the grafana installation",
Value: getGrafanaPluginPath(),
Name: "path",
Usage: "path to the grafana installation",
Value: getGrafanaPluginPath(),
EnvVar: "GF_PLUGIN_DIR",
},
cli.StringFlag{
Name: "repo",
Usage: "url to the plugin repository",
Value: "https://grafana-net.raintank.io/api/plugins",
Name: "repo",
Usage: "url to the plugin repository",
Value: "https://grafana-net.raintank.io/api/plugins",
EnvVar: "GF_PLUGIN_REPO",
},
cli.BoolFlag{
Name: "debug, d",
......
......@@ -105,6 +105,13 @@ function (angular, _, coreModule, config) {
});
}
//populate error obj on Internal Error
if (_.isString(err.data) && err.status === 500) {
err.data = {
error: err.statusText
};
}
// for Prometheus
if (!err.data.message && _.isString(err.data.error)) {
err.data.message = err.data.error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment