Compare commits

..
10 Commits
Author SHA1 Message Date
Gina Häußge ed798e4c6f 🔖 Preparing release of 1.9.0rc3 2023-03-22 12:44:38 +01:00
Gina Häußge fe73d0d93c 🐛 Fix scan_deps breaking on non pep440 version numbers 2023-03-22 12:40:30 +01:00
Gina Häußge bb519ae88b 🐛 Fix login dialog when appkeys plugin is disabled
Closes #4763
2023-03-20 14:14:25 +01:00
Christian Würthner 4cc41b05ea ♻️ Use webcam container for intersection instead of controls (#4759)
* Use webcam container for intersection instead of controls

* Removed check for tab visibility, fully rely on control.js logic

* Allow intersection observers to be recreated

* Use onStartupComplete as callback to defer intersection initialization
2023-03-13 17:10:51 +01:00
Gina Häußge 65f53f3d86 🐛 Fix logic for language selection
Closes #4762
2023-03-13 15:45:17 +01:00
Gina Häußge 658c5578e2 🎨 Fix a typo in a var name 2023-03-13 15:31:57 +01:00
Gina Häußge ba54bd3006 🐛 Make sure label is always defined to read background color from
Fixes #4761
2023-03-13 14:24:16 +01:00
Gina Häußge 0ce7930653 🐛 Add CSRF cookie on standalone appkeys dialog
Fixes #4755
2023-03-09 10:42:21 +01:00
Gina Häußge f5e90a1aa4 🐛 Fix saving of extruder count in printer profiles
Simple copy-paste error.

Closes #4754
2023-03-08 12:31:24 +01:00
Gina Häußge a5ab135f82 🔖 staging/maintenance is now 1.9.0rc3.dev 2023-03-07 14:09:28 +01:00
10 changed files with 55 additions and 32 deletions

No files matched your search

+3 -3
View File
@@ -29,10 +29,10 @@ improve/.* 1.9.0 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev
staging/bugfix 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev
bug/.* 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.9.0rc2
# staging/maintenance is currently the branch for preparation of 1.9.0rc3
# so is regressionfix/...
staging/maintenance 1.9.0rc2 cd955e9a46782119b36cc22b8dea5652ebbf9774 pep440-dev
regressionfix/.* 1.9.0rc2 cd955e9a46782119b36cc22b8dea5652ebbf9774 pep440-dev
staging/maintenance 1.9.0rc3 95e87eb1970d8e322738f9698c9d665d78f2d74e pep440-dev
regressionfix/.* 1.9.0rc3 95e87eb1970d8e322738f9698c9d665d78f2d74e pep440-dev
# staging/devel is currently inactive (but has the 1.4.1rc4 namespace)
staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
+8 -2
View File
@@ -201,11 +201,17 @@ class ScanDepsCommand(setuptools.Command):
)
resp.raise_for_status()
def safe_parse_version(version):
try:
return parse_version(version)
except ValueError:
return None
data = resp.json()
versions = list(
filter(
lambda x: not x.is_prerelease and not x.is_devrelease,
map(lambda x: parse_version(x), data.get("versions", [])),
lambda x: x and not x.is_prerelease and not x.is_devrelease,
map(lambda x: safe_parse_version(x), data.get("versions", [])),
)
)
if not versions:
+3 -1
View File
@@ -218,6 +218,8 @@ class AppKeysPlugin(
@octoprint.plugin.BlueprintPlugin.route("/auth/<app_token>", methods=["GET"])
@no_firstrun_access
def handle_auth_dialog(self, app_token):
from octoprint.server.util.csrf import add_csrf_cookie
user_id = current_user.get_name()
required_user = flask.request.args.get("user", None)
@@ -256,7 +258,7 @@ class AppKeysPlugin(
).replace("%(app)s", app_id),
)
)
return add_non_caching_response_headers(response)
return add_csrf_cookie(add_non_caching_response_headers(response))
@octoprint.plugin.BlueprintPlugin.route("/decision/<user_token>", methods=["POST"])
@restricted_access
@@ -117,18 +117,11 @@ $(function () {
};
self._enableWebcam = function () {
if (
OctoPrint.coreui.selectedTab != "#control" ||
!OctoPrint.coreui.browserTabVisible
) {
return;
}
if (self.webcamDisableTimeout != undefined) {
clearTimeout(self.webcamDisableTimeout);
}
// IF disabled then we dont need to do anything
// If disabled then we dont need to do anything
if (self.settings.webcamEnabled() == false) {
console.log("Webcam not enabled");
return;
@@ -156,7 +149,7 @@ $(function () {
};
self.onWebcamErrored = function () {
log.debug("Webcam stream failed to load/disabled");
log.debug("Webcam stream failed to load/was unloaded");
self.webcamLoaded(false);
self.webcamError(true);
};
@@ -18,10 +18,10 @@ from octoprint.util.version import (
)
SENTRY_URL_SERVER = (
"https://11f9235bf2ac4f5d97f7e8bcb5be3783@o118517.ingest.sentry.io/1373987"
"https://cb1ee590a2f34baca47dd207d7f294d5@o118517.ingest.sentry.io/1373987"
)
SENTRY_URL_COREUI = (
"https://22fe071cb60c4dfcb8245a3712739f6e@o118517.ingest.sentry.io/1374096"
"https://a32c80a4a282468d8d41fc2accb77088@o118517.ingest.sentry.io/1374096"
)
SETTINGS_DEFAULTS = {
+6 -5
View File
@@ -1420,8 +1420,9 @@ class Server:
except octoprint.access.users.UnknownUser:
pass
elif (
default_language is not None
if (
not l10n
and default_language is not None
and not default_language == "_default"
and default_language in LANGUAGES
):
@@ -1430,14 +1431,14 @@ class Server:
if l10n:
# canonicalize and get rid of invalid language codes
l10n_canoicalized = []
l10n_canonicalized = []
for x in l10n:
try:
l10n_canoicalized.append(str(Locale.parse(x)))
l10n_canonicalized.append(str(Locale.parse(x)))
except Exception:
# invalid language code, ignore
continue
return Locale.negotiate(l10n_canoicalized, LANGUAGES)
return Locale.negotiate(l10n_canonicalized, LANGUAGES)
# request: preference
return Locale.parse(request.accept_languages.best_match(LANGUAGES, default="en"))
+9 -2
View File
@@ -20,6 +20,7 @@ from flask import (
send_from_directory,
url_for,
)
from werkzeug.routing import BuildError
import octoprint.plugin
from octoprint.access.permissions import OctoPrintPermission, Permissions
@@ -195,8 +196,14 @@ def login():
allowed_paths = [
url_for("index"),
url_for("recovery"),
url_for("plugin.appkeys.handle_auth_dialog", app_token="*"),
] + configured_allowed_paths
]
try:
allowed_paths += [
url_for("plugin.appkeys.handle_auth_dialog", app_token="*"),
]
except BuildError:
pass # no appkeys plugin enabled, see #4763
allowed_paths += configured_allowed_paths
if not validate_local_redirect(redirect_url, allowed_paths):
_logger.warning(
@@ -37,6 +37,7 @@ $(function () {
self.controlsFromServer = [];
self.additionalControls = [];
self.intersectionObservers = [];
self.keycontrolActive = ko.observable(false);
self.keycontrolHelpActive = ko.observable(false);
@@ -74,18 +75,27 @@ $(function () {
}
};
self.onAfterBinding = function () {
self.onStartupComplete = function () {
self.recreateIntersectionObservers();
};
self.recreateIntersectionObservers = function () {
// We are using the IntersectionObserver API to determine whether a webcam is visible or not.
// A webcam will not intersect with the control tab if the control tab is invisible because another tab
// is selected or if the webcam isn't shown because another webcam is active.
//
// Whenever the webacam changes visibility we will call onWebcamVisbilityChange() which the webcam's
// VM can use to start or stop the stream.
self.intersectionObservers.forEach(function (observer) {
observer.disconnect();
});
self.intersectionObservers = [];
document
.querySelectorAll("#webcam-group .tab-pane")
.forEach(function (target) {
var options = {
root: document.querySelector("#control"),
root: document.querySelector("#webcam_plugins_container"),
rootMargin: "0px",
threshold: 1.0
};
@@ -103,6 +113,7 @@ $(function () {
var observer = new IntersectionObserver(callback, options);
observer.observe(target);
self.intersectionObservers.push(observer);
});
};
@@ -290,7 +290,7 @@ $(function () {
}
}
if (checks.lt !== undefined) {
if (!(value < checks.gt)) {
if (!(value < checks.lt)) {
return def;
}
}
@@ -466,12 +466,15 @@ $(function () {
if (mark.label) {
markLabel = gettext(mark.label);
}
if (o.left > yAxisLabelWidth) {
var label = $("<div></div>");
label.html(markLabel);
label.addClass("temperature-mark-label");
label.addClass("temperature-mark-type-" + mark.type);
// we create the label even if we don't show it so that we can query its
// background color (see #4761)
var label = $("<div></div>");
label.html(markLabel);
label.addClass("temperature-mark-label");
label.addClass("temperature-mark-type-" + mark.type);
if (o.left > yAxisLabelWidth) {
graph.append(label);
// draw markings label on the left if doesn't fit on the right