Commit graph

4344 commits

Author SHA1 Message Date
Gina Häußge
b7e2b0f794 Fixed login dropdown not auto closing on click outside of it
When two wrongs make one right...
2017-02-28 09:54:36 +01:00
Gina Häußge
f02fac20ed Only do lookup by userid if session is None 2017-02-27 15:51:24 +01:00
Gina Häußge
755bcaa311 Add current path to "Back" button in file list
Closes #1712
2017-02-24 15:05:26 +01:00
Gina Häußge
aab98a7c9f Disable "Slice" button when printing and local slicer is selected
Solves #1631
2017-02-24 13:21:33 +01:00
Gina Häußge
3a984d41ff Remove color option in printer profile editor
We don't use it anywhere and its presence keeps confusing users. Kept
in the model since we might want to use it at some later time.

Closes #1790
2017-02-24 12:38:37 +01:00
Gina Häußge
28d01e2fa6 Disable external heatup detection until firmware is detected 2017-02-24 12:32:05 +01:00
Gina Häußge
2198add8e6 SWU: Refresh cache on startup & prevent concurrent refresh & fix hash 2017-02-24 11:56:02 +01:00
Gina Häußge
1de307e15d Log version, safe mode & plugins to log on log roll over
We want to make sure that information is ALWAYS in each and every log.
2017-02-24 10:53:16 +01:00
Gina Häußge
aab7b7f797 Timelapse: ignore both z-hop flanks but allow z-hop to next layer
Former implementation tested for z-hop rising flank and anything that
is falling. That however causes issues with z-hop directly followed
by layer change (diff is not z-hop size but negative, image hence not
captured).

Instead of testing for positive flank == z-hop and any negative flank,
we now test for absolute value == z-hop.

Solves #1777
2017-02-23 17:17:38 +01:00
Gina Häußge
162e8c50d3 Fixed CSS and LESS bundling for core vs plugins vs all 2017-02-23 17:05:42 +01:00
Gina Häußge
636d8e0faa Eventhandling: Wait for command to finish before triggering next
Should solve #733
2017-02-23 16:50:04 +01:00
Gina Häußge
62890ef73a Fix a bunch of caching issues
Cache was not invalidated on change of:

  * snapshot URL presence
  * system menu entry presence
  * gcode viewer enabled/disabled
  * changes in access control availability

Refactored cache setup to add enable_timelapse, enable_gcodeviewer
and enable_accesscontrol to ETag calculation, removed system menu
check. Template filtering will now be done based on the values of
these flags at render time, not before.

See also #1776 for a related ticket.
2017-02-23 14:49:47 +01:00
Gina Häußge
79af90dd6a Make sure we don't try to use an empty logging.yaml
Fixes #1560
2017-02-22 18:25:12 +01:00
Gina Häußge
d15262e7cc Fixed wrong replacement for __progress placeholder in events
Data reported from printer backend is already percent, multiplying it
with 100 again produces wrong values.
2017-02-22 17:58:21 +01:00
Gina Häußge
41f0ed0124 Move announcements between system and login 2017-02-22 15:20:07 +01:00
Gina Häußge
ff595a7e31 Move notifications down a bit
See discussion in #1741
2017-02-22 15:19:04 +01:00
Gina Häußge
444312d7d9 Free up some space in the navbar
* Use only icons for settings and system entries
  * Limit length of login entry to 100px
  * Limit length of instance name to 250px
  * Removed "OctoPrint" text if instance name is set

See discussion in #1741
2017-02-22 15:17:39 +01:00
Gina Häußge
c3740dd59d Added development dependencies to THIRDPARTYLICENSES 2017-02-21 17:14:39 +01:00
Gina Häußge
c203d79434 Remove empty-folder-filter
Doesn't really add anything and only causes issues for people.

Solves #1671
2017-02-21 17:06:26 +01:00
Gina Häußge
6dce2bc250 Added missing entries to THIRDPARTYLICENSES.md 2017-02-21 17:02:05 +01:00
Gina Häußge
cad66fcea7 Added @ghulands to AUTHORS.md 2017-02-21 16:55:17 +01:00
Gina Häußge
ed46d9967a Adjusted docs of slicing API to match implementation
Follow-up to PR #1748
2017-02-21 14:17:14 +01:00
Eyal Soha
6aae0017c4 add sameDevice to SlicingViewModel
(cherry picked from commit fea0791)
2017-02-21 14:15:02 +01:00
Eyal Soha
ebe93f9a6d add same device to the slicing API
(cherry picked from commit ce38ef6)
2017-02-21 14:14:54 +01:00
Greg Hulands
a16680b453 Issue #1780: Safari Webcam Fix.
(cherry picked from commit e82efd2)
2017-02-21 14:13:26 +01:00
Gina Häußge
9f963696c8 Interpret wait during connect fully as ok
Otherwise we might switch to connected state but lack an
acknowledgement to send the next lines and stay in a wait cycle.

Also related to #1770
2017-02-20 12:44:42 +01:00
Gina Häußge
7f0eb8d895 Hex-escape unprintable characters in terminal tab
If there's any binary going over the line like null bytes, we want to
see that here too.
2017-02-20 12:05:38 +01:00
Gina Häußge
e1eaf4eb8e comm: More resilience against garbage on the line during connect
* leading and trailing null bytes will now be stripped
  * while connecting, a "wait" will also trigger switch to connected
    state - relevant when connecting without reset and initial "ok" for
    M110 gets mangled
  * extended virtual printer by new options to test the above:
      * mangled "ok" can now be injected via "preparedOks" setting and
        prepare_ok DEBUG command
      * simulated reset lines on beginning ("start" etc) now only sent
        if new setting "simulateReset" is true

Should fix #1770
2017-02-20 11:57:47 +01:00
Gina Häußge
b8cbe02b7a Fixed docs for config.yaml and settings 2017-02-17 13:52:16 +01:00
Gina Häußge
4cc410133b Fixed description of a setting 2017-02-17 13:52:16 +01:00
Gina Häußge
216f05d553 Hibernate communication with printer during active G4 on Repetier
Should hopefully solve #1506
2017-02-17 13:52:16 +01:00
Gina Häußge
7beabf953c Fixed user unit tests 2017-02-17 13:43:47 +01:00
Gina Häußge
b7c078f429 Fixed size checking in watchdog growth check
It helps to actually update the last checked file size on each
iteration 🤦‍♀️

Related to #1760
2017-02-17 13:05:23 +01:00
Gina Häußge
7331bc2bf5 Ensure file from watched folder is stable in size before upload
Additional fix for #1760
2017-02-16 19:30:58 +01:00
Gina Häußge
59f49f392e Refactored upload/watched to use file check methods in PrinterInterface
Extracted methods to check if modification of a file is possible and
to determine if a specific file is currently select to take care of
denying upload and re-selecting file after upload.

Refactored watched folder handler to use the same methods and mirror
behaviour of file upload via API.

Should solve #1760
2017-02-16 19:29:21 +01:00
Gina Häußge
997e0b510b Abort file analysis if file is about to be overwritten 2017-02-16 16:52:30 +01:00
Gina Häußge
1f9b8f40cd Enqueue copied/moved files/folders for analysis
Fixes #1775
2017-02-15 17:35:42 +01:00
Gina Häußge
8630ec5beb Fix some bugs in the client lib refactoring
* Endless recursion on file delete as reported in #1738
  * Broken implementation of .move
  * Broken definition of .pathForEntry, .entryForPath,
    .pathForElement and .elementByPath
2017-02-15 16:15:35 +01:00
Gina Häußge
e8349d6593 Always create a user session for requests with an API key
API endpoints that were not decorated with restricted_access so far did
not properly create a user session for cookie-less requests with an API
key only.

That meant that flask.current_user stayed an anonymous user, even with
the global admin API key. In case of /api/settings that meant that even
with the global admin API key it was not possible to read settings that
are admin-only (like the API key for example) or user-only.

This has now been rectified by moving the session creation into a
different before_request handler that is registered globally on all API
endpoints, meaning that an API key will now always lead to a user
session to be created, regardless of the requirements of the API
endpoint in question. Additionally the CORS handling was extracted
as well as the API key presence enforcement.

BlueprintPlugins will now also get the CORS and session-from-API-Key
treatment if they do not declare their endpoints as restricted.

Might solve the API key "n/a" issue filed in #1751, but since the cause
of that isn't identified yet that's not sure.
2017-02-15 13:12:35 +01:00
Gina Häußge
9b457cce9e Fixed user settings API 2017-02-15 11:38:33 +01:00
Gina Häußge
b2229ae24a SWU: Ignore empty or None configs 2017-02-14 15:03:20 +01:00
Gina Häußge
189c842881 dict_merge should not hiccup on None values 2017-02-14 15:02:33 +01:00
Gina Häußge
6963e5e495 SWU: We need to do that overwrite protection differently
Only replace data from config.yaml with merged results once everything
trying to overwrite stuff is filtered out.
2017-02-14 12:52:07 +01:00
Gina Häußge
7b6642f7c2 SWU: Better resilience against overwriting of update configs
Don't allow overwriting of "octoprint" config through plugins, don't
allow overwriting of already registered configs unless id to register
matches plugin identifier (in which case the already registered config
was probably a case of a copy-paste-error from another plugin).
2017-02-14 11:14:03 +01:00
Gina Häußge
5d97dc4b40 Better resilience against broken software update configs
Fixes #1773
2017-02-14 10:42:02 +01:00
Paul de Vries
b453897ea3 Upgrade LESS.min.js from 2.7.1 to 2.7.2
This will fix the broken contrast function introduced in 2.7.1

This commit will only affect the contrast function
See more @ https://github.com/less/less.js/compare/v2.7.1...v2.7.2#diff-8c2e50ef84a06711745a46e22c67d631
2017-02-05 14:45:10 +01:00
Gina Häußge
54a9a7b906 Use codecs.open for translation po files 2017-01-26 17:22:51 +01:00
Gina Häußge
a3f24c59e9 Don't render untranslated strings to messages.js 2017-01-26 17:22:07 +01:00
Gina Häußge
42f4fad257 Fixed minor doc issue 2017-01-26 15:00:06 +01:00
Gina Häußge
eaadf8743b Allow multiple instances of the JS client
We now have a global OctoPrintClient, which is the class from which
all clients are derived, and a global OctoPrint, which is a single
instance already setup and ready to use in case we only need one.

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

New clients can be create with

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

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

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

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

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

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

See #1681 for the corresponding discussion.
2017-01-26 14:59:56 +01:00