🚸 pgmr: Dedicated error message on general failure

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.
This commit is contained in:
Gina Häußge committed 2020-05-19 17:50:40 +02:00
1 parent e0a5751d9f
commit 052f81275b
2 files changed
+15 -1

No files matched your search

@@ -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);
});
};
@@ -34,6 +34,13 @@
{% endtrans %}</div>
{% endmacro %}
{% macro pluginmanager_requesterror() %}
<div class="alert" data-bind="visible: 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 %}</div>
{% endmacro %}
<ul class="nav nav-pills">
<li class="active">
<a href="#settings_plugin_pluginmanager_plugins" data-toggle="tab">{{ _('Plugins') }}</a>
@@ -49,6 +56,7 @@
{{ pluginmanager_nopip() }}
{{ pluginmanager_safemode() }}
{{ pluginmanager_throttled() }}
{{ pluginmanager_requesterror() }}
<div class="pull-right">
<button class="btn btn-small" data-bind="click: function() { $root.showPluginSettings(); }" title="{{ _('Plugin Configuration')|edq }}"><i class="fa fa-wrench"></i></button>