Commit graph

2733 commits

Author SHA1 Message Date
Gina Häußge
5aad696c5c Do not enable timelapse if settings are missing
If snapshot url and/or ffmpeg path are not set, the timelapse cannot
work regardless of what type has been configured.

So if the current configuration still contains a timelapse type other
than "off" but snapshot url or ffmpeg path are unset, force a disabled
timelapse.

Fixes #2206
2017-11-06 12:24:19 +01:00
Gina Häußge
9837f67140 Small adjustments in webasset filters
* Add comment with source file to JsDelimiterBundler and
    JsPluginDelimiterBundler
  * Include source file name in JsPluginDelimiterBundler catch
    block and use log.error instead of console.error
2017-11-06 11:39:11 +01:00
Josh Major
dc53942015 Added plugin Javascript isolation 2017-11-04 10:08:04 -05:00
Gina Häußge
79581c390a Prefer plain pip over git for updating OctoPrint
At least unless we've selected git based tracking over release tracking.

This should greatly reduce the likelihood of not being able to update
due to some git repository corruption issues, as has happened to some
people in the past.
2017-11-03 16:31:21 +01:00
Gina Häußge
c30e54d75c Slight rewording/typo correction 2017-11-03 14:55:55 +01:00
Gina Häußge
55adb7ca33 Support sub codes for auto upper casing too
If either the full code or just the main code are blacklisted, only
upper case the code. Otherwise also upper case the parameter list.

In any case push originally entered command to history, not the
modified one.
2017-11-03 14:48:45 +01:00
Peter Backx
ce16f861b3 Implemented @foosel's suggestions + made the blacklist settings actually work [#1026]
(cherry picked from commit 1857f07)
2017-11-03 12:44:25 +01:00
Ishwar Agarwal
51406b7c42 Auto uppercase Gcode except commands in configurable blacklist
Added new config setting: auto uppercase blacklist that is configurable
in the advanced option of the serial tab, with M117 included in the
default settings of the blacklist. Changed the sendCommand method in the
TerminalViewModel to auto uppercase the entire gcode command except when
gcode is in the blacklist. Updated documentation to include the default
auto uppercase blacklist command M117.

Resolves: #1026

(cherry picked from commit dbf7af1)
2017-11-03 12:44:05 +01:00
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