Commit graph

21 commits

Author SHA1 Message Date
Peter Backx
a0df4e78b5 Fixing Sphinx warnings during doc generation 2017-11-03 11:11:52 +01:00
Gina Häußge
9c3d7bbbc3 New server subcommand on test API
Tests if a host/port combination is reachable via server_reachable.
2017-10-18 17:11:22 +02:00
Daniele Forsi
69dec6e83f Fix typos in strings and comments
Those typos were found with codespell which is available from
https://github.com/lucasdemarchi/codespell.git
2017-07-29 16:12:08 +02:00
Gina Häußge
3e5923b21e Consolidate API Key handling
System wide API key now offers a generate button like the user
API keys. Setting the API key directly to a value via the settings API
endpoint is now no longer possible, which should prevent setting it
accidentally thanks to the browser prefilling things where it shouldn't.

No delete button is offered for the system wide API key since it will
get automatically regenerated on server start if not set, so
regeneration is the only functionality here that makes sense.

If no API key is set in the user settings, the "delete" button is now
disabled. If a key is already set and a new one is to be generated, a
confirmation dialog makes sure this is really what the user wants. Same
for deleting an existing API key.

Both the system wide API key and the user specific API keys will now
only display a QRCode if there's actually a value for the key.
2017-03-13 17:09:56 +01:00
Gina Häußge
eaadf8743b Allow multiple instances of the JS client
We now have a global OctoPrintClient, which is the class from which
all clients are derived, and a global OctoPrint, which is a single
instance already setup and ready to use in case we only need one.

It would be cleaner to have clients create that singular instance
themselves, but we need to maintain backward compatibility for now
with how we established the client to work with the 1.3.0 release.

New clients can be create with

    client = new OctoPrintClient({ /* options */ });

Alternatively the options can be left out and set at a later point:

    client = new OctoPrintClient();
    /* ... */
    client.options = { /* options */ };

Individual client components register themselves with OctoPrintClient
via OctoPrintClient.registerComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.<name>",
 e.g. "OctoPrint.files".

Plugin components register themselves with OctoPrintClient via
OctoPrintClient.registerPluginComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.plugins
.<name>", e.g. "OctoPrint.plugins.softwareupdate".

This should make it possible to create dashboard pages utilizing the
JS client that monitor the status of multiple OctoPrint instances,
without workarounds such as having to swap out the options globally
before each request.

See #1681 for the corresponding discussion.
2017-01-26 14:59:56 +01:00
Gina Häußge
558a8957f9 Fix docs for OctoPrint.upload method 2016-12-07 10:59:16 +01:00
Gina Häußge
65377b396f Added note that jquery and lodash are dependencies of the js client lib 2016-11-28 11:29:17 +01:00
Gina Häußge
0d13c3b439 Add OctoPrint.options.locale and if set send X-Locale header on requests
See #1593
2016-11-18 07:56:49 +01:00
Gina Häußge
20d15b2abb Documented usage of js client lib 2016-10-18 11:26:17 +02:00
Gina Häußge
82ae52e619 More docs & client fixes 2016-09-28 12:53:43 +02:00
Gina Häußge
4e69b260a1 Docs for user API
Also some fixes on said API and some fixes in the docs
2016-09-28 11:18:43 +02:00
Gina Häußge
82ae3f6f6e Re-added two utility methods removed in d9e3553c7c
They are still useful for other clients than the core application. Renamed them to fit the
general naming on the API however:

  * pathForElement is now called pathForEntry
  * elementByPath is now called entryForPath
2016-09-28 10:21:27 +02:00
Gina Häußge
0b551f6b7e Some more documentation 2016-09-22 22:21:52 +02:00
Gina Häußge
8e8853c9c3 Lots of documentation updates + some related code fixes 2016-09-22 16:27:06 +02:00
Gina Häußge
a13e12bb5e More work on JS Client documentation 2016-08-26 17:47:38 +02:00
Gina Häußge
52d272bd24 More work on the docs 2016-07-01 17:52:40 +02:00
Gina Häußge
cec2f7d917 WIP: More work on the documentation of the js client lib 2016-06-30 12:06:08 +02:00
Gina Häußge
b8405becb3 Fixed a typo 2016-06-29 09:41:53 +02:00
Gina Häußge
ca8bbe2de4 JS Client docs for OctoPrint.connection 2016-06-29 09:28:55 +02:00
Gina Häußge
5611f87339 Docs for JS client lib's base module 2016-06-28 19:22:31 +02:00
Gina Häußge
6016b04d03 WIP: Started on JS Client docs 2016-06-15 09:47:32 +02:00