From 658c4233d4c5db2704f97f511fe12a19f676fc6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 23 Nov 2021 17:37:20 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20SWU:=20Improve=20update=20&=20ch?= =?UTF-8?q?eck=20buttons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * "Update all" will now only update *enabled* items * "Update all available" (dropdown) will update enabled *and* muted items * "Check for updates" does what it always did * "Force check for updates" (dropdown) bypasses the cache * Notification muting and logic is now also explained in a footer. --- .../static/js/softwareupdate.js | 15 +++++++ .../templates/softwareupdate_settings.jinja2 | 40 +++++++++++++------ 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js index f812219d7..d98069c23 100644 --- a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js +++ b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js @@ -82,6 +82,10 @@ $(function () { }); self.enableUpdateAll = ko.pureComputed(function () { + return self.enableUpdate() && self.availableAndPossible().length > 0; + }); + + self.enableUpdateEnabled = ko.pureComputed(function () { return ( self.enableUpdate() && self.availableAndPossibleAndEnabled().length > 0 ); @@ -370,6 +374,17 @@ $(function () { }); }; + information.notificationIconTitle = function () { + var update = information.updateAvailable + ? gettext("Update available") + : gettext("Up-to-date"); + var notifications = information.disabled + ? gettext("notifications are muted") + : gettext("notifications are enabled"); + + return update + " (" + notifications + ")"; + }; + return information; }; diff --git a/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 b/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 index 3bf2516d5..702ebf0f5 100644 --- a/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 +++ b/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 @@ -85,28 +85,31 @@
- - +
+ + + +
+
+ + + +

{{ _('Current versions') }}

-
-
{{ _('Advanced options') }}
-
- {{ _('Last cache refresh:') }} - - -
-
-
- +
- + @@ -126,6 +129,17 @@
+ + = {{ _('Update notifications enabled') }}, + = {{ _('Update notifications muted') }}, + {{ _('click to toggle') }}. + {% trans %} + "Update all" will update all items for which updates are availalbe & + update notifications are enabled as well, "Update all available" will + update all items for which updates are available regardless of update + notifications being enabled or muted. + {% endtrans %} +