It looks like you are tracking an OctoPrint RC release channel. It " + + "would be great if you would enable error reporting so that any kind of errors that occur " + + "with an RC can be looked into more easily. Thank you!
" + + "You can find more information on error reporting " + + "under Settings > Error Tracking
"), + hide: false, + confirm: { + confirm: true, + buttons: [{ + text: gettext("Ignore"), + click: function() { + notification.remove(); + notification = undefined; + new PNotify({ + text: gettext("You can still enable error tracking via \"Settings\" > \"Error Tracking\"") + }); + + if (Modernizr.localstorage) { + localStorage["plugin.errortracking.notification_ignored"] = JSON.stringify(true); + } + } + }, { + text: gettext("Enable"), + addClass: "btn-primary", + click: function() { + self.settings.saveData({ + plugins: { + errortracking: { + enabled: true + } + } + }).done(function() { + notification.remove(); + notification = undefined; + location.reload(true); + }); + } + }] + }, + buttons: { + closer: false, + sticker: false + } + }); + + // not an RC release channel, close notification + } else if (notification !== undefined) { + notification.remove(); + notification = undefined; + } + }; + + var subbed = false; + self.onStartup = self.onUserLoggedIn = self.onUserLoggedOut = function() { + performCheck(); + if (self.settings && self.settings.settings && self.settings.settings.plugins && self.settings.settings.plugins.softwareupdate && !subbed) { + subbed = true; + self.settings.settings.plugins.softwareupdate.octoprint_release_channel.subscribe(performCheck); + } + }; + } + + OCTOPRINT_VIEWMODELS.push({ + construct: ErrorTrackingViewModel, + dependencies: ["settingsViewModel", "loginStateViewModel"] + }); +}); diff --git a/src/octoprint/plugins/errortracking/static/js/sentry.min.js b/src/octoprint/plugins/errortracking/static/js/sentry.min.js new file mode 100644 index 000000000..e4979d05a --- /dev/null +++ b/src/octoprint/plugins/errortracking/static/js/sentry.min.js @@ -0,0 +1,3 @@ +/*! @sentry/browser 4.5.1 (6a390acf) | https://github.com/getsentry/sentry-javascript */ +var Sentry=function(t){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)};function n(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r,o,i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n+ Error tracking will cause any logged exceptions in the server and the browser interface to be sent + to OctoPrint's Sentry instance. +
++ By enabling it you help to gather detailed information on the cause of bugs or other issues. This is especially valuable + on release candidates, which is why this plugin will also prompt you to enable error tracking if it detects that + you are subscribed to an RC release channel. +
++ Please enable this if you are running a release candidate, or are prompted to do so while debugging an issue that you reported. +
+{% endtrans %} + + + +{% trans %} ++ The Error Tracking plugin is using a Sentry instance kindly provided by + sentry.io. For information on their service + please refer to their Security & Compliance documentation + and their Privacy Policy. +
+{% endtrans %} diff --git a/src/octoprint/server/views.py b/src/octoprint/server/views.py index 04f888e12..76c8d720e 100644 --- a/src/octoprint/server/views.py +++ b/src/octoprint/server/views.py @@ -196,7 +196,7 @@ def index(): default_additional_etag = [enable_accesscontrol, enable_gcodeviewer, - enable_timelapse] + enable_timelapse] + sorted(["{}:{}".format(k, v) for k, v in _plugin_vars.items()]) def get_preemptively_cached_view(key, view, data=None, additional_request_data=None, additional_unless=None): if (data is None and additional_request_data is None) or g.locale is None: diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 6cbabf348..51ac62794 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -302,7 +302,8 @@ default_settings = { "section_printer", "serial", "printerprofiles", "temperatures", "terminalfilters", "gcodescripts", "section_features", "features", "webcam", "accesscontrol", "gcodevisualizer", "api", "plugin_appkeys", "section_octoprint", "server", "folders", "appearance", "plugin_logging", "plugin_pluginmanager", - "plugin_softwareupdate", "plugin_announcements", "plugin_backup", "plugin_tracking", "plugin_pi_support" + "plugin_softwareupdate", "plugin_announcements", "plugin_backup", "plugin_tracking", "plugin_errortracking", + "plugin_pi_support" ], "usersettings": ["access", "interface"], "wizard": ["access"],