Commit graph

2725 commits

Author SHA1 Message Date
Peter Backx
a0df4e78b5 Fixing Sphinx warnings during doc generation 2017-11-03 11:11:52 +01:00
Gina Häußge
772ee76e76 More hardening against invalid requests
See #2189
2017-11-02 09:36:53 +01:00
Gina Häußge
caaaa2e4e9 Fix temperature autoreport after external reset
We didn't reset the capability flag and also didn't resend M155. Now we
do at least the latter if we detected that the printer supports
temperature auto reporting earlier.
2017-10-30 12:59:43 +01:00
Gina Häußge
02aad445aa Hardening against system.actions = null
See #2187
2017-10-30 12:36:09 +01:00
Gina Häußge
bf7d4173cd Fix auto-adjust of temperature y axis
Thanks @Salandora for the heads-up
2017-10-27 14:22:03 +02:00
Shawn Bruce
b2552795dc Set tools actual/target to 0 if they dont exist. 2017-10-26 13:12:38 -04:00
Shawn Bruce
4b5eff5ec6 Don't set target temp for tools that do not exist. 2017-10-26 12:42:55 -04:00
Gina Häußge
bedcbb80be Set a minimum delay of 1s between snapshots
Followup to #2067
2017-10-26 16:38:40 +02:00
Gina Häußge
09509ca61d Refactor timelapse form & add reset button 2017-10-26 16:33:00 +02:00
Gina Häußge
8bf3f4ff50 Rate limit snapshots on for z-timelapses
This is to prevent against an endless stream of snapshots when
accidentally printing a vase mode file despite the warning.

As mentioned in #2067
2017-10-26 16:03:54 +02:00
Gina Häußge
490ef61e19 If serial.log is disabled, log how to enable it
That will hopefully help a bit against the endless stream of "serial
.log was empty" statements on the bug tracker. Or not. Here's hope.
2017-10-26 13:13:21 +02:00
Gina Häußge
a1548e1c1d Fix issue in M115 parser
If FIRMWARE_NAME is not there, but NAME is neither, we'd run into an
exception due to the Malyan detection. Not anymore.

Fixes #2181
2017-10-26 13:12:09 +02:00
Gina Häußge
77e48335da Virtual printer: support config of reset lines
Also updated config docs accordingly.
2017-10-26 13:10:54 +02:00
Gina Häußge
14b8fd7fa5 Only send "deactivated" status if password matches 2017-10-25 17:30:56 +02:00
Gina Häußge
0afa854763 Support a centralized plugin blacklist (opt-in)
A centralized plugin blacklist read from plugins.octoprint.org on server
start now allows us to stop plugins from being loaded that are known to
cause severe issues with OctoPrint's regular operation.

Blacklist entries can be restricted for specific plugin versions &
OctoPrint versions, allowing for very granular control of any kind of
blocking.

Additionally users may disable blacklist processing in general (an
opt-in wizard and a new section in the settings have been added) and
at server start via the new --ignore-blacklist parameter available for
"octoprint serve" and "octoprint daemon".

If a plugin is blacklisted, OctoPrint will not even import the
plugin module in question (if only a plugin key is specified OR a key
and a version and the plugin's version is already known during import
time, which is the case for plugins loaded from entry points) or at the
very least stop the plugin from being enabled (if a plugin key and a
version is specified and the plugin's version is only known after
loading, which is the case for plugins loaded from directories).
2017-10-25 17:29:00 +02:00
Marc Hannappel
3d1f3be4fc Make sure that deactivated Users can't login 2017-10-25 14:40:49 +02:00
Gina Häußge
38c410f80f New sub command "octoprint safemode"
Sets server.startOnceInSafeMode flag to true. Probably easier for a lot
of people than editing a config file or running OctoPrint manually from
command line, in case the built-in "Restart in safe mode" system command
is not an option.
2017-10-24 13:23:10 +02:00
Gina Häußge
46bd2ce7e9 Fix "octoprint config" sub command 2017-10-24 12:31:44 +02:00
Gina Häußge
10fc631700 More error resilience against broken view models
We so far only protected the binding process itself against errors
triggered inside view models. Now we are also more resilient against
issues arising in view model callbacks like onBeforeBinding,
onBoundTo and onAfterBinding as well as exceptions during plugin
instantiation itself.

Triggered by jneilliii/OctoPrint-TPLinkSmartplug#19 which was also
reported on OctoPrint's tracker as #2168, #2170 and #2171 and on OctoPi
as guysoft/OctoPi#427.
2017-10-24 10:37:25 +02:00
Gina Häußge
8f78784be3 Add safety warning to first run wizard
There are too many printers out there with crappy electronics that are
just waiting to go up in smoke, and people keep leaving those alone
because "they are monitoring them via OctoPrint, so nothing can happen".
So let's add a safety warning, in the hopes that will bring at least
some people to their senses or at the very least force them into making
the conscious decision to blow all warnings into the wind.
2017-10-23 18:41:42 +02:00
Gina Häußge
4479dd0222 Fix API key copy function in user list
Was firing on page load instead of only when clicked m(
2017-10-23 15:42:17 +02:00
Gina Häußge
9466e5d001 Some cleanup and renaming 2017-10-23 13:51:00 +02:00
Gina Häußge
4b3d883639 Don't evaluate onWebcamLoaded more than once
Firefox for some reason keeps triggering the event and we don't want to
do unnecessary work on each trigger (and flood the log with debug
statements).
2017-10-23 13:51:00 +02:00
Gina Häußge
4439f5aad0 Workaround for a Firefox bug
Firefox doesn't trigger dragleave if the mouse leaves the browser
window to another window on top during an active drag. That leaves
OctoPrint stuck with the drag-n-drop overlay.

Adding a timeout for dragover for only Firefox that clears the overlay
solves this issue.

Solves #2166
2017-10-23 13:51:00 +02:00
Gina Häußge
c8e5820c7d Change wording of a tooltip
Closes #2167
2017-10-23 11:02:39 +02:00
Gina Häußge
21cc58ad14 GCO viewer: Persist options to localStorage
See #443
2017-10-20 19:34:39 +02:00
Gina Häußge
b65a3bb903 GCO viewer: Add advanced options
Allow user toggling of sortLayers and hideEmptyLayers.

As suggested in #1973
2017-10-20 19:24:33 +02:00
Gina Häußge
e49adcac85 GCO viewer: Fix error on empty layers 2017-10-20 19:22:39 +02:00
Gina Häußge
e7b455f880 New hook octoprint.accesscontrol.keyvalidator
Allows plugins to provide their own API keys which then can be
validated/translated into a User instance via this hook.
2017-10-19 13:15:18 +02:00
Gina Häußge
a9819cc2f9 b/h5 => strong on new reset warnings 2017-10-18 17:19:45 +02:00
Gina Häußge
0b95894da1 Test button for online connectivity check
As suggested by @ntoff.
2017-10-18 17:12:21 +02:00
Gina Häußge
9c3d7bbbc3 New server subcommand on test API
Tests if a host/port combination is reachable via server_reachable.
2017-10-18 17:11:22 +02:00
Gina Häußge
01b3b8a0e0 Make first slicing profile the default
We also reflect that in the Cura profile import dialog by checking and
disabling modification of the corresponding checkbox if no profiles are
yet available.
2017-10-18 16:01:48 +02:00
Gina Häußge
50983c8524 Fix initial size of temperature graph
Plot area was wrongly sized due to (invisible) X axis tick labels.

We now initialize an empty plot to min/max timestamps of "now" to
circumvent this. Additionally plot was not properly initialized on
initial load of page due to onAfterTabChange not firing for the first
tab.

Also added a bit for tick labels.
2017-10-18 12:39:38 +02:00
Gina Häußge
e99f762974 Cura Plugin: Less "not configured yet" logging 2017-10-17 18:59:40 +02:00
Gina Häußge
468155c9c8 Fix cache invalidation on slicing API
Wasn't properly revalidating when an already registered slicer switched
between unconfigured and configured.

Also adjusted data format version tracking on files and slicing API to
match.
2017-10-17 18:59:05 +02:00
Gina Häußge
7df78defb1 Make data version part of etag
We might add fields to things like file entries (e.g. "display") and in
such cases want to refetch the list even if the files itself didn't
change, to make sure those new fields are available to the clients.

See https://github.com/foosel/OctoPrint/issues/2111#issuecomment-337164940
2017-10-17 11:05:43 +02:00
Gina Häußge
fd53f47f86 Wider scrollbars & no fade out
Increased scrollbar width of file list and plugin repository list to
10px (from 5px). Fixed scroll bar hiding itself on initialization due to
alwaysVisible not properly persisting the initial binding.

Enhance knockout binding syntax for slimScrolledForeach: slimscroll
initialization parameters may now be provided during data binding via
the additional slimscroll property accepted as part of the extended
foreach syntax, e.g.

slimScrolledForEach: {data: ..., slimscroll: {alwaysVisible: true, ...}}

Implements #2111
2017-10-13 17:52:54 +02:00
Gina Häußge
af4f97f2df Updated slimscroll.js to version 1.3.8 2017-10-13 17:52:54 +02:00
Gina Häußge
44f5916cd4 Faster animation speed & close on PNotify 2017-10-13 17:52:54 +02:00
Gina Häußge
4e80d69e51 SWU: Always auto-hide up-to-date info
See #2042
2017-10-13 17:52:54 +02:00
ntoff
a21934abba add print interruption warning to auto update dialog 2017-10-13 13:04:38 +10:00
Gina Häußge
42ac133436 Support full UTF8 file names
Files (and folders) are still slugified to ASCII for storage on disk,
but now the original filename is stored alongside in metadata.yaml
and used for display in the file list and print status.

The slicing dialog also inherits that display name for use as base
for the suggested GCODE name.

Internally, everything still depends completely on the slugified
ASCII version.

This implements #2094
2017-10-12 18:08:41 +02:00
Gina Häußge
42018ae29a starts_with => startswith
Now that was embarrassing.

Fixes #2151
2017-10-11 16:27:51 +02:00
Gina Häußge
054bbd8a9b comm: no need to fetch potential ports again 2017-10-11 16:20:37 +02:00
Gina Häußge
4093995ba0 STK500v2: Retries for reading from serial
This would normally not fly at all but we give it a pass here since we
only use that module for auto detection anyhow (and probably not for
much longer since that approach is simply too error prone).

Adapted from

  https://github.com/foosel/OctoPrint/issues/2138#issuecomment-334117910

by @dtynan.

Solves #2138 until I come up with something better
2017-10-11 16:19:37 +02:00
Gina Häußge
d1fdbd5080 More lenient check for unrendered timelapses
Only delete automatically if modification AND creation date are older
than the calculated cutoff.
2017-10-10 12:51:43 +02:00
Gina Häußge
abfcc6e5aa Fix deletion of unrendered timelapses
If the filename contained a [] pair, the file would not match the glob
pattern used for selecting for deletion.

Backporting the glob.escape function from Python 3.4 and using it here
should fix that. We only use our own ported version if glob.escape
doesn't exist - that should reduce redundant code once we become Python
3 compatible.
2017-10-10 12:41:47 +02:00
Gina Häußge
b89b6970c6 Fix temperature plot init if it's not the 1st tab
If the temperature graph was not on the first tab, the plot would be
initialized without being visible, causing some sizing issues and
alignment issues with the Y axis ticks.

Forcing the plot to only get initialized once visible solves these
problems.

Fixes #2147
2017-10-09 15:57:52 +02:00
ntoff
178131945e Add possible print distruption warning to shutdown dialog 2017-10-06 09:32:49 +10:00