Merge branch 'master' into maintenance

This commit is contained in:
Gina Häußge committed 2021-02-16 17:12:35 +01:00
commit 2bfa72acd4
3 files changed
+43 -3

No files matched your search

+13 -2
View File
@@ -58,6 +58,17 @@ inputs:
- No, it did not persist (it's an issue with one of your installed plugins, don't report here)
- I cannot test this issue in safe mode (state why below)
required: true
- type: input
attributes:
label: If you could not test in safe mode, please state why
description: >-
Issues caused by a third party plugin are a major cause of bugs reported here, so we really need to
rule out that a plugin is at fault here. [Safe mode](https://docs.octoprint.org/en/master/features/safemode.html) is an easy way to do that. Only skip safe mode
if your particular problem *absolutely requires* third party plugins to be enabled. "It would take
too long" is **not** a reason to skip testing in safe mode, neither is "I do not know how to
enable it" as you can find info on that [here](https://docs.octoprint.org/en/master/features/safemode.html).
If you really *cannot* test in safe mode, leave a short explanation as to why.
- type: description
attributes:
value: |
@@ -92,10 +103,10 @@ inputs:
value: >-
Please also be sure to upload the following files below:
* `octoprint.log`: See [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know where to find that.
* `octoprint.log`: See [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know where to find that. Just attach down below as-is.
* `serial.log` or the contents of your terminal tab, if applicable. Always
include if unsure. **Please note that you need to enable `serial.log` first**,
see [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know how to do or where to find it.
see [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know how to do or where to find it. Just attach down below as-is.
* Your browser's JavaScript console, if you are reporting a problem with the
user interface. See [here](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers) on where to find that.
* If possible, screenshots or videos showing the problem, especially if you
+6
View File
@@ -40,6 +40,12 @@ because the library depends on those to be available (as ``$`` and ``_``). You c
<script src="{{ url_for("static", filename="js/lib/jquery/jquery.min.js") }}"></script>
<script src="{{ url_for("static", filename="js/lib/lodash.min.js") }}"></script>
Moreover, if you need to use the socket module, you'll need to include sockJS. You can embed it like this:
.. code-block:: html+jinja
<script src="{{ url_for("static", filename="js/lib/sockjs.min.js") }}"></script>
Note that all components depend on the ``base`` component to be present, so if you are only including a select
number of components, make sure to at the very least include that one to be able to utilize the client.
+24 -1
View File
@@ -64,12 +64,24 @@
Sends a message of type ``type`` with the provided ``payload`` to the server.
Note that at the time of writing, OctoPrint only supports the ``throttle`` message. See
Note that at the time of writing, OctoPrint only supports the ``throttle`` and ``auth`` messages. See
also the :ref:`Push API documentation <sec-api-push>`.
:param string type: Type of message to send
:param object payload: Payload to send
.. js:function:: OctoPrintClient.socket.sendAuth(userId, session)
Sends an ``auth`` message with the provided ``userId`` and ``session`` to the server.
``session`` is expected to be the ``session`` value retrieved
from any valid :ref:`OctoPrint.browser.login(userId,...) <sec-jsclientlib-browser>` response.
See also the :ref:`Push API documentation <sec-api-push>`.
:param string userId: An existing OctoPrint username
:param string session: A valid session id for the provided username
.. js:function:: OctoPrintClient.socket.onRateTooLow(measured, minimum)
Called by the socket client when the measured message round trip times have been lower than
@@ -102,6 +114,17 @@
Instructs the server to decrease the message rate by 500ms.
Sample to setup an authed socket
================================
.. code-block:: javascript
OctoPrint.socket.connect();
OctoPrint.browser.login("myusername", "mypassword", true)
.done(function(response) {
OctoPrint.socket.sendAuth("myusername", response.session);
});
.. _sec-jsclient-socket-throttling:
Communication Throttling