Compare commits

..
Author SHA1 Message Date
GitHub Nightly Merge Action 7fe43d38c8 Merge branch 'maintenance' into devel 2024-01-12 00:12:23 +00:00
Gina Häußge cd3b24e3e4 🐛 Keep graph updating even if disconnected
Otherwise the timeline will "lie" ("now" vs "20min ago")

See comment in #4921
2024-01-11 11:28:02 +01:00
GitHub Nightly Merge Action 73d944ba68 Merge branch 'maintenance' into devel 2024-01-11 00:12:36 +00:00
Gina Häußge a0c8c9f84f ✨ Add temperature chart markings for connect/disconnect
Implements #4921
2024-01-10 12:37:55 +01:00
ee4a4b1c92 ♿️ Add dashed lines for target temperatures (#4918)
* Previously only colour determined Target vs Actual temperatures, this wasn't
great at a glance for colourblind people; making the target dashes makes this
clearer.

* 📄 Add license info for flot plugins

---------

Co-authored-by: Rob Emery <git@mintsoft.net>
Co-authored-by: Gina Häußge <gina@octoprint.org>
2024-01-10 10:59:45 +01:00
GitHub Nightly Merge Action b324da152b Merge branch 'maintenance' into devel 2024-01-09 00:12:56 +00:00
Gina Häußge 0a3e19a342 ✨ virtual: Implement basic M524 support 2024-01-08 17:01:07 +01:00
Gina Häußge 3e94574a9b 🐛 virtual: remove wrong assertion
Was actually wrong to have that here, but thankfully it was
implemented wrong as well, and here two wrongs made
one right.

To match existing firmware out there, we should be sending
SD status auto reports with progress information whenever
a print from a selected SD file has been started. If a such a print
is cancelled via OctoPrint, all we can do is send an M25 to pause
it and just never resume it. That means that the SD status will
continue to report the current file position.

See #4924
2024-01-08 15:03:07 +01:00
Gina Häußge aa02750458 🐛 Make sure to sort folder list
Closes #4922
2024-01-08 11:05:09 +01:00
GitHub Nightly Merge Action 4040c4fd8a Merge branch 'maintenance' into devel 2023-12-14 00:12:10 +00:00
Gina Häußge a2e5558165 🔥 Achievements: Get rid of some debug code 2023-12-13 09:31:17 +01:00
GitHub Nightly Merge Action 57b18a3427 Merge branch 'maintenance' into devel 2023-12-13 00:12:16 +00:00
GitHub Nightly Merge Action 80e637de8c Merge branch 'maintenance' into devel 2023-12-12 00:12:41 +00:00
GitHub Nightly Merge Action fc5d2cb5d9 Merge branch 'maintenance' into devel 2023-12-07 00:12:22 +00:00
GitHub Nightly Merge Action 01e9bc959a Merge branch 'maintenance' into devel 2023-12-06 00:12:29 +00:00
GitHub Nightly Merge Action 02939367da Merge branch 'maintenance' into devel 2023-12-05 00:12:36 +00:00
GitHub Nightly Merge Action 8082c11571 Merge branch 'maintenance' into devel 2023-12-01 00:13:39 +00:00
GitHub Nightly Merge Action 38ae0c9ac5 Merge branch 'maintenance' into devel 2023-11-29 00:12:24 +00:00
GitHub Nightly Merge Action 1763f31bda Merge branch 'maintenance' into devel 2023-11-28 00:12:32 +00:00
GitHub Nightly Merge Action 12a6f8ec42 Merge branch 'maintenance' into devel 2023-11-24 00:11:42 +00:00
GitHub Nightly Merge Action 5e9f0caa75 Merge branch 'maintenance' into devel 2023-11-23 00:12:12 +00:00
GitHub Nightly Merge Action 8c8442055e Merge branch 'maintenance' into devel 2023-11-22 00:12:34 +00:00
GitHub Nightly Merge Action 17b371c4a0 Merge branch 'maintenance' into devel 2023-11-21 00:12:20 +00:00
GitHub Nightly Merge Action 1b9a4fb8a6 Merge branch 'maintenance' into devel 2023-10-28 00:11:10 +00:00
Gina Häußge 8a9a541862 Merge branch 'maintenance' into devel 2023-10-24 15:59:15 +02:00
GitHub Nightly Merge Action 159df4c3f7 Merge branch 'maintenance' into devel 2023-10-13 00:11:51 +00:00
Gina Häußge 5f38635843 Merge branch 'maintenance' into devel 2023-10-09 17:20:18 +02:00
GitHub Nightly Merge Action 5e40b5106b Merge branch 'maintenance' into devel 2023-10-05 00:11:57 +00:00
GitHub Nightly Merge Action 445d2dc600 Merge branch 'maintenance' into devel 2023-09-07 00:11:07 +00:00
GitHub Nightly Merge Action c5db904012 Merge branch 'maintenance' into devel 2023-09-06 00:11:07 +00:00
GitHub Nightly Merge Action b83c978579 Merge branch 'maintenance' into devel 2023-09-01 00:12:04 +00:00
GitHub Nightly Merge Action 27021b5255 Merge branch 'maintenance' into devel 2023-08-31 00:11:09 +00:00
GitHub Nightly Merge Action 261f06c34e Merge branch 'maintenance' into devel 2023-08-29 00:11:13 +00:00
GitHub Nightly Merge Action b2e37cd73e Merge branch 'maintenance' into devel 2023-08-11 00:10:42 +00:00
GitHub Nightly Merge Action 87d6ddb7ee Merge branch 'maintenance' into devel 2023-08-08 00:13:01 +00:00
GitHub Nightly Merge Action 38af40a212 Merge branch 'maintenance' into devel 2023-08-01 00:14:50 +00:00
GitHub Nightly Merge Action 403b4ed51b Merge branch 'maintenance' into devel 2023-07-19 00:24:14 +00:00
Gina Häußge 85b1442c53 Merge branch 'maintenance' into devel 2023-07-18 13:26:07 +02:00
GitHub Nightly Merge Action b827d87e73 Merge branch 'maintenance' into devel 2023-07-06 00:15:04 +00:00
GitHub Nightly Merge Action 3f9d1e3867 Merge branch 'maintenance' into devel 2023-07-04 00:15:51 +00:00
GitHub Nightly Merge Action 4c47329b6d Merge branch 'maintenance' into devel 2023-06-30 00:13:21 +00:00
GitHub Nightly Merge Action 913ef0bbf5 Merge branch 'maintenance' into devel 2023-06-28 00:14:34 +00:00
Gina Häußge bb8a7d6ec3 Merge branch 'maintenance' into devel 2023-06-27 10:24:08 +02:00
GitHub Nightly Merge Action 9719054888 Merge branch 'maintenance' into devel 2023-06-27 00:14:44 +00:00
GitHub Nightly Merge Action b1793d19e8 Merge branch 'maintenance' into devel 2023-06-23 00:15:23 +00:00
GitHub Nightly Merge Action 5ee83611b0 Merge branch 'maintenance' into devel 2023-06-21 00:12:50 +00:00
GitHub Nightly Merge Action 5c7e9e42fb Merge branch 'maintenance' into devel 2023-06-20 00:11:35 +00:00
GitHub Nightly Merge Action 59b17eb380 Merge branch 'maintenance' into devel 2023-06-15 00:12:40 +00:00
GitHub Nightly Merge Action 7af6be5253 Merge branch 'maintenance' into devel 2023-06-08 00:13:12 +00:00
GitHub Nightly Merge Action 938a74003b Merge branch 'maintenance' into devel 2023-06-07 00:12:57 +00:00
GitHub Nightly Merge Action b150cb07ed Merge branch 'maintenance' into devel 2023-06-06 00:20:14 +00:00
GitHub Nightly Merge Action a94061a10c Merge branch 'maintenance' into devel 2023-05-23 00:12:16 +00:00
GitHub Nightly Merge Action 354d07883f Merge branch 'maintenance' into devel 2023-05-16 00:12:03 +00:00
Gina Häußge 6c5f288995 Merge branch 'maintenance' into devel 2023-05-08 16:17:24 +02:00
GitHub Nightly Merge Action f3b5f35c1c Merge branch 'maintenance' into devel 2023-04-26 00:11:49 +00:00
Gina Häußge a1e2904530 Merge branch 'maintenance' into devel 2023-04-13 16:25:13 +02:00
Gina Häußge a768f4cafe Merge branch 'maintenance' into devel 2023-04-12 16:06:11 +02:00
GitHub Nightly Merge Action d8dd36302b Merge branch 'maintenance' into devel 2023-03-30 00:12:41 +00:00
Gina Häußge 10516511ef Merge branch 'maintenance' into devel 2023-03-23 09:49:37 +01:00
Gina Häußge 6638e9aebf Merge branch 'maintenance' into devel 2023-03-23 09:47:14 +01:00
Gina Häußge c1570d088b Merge branch 'maintenance' into devel 2023-03-07 14:10:28 +01:00
GitHub Nightly Merge Action 650d2b5489 Merge branch 'maintenance' into devel 2023-03-07 00:14:22 +00:00
GitHub Nightly Merge Action f89e10a561 Merge branch 'maintenance' into devel 2023-03-03 01:52:54 +00:00
Gina Häußge 4febdd6800 Merge branch 'maintenance' into devel 2023-03-02 17:18:51 +01:00
Gina Häußge 2ba74a1117 ⬆️ Upgrade loglevel version 2023-02-27 12:09:35 +01:00
Gina Häußge 5118088ad6 🔊 Improve JS error reporting in Firefox
It turns out the issues we had with the less helpful
JS error output under Firefox was simply due to
the error message not being included in the
stack trace, vs Chrome where it is.

Solved this by always including the message.
2023-02-27 12:06:29 +01:00
Gina Häußge 628df9e8cd Merge branch 'maintenance' into devel 2023-02-23 16:06:57 +01:00
GitHub Nightly Merge Action eb336bce31 Merge branch 'maintenance' into devel 2023-02-21 00:13:33 +00:00
GitHub Nightly Merge Action c3c555330c Merge branch 'maintenance' into devel 2023-02-19 00:14:13 +00:00
Gina Häußge bba932242f Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2023-02-16 10:28:40 +01:00
Gina Häußge 894985ef8f Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2023-02-13 11:09:01 +01:00
Gina Häußge ae62e85f0d Merge branch 'maintenance' into devel 2023-02-13 11:08:54 +01:00
GitHub Nightly Merge Action f75f763538 Merge branch 'maintenance' into devel 2023-02-09 01:04:40 +00:00
GitHub Nightly Merge Action daf5881962 Merge branch 'maintenance' into devel 2023-02-07 01:04:19 +00:00
GitHub Nightly Merge Action ffa6e978a4 Merge branch 'maintenance' into devel 2023-02-03 00:12:56 +00:00
GitHub Nightly Merge Action 8879a0eb04 Merge branch 'maintenance' into devel 2023-02-02 00:13:00 +00:00
GitHub Nightly Merge Action 4b11098eef Merge branch 'maintenance' into devel 2023-02-01 00:14:02 +00:00
GitHub Nightly Merge Action eba158d53d Merge branch 'maintenance' into devel 2023-01-28 00:12:02 +00:00
Gina Häußge 63ec0d5bca Merge branch 'maintenance' into devel 2023-01-26 09:23:25 +01:00
GitHub Nightly Merge Action 6cbd1df8e0 Merge branch 'maintenance' into devel 2023-01-18 00:12:58 +00:00
GitHub Nightly Merge Action 0ed259e1a8 Merge branch 'maintenance' into devel 2023-01-17 00:12:48 +00:00
GitHub Nightly Merge Action fa750bf971 Merge branch 'maintenance' into devel 2022-12-20 00:12:12 +00:00
GitHub Nightly Merge Action 67b075836a Merge branch 'maintenance' into devel 2022-12-13 00:13:09 +00:00
GitHub Nightly Merge Action a2fb012067 Merge branch 'maintenance' into devel 2022-11-18 00:15:40 +00:00
GitHub Nightly Merge Action 118e6f762e Merge branch 'maintenance' into devel 2022-11-17 00:14:59 +00:00
Gina Häußge 9a153bf133 Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2022-11-16 14:52:45 +01:00
Gina Häußge a8e9105769 Merge branch 'maintenance' into devel 2022-11-16 14:51:40 +01:00
Gina Häußge 7f11c4c769 Merge branch 'maintenance' into devel 2022-11-03 18:42:08 +01:00
GitHub Nightly Merge Action 659f08ce71 Merge branch 'maintenance' into devel 2022-10-27 00:15:50 +00:00
Gina Häußge f993ab05af Merge branch 'maintenance' into devel 2022-10-26 10:41:22 +02:00
Gina Häußge cdde1bbc07 Merge branch 'staging/bugfix' into devel 2022-10-18 11:45:16 +02:00
GitHub Nightly Merge Action 6fd26a5b75 Merge branch 'maintenance' into devel 2022-10-18 00:20:35 +00:00
Gina Häußge 26ad4f7269 Merge branch 'maintenance' into devel 2022-10-17 17:18:46 +02:00
GitHub Nightly Merge Action c1a2c0ef7a Merge branch 'maintenance' into devel 2022-10-14 00:20:54 +00:00
GitHub Nightly Merge Action a9d0856b3d Merge branch 'maintenance' into devel 2022-10-05 00:20:11 +00:00
GitHub Nightly Merge Action 7bc15efc13 Merge branch 'maintenance' into devel 2022-09-29 00:22:06 +00:00
Gina Häußge c33f8c2d08 Merge branch 'maintenance' into devel 2022-09-27 17:52:49 +02:00
GitHub Nightly Merge Action c76fee7804 Merge branch 'maintenance' into devel 2022-09-27 00:21:02 +00:00
GitHub Nightly Merge Action 5ad1ae91a0 Merge branch 'maintenance' into devel 2022-09-22 00:16:11 +00:00
Gina Häußge 952946c3ee Merge branch 'maintenance' into devel 2022-09-20 14:55:30 +02:00
GitHub Nightly Merge Action e8cbe8396c Merge branch 'maintenance' into devel 2022-09-08 00:16:55 +00:00
GitHub Nightly Merge Action 7510a20d0f Merge branch 'maintenance' into devel 2022-08-24 00:14:24 +00:00
GitHub Nightly Merge Action 1b9c92bbc5 Merge branch 'maintenance' into devel 2022-08-23 00:16:05 +00:00
GitHub Nightly Merge Action 20c60d6c1a Merge branch 'maintenance' into devel 2022-08-19 00:14:56 +00:00
GitHub Nightly Merge Action 801be9c77d Merge branch 'maintenance' into devel 2022-08-17 00:13:16 +00:00
GitHub Nightly Merge Action 2712412c66 Merge branch 'maintenance' into devel 2022-08-16 00:15:27 +00:00
GitHub Nightly Merge Action ac61ed6bb7 Merge branch 'maintenance' into devel 2022-08-13 00:14:15 +00:00
GitHub Nightly Merge Action 8bf68fae87 Merge branch 'maintenance' into devel 2022-08-12 00:12:29 +00:00
Gina Häußge d837648b9a Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2022-08-09 15:03:48 +02:00
Gina Häußge c7d9a4b7b5 Merge branch 'maintenance' into devel 2022-08-09 15:03:28 +02:00
GitHub Nightly Merge Action 4ae5ef037c Merge branch 'maintenance' into devel 2022-08-03 00:14:19 +00:00
Gina Häußge e524da88d6 Merge branch 'maintenance' into devel 2022-08-02 15:43:35 +02:00
GitHub Nightly Merge Action 378839891e Merge branch 'maintenance' into devel 2022-07-19 00:15:18 +00:00
GitHub Nightly Merge Action 1056e454bd Merge branch 'maintenance' into devel 2022-07-13 00:14:56 +00:00
GitHub Nightly Merge Action 8a7cc67e11 Merge branch 'maintenance' into devel 2022-06-30 00:13:08 +00:00
GitHub Nightly Merge Action 0f42545db0 Merge branch 'maintenance' into devel 2022-06-29 00:11:52 +00:00
GitHub Nightly Merge Action eb26009782 Merge branch 'maintenance' into devel 2022-06-28 00:15:19 +00:00
GitHub Nightly Merge Action 22d42d4864 Merge branch 'maintenance' into devel 2022-06-24 00:11:58 +00:00
GitHub Nightly Merge Action f36c773291 Merge branch 'maintenance' into devel 2022-06-22 00:14:36 +00:00
GitHub Nightly Merge Action 655df5937a Merge branch 'maintenance' into devel 2022-06-21 00:12:14 +00:00
Gina Häußge 294140d938 🔥 Get rid of global API key leftovers
Also get rid of static apps key configuration. That has
long been replaced by the bundled appkeys plugin.
2022-06-13 12:00:49 +02:00
Gina Häußge d281b17d67 Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2022-06-13 11:46:46 +02:00
Gina Häußge 0e5b1ec1d3 Merge branch 'maintenance' into devel 2022-06-13 11:46:03 +02:00
GitHub Nightly Merge Action 026ea53145 Merge branch 'maintenance' into devel 2022-06-09 00:12:01 +00:00
GitHub Nightly Merge Action df37e6296d Merge branch 'maintenance' into devel 2022-06-08 00:11:10 +00:00
GitHub Nightly Merge Action 49bc29fca3 Merge branch 'maintenance' into devel 2022-06-01 00:14:31 +00:00
GitHub Nightly Merge Action 4d12707f07 Merge branch 'maintenance' into devel 2022-05-30 13:00:11 +00:00
GitHub Nightly Merge Action fe1db28bdf Merge branch 'maintenance' into devel 2022-05-26 00:13:33 +00:00
Gina Häußge 06db48c560 Merge branch 'maintenance' into devel 2022-05-24 12:24:27 +02:00
Gina Häußge 32bc6f84ca Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2022-05-17 13:42:33 +02:00
Gina Häußge 938149b65e Merge branch 'maintenance' into devel 2022-05-17 13:42:29 +02:00
GitHub Nightly Merge Action 26f032a5b6 Merge branch 'maintenance' into devel 2022-05-12 00:13:39 +00:00
GitHub Nightly Merge Action 0fd1f53230 Merge branch 'maintenance' into devel 2022-05-04 09:29:18 +00:00
Gina Häußge 5cdfc14cb6 Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2022-04-12 16:22:28 +02:00
Gina Häußge 23a186ebe8 Merge branch 'maintenance' into devel 2022-04-12 16:22:21 +02:00
GitHub Nightly Merge Action 71116c3641 Merge branch 'maintenance' into devel 2022-04-08 00:11:43 +00:00
GitHub Nightly Merge Action 04bc60bd8a Merge branch 'maintenance' into devel 2022-04-07 00:13:03 +00:00
Gina Häußge 385a7b6bc8 Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2022-04-05 14:50:27 +02:00
Gina Häußge c0c9bf0ea5 Merge branch 'maintenance' into devel 2022-04-05 14:50:10 +02:00
GitHub Nightly Merge Action 977e30c174 Merge branch 'maintenance' into devel 2022-03-31 01:00:52 +00:00
Gina Häußge e552ca9f97 Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2022-03-29 14:06:56 +02:00
Gina Häußge 33dbf409b6 Merge branch 'maintenance' into devel 2022-03-29 14:06:45 +02:00
GitHub Nightly Merge Action 94903b4a75 Merge branch 'maintenance' into devel 2022-03-24 00:10:03 +00:00
GitHub Nightly Merge Action ac28eadf03 Merge branch 'maintenance' into devel 2022-03-17 00:10:19 +00:00
Gina Häußge fc1c4da261 Merge branch 'maintenance' into devel 2022-03-16 11:53:58 +01:00
Gina Häußge 35a86650fc Merge branch 'maintenance' into devel 2022-03-14 12:30:58 +01:00
GitHub Nightly Merge Action 145482d581 Merge branch 'maintenance' into devel 2022-03-11 00:12:18 +00:00
GitHub Nightly Merge Action e711ffd4c0 Merge branch 'maintenance' into devel 2022-03-08 00:09:52 +00:00
GitHub Nightly Merge Action 30739dd375 Merge branch 'maintenance' into devel 2022-03-04 00:11:23 +00:00
GitHub Nightly Merge Action caa8962c36 Merge branch 'maintenance' into devel 2022-03-03 00:11:14 +00:00
GitHub Nightly Merge Action 21b2dde2c3 Merge branch 'maintenance' into devel 2022-03-02 00:14:55 +00:00
GitHub Nightly Merge Action 5f47af505a Merge branch 'maintenance' into devel 2022-03-01 00:11:27 +00:00
Gina Häußge e83adf3978 Merge branch 'maintenance' into devel 2022-02-28 15:16:06 +01:00
GitHub Nightly Merge Action fcc4bc7d03 Merge branch 'maintenance' into devel 2022-02-23 00:10:21 +00:00
Gina Häußge 5e7ccce736 Merge branch 'devel' of github.com:OctoPrint/OctoPrint into devel 2022-02-22 17:50:25 +01:00
Gina Häußge 581ce02504 Merge branch 'maintenance' into devel 2022-02-22 17:49:09 +01:00
GitHub Nightly Merge Action fe719623ed Merge branch 'maintenance' into devel 2022-02-19 00:09:55 +00:00
GitHub Nightly Merge Action 53995cca88 Merge branch 'maintenance' into devel 2022-02-18 00:08:24 +00:00
GitHub Nightly Merge Action 2598625805 Merge branch 'maintenance' into devel 2022-02-17 00:07:51 +00:00
GitHub Nightly Merge Action 1697287693 Merge branch 'maintenance' into devel 2022-02-16 00:08:03 +00:00
Gina Häußge 30161e98b5 Merge branch 'maintenance' into devel 2022-02-15 14:54:44 +01:00
Gina Häußge ff494fad8f Merge branch 'maintenance' into devel 2022-02-07 17:04:42 +01:00
Gina Häußge 8505a977d6 💚 Fix a unit test that got forgotten to adjust 2021-12-08 13:12:44 +01:00
Gina Häußge c28629bb40 🐛 Fix a merge error 2021-12-08 13:07:09 +01:00
Gina Häußge eb61020395 🐛 Fix blueprint registration
Forgot to commit the file
2021-12-06 17:13:47 +01:00
Gina Häußge 8153d70da7 💥 Upgrade Flask & thus Jinja to fix warnings
Also iron out a bunch of other warnings.

Heads-up: This upgrades Jinja, werkzeug and itsdangerous as well!

Jinja 3 is not fully backwards compatible to 2
due to a bug fix we so far pinned to an old
version for. It's time to stop doing that
with OctoPrint 2.0.0. Should only affect plugins that
are still trying to access variables defined in
an outer scope in an inner scope, as deemed
an unintentional behaviour in pallets/jinja#641
and removed in Jinja 2.9. It's easy to solve
by switching to using assignments, see
https://jinja.palletsprojects.com/en/3.0.x/templates/#assignments.
2021-12-06 16:41:32 +01:00
Gina Häußge 0dba51181c Merge branch 'maintenance' into devel 2021-12-06 16:25:53 +01:00
Carey Metcalfe c2842694ce ♻ Provide a content-length for streaming zip downloads (#4313)
This allows browsers and other clients to calculate download progress
and detect if the download fails (they get less data than expected).
This is most useful when downloading multiple timelapses due to their
potential size.

Also fixes an oversight where the printer's firmware wasn't being added
to `systeminfo.txt` when downloading system info.
2021-11-15 16:03:02 +01:00
Gina Häußge 43a62bf6f3 Merge branch 'maintenance' into devel 2021-11-03 10:19:08 +01:00
Gina Häußge bcea4839f6 Merge branch 'maintenance' into devel 2021-11-01 16:34:21 +01:00
Gina Häußge 54454deaf3 🎨 Post-merge pre-commit fixes 2021-10-12 18:27:18 +02:00
Gina Häußge e3df0ea934 Merge branch 'maintenance' into devel 2021-10-12 18:19:59 +02:00
Gina Häußge b3affac9e5 Merge branch 'maintenance' into devel 2021-10-11 16:31:25 +02:00
Gina Häußge 6026f066e0 🐛 Fix merge error 2021-09-13 15:47:09 +02:00
Gina Häußge 6a697e9013 Merge branch 'maintenance' into devel 2021-09-13 14:03:05 +02:00
Gina Häußge 75ec0c887e 🎨 eventmgr: Pyupgrade 2021-08-11 15:01:56 +02:00
Gina Häußge 9b0f60da05 Merge branch 'maintenance' into devel 2021-08-11 14:58:47 +02:00
Gina Häußge 3e6e7d3a6a ⬆️ Some more dependency updates 2021-08-04 16:01:54 +02:00
Gina Häußge 4156ccc08f Merge branch 'maintenance' into devel 2021-08-04 15:55:54 +02:00
Gina Häußge 28ec474ed4 🐛 Use devel branch of codemods 2021-07-13 17:06:23 +02:00
Gina Häußge 7f5700e0f9 Merge branch 'maintenance' into devel 2021-07-13 15:50:19 +02:00
Gina Häußge e41b8e3090 🔀 Fix merge issue 2021-07-02 17:01:56 +02:00
Gina Häußge 635156cf7a Merge branch 'maintenance' into devel 2021-07-02 16:32:44 +02:00
Gina Häußge cbe72cc1ec 🎨 Clean up a Py2 leftover 2021-07-02 16:18:15 +02:00
Gina Häußge b202c6db54 🔥 Remove Py2 related code 2021-05-20 15:42:37 +02:00
Gina Häußge 3778bcc423 Merge branch 'maintenance' into devel
# Conflicts:
#	docs/development/environment.rst
2021-05-20 15:34:29 +02:00
Gina Häußge 49621a65b0 Merge branch 'maintenance' into devel 2021-05-20 12:23:26 +02:00
Gina Häußge d80f67df9a Merge branch 'maintenance' into devel 2021-05-10 16:39:21 +02:00
Gina Häußge 6cb550e9f4 Merge branch 'maintenance' into devel 2021-04-27 11:37:24 +02:00
Gina Häußge 55158bdef9 Merge branch 'maintenance' into devel
# Conflicts:
#	src/octoprint/printer/standard.py
2021-04-26 14:47:21 +02:00
Gina Häußge a34202fdec 🎨 pyupgrade 2021-04-19 18:06:51 +02:00
Gina Häußge 944441ec7d Merge branch 'maintenance' into devel 2021-04-19 17:39:17 +02:00
Gina Häußge beef176ac0 Merge branch 'maintenance' into devel 2021-04-14 15:35:50 +02:00
Gina Häußge f97db4465f Merge branch 'maintenance' into devel 2021-03-30 14:27:32 +02:00
Gina Häußge 262983840a Merge branch 'maintenance' into devel 2021-03-16 14:35:40 +01:00
Gina Häußge bb2c3273c0 🔥 Remove deprecated thaw_frozendict 2021-03-15 18:05:34 +01:00
Gina Häußge d8fa8e3029 Merge branch 'maintenance' into devel
# Conflicts:
#	.github/workflows/build.yml
#	.github/workflows/test_install.yml
#	setup.py
#	src/octoprint/printer/standard.py
#	src/octoprint/util/__init__.py
2021-03-15 18:03:51 +01:00
Gina Häußge ed21f75acf ♻️ Remove py2 stuff 2021-03-15 17:14:39 +01:00
Gina Häußge d2452c007e Merge branch 'maintenance' into devel 2021-03-15 17:08:47 +01:00
GitHub Nightly Merge Action 9625695467 Merge branch 'maintenance' into devel 2021-03-11 16:40:10 +00:00
Gina Häußge 7668afcff7 💚 Fix unit tests
io.open is no longer used, mocks needed adjustments
2021-03-11 17:06:04 +01:00
Gina Häußge fd2ece0f13 🎨 pyupgrade --py37-plus 2021-03-11 16:01:02 +01:00
Gina Häußge a71f6fcd40 Merge branch 'maintenance' into devel
# Conflicts:
#	.pre-commit-config.yaml
#	setup.py
#	src/octoprint/plugins/pluginmanager/__init__.py
#	src/octoprint/server/api/printer.py
#	src/octoprint/server/api/printer_profiles.py
#	src/octoprint/server/api/settings.py
#	src/octoprint/util/commandline.py
2021-03-11 15:26:46 +01:00
Gina Häußge ca3b78d140 🎨 Clean up some py2 leftovers & arm more codemods 2021-02-25 14:17:47 +01:00
Gina Häußge 5b7bc6cb91 Merge branch 'maintenance' into devel 2021-02-24 15:04:22 +01:00
Gina Häußge 0fd00ef5fc Merge branch 'maintenance' into devel
# Conflicts:
#	docs/development/environment.rst
2021-02-17 15:38:54 +01:00
Gina Häußge 2a6f7478c3 Merge branch 'maintenance' into devel
# Conflicts:
#	src/octoprint/logging/__init__.py
2021-02-05 13:04:26 +01:00
Gina Häußge 5e620bcdfe Merge pull request #3981 from eumiro/py36plus
🚀 Modernize the code to Python 3.6+
2021-01-26 10:53:45 +01:00
Miroslav Šedivý dcd3592fd4 ✒️ Fix declared encoding of literal strings 2021-01-25 19:00:33 +01:00
Miroslav Šedivý 7f56d47dbc 🐝 Compact yield from generator 2021-01-25 19:00:33 +01:00
Miroslav Šedivý d041e1ce97 👴 Use default super() arguments 2021-01-25 19:00:32 +01:00
Miroslav Šedivý ad0c0ddfe1 👣 Remove __future__ imports and source code encodings 2021-01-25 19:00:32 +01:00
Miroslav Šedivý 0308150048 📗 Compact dict creation 2021-01-25 19:00:28 +01:00
Miroslav Šedivý 35e35d92a6 💥 Use OSError as the general system-related exception
According to PEP 3151, OSError can be used for all system-related exceptions and thus replace IOError, EnvironmentError, socket.error, etc.
2021-01-25 18:04:47 +01:00
Miroslav Šedivý 95441dafd4 📦 Use Python3 default for class inheriting from object 2021-01-25 18:04:40 +01:00
Gina Häußge f7ad7d93a5 Merge branch 'maintenance' into devel 2021-01-25 16:07:48 +01:00
Gina Häußge 9c8691eeb7 Merge pull request #3980 from eumiro/numbers
🦕 Remove the redundant Python2 float conversion relics from the `devel` branch
2021-01-25 15:53:10 +01:00
Miroslav Šedivý a89d03b794 🔪 Compare the difference, not rounded values
round(1.0004, 3) != round(1.0006, 3) but still abs(1.0004 - 1.0006) < 0.001
2021-01-22 13:40:44 +01:00
Miroslav Šedivý 7810a622a9 🦕 Remove redundant float conversions from Python2 2021-01-22 13:40:44 +01:00
Gina Häußge bb8fafaacb 💚 mock => unittest.mock
We don't have the mock package installed here anymore
2021-01-19 11:52:41 +01:00
Gina Häußge 977e021b36 Merge branch 'maintenance' into devel 2021-01-19 11:44:31 +01:00
Gina Häußge 00fb7daecf Merge branch 'maintenance' into devel 2021-01-14 16:12:30 +01:00
Gina Häußge f66b318022 📌 Pin watchdog to 1.0.0
That's the latest Python 3 compatible release. We'll need to pin this
explicitly from now on since it's proven to not adhere to semver.
2020-12-10 14:16:03 +01:00
Gina Häußge 97ec0493d1 Merge branch 'maintenance' into devel 2020-12-10 14:14:22 +01:00
Gina Häußge 669660c2fb Merge branch 'maintenance' into devel 2020-12-04 12:02:29 +01:00
Gina Häußge 1b5d24cb9d Merge branch 'maintenance' into devel 2020-11-30 16:11:38 +01:00
Gina Häußge d60bb43e07 💚 Fix unit tests testing settings init
We now need to explicitly trigger a write to config.yaml to test proper
creation at the right places since we no longer will automatically
generate a global API key - that has been removed.
2020-11-26 12:24:12 +01:00
Gina Häußge 86db7d8ec4 Merge branch 'maintenance' into devel
# Conflicts:
#	src/octoprint/static/js/app/viewmodels/printerstate.js
2020-11-25 17:30:31 +01:00
Gina Häußge 43541ceebc 💥 Remove global API key 2020-11-25 17:24:38 +01:00
Gina Häußge 8ef57e2ab7 Merge branch 'maintenance' into devel
# Conflicts:
#	src/octoprint/filemanager/storage.py
#	src/octoprint/plugins/announcements/__init__.py
2020-11-25 13:19:01 +01:00
Gina Häußge 4b0c1fe63c Merge branch 'maintenance' into devel
# Conflicts:
#	src/octoprint/util/commandline.py
2020-11-18 16:32:12 +01:00
Gina Häußge 90c0675234 Merge branch 'maintenance' into devel 2020-11-17 16:23:15 +01:00
Gina Häußge b8bbdbdc64 Merge branch 'maintenance' into devel
# Conflicts:
#	setup.py
2020-11-10 16:10:41 +01:00
Gina Häußge 5325b32cf2 Merge branch 'maintenance' into devel
# Conflicts:
#	setup.py
#	src/octoprint/server/__init__.py
#	src/octoprint/util/__init__.py
2020-11-06 17:08:58 +01:00
Gina Häußge 29994cd63f 🎨 Some more checks so Py2 stuff doesn't creep back in 2020-10-23 17:03:14 +02:00
Gina Häußge 718f89fdbd Merge branch 'maintenance' into devel 2020-10-23 16:59:02 +02:00
Gina Häußge c02c1452e6 ♻️ Py3: Some more import & compat stragglers 2020-10-22 16:25:47 +02:00
Gina Häußge 55ddfdd314 💚 Fix tests 2020-10-22 16:22:00 +02:00
Gina Häußge d5e4cf3a1a ♻️ Py3: native support for typing annotations 2020-10-22 15:51:26 +02:00
Gina Häußge b73f62b433 ♻️ Py3: get rid of unneeded noinspection comments & imports 2020-10-22 15:50:49 +02:00
Gina Häußge 5102c3b5e0 ♻️ Py3: require Python 3.7 at a minimum 2020-10-22 14:34:04 +02:00
Gina Häußge fe87062768 ♻️ Py3: no more need to patch scandir for watchdog 2020-10-22 14:31:52 +02:00
Gina Häußge 21a30001fa ♻️ Py3: NamedTemporaryFile now DOES support encoding 2020-10-22 14:31:23 +02:00
Gina Häußge e1d55e00af ♻️ Py3: Remove py2 specific sarge patch 2020-10-22 14:30:40 +02:00
Gina Häußge d98a6da7b2 ♻️ Py3: get rid of some py2 import stragglers 2020-10-22 14:29:30 +02:00
Gina Häußge f510cc4218 ♻️ Py3: collections.{Iterable,KeysView} => collections.abc.{...} 2020-10-21 19:06:25 +02:00
Gina Häußge ac347c4e06 ♻️ Py3: Remove use of glob_escape & monotonic_time & mark deprecated
Those are natively available in Python 3.
2020-10-21 19:01:02 +02:00
Gina Häußge d2298a8092 ♻️ Py3: Remove PY3 use 2020-10-21 18:41:53 +02:00
Gina Häußge e45e97f9ac ♻️ Py3: Remove past.builtins and future.utils uses 2020-10-21 18:39:52 +02:00
Gina Häußge 292aa99543 ♻️ Py3: Remove Py2 specific imports 2020-10-21 18:13:39 +02:00
Gina Häußge 61a08d26b2 Merge branch 'maintenance' into devel 2020-10-21 14:35:24 +02:00
Gina Häußge 9f0ae77f95 🎨 pre-commit: add future import check 2020-10-07 22:16:41 +02:00
Gina Häußge 100764b03e 🎨 Remove some left-over pragma headers & future imports 2020-10-07 21:37:22 +02:00
Gina Häußge c715751bc6 Merge branch 'maintenance' into devel 2020-10-07 21:19:05 +02:00
Gina Häußge 18e6bfc7f8 Merge branch 'maintenance' into devel
# Conflicts:
#	.github/workflows/build.yml
#	docs/conf.py
#	docs/development/environment.rst
#	docs/sphinxext/codeblockext.py
#	docs/sphinxext/onlineinclude.py
#	setup.py
#	src/octoprint/access/groups.py
#	src/octoprint/access/permissions.py
#	src/octoprint/access/users.py
#	src/octoprint/cli/__init__.py
#	src/octoprint/cli/analysis.py
#	src/octoprint/cli/client.py
#	src/octoprint/cli/config.py
#	src/octoprint/cli/plugins.py
#	src/octoprint/cli/server.py
#	src/octoprint/cli/user.py
#	src/octoprint/environment.py
#	src/octoprint/events.py
#	src/octoprint/filemanager/__init__.py
#	src/octoprint/filemanager/analysis.py
#	src/octoprint/filemanager/destinations.py
#	src/octoprint/filemanager/storage.py
#	src/octoprint/filemanager/util.py
#	src/octoprint/logging/__init__.py
#	src/octoprint/logging/handlers.py
#	src/octoprint/plugin/__init__.py
#	src/octoprint/plugin/core.py
#	src/octoprint/plugins/action_command_notification/__init__.py
#	src/octoprint/plugins/action_command_prompt/__init__.py
#	src/octoprint/plugins/appkeys/__init__.py
#	src/octoprint/plugins/backup/__init__.py
#	src/octoprint/plugins/corewizard/__init__.py
#	src/octoprint/plugins/corewizard/subwizards.py
#	src/octoprint/plugins/discovery/__init__.py
#	src/octoprint/plugins/errortracking/__init__.py
#	src/octoprint/plugins/gcodeviewer/__init__.py
#	src/octoprint/plugins/logging/__init__.py
#	src/octoprint/plugins/pi_support/__init__.py
#	src/octoprint/plugins/softwareupdate/cli.py
#	src/octoprint/plugins/softwareupdate/updaters/single_file_plugin.py
#	src/octoprint/plugins/softwareupdate/updaters/sleep_a_bit.py
#	src/octoprint/plugins/softwareupdate/version_checks/always_current.py
#	src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py
#	src/octoprint/plugins/softwareupdate/version_checks/github_release.py
#	src/octoprint/plugins/softwareupdate/version_checks/httpheader.py
#	src/octoprint/plugins/softwareupdate/version_checks/jsondata.py
#	src/octoprint/plugins/softwareupdate/version_checks/never_current.py
#	src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py
#	src/octoprint/plugins/tracking/__init__.py
#	src/octoprint/plugins/virtual_printer/virtual.py
#	src/octoprint/printer/__init__.py
#	src/octoprint/printer/estimation.py
#	src/octoprint/printer/profile.py
#	src/octoprint/printer/standard.py
#	src/octoprint/server/__init__.py
#	src/octoprint/server/api/__init__.py
#	src/octoprint/server/api/system.py
#	src/octoprint/server/api/users.py
#	src/octoprint/server/util/flask.py
#	src/octoprint/server/util/tornado.py
#	src/octoprint/server/util/webassets.py
#	src/octoprint/settings.py
#	src/octoprint/slicing/__init__.py
#	src/octoprint/timelapse.py
#	src/octoprint/util/__init__.py
#	src/octoprint/util/comm.py
#	src/octoprint/util/commandline.py
#	src/octoprint/util/connectivity.py
#	src/octoprint/util/fixes.py
#	src/octoprint/util/gcodeInterpreter.py
#	src/octoprint/util/jinja.py
#	src/octoprint/util/json/__init__.py
#	src/octoprint/util/net.py
#	src/octoprint_client/__init__.py
#	src/octoprint_setuptools/__init__.py
#	tests/filemanager/test_filemanager.py
#	tests/filemanager/test_localstorage.py
#	tests/plugin/test_core.py
#	tests/plugin/test_settings.py
#	tests/plugin/test_types_blueprint.py
#	tests/plugin/test_types_settings.py
#	tests/server/api/test_system.py
#	tests/server/util/test_flask.py
#	tests/server/util/test_tornado.py
#	tests/slicing/test_slicingmanager.py
#	tests/test_daemon.py
#	tests/timelapse/test_timelapse_helpers.py
#	tests/util/test_comm.py
#	tests/util/test_file_helpers.py
#	tests/util/test_pip.py
#	tests/util/test_repeated_timer.py
#	tests/util/test_resettable_timer.py
#	versioneer.py
2020-10-07 21:08:44 +02:00
Gina Häußge 0bdedffac3 Merge pull request #3753 from frenck/frenck-2020-0005
Use py3 style super calls
2020-09-28 15:08:45 +02:00
Franck Nijhof 86e6cd595f Use py3 style super calls 2020-09-28 14:51:09 +02:00
Gina Häußge 5faff84a9d Merge pull request #3752 from frenck/frenck-2020-0004
Use py3 style classes
2020-09-28 13:40:32 +02:00
Franck Nijhof 656b0edb90 Use py3 style classes 2020-09-28 12:53:04 +02:00
Gina Häußge 7f042b1c55 Merge remote-tracking branch 'origin/devel' into devel 2020-09-28 11:49:44 +02:00
Gina Häußge c574947e93 Merge branch 'maintenance' into devel 2020-09-28 11:49:22 +02:00
Gina Häußge 0949975fcd Merge pull request #3750 from frenck/frenck-2020-0003
Cleanup encoding pragma headers and future imports
2020-09-28 11:46:41 +02:00
Gina Häußge a24dad6bdb Merge branch 'maintenance' into devel 2020-09-28 11:43:17 +02:00
Franck Nijhof 025fb23fed Cleanup encoding pragma headers and future imports 2020-09-25 22:56:25 +02:00
Gina Häußge 46beea8972 Merge branch 'maintenance' into devel 2020-09-17 16:44:16 +02:00
Gina Häußge 67378e1d55 Merge branch 'maintenance' into devel 2020-09-17 15:25:59 +02:00
Gina Häußge 95ab458677 📝 Fix docs build 2020-08-12 13:16:07 +02:00
Gina Häußge 49b40a4af3 Merge branch 'maintenance' into devel
# Conflicts:
#	docs/sphinxext/codeblockext.py
2020-08-10 16:36:19 +02:00
Gina Häußge 99293b9ccf Merge branch 'maintenance' into devel
# Conflicts:
#	.versioneer-lookup
2020-08-06 12:43:11 +02:00
Gina Häußge c6155e9279 Merge branch 'maintenance' into devel 2020-08-04 12:03:41 +02:00
Gina Häußge 9897fc2d56 Merge branch 'maintenance' into devel 2020-08-03 10:53:31 +02:00
Gina Häußge 35ae4af868 Merge branch 'maintenance' into devel
# Conflicts:
#	docs/development/environment.rst
#	setup.py
2020-08-03 10:32:57 +02:00
Gina Häußge 95c8902d96 Merge branch 'maintenance' into devel 2020-07-29 12:21:46 +02:00
Gina Häußge 1afd7d532c 💚 Fix a test 2020-07-15 16:18:14 +02:00
Gina Häußge eba336221e 🐛 We need markdown during setup 2020-07-15 16:06:30 +02:00
Gina Häußge 2bb0e0edfc Merge branch 'maintenance' into devel 2020-07-15 14:22:53 +02:00
Gina Häußge 248352ae5c Merge branch 'maintenance' into devel
# Conflicts:
#	setup.py
2020-07-08 13:59:57 +02:00
Gina Häußge 7ee8c5d284 Merge branch 'maintenance' into devel 2020-07-06 22:31:19 +02:00
Gina Häußge 54b3d770e7 ♻ mock => unittest.mock 2020-07-06 15:05:33 +02:00
Gina Häußge 288f6ac900 👷‍ devel is Python 3 only 2020-07-06 14:39:09 +02:00
Gina Häußge 08b48e92d3 Merge branch 'maintenance' into devel
# Conflicts:
#	.travis.yml
#	README.md
2020-07-06 14:34:59 +02:00
Gina Häußge fcf60b2a9a ⬆ devel is now 2.0.0.dev & py3 only 2020-06-16 18:12:38 +02:00
57 changed files with 452 additions and 266 deletions

No files matched your search

-1
View File
@@ -19,7 +19,6 @@ win32-Cura-*
linux-Cura-*
*.iml
Printrun
=======
.idea
.vscode
.DS_Store
+2
View File
@@ -158,6 +158,7 @@ date of first contribution):
* [Christian Würthner](https://github.com/crysxd)
* [Maciej Urbański](https://github.com/rooterkyberian)
* [Adam Wolf](https://github.com/adamwolf)
* [Carey Metcalfe](https://github.com/pR0Ps)
* [Didi Kohen](https://github.com/kohend)
* [Taylor Talkington](https://github.com/The-EG)
* [Carey Metcalfe](https://github.com/pR0Ps)
@@ -181,6 +182,7 @@ date of first contribution):
* [Jatin Saini](https://github.com/jatin-47)
* [Martin Bartsch](https://github.com/kaenguruhs)
* [Matthias Weis](https://github.com/mad73923)
* [Rob Emery](https://github.com/mintsoft)
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
[Daid Braam](https://github.com/daid). Parts of its communication layer and
+4
View File
@@ -12,6 +12,10 @@
* [css-element-queries](https://github.com/marcj/css-element-queries): MIT
* [Detect Mobile Browser](http://detectmobilebrowsers.com/): Public Domain
* [Flot](http://www.flotcharts.org/): MIT
* [Flot Crosshair Plugin](http://www.flotcharts.org/): MIT
* [Flot Dashes Plugin](https://github.com/cquartier/flot.dashes): Unlicense
* [Flot Resize Plugin](http://www.flotcharts.org/): MIT
* [Flot Time Plugin](http://www.flotcharts.org/): MIT
* [HLS.js](https://github.com/video-dev/hls.js): Apache License 2.0
* [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5): MIT
* [JQuery](http://jquery.com/): MIT
+2 -17
View File
@@ -12,11 +12,11 @@ Authorization
=============
If :ref:`Access Control <sec-features-access_control>` is enabled OctoPrint's API expects an API key to be supplied with each request. This API
key can be either the globally configured one, a user specific one or an app and user specific one as generated by the
key can be either a user specific one or an app and user specific one as generated by the
authorization workflow implemented by the bundled :ref:`Application Keys Plugin <sec-bundledplugins-appkeys>` (since 1.3.10).
Clients are advised to implement the :ref:`Application Keys Plugin workflow <sec-bundledplugins-appkeys-workflow>` first and
fallback on directing the user to manually supply the the user specific API key. The global key should rarely be used.
fallback on directing the user to manually supply the the user specific API key.
The API key must either be supplied in the custom HTTP header ``X-Api-Key``, e.g.
@@ -52,21 +52,6 @@ will be denied with a :http:statuscode:`403`.
If :ref:`Access Control <sec-features-access_control>` is disabled, OctoPrint will treat any unauthenticated anonymous requests and thus also requests
with an invalid or outright missing API key as requests with full admin rights!
.. note::
The API key requirements changed in 1.3.11. Up to that version, even if Access Control was disabled, all requests needed to
be supplied with an API Key. To make the webinterface work under these circumstances, an unauthenticated anonymous API key was injected into the
HTML page and also available on the :ref:`Push API <sec-api-push>`. The presence and ready availability of this unauthenticated
anonymous "UI API key" caused confusion and false alarm among users and didn't contribute to the security of the platform in a
meaningful way, so it was finally abandoned in 1.3.11.
.. _fig-api-general-globalapikey:
.. figure:: ../images/settings-global-api-key.png
:align: center
:alt: Global API key in the API settings
The global API key can be found in the "API" settings
.. _fig-api-general-userapikey:
.. figure:: ../images/settings-user-api-key.png
:align: center
-17
View File
@@ -71,23 +71,6 @@ Save settings
}
}
.. _sec-api-settings-generateapikey:
Regenerate the system wide API key
==================================
.. http:post:: /api/settings/apikey
Generates a new system wide API key.
Does not expect a body. Will return the generated API key as ``apikey``
property in the JSON object contained in the response body.
Requires admin rights.
:status 200: No error
:status 403: No admin rights
.. _sec-api-settings-fetchtemplaatedata:
Fetch template data
+11 -13
View File
@@ -81,6 +81,12 @@ installed:
sudo apt-get install python3 python3-pip python3-dev python3-setuptools python3-virtualenv git libyaml-dev build-essential
.. todo::
Using a Linux distribution that doesn't use ``apt``? Please send a
`Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
steps into this guide!
Then:
.. code-block:: none
@@ -96,12 +102,6 @@ Then:
git config blame.ignoreRevsFile .git-blame-ignore-revs
.. todo::
Using a Linux distribution that doesn't use ``apt``? Please send a
`Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
steps into this guide!
.. _sec-development-environment-windows:
Windows
@@ -112,20 +112,19 @@ location, please substitute accordingly.
First download & install:
* `Git for Windows <https://git-for-windows.github.io/>`_
* `Latest *stable* Python 3 release from python.org <https://www.python.org/downloads/windows/>`_
* `The current Python 3.8 Windows x86 executable installer <https://www.python.org/downloads/windows/>`_
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
* it's recommended to install Python 3 into ``C:\Python3`` - if you select
different install locations please substitute accordingly
* it's also recommended to install for all users
* `Build Tools For Visual Studio 2019 <https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019>`_
* `Build Tools for Visual Studio 2019 <https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019>`_
* install "C++ build tools" and ensure the latest versions of "MSVCv142 - VS 2019 C++ x64/x86 build tools" and
"Windows 10 SDK" are checked under individual components.
"Windows 10 SDK" are checked.
* `Git for Windows <https://git-scm.com/downloads>`_
Open the Git Bash you just installed and in that:
@@ -150,7 +149,6 @@ Optional but recommended tools
These are some tools that are recommended but not required to have on hand:
* `Visual Studio Code <https://code.visualstudio.com/download>`_
* `Windows Terminal <https://github.com/microsoft/terminal>`_
Add the following profile to ``profiles.list`` in the settings, that will allow you to
@@ -306,7 +304,7 @@ PyCharm
* disable "Auto-save edited files to trigger the watched"
* enable "Trigger the watched on external changes"
To switch between virtual environments (e.g. Python 3.7 and 3.8), all you need to do now is change the Project Default Interpreter and restart
To switch between virtual environments (e.g. various Python 3 versions), all you need to do now is change the Project Default Interpreter and restart
OctoPrint. On current PyCharm versions you can do that right from a small selection field in the footer of the IDE.
Otherwise go through Settings.
+4 -4
View File
@@ -24,7 +24,7 @@ The following example defines a control for enabling the cooling fan with a vari
feedback evaluation for the result of the M114 "Get Position" gcode inside a section named "Reporting" and finally
a GCODE script including user input.
.. code-block-ext:: yaml
.. code-block:: yaml
controls:
- name: Fan
@@ -181,7 +181,7 @@ Controls
additional input fields. ``command``/``commands`` may contain placeholders to be replaced by the values obtained
from the user for the defined input fields:
.. code-block-ext:: yaml
.. code-block:: yaml
name: Enable Fan
command: M106 S%(speed)s
@@ -253,7 +253,7 @@ Examples
Parameterized GCODE Script
..........................
.. code-block-ext:: yaml
.. code-block:: yaml
:caption: Control definition in ~/.octoprint/config.yaml
:name: code-features-custom_controls-example-gcode_script-config_yaml
@@ -268,7 +268,7 @@ Parameterized GCODE Script
min: 1
step: 1
.. code-block-ext:: jinja
.. code-block:: jinja
:caption: ~/.octoprint/scripts/gcode/custom/dance.gco
:name: code-features-custom_controls-example-gcode_script-dance_gco
+1 -1
View File
@@ -270,6 +270,6 @@ def setup(app):
# custom node type
handler = (visit_literal_block_ext, depart_literal_block_ext)
app.add_node(literal_block_ext, html=handler, latex=handler, text=handler)
app.add_node(literal_block_ext, html=handler)
return {"version": "0.1"}
+1 -1
View File
@@ -117,4 +117,4 @@ def setup(app):
app.add_directive("onlineinclude", OnlineIncludeDirective)
handler = (visit_onlineinclude, depart_onlineinclude)
app.add_node(OnlineIncludeDirective, html=handler, latex=handler, text=handler)
app.add_node(OnlineIncludeDirective, html=handler)
-1
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env python
import logging as log
import os
import sys
-1
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env python
if __name__ == "__main__":
import octoprint
+7 -10
View File
@@ -62,8 +62,10 @@ class UserManager(GroupChangeListener):
def anonymous_user_factory(self):
return AnonymousUser([self._group_manager.guest_group])
def api_user_factory(self):
return ApiUser([self._group_manager.admin_group, self._group_manager.user_group])
def cli_user_factory(self):
return LocalCliUser(
[self._group_manager.admin_group, self._group_manager.user_group]
)
@property
def enabled(self):
@@ -1102,11 +1104,6 @@ class MethodReplacedByBooleanProperty:
return self._attr != other
def __bool__(self):
# Python 3
return self._attr
def __nonzero__(self):
# Python 2
return self._attr
def __hash__(self):
@@ -1495,9 +1492,9 @@ class SessionUser(wrapt.ObjectProxy):
)
##~~ User object to use when global api key is used to access the API
##~~ User object to use when CLI key is used
class ApiUser(User):
class LocalCliUser(User):
def __init__(self, groups):
User.__init__(self, "_api", "", True, [], groups)
User.__init__(self, "_cli", "", True, [], groups)
-1
View File
@@ -151,7 +151,6 @@ def gcode_command(
"happened"
)
sys.exit(-1)
click.echo("RESULTS:")
click.echo(yaml.dump(interpreter.get_result(), pretty=True))
+11 -5
View File
@@ -2,6 +2,7 @@ __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agp
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
import json
import os
import click
@@ -33,18 +34,23 @@ def create_client(
https=False,
prefix=None,
):
assert host is not None or settings is not None
assert port is not None or settings is not None
assert apikey is not None or settings is not None
if not host:
host = settings.get(["server", "host"])
host = host if host != "0.0.0.0" else "127.0.0.1"
host = "127.0.0.1"
if not port:
port = settings.getInt(["server", "port"])
if not apikey:
apikey = settings.get(["api", "key"])
cli_key_file = os.path.join(settings.getBaseFolder("generated"), "cli.key")
try:
with open(cli_key_file, encoding="utf8") as f:
apikey = f.readline()
except Exception:
raise FatalStartupError(
f"Can not authenticate with server at {host}:{port}, no key"
)
baseurl = octoprint_client.build_base_url(
https=https,
@@ -79,7 +85,7 @@ def cli(ctx, apikey, host, port, httpuser, httppass, https, prefix):
"""Basic API client."""
try:
settings = None
if not host or not port or not apikey:
if not port or not apikey:
settings = init_settings(
get_ctx_obj_option(ctx, "basedir", None),
get_ctx_obj_option(ctx, "configfile", None),
+1 -2
View File
@@ -2,6 +2,7 @@ __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import io
import logging
import os
import time
@@ -439,8 +440,6 @@ class FileManager:
source_meta = self.get_metadata(source_location, source_path)
hash = source_meta.get("hash", "n/a")
import io
links = [("model", {"name": source_path})]
_, stl_name = self.split_path(source_location, source_path)
file_obj = StreamWrapper(
+3 -1
View File
@@ -1,3 +1,5 @@
from typing import Union
from octoprint.logging import filters # noqa: F401
from octoprint.logging import handlers # noqa: F401
@@ -142,7 +144,7 @@ def get_divider_line(c, message=None, length=78, indent=3):
return c * indent + " " + message
def prefix_multilines(text: str, prefix: str = ": ") -> str:
def prefix_multilines(text: Union[str, bytes], prefix: str = ": ") -> str:
from octoprint.util import to_unicode
lines = text.splitlines()
@@ -322,7 +322,7 @@ class AchievementsPlugin(
**a.dict(),
)
for a in Achievements.all()
# if not a.hidden or self._has_achievement(a)
if not a.hidden or self._has_achievement(a)
]
achievements.sort(key=lambda a: a.name)
@@ -406,9 +406,7 @@ class AchievementsPlugin(
if self._has_achievement(achievement):
return
self._data.achievements[achievement.key] = int(
datetime.datetime.now().timestamp()
)
self._data.achievements[achievement.key] = int(self._now().timestamp())
if write:
self._write_data_file()
@@ -1,8 +1,3 @@
<!--
<button class="btn" data-bind="click: () => {triggerTestAchievement()}">Trigger</button>
<button class="btn" data-bind="click: () => {triggerTestAchievement(true)}">Trigger w/ nag</button>
-->
<h3>{{ _('Achievements') }} (<span data-bind="text: achievedAchievements"></span>/<span data-bind="text: totalAchievements"></span>)</h3>
<div class="achievement-list" data-bind="foreach: achievements">
@@ -1,10 +1,9 @@
import datetime
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import copy
import datetime
import hashlib
import logging
import logging.handlers
@@ -1,5 +1,4 @@
#!/bin/env python
__author__ = "Gina Haeussge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
@@ -250,6 +250,7 @@ class VirtualPrinter:
self._sdCardReady = True
self._sdPrinting = False
self._sdCacnelled = False
if self._sdPrinter:
self._sdPrinting = False
self._sdPrintingSemaphore.set()
@@ -682,6 +683,10 @@ class VirtualPrinter:
if file is not None:
self._send(file["name"])
def _gcode_M524(self, data: str) -> None:
if self._sdCardReady:
self._cancelSdPrint()
def _gcode_M113(self, data: str) -> None:
matchS = re.search(r"S([0-9]+)", data)
if matchS is not None:
@@ -930,9 +935,9 @@ class VirtualPrinter:
_timeout = 0
if matchP:
_timeout = float(matchP.group(1)) / 1000
_timeout = int(matchP.group(1)) / 1000
elif matchS:
_timeout = float(matchS.group(1))
_timeout = int(matchS.group(1))
if self._sendBusy and self._busyInterval > 0:
until = time.monotonic() + _timeout
@@ -1566,7 +1571,9 @@ class VirtualPrinter:
def _startSdPrint(self):
if self._selectedSdFile is not None:
self._sdPrinting = False
if self._sdPrinter is None:
self._sdCancelled = False
self._sdPrinting = True
self._sdPrinter = threading.Thread(target=self._sdPrintingWorker)
self._sdPrinter.start()
@@ -1575,11 +1582,17 @@ class VirtualPrinter:
def _pauseSdPrint(self):
self._sdPrintingSemaphore.clear()
def _cancelSdPrint(self):
self._sdCancelled = True
self._sdPrinting = False
self._sdPrintingSemaphore.set() # just in case it was cleared before
self._sdPrinter.join()
def _setSdPos(self, pos):
self._newSdFilePos = pos
def _reportSdStatus(self):
if self._sdPrinter is not None and self._sdPrintingSemaphore.is_set:
if self._sdPrinter is not None:
self._send(
f"SD printing byte {self._selectedSdFilePos}/{self._selectedSdFileSize}"
)
@@ -1684,11 +1697,11 @@ class VirtualPrinter:
return
try:
self.targetTemp[tool] = float(re.search(r"S([0-9]+)", line).group(1))
self.targetTemp[tool] = int(re.search(r"S([0-9]+)", line).group(1))
except Exception:
if support_r:
try:
self.targetTemp[tool] = float(re.search(r"R([0-9]+)", line).group(1))
self.targetTemp[tool] = int(re.search(r"R([0-9]+)", line).group(1))
only_wait_if_higher = False
except Exception:
pass
@@ -1704,11 +1717,11 @@ class VirtualPrinter:
only_wait_if_higher = True
try:
self.bedTargetTemp = float(re.search(r"S([0-9]+)", line).group(1))
self.bedTargetTemp = int(re.search(r"S([0-9]+)", line).group(1))
except Exception:
if support_r:
try:
self.bedTargetTemp = float(re.search(r"R([0-9]+)", line).group(1))
self.bedTargetTemp = int(re.search(r"R([0-9]+)", line).group(1))
only_wait_if_higher = False
except Exception:
pass
@@ -1724,11 +1737,11 @@ class VirtualPrinter:
only_wait_if_higher = True
try:
self.chamberTargetTemp = float(re.search("S([0-9]+)", line).group(1))
self.chamberTargetTemp = int(re.search("S([0-9]+)", line).group(1))
except Exception:
if support_r:
try:
self.chamberTargetTemp = float(re.search("R([0-9]+)", line).group(1))
self.chamberTargetTemp = int(re.search("R([0-9]+)", line).group(1))
only_wait_if_higher = False
except Exception:
pass
@@ -1975,12 +1988,12 @@ class VirtualPrinter:
self._finishSdPrint()
def _finishSdPrint(self):
if not self._killed:
self._sdPrintingSemaphore.clear()
self._sdPrintingSemaphore.clear()
self._selectedSdFilePos = 0
self._sdPrinting = False
self._sdPrinter = None
if not self._killed and not self._sdCancelled:
self._send("Done printing file")
self._selectedSdFilePos = 0
self._sdPrinting = False
self._sdPrinter = None
def _waitForHeatup(self, heater: str, only_wait_if_higher: bool) -> None:
delta = 1
+1 -1
View File
@@ -42,7 +42,7 @@ class PrintTimeEstimator:
# by that divided by the sd status polling interval
interval = settings().getFloat(["serial", "timeout", "sdStatus"])
if interval <= 0:
interval = 1.0
interval = 1
rolling_window = int(15 // interval)
if rolling_window < 1:
rolling_window = 1
+14
View File
@@ -173,6 +173,8 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
eventManager().subscribe(
Events.METADATA_STATISTICS_UPDATED, self._on_event_MetadataStatisticsUpdated
)
eventManager().subscribe(Events.CONNECTED, self._on_event_Connected)
eventManager().subscribe(Events.DISCONNECTED, self._on_event_Disconnected)
eventManager().subscribe(Events.CHART_MARKED, self._on_event_ChartMarked)
self._handle_connect_hooks = plugin_manager().get_hooks(
@@ -321,6 +323,18 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._selectedFile["user"],
)
# ~~ connection events
def _on_event_Connected(self, event, data):
self._markings.append(
{"type": "connected", "label": "Connected", "time": time.time()}
)
def _on_event_Disconnected(self, event, data):
self._markings.append(
{"type": "disconnected", "label": "Disconnected", "time": time.time()}
)
# ~~ chart marking insertions
def _on_event_ChartMarked(self, event, data):
-7
View File
@@ -1,18 +1,11 @@
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
from typing import Dict, Optional
from octoprint.schema import BaseModel
from octoprint.vendor.with_attrs_docs import with_attrs_docs
@with_attrs_docs
class ApiConfig(BaseModel):
key: Optional[str] = None
"""Global API key, deprecated, use User API keys instead. Unset by default, will be generated on first run."""
apps: Dict[str, str] = {}
allowCrossOrigin: bool = False
"""Whether to allow cross origin access to the API or not."""
+18 -3
View File
@@ -96,6 +96,8 @@ jsonDecoder = None
connectivityChecker = None
environmentDetector = None
cli_key = None
class OctoPrintAnonymousIdentity(AnonymousIdentity):
def __init__(self):
@@ -201,8 +203,8 @@ def load_user(id):
if id is None:
return None
if id == "_api":
return userManager.api_user_factory()
if id == "_cli":
return userManager.cli_user_factory()
if session and "usersession.id" in session:
sessionid = session["usersession.id"]
@@ -335,6 +337,7 @@ class Server:
global environmentDetector
global debug
global safe_mode
global cli_key
from tornado.ioloop import IOLoop
from tornado.web import Application
@@ -381,6 +384,7 @@ class Server:
util.tornado.fix_websocket_check_origin()
util.tornado.enable_per_message_deflate_extension()
cli_key = self._setup_cli_key()
self._setup_mimetypes()
# setup app
@@ -1999,7 +2003,7 @@ class Server:
)
except Exception:
self._logger.exception(
f"Error while registering blueprint of plugin {plugin}, ignoring it",
f"Error while registering assets of plugin {plugin}, ignoring it",
extra={"plugin": plugin},
)
@@ -2100,6 +2104,16 @@ class Server:
extra={"plugin": name},
)
def _setup_cli_key(self):
from octoprint.util import generate_api_key
cli_key_file = os.path.join(self._settings.getBaseFolder("generated"), "cli.key")
cli_key = generate_api_key()
with open(cli_key_file, "w", encoding="utf8") as f:
f.write(cli_key)
return cli_key
def _setup_mimetypes(self):
# Safety measures for Windows... apparently the mimetypes module takes its translation from the windows
# registry, and if for some weird reason that gets borked the reported MIME types can be all over the place.
@@ -2252,6 +2266,7 @@ class Server:
"js/lib/jquery/jquery.flot.js",
"js/lib/jquery/jquery.flot.time.js",
"js/lib/jquery/jquery.flot.crosshair.js",
"js/lib/jquery/jquery.flot.dashes.js",
"js/lib/jquery/jquery.flot.resize.js",
"js/lib/jquery/jquery.iframe-transport.js",
"js/lib/jquery/jquery.fileupload.js",
+1 -18
View File
@@ -12,7 +12,7 @@ import octoprint.plugin
import octoprint.util
from octoprint.access.permissions import Permissions
from octoprint.server import pluginManager, printer, userManager
from octoprint.server.api import NO_CONTENT, api
from octoprint.server.api import api
from octoprint.server.util.flask import no_firstrun_access, with_revalidation_checking
from octoprint.settings import settings, valid_boolean_trues
from octoprint.timelapse import configure_timelapse
@@ -118,7 +118,6 @@ def getSettings():
data = {
"api": {
"key": s.get(["api", "key"]) if Permissions.ADMIN.can() else None,
"allowCrossOrigin": s.get(["api", "allowCrossOrigin"]),
},
"appearance": {
@@ -456,22 +455,6 @@ def setSettings():
return getSettings()
@api.route("/settings/apikey", methods=["POST"])
@no_firstrun_access
@Permissions.SETTINGS.require(403)
def generateApiKey():
apikey = settings().generateApiKey()
return jsonify(apikey=apikey)
@api.route("/settings/apikey", methods=["DELETE"])
@no_firstrun_access
@Permissions.SETTINGS.require(403)
def deleteApiKey():
settings().deleteApiKey()
return NO_CONTENT
@api.route("/settings/templates", methods=["GET"])
@no_firstrun_access
@Permissions.SETTINGS.require(403)
+12 -5
View File
@@ -10,6 +10,7 @@ PY3 = sys.version_info >= (3, 0) # should now always be True, kept for plugins
import flask as _flask
import flask_login
import netaddr
import octoprint.server
import octoprint.timelapse
@@ -66,7 +67,8 @@ def loginUserFromApiKey():
if not apikey:
return False
user = get_user_for_apikey(apikey)
remote_address = flask.get_remote_address(_flask.request)
user = get_user_for_apikey(apikey, remote_address=remote_address)
if user is None:
# invalid API key = no API key
raise InvalidApiKeyException("Invalid API key")
@@ -219,11 +221,16 @@ def optionsAllowOrigin(request):
return resp
def get_user_for_apikey(apikey):
def get_user_for_apikey(apikey, remote_address=None):
if apikey is not None:
if apikey == settings().get(["api", "key"]):
# master key was used
return octoprint.server.userManager.api_user_factory()
if apikey == octoprint.server.cli_key and remote_address:
try:
remote_address = netaddr.IPAddress(remote_address)
if remote_address.is_loopback():
# CLI key was used on loopback
return octoprint.server.userManager.cli_user_factory()
except Exception:
pass
user = octoprint.server.userManager.find_user(apikey=apikey)
if user is not None:
+4 -1
View File
@@ -1541,9 +1541,12 @@ def get_flask_user_from_request(request):
user = None
apikey = octoprint.server.util.get_api_key(request)
remote_address = get_remote_address(request)
if apikey is not None:
# user from api key?
user = octoprint.server.util.get_user_for_apikey(apikey)
user = octoprint.server.util.get_user_for_apikey(
apikey, remote_address=remote_address
)
if user is None:
# user still None -> current session user
+1 -1
View File
@@ -172,7 +172,7 @@ _PLUGIN_BUNDLE_WRAPPER_PREFIX = """// JS assets for plugin {plugin}
"""
_PLUGIN_BUNDLE_WRAPPER_SUFFIX = """
}} catch (error) {{
log.error("Error in JS assets for plugin {plugin}:", (error.stack || error));
log.error("Error in JS assets for plugin {plugin}:", `${{exc.message}}\n${{exc.stack || exc}}`);
}}
}})();
"""
-15
View File
@@ -39,7 +39,6 @@ from octoprint.util import (
deprecated,
dict_merge,
fast_deepcopy,
generate_api_key,
is_hidden_path,
time_this,
yaml,
@@ -555,10 +554,6 @@ class Settings:
self._configfile = os.path.join(self._basedir, "config.yaml")
self.load(migrate=True)
apikey = self.get(["api", "key"])
if not apikey or apikey == "n/a":
self.generateApiKey()
self._script_env = self._init_script_templating()
self.sanity_check_folders(
@@ -2105,16 +2100,6 @@ class Settings:
with atomic_write(filename, mode="wt", max_permissions=0o666) as f:
f.write(script)
def generateApiKey(self):
apikey = generate_api_key()
self.set(["api", "key"], apikey)
self.save(force=True)
return apikey
def deleteApiKey(self):
self.set(["api", "key"], None)
self.save(force=True)
def _default_basedir(applicationName):
# taken from http://stackoverflow.com/questions/1084697/how-do-i-store-desktop-application-data-in-a-cross-platform-way-for-python
+1 -1
View File
@@ -1 +1 @@
.btn,.btn-link,ul.dropdown-menu li a{cursor:pointer}#files .gcode_files .entry:hover,.btn{background-color:#f5f5f5}.btn,.btn-danger,.btn-info,.btn-inverse,.btn-primary,.btn-success,.btn-warning{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);*background-color:#e6e6e6;border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn.active,.btn.disabled,.btn:active,.btn:focus,.btn:hover,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:first-child{*margin-left:0}.btn:focus,.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.active,.btn:active{background-color:#ccc\9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-primary,.slider .slider-selection{text-shadow:0 -1px 0 rgba(0,0,0,.25);background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c)}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class*=" icon-"],.btn-large [class^=icon-]{margin-top:4px}.btn-small [class*=" icon-"],.btn-small [class^=icon-],table td.timelapse_files_checkbox input[type=checkbox],table td.timelapse_unrendered_checkbox input[type=checkbox],table th.timelapse_files_checkbox input[type=checkbox],table th.timelapse_unrendered_checkbox input[type=checkbox]{margin-top:0}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-mini [class*=" icon-"],.btn-mini [class^=icon-]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.border_box,.input-block-level{-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.btn-danger.active,.btn-info.active,.btn-inverse.active,.btn-primary.active,.btn-success.active,.btn-warning.active{color:rgba(255,255,255,.75)}.btn-primary{color:#fff;background-color:#006dcc;background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#04c}.btn-primary.active,.btn-primary.disabled,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary.active,.btn-primary:active{background-color:#039\9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#f89406}.btn-warning.active,.btn-warning.disabled,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning.active,.btn-warning:active{bLine truncated
.btn,.btn-link,ul.dropdown-menu li a{cursor:pointer}#files .gcode_files .entry:hover,.btn{background-color:#f5f5f5}.btn,.btn-danger,.btn-info,.btn-inverse,.btn-primary,.btn-success,.btn-warning{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);*background-color:#e6e6e6;border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn.active,.btn.disabled,.btn:active,.btn:focus,.btn:hover,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:first-child{*margin-left:0}.btn:focus,.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.active,.btn:active{background-color:#ccc\9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-primary,.slider .slider-selection{text-shadow:0 -1px 0 rgba(0,0,0,.25);background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c)}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class*=" icon-"],.btn-large [class^=icon-]{margin-top:4px}.btn-small [class*=" icon-"],.btn-small [class^=icon-],table td.timelapse_files_checkbox input[type=checkbox],table td.timelapse_unrendered_checkbox input[type=checkbox],table th.timelapse_files_checkbox input[type=checkbox],table th.timelapse_unrendered_checkbox input[type=checkbox]{margin-top:0}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-mini [class*=" icon-"],.btn-mini [class^=icon-]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.border_box,.input-block-level{-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.btn-danger.active,.btn-info.active,.btn-inverse.active,.btn-primary.active,.btn-success.active,.btn-warning.active{color:rgba(255,255,255,.75)}.btn-primary{color:#fff;background-color:#006dcc;background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#04c}.btn-primary.active,.btn-primary.disabled,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary.active,.btn-primary:active{background-color:#039\9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#f89406}.btn-warning.active,.btn-warning.disabled,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning.active,.btn-warning:active{bLine truncated
+3 -3
View File
@@ -1367,7 +1367,7 @@ function setOnViewModelIf(viewModel, key, value, condition) {
"on view model",
viewModel.constructor.name,
":",
exc.stack || exc
`${exc.message}\n${exc.stack || exc}`
);
}
}
@@ -1392,7 +1392,7 @@ function callViewModelsIf(allViewModels, method, condition, callback) {
"on view model",
viewModel.constructor.name,
":",
exc.stack || exc
`${exc.message}\n${exc.stack || exc}`
);
}
});
@@ -1476,7 +1476,7 @@ function callViewModelIf(viewModel, method, condition, callback, raiseErrors) {
"on view model",
viewModel.constructor.name,
":",
exc.stack || exc
`${exc.message}\n${exc.stack || exc}`
);
}
}
+10 -5
View File
@@ -506,7 +506,12 @@ $(function () {
if (typeof Sentry !== "undefined") {
Sentry.captureException(exc);
}
log.error("Error instantiating", viewModel.name, ":", exc.stack || exc);
log.error(
"Error instantiating",
viewModel.name,
":",
`${exc.message}\n${exc.stack || exc}`
);
continue;
}
@@ -794,7 +799,7 @@ $(function () {
"Error calling onBeforeBinding on view model",
viewModel.constructor.name,
":",
exc.stack || exc
`${exc.message}\n${exc.stack || exc}`
);
return;
}
@@ -829,7 +834,7 @@ $(function () {
"of view model",
viewModel.constructor.name,
":",
exc.stack || exc
`${exc.message}\n${exc.stack || exc}`
);
return;
}
@@ -887,7 +892,7 @@ $(function () {
"to target",
target,
":",
exc.stack || exc
`${exc.message}\n${exc.stack || exc}`
);
}
});
@@ -911,7 +916,7 @@ $(function () {
"Error while processing view model",
name,
"for binding:",
exc.stack || exc
`${exc.message}\n${exc.stack || exc}`
);
}
});
@@ -506,7 +506,9 @@ $(function () {
});
return result;
};
self.folderList(["/"].concat(createFolderList(files)));
const folders = createFolderList(files);
folders.sort();
self.folderList(["/"].concat(folders));
// Sanity check file list - see #2572
var nonrecursive = false;
@@ -252,8 +252,8 @@ $(function () {
self.userString = ko.pureComputed(function () {
var user = self.user();
if (user === "_api") {
user = "API client";
if (user === "_cli") {
user = "CLI";
}
var file = self.filename();
@@ -124,7 +124,6 @@ $(function () {
);
self.locale_languages = _.keys(AVAILABLE_LOCALES);
self.api_key = ko.observable(undefined);
self.api_allowCrossOrigin = ko.observable(undefined);
self.appearance_name = ko.observable(undefined);
@@ -687,26 +686,6 @@ $(function () {
self.settingsDialog.modal("hide");
};
self.generateApiKey = function () {
if (!CONFIG_ACCESS_CONTROL) return;
showConfirmationDialog(
gettext(
"This will generate a new API Key. The old API Key will cease to function immediately."
),
function () {
OctoPrint.settings.generateApiKey().done(function (response) {
self.api_key(response.apikey);
self.requestData();
});
}
);
};
self.copyApiKey = function () {
copyToClipboard(self.api_key());
};
self.showTranslationManager = function () {
self.translationManagerDialog.modal();
return false;
@@ -741,7 +720,7 @@ $(function () {
"Error calling settings callback",
callback,
":",
exc.stack || exc.stacktrace || exc
`${exc.message}\n${exc.stack || exc}`
);
}
};
@@ -5,6 +5,7 @@ $(function () {
self.loginState = parameters[0];
self.settingsViewModel = parameters[1];
self.access = parameters[2];
self.printerState = parameters[3];
self._createToolEntry = function () {
var entry = {
@@ -116,6 +117,8 @@ $(function () {
self._currentTemperatureDataBacklog = [];
self._historyTemperatureDataBacklog = [];
self._graphUpdater = undefined;
self._printerProfileUpdated = function () {
var graphColors = ["red", "orange", "green", "brown", "purple"];
var heaterOptions = {};
@@ -528,7 +531,9 @@ $(function () {
gettext("Done"),
gettext("Cancel"),
gettext("Pause"),
gettext("Resume")
gettext("Resume"),
gettext("Connected"),
gettext("Disconnected")
];
self._initializePlot = function (force, plotInfo) {
@@ -664,7 +669,8 @@ $(function () {
": " +
targetTemp,
color: pusher.color(heaterOptions[type].color).tint(0.5).html(),
data: targets.length ? targets : [[now, undefined]]
data: targets.length ? targets : [[now, undefined]],
dashes: {show: true}
});
maxTemps.push(self.getMaxTemp(actuals, targets));
@@ -1112,6 +1118,24 @@ $(function () {
}
self.changeOffsetDialog = $("#change_offset_dialog");
self._graphUpdater = setInterval(() => {
if (self.printerState.isOperational()) return;
const now = Date.now() / 1000;
const entry = {};
_.each(_.keys(self.heaterOptions()), (type) => {
entry[type] = {actual: undefined, target: undefined};
});
entry["time"] = now;
self.temperatures = self._processTemperatureData(
now,
[entry],
self.temperatures
);
self.updatePlot();
}, 1000);
};
self.onStartupComplete = function () {
@@ -1129,7 +1153,12 @@ $(function () {
OCTOPRINT_VIEWMODELS.push({
construct: TemperatureViewModel,
dependencies: ["loginStateViewModel", "settingsViewModel", "accessViewModel"],
dependencies: [
"loginStateViewModel",
"settingsViewModel",
"accessViewModel",
"printerStateViewModel"
],
elements: ["#temp", "#temp_link", "#change_offset_dialog"]
});
});
@@ -0,0 +1,228 @@
/*
* jQuery.flot.dashes
*
* options = {
* series: {
* dashes: {
*
* // show
* // default: false
* // Whether to show dashes for the series.
* show: <boolean>,
*
* // lineWidth
* // default: 2
* // The width of the dashed line in pixels.
* lineWidth: <number>,
*
* // dashLength
* // default: 10
* // Controls the length of the individual dashes and the amount of
* // space between them.
* // If this is a number, the dashes and spaces will have that length.
* // If this is an array, it is read as [ dashLength, spaceLength ]
* dashLength: <number> or <array[2]>
* }
* }
* }
*/
(function($){
function init(plot) {
plot.hooks.drawSeries.push(function(plot, ctx, series) {
if (!series.dashes.show) return;
var plotOffset = plot.getPlotOffset(),
axisx = series.xaxis,
axisy = series.yaxis;
function plotDashes(xoffset, yoffset) {
var points = series.datapoints.points,
ps = series.datapoints.pointsize,
prevx = null,
prevy = null,
dashRemainder = 0,
dashOn = true,
dashOnLength,
dashOffLength;
if (series.dashes.dashLength[0]) {
dashOnLength = series.dashes.dashLength[0];
if (series.dashes.dashLength[1]) {
dashOffLength = series.dashes.dashLength[1];
} else {
dashOffLength = dashOnLength;
}
} else {
dashOffLength = dashOnLength = series.dashes.dashLength;
}
ctx.beginPath();
for (var i = ps; i < points.length; i += ps) {
var x1 = points[i - ps],
y1 = points[i - ps + 1],
x2 = points[i],
y2 = points[i + 1];
if (x1 == null || x2 == null) continue;
// clip with ymin
if (y1 <= y2 && y1 < axisy.min) {
if (y2 < axisy.min) continue; // line segment is outside
// compute new intersection point
x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
y1 = axisy.min;
} else if (y2 <= y1 && y2 < axisy.min) {
if (y1 < axisy.min) continue;
x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
y2 = axisy.min;
}
// clip with ymax
if (y1 >= y2 && y1 > axisy.max) {
if (y2 > axisy.max) continue;
x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
y1 = axisy.max;
} else if (y2 >= y1 && y2 > axisy.max) {
if (y1 > axisy.max) continue;
x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
y2 = axisy.max;
}
// clip with xmin
if (x1 <= x2 && x1 < axisx.min) {
if (x2 < axisx.min) continue;
y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
x1 = axisx.min;
} else if (x2 <= x1 && x2 < axisx.min) {
if (x1 < axisx.min) continue;
y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
x2 = axisx.min;
}
// clip with xmax
if (x1 >= x2 && x1 > axisx.max) {
if (x2 > axisx.max) continue;
y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
x1 = axisx.max;
} else if (x2 >= x1 && x2 > axisx.max) {
if (x1 > axisx.max) continue;
y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
x2 = axisx.max;
}
if (x1 != prevx || y1 != prevy) {
ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);
}
var ax1 = axisx.p2c(x1) + xoffset,
ay1 = axisy.p2c(y1) + yoffset,
ax2 = axisx.p2c(x2) + xoffset,
ay2 = axisy.p2c(y2) + yoffset,
dashOffset;
function lineSegmentOffset(segmentLength) {
var c = Math.sqrt(Math.pow(ax2 - ax1, 2) + Math.pow(ay2 - ay1, 2));
if (c <= segmentLength) {
return {
deltaX: ax2 - ax1,
deltaY: ay2 - ay1,
distance: c,
remainder: segmentLength - c
}
} else {
var xsign = ax2 > ax1 ? 1 : -1,
ysign = ay2 > ay1 ? 1 : -1;
return {
deltaX: xsign * Math.sqrt(Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))),
deltaY: ysign * Math.sqrt(Math.pow(segmentLength, 2) - Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))),
distance: segmentLength,
remainder: 0
};
}
}
//-end lineSegmentOffset
do {
dashOffset = lineSegmentOffset(
dashRemainder > 0 ? dashRemainder :
dashOn ? dashOnLength : dashOffLength);
if (dashOffset.deltaX != 0 || dashOffset.deltaY != 0) {
if (dashOn) {
ctx.lineTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY);
} else {
ctx.moveTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY);
}
}
dashOn = !dashOn;
dashRemainder = dashOffset.remainder;
ax1 += dashOffset.deltaX;
ay1 += dashOffset.deltaY;
} while (dashOffset.distance > 0);
prevx = x2;
prevy = y2;
}
ctx.stroke();
}
//-end plotDashes
ctx.save();
ctx.translate(plotOffset.left, plotOffset.top);
ctx.lineJoin = 'round';
var lw = series.dashes.lineWidth,
sw = series.shadowSize;
// FIXME: consider another form of shadow when filling is turned on
if (lw > 0 && sw > 0) {
// draw shadow as a thick and thin line with transparency
ctx.lineWidth = sw;
ctx.strokeStyle = "rgba(0,0,0,0.1)";
// position shadow at angle from the mid of line
var angle = Math.PI/18;
plotDashes(Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2));
ctx.lineWidth = sw/2;
plotDashes(Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4));
}
ctx.lineWidth = lw;
ctx.strokeStyle = series.color;
if (lw > 0) {
plotDashes(0, 0);
}
ctx.restore();
});
//-end draw hook
}
//-end init
$.plot.plugins.push({
init: init,
options: {
series: {
dashes: {
show: false,
lineWidth: 2,
dashLength: 10
}
}
},
name: 'dashes',
version: '0.1'
});
})(jQuery)
+2 -2
View File
@@ -1,2 +1,2 @@
/*! loglevel - v1.7.0 - https://github.com/pimterry/loglevel - (c) 2020 Tim Perry - licensed MIT */
!function(a,b){"use strict";"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(c){return"debug"===c&&(c="log"),typeof console!==i&&("trace"===c&&j?b:void 0!==console[c]?a(console,c):void 0!==console.log?a(console,"log"):h)}function d(a,b){for(var c=0;c<k.length;c++){var d=k[c];this[d]=c<a?h:this.methodFactory(d,a,b)}this.log=this.debug}function e(a,b,c){return function(){typeof console!==i&&(d.call(this,b,c),this[a].apply(this,arguments))}}function f(a,b,d){return c(a)||e.apply(this,arguments)}function g(a,b,c){function e(a){var b=(k[a]||"silent").toUpperCase();if(typeof window!==i&&l){try{return void(window.localStorage[l]=b)}catch(a){}try{window.document.cookie=encodeURIComponent(l)+"="+b+";"}catch(a){}}}function g(){var a;if(typeof window!==i&&l){try{a=window.localStorage[l]}catch(a){}if(typeof a===i)try{var b=window.document.cookie,c=b.indexOf(encodeURIComponent(l)+"=");-1!==c&&(a=/^([^;]+)/.exec(b.slice(c))[1])}catch(a){}return void 0===j.levels[a]&&(a=void 0),a}}var h,j=this,l="loglevel";"string"==typeof a?l+=":"+a:"symbol"==typeof a&&(l=void 0),j.name=a,j.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},j.methodFactory=c||f,j.getLevel=function(){return h},j.setLevel=function(b,c){if("string"==typeof b&&void 0!==j.levels[b.toUpperCase()]&&(b=j.levels[b.toUpperCase()]),!("number"==typeof b&&b>=0&&b<=j.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(h=b,!1!==c&&e(b),d.call(j,b,a),typeof console===i&&b<j.levels.SILENT)return"No console available for logging"},j.setDefaultLevel=function(a){g()||j.setLevel(a,!1)},j.enableAll=function(a){j.setLevel(j.levels.TRACE,a)},j.disableAll=function(a){j.setLevel(j.levels.SILENT,a)};var m=g();null==m&&(m=null==b?"WARN":b),j.setLevel(m,!1)}var h=function(){},i="undefined",j=typeof window!==i&&typeof window.navigator!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"],l=new g,m={};l.getLogger=function(a){if("symbol"!=typeof a&&"string"!=typeof a||""===a)throw new TypeError("You must supply a name when creating a logger.");var b=m[a];return b||(b=m[a]=new g(a,l.getLevel(),l.methodFactory)),b};var n=typeof window!==i?window.log:void 0;return l.noConflict=function(){return typeof window!==i&&window.log===l&&(window.log=n),l},l.getLoggers=function(){return m},l.default=l,l});
/*! loglevel - v1.8.1 - https://github.com/pimterry/loglevel - (c) 2022 Tim Perry - licensed MIT */
!function(a,b){"use strict";"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(c){return"debug"===c&&(c="log"),typeof console!==i&&("trace"===c&&j?b:void 0!==console[c]?a(console,c):void 0!==console.log?a(console,"log"):h)}function d(a,b){for(var c=0;c<k.length;c++){var d=k[c];this[d]=c<a?h:this.methodFactory(d,a,b)}this.log=this.debug}function e(a,b,c){return function(){typeof console!==i&&(d.call(this,b,c),this[a].apply(this,arguments))}}function f(a,b,d){return c(a)||e.apply(this,arguments)}function g(a,b,c){function e(a){var b=(k[a]||"silent").toUpperCase();if(typeof window!==i&&m){try{return void(window.localStorage[m]=b)}catch(a){}try{window.document.cookie=encodeURIComponent(m)+"="+b+";"}catch(a){}}}function g(){var a;if(typeof window!==i&&m){try{a=window.localStorage[m]}catch(a){}if(typeof a===i)try{var b=window.document.cookie,c=b.indexOf(encodeURIComponent(m)+"=");-1!==c&&(a=/^([^;]+)/.exec(b.slice(c))[1])}catch(a){}return void 0===l.levels[a]&&(a=void 0),a}}function h(){if(typeof window!==i&&m){try{return void window.localStorage.removeItem(m)}catch(a){}try{window.document.cookie=encodeURIComponent(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(a){}}}var j,l=this;b=null==b?"WARN":b;var m="loglevel";"string"==typeof a?m+=":"+a:"symbol"==typeof a&&(m=void 0),l.name=a,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=c||f,l.getLevel=function(){return j},l.setLevel=function(b,c){if("string"==typeof b&&void 0!==l.levels[b.toUpperCase()]&&(b=l.levels[b.toUpperCase()]),!("number"==typeof b&&b>=0&&b<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(j=b,!1!==c&&e(b),d.call(l,b,a),typeof console===i&&b<l.levels.SILENT)return"No console available for logging"},l.setDefaultLevel=function(a){b=a,g()||l.setLevel(a,!1)},l.resetLevel=function(){l.setLevel(b,!1),h()},l.enableAll=function(a){l.setLevel(l.levels.TRACE,a)},l.disableAll=function(a){l.setLevel(l.levels.SILENT,a)};var n=g();null==n&&(n=b),l.setLevel(n,!1)}var h=function(){},i="undefined",j=typeof window!==i&&typeof window.navigator!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"],l=new g,m={};l.getLogger=function(a){if("symbol"!=typeof a&&"string"!=typeof a||""===a)throw new TypeError("You must supply a name when creating a logger.");var b=m[a];return b||(b=m[a]=new g(a,l.getLevel(),l.methodFactory)),b};var n=typeof window!==i?window.log:void 0;return l.noConflict=function(){return typeof window!==i&&window.log===l&&(window.log=n),l},l.getLoggers=function(){return m},l.default=l,l});
+6
View File
@@ -608,6 +608,12 @@ table {
.temperature-mark-type-done {
background-color: #1b72f9;
}
.temperature-mark-type-connected {
background-color: #666666;
}
.temperature-mark-type-disconnected {
background-color: #333333;
}
/** Various */
@@ -9,37 +9,4 @@
</div>
</div>
</fieldset>
<fieldset>
<h3>{{ _('Global API Key') }}</h3>
<div class="alert">
<p>{% trans %}
It is recommended to no longer use the global API key as it's one single key that gives full admin access
to your whole OctoPrint instance. <strong>It will be removed in OctoPrint 2.0</strong>.
Instead of using the global key you should create individual Application Keys for
your third party clients. That way they get permissions matching the user account used for key
creation and you can also revoke access to one app without having to change the keys for all other apps.
It's also recommended to create a user account without admin access and use that for third
party clients where possible.
{% endtrans %}</p>
<p><a href="javascript:void(0)" data-bind="click: function() { $root.selectTab('#settings_plugin_appkeys') }">{{ _('Access Application Keys') }}</a></p>
</div>
<div class="control-group">
<label class="control-label" for="settings-apikey">{{ _('Global API Key') }}</label>
<div class="controls">
<div class="input-append input-block-level">
<input type="text" readonly="readonly" id="settings-apikey" data-bind="value: api_key, attr: {placeholder: '{{ _('N/A')|esq }}'}">
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApiKey, css: {'disabled': !api_key()}"><i class="fas fa-copy"></i></a>
<a class="btn add-on" title="Generate new API Key" data-bind="click: generateApiKey"><i class="fas fa-sync"></i></a>
</div>
<span class="help-block">{{ _('Please note that changes to the API key are applied immediately, without having to "Save" first.') }}</span>
</div>
</div>
<div class="control-group" data-bind="visible: api_key">
<label class="control-label">{{ _('QR Code') }}</label>
<div class="controls">
<div data-bind="qrcode: {text: api_key, size: 180}"></div>
</div>
</div>
</fieldset>
</form>
+3 -3
View File
@@ -882,9 +882,9 @@ class ZTimelapse(Timelapse):
and payload["old"] is not None
and payload["new"] is not None
):
diff = round(abs(payload["new"] - payload["old"]), 3)
zhop = round(self._retraction_zhop, 3)
if diff == zhop:
diff = abs(payload["new"] - payload["old"])
zhop = self._retraction_zhop
if abs(diff - zhop) < 0.001:
return
# check if last picture has been less than min_delay ago, if so don't take a picture (anti vase mode...)
+8 -1
View File
@@ -320,6 +320,12 @@ to_str = deprecated(
since="1.3.11",
)(to_bytes)
to_native_str = deprecated(
"to_native_str is no longer needed",
includedoc="to_native_str is no longer needed, use to_unicode",
since="2.0.0",
)(to_unicode)
to_native_str = deprecated(
"to_native_str is no longer needed, use to_unicode instead",
@@ -468,7 +474,7 @@ def get_exception_string(fmt="{type}: '{message}' @ {file}:{function}:{line}"):
def sanitize_ascii(line):
if not isinstance(line, (str, bytes)):
raise ValueError(
"Expected str but got {} instead".format(
"Expected either str or bytes but got {} instead".format(
line.__class__.__name__ if line is not None else None
)
)
@@ -1004,6 +1010,7 @@ def atomic_write(
yield fd
finally:
fd.close()
os.chmod(fd.name, permissions)
shutil.move(fd.name, filename)
finally:
+1 -4
View File
@@ -51,10 +51,7 @@ from octoprint.util.platform import get_os, set_close_exec
try:
import winreg
except ImportError:
try:
import _winreg as winreg # type: ignore
except ImportError:
pass
pass
_logger = logging.getLogger(__name__)
-1
View File
@@ -1,5 +1,4 @@
"""
This module contains a functions that monkey patch third party dependencies in the one or other way.
"""
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
+1 -1
View File
@@ -655,7 +655,7 @@ class gcode:
elif gcode == "G20": # Units are inches
scale = 25.4
elif gcode == "G21": # Units are mm
scale = 1.0
scale = 1
elif gcode == "G28": # Home
x = getCodeFloat(line, "X")
y = getCodeFloat(line, "Y")
-2
View File
@@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
-3
View File
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
flask_principal
~~~~~~~~~~~~~~~
@@ -10,8 +9,6 @@
"""
from __future__ import with_statement
__version__ = '0.4.0'
import sys
-3
View File
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
-3
View File
@@ -1,5 +1,2 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from .router import SockJSRouter
from .conn import SockJSConnection
-3
View File
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
sockjs.tornado.periodic
~~~~~~~~~~~~~~~~~~~~~~~
-1
View File
@@ -2,7 +2,6 @@ __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import unittest
from ddt import data, ddt, unpack
-1
View File
@@ -2,7 +2,6 @@
Unit tests for ``octoprint.server.api``.
"""
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2016 The OctoPrint Project - Released under terms of the AGPLv3 License"
-1
View File
@@ -2,7 +2,6 @@
Unit tests for ``octoprint.server.api`` system.
"""
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2016 The OctoPrint Project - Released under terms of the AGPLv3 License"
+6 -8
View File
@@ -11,11 +11,11 @@ import unittest
from ddt import data, ddt, unpack
##~~ _parse_header
@ddt
class ParseHeaderTest(unittest.TestCase):
"""Tests for _parse_header"""
@data(
("form-data; filename=test.gco", "form-data", {"filename": "test.gco"}),
('form-data; filename="test.gco"', "form-data", {"filename": "test.gco"}),
@@ -56,11 +56,10 @@ class ParseHeaderTest(unittest.TestCase):
self.assertDictEqual(expected_dict, actual_dict)
##~~ _strip_value_quotes
@ddt
class StripValueQuotesTest(unittest.TestCase):
"""Tests for _strip_value_quotes"""
@data(
("", ""),
(None, None),
@@ -78,11 +77,10 @@ class StripValueQuotesTest(unittest.TestCase):
self.assertEqual(expected, actual)
##~~ _extended_header_value
@ddt
class ExtendedHeaderValueTest(unittest.TestCase):
"""Tests for _extended_header_value"""
@data(
("", ""),
(None, None),
+6 -2
View File
@@ -58,11 +58,13 @@ class SettingsTest(unittest.TestCase):
with self.mocked_basedir() as basedir:
# construct settings
settings = octoprint.settings.Settings()
settings.set(["appearance", "name"], "unit test")
settings.save()
# verify
self.assertTrue(os.path.isdir(basedir))
self.assertTrue(os.path.isfile(os.path.join(basedir, "config.yaml")))
self.assertIsNotNone(settings.get(["api", "key"]))
self.assertIsNotNone(settings.get(["appearance", "name"]))
def test_basedir_folder_creation(self):
with self.mocked_basedir() as basedir:
@@ -95,7 +97,9 @@ class SettingsTest(unittest.TestCase):
my_basedir = tempfile.mkdtemp("octoprint-settings-test-custom")
self.assertNotEqual(my_basedir, default_basedir)
octoprint.settings.Settings(basedir=my_basedir)
settings = octoprint.settings.Settings(basedir=my_basedir)
settings.set(["appearance", "name"], "unit test")
settings.save()
self.assertFalse(
os.path.isfile(os.path.join(default_basedir, "config.yaml"))
+11 -5
View File
@@ -206,9 +206,12 @@ class TestAtomicWrite(unittest.TestCase):
mock_ntf.return_value = mock_file
mock_exists.return_value = False
umask = 0o026
# test
with octoprint.util.atomic_write(targetpath) as f:
f.write("test")
with mock.patch("octoprint.util.UMASK", umask):
with octoprint.util.atomic_write(targetpath) as f:
f.write("test")
# assert
mock_ntf.assert_called_once_with(
@@ -227,7 +230,7 @@ class TestAtomicWrite(unittest.TestCase):
def test_atomic_write_rel_path_aware(
self, mock_exists, mock_chmod, mock_ntf, mock_move
):
"""Tests whether the tempoary file is to created in the same directory as the target file. This time submitting a relative path."""
"""Tests whether the temporary file is to created in the same directory as the target file. This time submitting a relative path."""
# setup
tmpdirpath = "../test"
@@ -240,9 +243,12 @@ class TestAtomicWrite(unittest.TestCase):
mock_ntf.return_value = mock_file
mock_exists.return_value = False
umask = 0o026
# test
with octoprint.util.atomic_write(targetpath) as f:
f.write("test")
with mock.patch("octoprint.util.UMASK", umask):
with octoprint.util.atomic_write(targetpath) as f:
f.write("test")
# assert
mock_ntf.assert_called_once_with(