From 349f6b51a5d5417e3179af0b590df83a85a60a27 Mon Sep 17 00:00:00 2001 From: Matt Toback Date: Fri, 22 Apr 2016 11:32:19 -0400 Subject: [PATCH 1/8] Updated link color in text panel to be -link-color --- public/sass/components/_panel_text.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/public/sass/components/_panel_text.scss b/public/sass/components/_panel_text.scss index 9de31bab4c8..6e0301cecc5 100644 --- a/public/sass/components/_panel_text.scss +++ b/public/sass/components/_panel_text.scss @@ -4,4 +4,5 @@ margin: 0 0 $spacer $spacer * 1.5; } li {line-height: 2;} + a { color: $external-link-color; } } From 25b0773a947939708b2d7219cde684745e4b1abb Mon Sep 17 00:00:00 2001 From: Dan Cech Date: Fri, 22 Apr 2016 12:12:36 -0400 Subject: [PATCH 2/8] fix broken link to grafana.net, standardize on https://grafana.net for links --- docs/sources/plugins/index.md | 2 +- public/app/features/plugins/partials/update_instructions.html | 2 +- public/app/plugins/datasource/influxdb/README.md | 4 ++-- public/app/plugins/panel/pluginlist/module.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sources/plugins/index.md b/docs/sources/plugins/index.md index 08654bfb946..bb5c8062223 100644 --- a/docs/sources/plugins/index.md +++ b/docs/sources/plugins/index.md @@ -15,7 +15,7 @@ Grafana already have a strong community of contributors and plugin developers. By making it easier to develop and install plugins we hope that the community can grow even stronger and develop new plugins that we would never think about. -You can discover available plugins on [Grafana.net](http://grafana.net) +You can discover available plugins on [Grafana.net](https://grafana.net) diff --git a/public/app/features/plugins/partials/update_instructions.html b/public/app/features/plugins/partials/update_instructions.html index 55455e24af7..9648be53c86 100644 --- a/public/app/features/plugins/partials/update_instructions.html +++ b/public/app/features/plugins/partials/update_instructions.html @@ -14,7 +14,7 @@

Type the following on the command line to update {{plugin.name}}.

grafana-cli plugins update {{plugin.id}}
- Check out {{plugin.name}} on Grafana.net for README and changelog. If you do not have access to the command line, ask your Grafana administator. + Check out {{plugin.name}} on Grafana.net for README and changelog. If you do not have access to the command line, ask your Grafana administator.

Pro tip: To update all plugins at once, type grafana-cli plugins update-all on the command line. diff --git a/public/app/plugins/datasource/influxdb/README.md b/public/app/plugins/datasource/influxdb/README.md index 45eaa51eb0f..d8d98cf5c6b 100644 --- a/public/app/plugins/datasource/influxdb/README.md +++ b/public/app/plugins/datasource/influxdb/README.md @@ -6,8 +6,8 @@ There are currently two separate datasources for InfluxDB in Grafana: InfluxDB 0 This is the plugin for InfluxDB 0.9. It is rapidly evolving and we continue to track its API. -InfluxDB 0.8 is no longer maintained by InfluxDB Inc, but we provide support as a convenience to existing users. You can find it [here](https://www.grafana.net/plugins/grafana-influxdb-08-datasource). +InfluxDB 0.8 is no longer maintained by InfluxDB Inc, but we provide support as a convenience to existing users. You can find it [here](https://grafana.net/plugins/grafana-influxdb-08-datasource). Read more about InfluxDB here: -[http://docs.grafana.org/datasources/influxdb/](http://docs.grafana.org/datasources/influxdb/) \ No newline at end of file +[http://docs.grafana.org/datasources/influxdb/](http://docs.grafana.org/datasources/influxdb/) diff --git a/public/app/plugins/panel/pluginlist/module.html b/public/app/plugins/panel/pluginlist/module.html index c73da35b391..8e74f173a07 100644 --- a/public/app/plugins/panel/pluginlist/module.html +++ b/public/app/plugins/panel/pluginlist/module.html @@ -22,7 +22,7 @@

From 70acfb2cfd942d75eb0fc75ef610d909a8d26c3e Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 21 Apr 2016 11:15:51 +0200 Subject: [PATCH 3/8] fix(cli): adds better help text. The zip lib is throwing panics sometimes when the response is malformed. The cli will now try to download the zip file up to three times before aborting. The cli gives a better error message and informes the user about retrying. closes #4651 --- pkg/cmd/grafana-cli/commands/install_command.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/grafana-cli/commands/install_command.go b/pkg/cmd/grafana-cli/commands/install_command.go index addcf9a8b7e..1ed3a8a3fe8 100644 --- a/pkg/cmd/grafana-cli/commands/install_command.go +++ b/pkg/cmd/grafana-cli/commands/install_command.go @@ -127,9 +127,14 @@ func downloadFile(pluginName, filePath, url string) (err error) { if r := recover(); r != nil { retryCount++ if retryCount < 3 { - fmt.Printf("\nFailed downloading. Will retry once.\n%v\n", r) + + fmt.Println("Failed downloading. Will retry once.") downloadFile(pluginName, filePath, url) } else { + failure := fmt.Sprintf("%v", r) + if failure == "runtime error: makeslice: len out of range" { + log.Errorf("Failed to extract zipped HTTP response. Please try again.\n") + } panic(r) } } From 0855f514363146a2623a3081fd337982c5c940a5 Mon Sep 17 00:00:00 2001 From: bergquist Date: Sat, 23 Apr 2016 10:03:00 +0200 Subject: [PATCH 4/8] feat(cli): improves defer error handling --- pkg/cmd/grafana-cli/commands/install_command.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/grafana-cli/commands/install_command.go b/pkg/cmd/grafana-cli/commands/install_command.go index 1ed3a8a3fe8..a07b2dcae38 100644 --- a/pkg/cmd/grafana-cli/commands/install_command.go +++ b/pkg/cmd/grafana-cli/commands/install_command.go @@ -127,15 +127,15 @@ func downloadFile(pluginName, filePath, url string) (err error) { if r := recover(); r != nil { retryCount++ if retryCount < 3 { - fmt.Println("Failed downloading. Will retry once.") - downloadFile(pluginName, filePath, url) + err = downloadFile(pluginName, filePath, url) } else { failure := fmt.Sprintf("%v", r) if failure == "runtime error: makeslice: len out of range" { - log.Errorf("Failed to extract zipped HTTP response. Please try again.\n") + err = fmt.Errorf("Failed to extract zipped HTTP response. Please try again.\n") + } else { + panic(r) } - panic(r) } } }() From 07b13e24fa43e7c171046f6d77ab13f053af3a3c Mon Sep 17 00:00:00 2001 From: bergquist Date: Sat, 23 Apr 2016 14:31:24 +0200 Subject: [PATCH 5/8] style(cli): add some color to error messages --- pkg/cmd/grafana-cli/commands/commands.go | 3 ++- pkg/cmd/grafana-cli/commands/install_command.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/grafana-cli/commands/commands.go b/pkg/cmd/grafana-cli/commands/commands.go index b3821a47844..ec454078f9b 100644 --- a/pkg/cmd/grafana-cli/commands/commands.go +++ b/pkg/cmd/grafana-cli/commands/commands.go @@ -4,6 +4,7 @@ import ( "os" "github.com/codegangsta/cli" + "github.com/fatih/color" "github.com/grafana/grafana/pkg/cmd/grafana-cli/log" ) @@ -12,7 +13,7 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C cmd := &contextCommandLine{context} if err := command(cmd); err != nil { - log.Error("\nError: ") + log.Errorf("\n%s: ", color.RedString("Error")) log.Errorf("%s\n\n", err) cmd.ShowHelp() diff --git a/pkg/cmd/grafana-cli/commands/install_command.go b/pkg/cmd/grafana-cli/commands/install_command.go index a07b2dcae38..eb5973d07be 100644 --- a/pkg/cmd/grafana-cli/commands/install_command.go +++ b/pkg/cmd/grafana-cli/commands/install_command.go @@ -132,7 +132,7 @@ func downloadFile(pluginName, filePath, url string) (err error) { } else { failure := fmt.Sprintf("%v", r) if failure == "runtime error: makeslice: len out of range" { - err = fmt.Errorf("Failed to extract zipped HTTP response. Please try again.\n") + err = fmt.Errorf("Corrupt http response from source. Please try again.\n") } else { panic(r) } From ee0c4cd1945b646ebf7671eaecb8f1acee358cb4 Mon Sep 17 00:00:00 2001 From: bergquist Date: Sat, 23 Apr 2016 14:37:26 +0200 Subject: [PATCH 6/8] docs(changelog): add note about cli issue closes #4651 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba8e6242243..9d4ee020dce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * **Dashlist**: Fixed issue dashboard list panel and caching tags, fixes [#4768](https://github.com/grafana/grafana/issues/4768) * **Graph**: Fixed issue with unneeded scrollbar in legend for Firefox, fixes [#4760](https://github.com/grafana/grafana/issues/4760) * **Table panel**: Fixed issue table panel formating string array properties, fixes [#4791](https://github.com/grafana/grafana/issues/4791) +* **grafana-cli**: Improve error message when failing to install plugins due to corrupt response, fixes [#4651](https://github.com/grafana/grafana/issues/4651) # 3.0.0-beta5 (2016-04-15) From 21d2a51cd335da768af4d12a77842ac2e48bf852 Mon Sep 17 00:00:00 2001 From: Tyler Mitchell Date: Sat, 23 Apr 2016 22:00:42 -0700 Subject: [PATCH 7/8] typo tabs != tags --- docs/sources/http_api/dashboard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/http_api/dashboard.md b/docs/sources/http_api/dashboard.md index 68f6ab022cc..ead63c722aa 100644 --- a/docs/sources/http_api/dashboard.md +++ b/docs/sources/http_api/dashboard.md @@ -191,7 +191,7 @@ Will return the home dashboard. `GET /api/dashboards/tags` -Get all tabs of dashboards +Get all tags of dashboards **Example Request**: From 00827ce921352807315e05ef664d3cba77c29a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 24 Apr 2016 12:50:33 +0200 Subject: [PATCH 8/8] fix(): let binding cycle complete before adding panel to dom --- public/app/core/directives/plugin_component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/app/core/directives/plugin_component.ts b/public/app/core/directives/plugin_component.ts index 3e6383cc5c6..6708c0315f3 100644 --- a/public/app/core/directives/plugin_component.ts +++ b/public/app/core/directives/plugin_component.ts @@ -206,9 +206,12 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $ }); $compile(child)(scope); - elem.empty(); - elem.append(child); + + // let a binding digest cycle complete before adding to dom + setTimeout(function() { + elem.append(child); + }); } function registerPluginComponent(scope, elem, attrs, componentInfo) {