From 052f81275bf53b5457341679b9cbcda8e5507a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 19 May 2020 17:50:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20pgmr:=20Dedicated=20error=20mess?= =?UTF-8?q?age=20on=20general=20failure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we can't load stuff from the backend, don't get stuck in "pip not available" mode (which confuses people terribly) but instead show a dedicated error. --- .../plugins/pluginmanager/static/js/pluginmanager.js | 8 +++++++- .../pluginmanager/templates/pluginmanager_settings.jinja2 | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js index 0f5c8e404..fe8e15fb2 100644 --- a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js +++ b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js @@ -131,7 +131,7 @@ $(function() { self.followDependencyLinks = ko.observable(false); - self.pipAvailable = ko.observable(false); + self.pipAvailable = ko.observable(true); self.pipVersion = ko.observable(); self.pipInstallDir = ko.observable(); self.pipUseUser = ko.observable(); @@ -142,6 +142,8 @@ $(function() { self.safeMode = ko.observable(); self.online = ko.observable(); + self.requestError = ko.observable(false); + self.pipUseUserString = ko.pureComputed(function() { return self.pipUseUser() ? "yes" : "no"; }); @@ -444,7 +446,11 @@ $(function() { options.eval_notices = options.eval_notices || false; OctoPrint.plugins.pluginmanager.get({repo: options.refresh_repo, notices: options.refresh_notices, orphans: options.refresh_orphans}) + .fail(function() { + self.requestError(true); + }) .done(function(data) { + self.requestError(false); self.fromResponse(data, options); }); }; diff --git a/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 b/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 index ea4788b51..317e03a12 100644 --- a/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 +++ b/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 @@ -34,6 +34,13 @@ {% endtrans %} {% endmacro %} +{% macro pluginmanager_requesterror() %} +
{% trans %} + There appears to have been an error retrieving the plugin data from the backend. Please report this + in the bug tracker & be sure to include all requested logs. +{% endtrans %}
+{% endmacro %} +