Merge branch 'maintenance' into devel

This commit is contained in:
GitHub Nightly Merge Action committed 2022-03-02 00:14:55 +00:00
commit 21b2dde2c3
5 files changed
+32 -20

No files matched your search

@@ -553,6 +553,10 @@ class TrackingPlugin(
payload["octopi_version"] = self._environment["plugins"]["pi_support"][
"octopi_version"
]
if "octopiuptodate_build" in self._environment["plugins"]["pi_support"]:
payload["octopiuptodate_build"] = self._environment["plugins"][
"pi_support"
]["octopiuptodate_build"]
return payload
+13 -18
View File
@@ -661,13 +661,7 @@ class HierarchicalChainMap:
key = self._path_to_key(path)
# delete any subkeys
subkeys_start = key + _CHAINMAP_SEP
to_delete = []
for k in current.keys():
if k.startswith(subkeys_start):
to_delete.append(k)
for k in to_delete:
del current[k]
self._del_prefix(current, key)
if isinstance(value, dict):
current.update(self._flatten(value, key))
@@ -686,19 +680,11 @@ class HierarchicalChainMap:
if not path:
raise ValueError("Invalid path")
current = self._chainmap
current = self._chainmap.maps[0]
# used to check if we've deleted anything
deleted_any = False
# we delete recursively: the path that we got, and any subpaths
# delete any subkeys
delete_key = self._path_to_key(path)
for key in self._chainmap.keys():
if key.startswith(delete_key):
del current[key]
deleted_any = True
if not deleted_any:
if not self._del_prefix(current, delete_key):
raise KeyError("Could not find entry for " + str(path))
# create a placeholder object above if needed
@@ -710,6 +696,15 @@ class HierarchicalChainMap:
if not any(map(lambda k: k.startswith(up_one_path_prefix), current.keys())):
current[up_one_path] = {}
def _del_prefix(self, current, key):
prefix = key + _CHAINMAP_SEP
to_delete = [k for k in current if k.startswith(prefix)]
for k in to_delete:
del current[k]
return len(to_delete) > 0
def with_config_defaults(self, config=None, defaults=None):
"""
Builds a new map with the following layers: provided config + any intermediary
@@ -21,6 +21,7 @@ $(function () {
self.selectedPrinter(self.printerProfiles.currentProfile());
});
self.portOptionsFetched = ko.observable(false);
self.portOptions = ko.observableArray(undefined);
self.baudrateOptions = ko.observableArray(undefined);
self.printerOptions = ko.observableArray(undefined);
@@ -53,6 +54,7 @@ $(function () {
self.validPort = ko.pureComputed(function () {
return (
!self.portOptionsFetched() ||
self.portOptions().length > 0 ||
self.settings.settings.serial.ignoreEmptyPorts()
);
@@ -119,6 +121,7 @@ $(function () {
}
self.saveSettings(false);
self.portOptionsFetched(true);
};
self.fromHistoryData = function (data) {
@@ -311,6 +311,13 @@ $(function () {
self.webcam_ffmpegPathOk(false);
self.webcam_ffmpegPathBroken(false);
};
self.webcam_streamType = ko.pureComputed(function () {
try {
return determineWebcamStreamType(self.webcam_streamUrl());
} catch (e) {
return "";
}
});
self.server_onlineCheckText = ko.observable();
self.server_onlineCheckOk = ko.observable(false);
@@ -442,7 +449,7 @@ $(function () {
var text = gettext(
"If you see your webcam stream below, the entered stream URL is ok."
);
var streamType = determineWebcamStreamType(self.webcam_streamUrl());
var streamType = self.webcam_streamType();
var webcam_element;
var webrtc_peer_connection;
if (streamType == "mjpg") {
@@ -5,6 +5,9 @@
<input type="text" class="input-block-level" data-bind="value: webcam_streamUrl, valueUpdate: 'afterkeydown'" id="settings-webcamStreamUrl">
<button class="btn" type="button" data-bind="click: testWebcamStreamUrl, enable: webcam_streamUrl() && !testWebcamStreamUrlBusy(), css: {disabled: !webcam_streamUrl() || testWebcamStreamUrlBusy()}"><i class="fas fa-spinner fa-spin" data-bind="visible: testWebcamStreamUrlBusy"></i> {{ _('Test') }}</button>
</div>
<span class="help-block">{% trans %}Needs to be reachable from the browser displaying the OctoPrint UI, used to embed the webcam stream into the page.{% endtrans %}</span>
<span class="help-block">
<p>{% trans %}Needs to be reachable from the browser displaying the OctoPrint UI, used to embed the webcam stream into the page.{% endtrans %}</p>
<p data-bind="visible: webcam_streamType() === 'webrtc'">{% trans %}<strong>Heads-up!</strong> WebRTC support is still in beta and subject to change, monitor the changelog of future versions closely for heads-ups regarding the WebRTC support in OctoPrint.{% endtrans %}</p>
</span>
</div>
</div>