diff --git a/docs/api/fileops.rst b/docs/api/fileops.rst index e9786c29..3ac67bfe 100644 --- a/docs/api/fileops.rst +++ b/docs/api/fileops.rst @@ -387,6 +387,30 @@ Issue a file command Upon success, a status code of :http:statuscode:`202` and a :ref:`sec-api-datamodel-files-fileabridged` in the response body will be returned. + copy + Copies the file or folder to a new ``destination`` on the same ``location``. Additional parameters are: + + * ``destination``: The path of the parent folder to which to copy the file or folder. It must already exist. + + If there already exists a file or folder of the same name at ``destination``, the request will return a :http:statuscode:`409`. + If the ``destination`` folder does not exist, a :http:statuscode:`404` will be returned. + + Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response + body will be returned. + + move + Moves the file or folder to a new ``destination`` on the same ``location``. Additional parameters are: + + * ``destination``: The path of the parent folder to which to move the file or folder. + + If there already exists a file or folder of the same name at ``destination``, the request will return a :http:statuscode:`409`. + If the ``destination`` folder does not exist, a :http:statuscode:`404` will be returned. If the ``path`` is currently + in use by OctoPrint (e.g. it is a GCODE file that's currently being printed) a :http:statuscode:`409` will be + returned. + + Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response + body will be returned. + **Example Select Request** .. sourcecode:: http @@ -441,6 +465,62 @@ Issue a file command } } + **Example Copy Request** + + .. sourcecode:: http + + POST /api/files/local/some_folder/some_model.gcode HTTP/1.1 + Host: example.com + Content-Type: application/json + X-Api-Key: abcdef... + + { + "command": "copy", + "destination": "some_other_folder/subfolder" + } + + .. sourcecode:: http + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "origin": "local", + "name": "some_model.gcode", + "path": "some_other_folder/subfolder/some_model.gcode", + "refs": { + "download": "http://example.com/downloads/files/local/some_other_folder/subfolder/some_model.gcode", + "resource": "http://example.com/api/files/local/some_other_folder/subfolder/some_model.gcode" + } + } + + **Example Move Request** + + .. sourcecode:: http + + POST /api/files/local/some_folder/and_a_subfolder HTTP/1.1 + Host: example.com + Content-Type: application/json + X-Api-Key: abcdef... + + { + "command": "move", + "destination": "some_other_folder" + } + + .. sourcecode:: http + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "origin": "local", + "name": "and_a_subfolder", + "path": "some_other_folder/and_a_subfolder", + "refs": { + "resource": "http://example.com/api/files/local/some_other_folder/and_a_subfolder" + } + } :param location: The target location on which to send the command for is located, either ``local`` (for OctoPrint's ``uploads`` folder) or ``sdcard`` for the printer's SD card (if available) diff --git a/docs/api/push.rst b/docs/api/push.rst index 9d4859cc..f8f93409 100644 --- a/docs/api/push.rst +++ b/docs/api/push.rst @@ -27,17 +27,21 @@ Each pushed message consists of a simple JSON object that follows this basic str ``type`` indicates the type of message being pushed to the client, the attached ``payload`` is message specific. The following message types are currently available for usage by 3rd party clients: + * ``connected``: Initial connection information, sent only right after establishing the socket connection. See + :ref:`the payload data model `. * ``current``: Rate limited general state update, payload contains information about the printer's state, job progress, accumulated temperature points and log lines since last update. OctoPrint will send these updates when new information is available, but not more often than twice per second in order to not flood the client with messages (e.g. during printing). See :ref:`the payload data model `. * ``history``: Current state, temperature and log history, sent upon initial connect to get the client up to date. Same - payload data model as ``current``, see :ref:`below `. + payload data model as ``current``, see :ref:`the payload data model `. * ``event``: Events triggered within OctoPrint, such as e.g. ``PrintFailed`` or ``MovieRenderDone``. Payload is the event - type and payload, see :ref:`below `. Sent when an event is triggered internally. + type and payload, see :ref:`the payload data model `. Sent when an event is triggered internally. * ``slicingProgress``: Progress updates from an active slicing background job, payload contains information about the model being sliced, the target file, the slicer being used and the progress as a percentage. See :ref:`the payload data model `. + * ``plugin``: Messages generated by plugins. The payload data models are determined by the plugin which sent the + message. Clients must ignore any unknown messages. @@ -66,6 +70,48 @@ Example for a ``throttle`` client-server-message: Datamodel ========= +.. _sec-api-push-datamodel-connected: + +``connected`` payload +--------------------- + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``apikey`` + - 1 + - String + - Current UI API KEY. The UI API KEY is a special API key that gets regenerated on every server restart and + has no rights attached other than accessing the REST API. An additional browser session is needed to + send valid requests when the UI API KEY is used. + * - ``version`` + - 1 + - String + - The server's version. + * - ``branch`` + - 1 + - String + - The source code branch from which the server was built. + * - ``display_version`` + - 1 + - String + - The server's version and branch in a human readable format. + * - ``plugin_hash`` + - 1 + - String + - A hash of all installed plugins. This allows to detect if there have been plugin changes between server + restarts. + * - ``config_hash`` + - 1 + - String + - A hash of the currently active config. This allows to detect if there have been configuration changes between + server restarts. + .. _sec-api-push-datamodel-currentandhistory: ``current`` and ``history`` payload diff --git a/docs/development/index.rst b/docs/development/index.rst index d06ff402..3cdef357 100644 --- a/docs/development/index.rst +++ b/docs/development/index.rst @@ -17,7 +17,7 @@ Setting up a Development environment Obtaining, building and running the source ------------------------------------------ -These describes the general steps in obtaining, building and running. OS specific instructions can be found +This describes the general steps in obtaining, building and running. OS specific instructions can be found below. * Prerequisites: @@ -115,7 +115,7 @@ Mac OS X This guide is based on the `Setup Guide for Mac OS X on OctoPrint's wiki `_. Please report back if it works for you, due to lack of access to a Mac I cannot test it myself. Thanks. -This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different +This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different location, please substitute accordingly. You'll need a user account with administrator privileges. diff --git a/docs/jsclientlib/files.rst b/docs/jsclientlib/files.rst index 0d313c42..399bd868 100644 --- a/docs/jsclientlib/files.rst +++ b/docs/jsclientlib/files.rst @@ -73,7 +73,7 @@ :param object opts: Additional options for the request :returns Promise: A `jQuery Promise `_ for the request's response -.. js:function:: OctoPrint.files.select(location, filename, print, opts) +.. js:function:: OctoPrint.files.select(location, path, print, opts) Selects a file at ``location`` named ``filename`` for printing. If ``print`` is supplied and truthy, also starts printing the file immediately. @@ -81,58 +81,95 @@ See the ``select`` command in :ref:`Issue a file command ` for more details. :param string location: The location of the file to select - :param string filename: The name of the file to select + :param string path: The name of the file to select :param boolean print: Whether to print the file after selection (true) or not (false, default) :param object opts: Additional options for the request :returns Promise: A `jQuery Promise `_ for the request's response -.. js:function:: OctoPrint.files.slice(location, filename, parameters, opts) +.. js:function:: OctoPrint.files.slice(location, path, parameters, opts) Slices a file at ``location`` called ``filename``, using the supplied slice command ``parameters``. See the ``slice`` command in :ref:`Issue a file command ` for more details. :param string location: The location of the file to slice - :param string filename: The name of the file to slice + :param string path: The path of the file to slice :param object parameters: Additional parameters for the ``slice`` command :param object opts: Additional options for the request :returns Promise: A `jQuery Promise `_ for the request's response -.. js:function:: OctoPrint.files.delete(location, filename, opts) +.. js:function:: OctoPrint.files.delete(location, path, opts) - Deletes the file at ``location`` named ``filename``. + Deletes the file or folder at ``location`` and ``path``. See :ref:`Delete file ` for more details. :param string location: The location of the file to delete - :param string filename: The name of the file to delete + :param string path: The path of the file to delete :param object opts: Additional options for the request :returns Promise: A `jQuery Promise `_ for the request's response -.. js:function:: OctoPrint.files.copy(location, filename, destination, opts) +.. js:function:: OctoPrint.files.copy(location, path, destination, opts) - .. todo:: + Copies file or folder ``path`` on ``location`` to new parent folder ``destination`` on ``location``. - Also needs API documentation. + ``destination`` must already exist. + **Example:** + + .. code-block:: javascript + + OctoPrint.files.copy("local", "some/file.gco", "other/folder"); + + See :ref:`Issue a file command ` for more details. + + :param string location: The location of the file to copy, currently only "local" is supported + :param string path: The path of the file or folder to copy + :param string destination: The path of the parent to which to copy the file or folder :param object opts: Additional options for the request :returns Promise: A `jQuery Promise `_ for the request's response .. js:function:: OctoPrint.files.move(location, filename, destination, opts) - .. todo:: + Moves file or folder ``path`` on ``location`` to new parent folder ``destination`` on ``location``. - Also needs API documentation. + ``destination`` must already exist. + **Example:** + + .. code-block:: javascript + + OctoPrint.files.move("local", "some/file.gco", "other/folder"); + + See :ref:`Issue a file command ` for more details. + + :param string location: The location of the file to move, currently only "local" is supported + :param string path: The path of the file or folder to move + :param string destination: The path of the parent to which to copy the file or folder :param object opts: Additional options for the request :returns Promise: A `jQuery Promise `_ for the request's response .. js:function:: OctoPrint.files.createFolder(location, name, path, opts) - .. todo:: + Creates a new folder ``name`` on ``location``. If ``path`` is provided and not empty the folder + will be created as a new child of it. - Also needs API documentation. + **Example:** + .. code-block:: javascript + + // creates new folder "folder" in the root of "local" + OctoPrint.files.createFolder("local", "folder"); + + // creates new folder "subfolder" in parent "some/existing/folder" on "local" + OctoPrint.files.createFolder("local", "subfolder", "some/existing/folder"); + + See :ref:`Upload file or create folder ` for more details on the folder creation API. + + :param string location: The location to create the folder on (currently only "local" is supported) + :param string name: The name of the new folder + :param string path: The path to the parent folder in which to create the new folder. May be left unset in which + case the folder will be created in the root directory of ``location``. :param object opts: Additional options for the request :returns Promise: A `jQuery Promise `_ for the request's response @@ -155,12 +192,12 @@ An optional object or a serialized JSON string of additional user supplised data to associate with the uploaded file. - See :ref:`Upload file ` for more details on the file upload API and + See :ref:`Upload file or create folder ` for more details on the file upload API and :js:func:`OctoPrint.upload` for more details on the underlying library upload mechanism, including what values are accepted for the ``file`` parameter. :param string location: The location to upload the file to - :param object or string file: The file to upload, either a + :param object or string file: The file to upload, see :js:func:`OctoPrint.upload` for more details :returns Promise: A `jQuery Promise `_ for the request's response .. js:function:: OctoPrint.files.download(location, path, opts) diff --git a/docs/jsclientlib/index.rst b/docs/jsclientlib/index.rst index 00af3f37..305b9bcb 100644 --- a/docs/jsclientlib/index.rst +++ b/docs/jsclientlib/index.rst @@ -16,3 +16,12 @@ JavaScript Client Library languages.rst logs.rst printer.rst + printerprofiles.rst + settings.rst + slicing.rst + socket.rst + system.rst + timelapse.rst + users.rst + util.rst + wizard.rst diff --git a/docs/jsclientlib/job.rst b/docs/jsclientlib/job.rst index f082c68c..3dd37323 100644 --- a/docs/jsclientlib/job.rst +++ b/docs/jsclientlib/job.rst @@ -7,12 +7,29 @@ Retrieves information about the current job. + See :ref:`Retrieve information about the current job ` for details. + + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response + .. js:function:: OctoPrint.job.start(opts) + Starts the current job. + + See :ref:`Issue a job command ` for details. + + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response + .. js:function:: OctoPrint.job.cancel(opts) Cancels the current job. + See :ref:`Issue a job command ` for details. + + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response + .. js:function:: OctoPrint.job.restart(opts) Restarts the current job. This is equivalent to cancelling and immediately restarting @@ -31,15 +48,35 @@ OctoPrint.job.start(); }); + See :ref:`Issue a job command ` for details. + + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response + .. js:function:: OctoPrint.job.pause(opts) Pauses the current job if it's running, does nothing if it's already paused. + See :ref:`Issue a job command ` for details. + + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response + .. js:function:: OctoPrint.job.resume(opts) Resumes the current job if it's currently pause, does nothing if it's running. + See :ref:`Issue a job command ` for details. + + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response + .. js:function:: OctoPrint.job.togglePause(opts) - Resumes a paused job and pauses a running a print. + Resumes a paused and pauses a running job. + + See :ref:`Issue a job command ` for details. + + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response diff --git a/docs/jsclientlib/languages.rst b/docs/jsclientlib/languages.rst index fa42e9b5..dff94504 100644 --- a/docs/jsclientlib/languages.rst +++ b/docs/jsclientlib/languages.rst @@ -5,6 +5,12 @@ .. js:function:: OctoPrint.languages.list(opts) + Retrieves a list of available language packs. + .. js:function:: OctoPrint.languages.upload(file) + Uploads a language pack. + .. js:function:: OctoPrint.languages.delete(locale, pack, opts) + + Deletes the language pack ``pack`` for the specified locale ``locale``. diff --git a/docs/jsclientlib/logs.rst b/docs/jsclientlib/logs.rst index 7633333b..6aeab66b 100644 --- a/docs/jsclientlib/logs.rst +++ b/docs/jsclientlib/logs.rst @@ -3,8 +3,37 @@ :mod:`OctoPrint.logs` --------------------- +.. note:: + + All methods here require that the used API token or a the existing browser session + has admin rights. + .. js:function:: OctoPrint.logs.list(opts) -.. js:function:: OctoPrint.logs.delete(opts) + Retrieves a list of log files. + + See :ref:`Retrieve a list of available log files ` for details. + + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response + +.. js:function:: OctoPrint.logs.delete(path, opts) + + Deletes the specified log ``path``. + + See :ref:`Delete a specific log file ` for details. + + :param string path: The path to the log file to delete + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response + +.. js:function:: OctoPrint.logs.download(path, opts) + + Downloads the specified log ``file``. + + See :js:func:`OctoPrint.download` for more details on the underlying library download mechanism. + + :param string path: The path to the log file to download + :param object opts: Additional options for the request + :returns Promise: A `jQuery Promise `_ for the request's response -.. js:function:: OctoPrint.logs.download(file, opts) diff --git a/docs/jsclientlib/printerprofiles.rst b/docs/jsclientlib/printerprofiles.rst new file mode 100644 index 00000000..39fb04ec --- /dev/null +++ b/docs/jsclientlib/printerprofiles.rst @@ -0,0 +1,18 @@ +.. sec-jsclientlib-printerprofiles: + +:mod:`OctoPrint.printerprofiles` +-------------------------------- + +.. todo:: + + Needs to be documented + +.. js:function:: OctoPrint.printerprofiles.list(opts) + +.. js:function:: OctoPrint.printerprofiles.get(id, opts) + +.. js:function:: OctoPrint.printerprofiles.add(profile, additional, opts) + +.. js:function:: OctoPrint.printerprofiles.update(id, profile, additional, opts) + +.. js:function:: OctoPrint.printerprofiles.delete(id, opts) diff --git a/docs/jsclientlib/settings.rst b/docs/jsclientlib/settings.rst new file mode 100644 index 00000000..da9a52ec --- /dev/null +++ b/docs/jsclientlib/settings.rst @@ -0,0 +1,16 @@ +.. sec-jsclientlib-settings: + +:mod:`OctoPrint.settings` +------------------------- + +.. todo:: + + Needs to be documented + +.. js:function:: OctoPrint.settings.get(opts) + +.. js:function:: OctoPrint.settings.save(settings, opts) + +.. js:function:: OctoPrint.settings.getPluginSettings(plugin, opts) + +.. js:function:: OctoPrint.settings.savePluginSettings(plugin, settings, opts) diff --git a/docs/jsclientlib/slicing.rst b/docs/jsclientlib/slicing.rst new file mode 100644 index 00000000..bbe1bd25 --- /dev/null +++ b/docs/jsclientlib/slicing.rst @@ -0,0 +1,20 @@ +.. sec-jsclientlib-slicing: + +:mod:`OctoPrint.slicing` +------------------------ + +.. todo:: + + Needs to be documented + +.. js:function:: OctoPrint.slicing.listAllSlicersAndProfiles(opts) + +.. js:function:: OctoPrint.slicing.listProfilesForSlicer(slicer, opts) + +.. js:function:: OctoPrint.slicing.getProfileForSlicer(slicer, profileId, opts) + +.. js:function:: OctoPrint.slicing.addProfileForSlicer(slicer, profileId, profile, opts) + +.. js:function:: OctoPrint.slicing.updateProfileForSlicer(slicer, profileId, profile, opts) + +.. js:function:: OctoPrint.slicing.deleteProfileForSlicer(slicer, profileId, opts) diff --git a/docs/jsclientlib/socket.rst b/docs/jsclientlib/socket.rst new file mode 100644 index 00000000..21c32d4c --- /dev/null +++ b/docs/jsclientlib/socket.rst @@ -0,0 +1,114 @@ +.. sec-jsclientlib-socket: + +:mod:`OctoPrint.socket` +----------------------- + +.. js:data:: OctoPrint.socket.options + + The socket client's options. + + ``OctoPrint.socket.options.timeouts`` + A list of consecutive timeouts after which to attempt reconnecting to a + disconnected sockets, in seconds. Defaults to ``[1, 1, 2, 3, 5, 8, 13, 20, 40, 100]``. + The default setting here makes the client slowly back off after the first couple of very + fast connection attempts don't succeed, and give up after 10 tries. + + ``OctoPrint.socket.options.rateSlidingWindowSize`` + Number of last rate measurements to take into account for timing analysis and + communication throttling. See :ref:`Communication Throttling ` + below. + +.. js:function:: OctoPrint.socket.connect(opts) + + Connects the socket client to OctoPrint's `SockJS `_ socket. + + The optional parameter ``opts`` may be used to provide additional configuration options + to the SockJS constructor. See the `SockJS documentation `_ on potential options. + + :param object opts: Additional options for the SockJS constructor. + +.. js:function:: OctoPrint.socket.reconnect() + + Reconnects the socket client. If the socket is currently connected it will be disconnected first. + +.. js:function:: OctoPrint.socket.disconnect() + + Disconnects the socket client. + +.. js:function:: OctoPrint.socket.onMessage(message, handler) + + Registers the ``handler`` for messages of type ``message``. + + To register for all message types, provide ``*`` as the type to register for. + + ``handler`` is expected to be a function accepting one object parameter ``eventObj``, consisting + of the received message as property ``key`` and the received payload (if any) as property ``data``. + + .. code-block:: javascript + + OctoPrint.socket.onMessage("*", function(message) { + // do something with the message object + }); + + The socket client will measure how long message processing over all handlers will take and utilize + that measurement to determine if the :ref:`communication throttling ` + needs to be adjusted or not. + + Please refer to the :ref:`Push API documentation ` + for details on the possible message types and their payloads. + + :param string message: The type of message for which to register + :param function handler: The handler function + +.. js:function:: OctoPrint.socket.sendMessage(type, payload) + + 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 + also the :ref:`Push API documentation `. + + :param string type: Type of message to send + :param object payload: Payload to send + +.. js:function:: OctoPrint.socket.onRateTooLow(measured, minimum) + + Called by the socket client when the measured message round trip times have been lower than + the current lower processing limit over the full sliding window, indicating that messages + are now processed faster than the current rate and a faster rate might be possible. + + Can be overwritten with custom handler methods. The default implementation will call + :js:func:`OctoPrint.socket.increaseRate`. + + :param Number measured: Maximal measured message round trip time + :param Number minimum: Lower round trip time limit for keeping the rate + +.. js:function:: OctoPrint.socket.onRateTooHigh(measured, maximum) + + Called by the socket client when the last measured round trip time was higher than the + current upper procesisng limit, indicating that the messages are now processed slower than + the current rate requires and a slower rate might be necessary. + + Can be overwritten with custom handler methods. The default implementation will call + :js:func:`OctoPrint.socket.decreaseRate`. + + :param Number measured: Measured message round trip time + :param Number minimum: Upper round trip time limit for keeping the rate + +.. js:function:: OctoPrint.socket.increaseRate() + + Instructs the server to increase the message rate by 500ms. + +.. js:function:: OctoPrint.socket.decreaseRate() + + Instructs the server to decrease the message rate by 500ms. + +.. sec-jsclient-socket-throttling: + +Communication Throttling +======================== + +The socket client supports communication throttling. It will measure how long each incoming message takes +to be processed by all registered handlers. If the processing times in a sliding window are longer than +the current rate limit configured on the socket (default: 500ms between messages), the socket client will +instruct the server to send slower. If the messages are handled faster than half the current rate limit, +the socket client will instruct the server to send faster. diff --git a/docs/jsclientlib/system.rst b/docs/jsclientlib/system.rst new file mode 100644 index 00000000..8d3e6a78 --- /dev/null +++ b/docs/jsclientlib/system.rst @@ -0,0 +1,14 @@ +.. sec-jsclientlib-system: + +:mod:`OctoPrint.system` +----------------------- + +.. todo:: + + Needs to be documented + +.. js:function:: OctoPrint.system.getCommands(opts) + +.. js:function:: OctoPrint.system.getCommandsForSource(source, opts) + +.. js:function:: OctoPrint.system.executeCommand(source, action, opts) diff --git a/docs/jsclientlib/timelapse.rst b/docs/jsclientlib/timelapse.rst new file mode 100644 index 00000000..8862f66e --- /dev/null +++ b/docs/jsclientlib/timelapse.rst @@ -0,0 +1,24 @@ +.. sec-jsclientlib-timelapse: + +:mod:`OctoPrint.timelapse` +-------------------------- + +.. todo:: + + Needs to be documented + +.. js:function:: OctoPrint.timelapse.get(opts) + +.. js:function:: OctoPrint.timelapse.list(opts) + +.. js:function:: OctoPrint.download(filename, opts) + +.. js:function:: OctoPrint.delete(filename, opts) + +.. js:function:: OctoPrint.deleteUnrendered(name, opts) + +.. js:function:: OctoPrint.renderUnrendered(name, opts) + +.. js:function:: getConfig(opts) + +.. js:function:: saveConfig(config, opts) diff --git a/docs/jsclientlib/users.rst b/docs/jsclientlib/users.rst new file mode 100644 index 00000000..3b06440c --- /dev/null +++ b/docs/jsclientlib/users.rst @@ -0,0 +1,28 @@ +.. sec-jsclientlib-users: + +:mod:`OctoPrint.users` +---------------------- + +.. todo:: + + Needs to be documented + +.. js:function:: OctoPrint.users.list(opts) + +.. js:function:: OctoPrint.users.get(name, opts) + +.. js:function:: OctoPrint.users.add(user, opts) + +.. js:function:: OctoPrint.users.update(name, active, admin, opts) + +.. js:function:: OctoPrint.users.delete(name, opts) + +.. js:function:: OctoPrint.users.changePassword(name, password, opts) + +.. js:function:: OctoPrint.users.generateApiKey(name, opts) + +.. js:function:: OctoPrint.users.resetApiKey(name, opts) + +.. js:function:: OctoPrint.users.getSettings(name, opts) + +.. js:function:: OctoPrint.users.saveSettings(name, settings, opts) diff --git a/docs/jsclientlib/util.rst b/docs/jsclientlib/util.rst new file mode 100644 index 00000000..9f9d91b4 --- /dev/null +++ b/docs/jsclientlib/util.rst @@ -0,0 +1,16 @@ +.. sec-jsclientlib-util: + +:mod:`OctoPrint.util` +--------------------- + +.. todo:: + + Needs to be documented + +.. js:function:: OctoPrint.util.test(command, data, opts) + +.. js:function:: OctoPrint.util.testPath(path, additional, opts) + +.. js:function:: OctoPrint.util.testExecutable(path, additional, opts) + +.. js:function:: OctoPrint.util.testUrl(url, additional, opts) diff --git a/docs/jsclientlib/wizard.rst b/docs/jsclientlib/wizard.rst new file mode 100644 index 00000000..d6398c9f --- /dev/null +++ b/docs/jsclientlib/wizard.rst @@ -0,0 +1,12 @@ +.. sec-jsclientlib-wizard: + +:mod:`OctoPrint.wizard` +----------------------- + +.. todo:: + + Needs to be documented + +.. js:function:: OctoPrint.wizard.get(opts) + +.. js:function:: OctoPrint.wizard.finish(handled, opts) diff --git a/src/octoprint/static/js/app/client/socket.js b/src/octoprint/static/js/app/client/socket.js index 43f3aafc..253e05c5 100644 --- a/src/octoprint/static/js/app/client/socket.js +++ b/src/octoprint/static/js/app/client/socket.js @@ -64,7 +64,7 @@ var catchAllHandlers = registeredHandlers["*"]; if (catchAllHandlers && catchAllHandlers.length) { _.each(catchAllHandlers, function(handler) { - handler({event: eventObj}) + handler(eventObj); }); }