Commit graph

294 commits

Author SHA1 Message Date
Gina Häußge
0e863ad776 Made diskspace running low a bit more obvious
* Added "total" space to "free" in file list
  * Added configurable space thresholds. If free space is below "warning"
    threshold, exclamation sign will be added to report. If free space is below
    "critical" threshold, report will be styled bold and red.
(cherry picked from commit 097800a)
2015-08-27 17:14:10 +02:00
Gina Häußge
ac8faf7910 Also provide branch info to UI/on socket
(cherry picked from commit cc8dcef)
2015-08-26 16:02:29 +02:00
Nicanor Romero Venier
1343a4a253 Added settings to specify server commands.
Added commands for system shutdown and restart and
for server restart.
(cherry picked from commit dab3285)
2015-08-26 15:53:30 +02:00
Gina Häußge
ba6a6723a6 Settings dialog for new resend setting
(cherry picked from commit 4525a3a)
2015-08-24 14:59:51 +02:00
Gina Häußge
8c1a79558b Always include timelapse view model in bundled js files
Even if the webcam URLs and the FFMPEG path is not yet configured. Otherwise
setting those URLs and the path will require a restart of OctoPrint to enable properly -
that's overkill.
(cherry picked from commit 1425b20)
2015-08-24 14:52:50 +02:00
Salandora
0ff43def3a Fix sorting of templates
(cherry picked from commit 3866c1a)
2015-08-14 09:01:02 +02:00
Gina Häußge
e33f69917f Made webassets folder cleanup win32-proof
If re-creation of the folder fails due to an access error, perform three retries. It might
be caused by the folder being open in the file explorer. Waiting a bit before retrying
seems to do the trick.

See also #1019
(cherry picked from commit a43de42)
2015-08-11 18:14:39 +02:00
Gina Häußge
202f93426a Capture compilation errors on additional templates
Shouldn't cause the whole page not to render but log an error. Should
provide more resilience against bad plugins.
(cherry picked from commit d25202d)
2015-08-11 15:30:19 +02:00
Gina Häußge
0c44762f6f Fix: Better error handling for webassets + cache
(cherry picked from commit 38be47c)
2015-08-11 14:08:04 +02:00
Gina Häußge
e328695100 Do not hiccup on unset Content-Type fields in multipart file uploads
Just don't set the content_type parameter in that case.

Fixes #985
(cherry picked from commit 4bb5be7)
2015-08-11 14:07:31 +02:00
Nicanor Romero Venier
6d24a46e88 Fixed form field truncation in upload requests
(cherry picked from commit 1f6c852)
2015-07-15 10:35:59 +02:00
Gina Häußge
96aad9d34f Better resilience against errors within plugins
(cherry picked from commit 75992ef)
2015-07-14 09:26:20 +02:00
Gina Häußge
5470aaaa3a Set no-cache headers on page while firstRun is True
(cherry picked from commit f1afb70)
2015-07-09 09:45:35 +02:00
Gina Häußge
f89cbc9133 Allow to not cache responses that set no-cache headers
(cherry picked from commit 163100b)
2015-07-09 09:45:29 +02:00
Gina Häußge
8d14ea6093 Rewrite urls in packed css and less files
See also #962
(cherry picked from commit 7ea2ee2)
2015-07-08 16:46:46 +02:00
Gina Häußge
97826b2f3b Fix: More resilience against missing plugin assets
Two changes:

  * Asset existence will now be checked before they get included
    in the assets to bundle by webassets, logging a warning if a
    file isn't present.
  * Monkey-patched webassets filter chain to not die when a file
    doesn't exist, but to log an error instead and just return
    an empty file instead.
(cherry picked from commit 2a5ec33)
2015-07-08 16:46:38 +02:00
Gina Häußge
811ffc760f Added "pollWatched" setting to UI
(cherry picked from commit b8cf5ef)
2015-07-06 10:21:21 +02:00
Gina Häußge
549b60edb1 Allow polling for changes in watched folder
Some underlying file systems might not trigger change events (e.g.
mounted remote file systems). Added a feature flag to allow for
switching to a (less performant) polling method.
(cherry picked from commit f2df174)
2015-07-06 10:20:57 +02:00
Gina Häußge
19b4a0f403 Fix: Always delete files from watched folder
Wasn't ensure previously when using file preprocessors.
2015-07-05 09:35:49 +02:00
Gina Häußge
537c205757 Use lowercase when matching extensions
(cherry picked from commit 29cee16)
2015-06-30 19:12:58 +02:00
Gina Häußge
f07b2477f5 Fixed some comments that were outdated
(cherry picked from commit 18816b6)
2015-06-30 19:12:52 +02:00
Gina Häußge
5e5531f6d8 Verify extension of uploaded language packs & plugins
Should be valid zip archives/tarballs. Also use only the extension
of an uploaded plugin archive as suffix for the temporary file that's
used for installing it.
(cherry picked from commit a1ff698)
2015-06-30 19:12:45 +02:00
Gina Häußge
4b11032567 Fix: Slicing profiles now can always be set as default
Previously depended on the slicer being already configured, which is not
really necessary.

Closes #956
(cherry picked from commit 13ac06c)
2015-06-28 02:24:57 +02:00
Gina Häußge
0c54eaf176 Fix: Use Exception, not BaseException
Custom exception should be derived from Exception, not BaseException.

Not only is this specified in the python documentation, but also
tornado will be able to handle Exceptions in requests perfectly fine
and return an HTTP 500 for them, but crash hard (as in, server shut
down follows) for BaseExceptions.
(cherry picked from commit 29b047b)
2015-06-28 02:24:47 +02:00
Gina Häußge
401ebcf685 Fix: Cleanly exit on SIGTERM 2015-06-25 15:18:33 +02:00
Gina Häußge
67a0fd11dd PluginSettings.get_plugin_data_folder moved to OctoPrintPlugin.get_plugin_data_folder
That way plugins don't need to implement the SettingsPlugin mixin in order to access their data folder, which is now an injected property in OctoPrintPlugin. Plugin authors should still always use the getter since that will also make sure the folder actually does exist (lazy creation).

PluginSettings.get_plugin_data_folder has been marked as deprecated.
2015-06-24 13:59:45 +02:00
Gina Häußge
a580482c29 Allow asynchronous system commands & commands w/ ignored result
That should get rid of error messages for things like shutdown commands.
2015-06-22 14:28:05 +02:00
Gina Häußge
22710ccfb3 Show overlay when a new server version is detected
That's more user friendly than just blindly reloading the page. Also include installed Template- and AssetPlugins in the check whether there's a new version or not.
2015-06-21 18:02:16 +02:00
Gina Häußge
e722c2f8ad Sanity check: verify that plugin settings data jsonifies without error
More resilience which apparently is necessary as witnessed in #946
2015-06-21 00:32:59 +02:00
Gina Häußge
0e60b26048 Config migration must happen after all plugin implementations are initialized
Introduced new callback for settings plugin to hook into the point after the settings have been migrated since the initialize method is not suitable for that as it might be called before other plugin implementations reachable through hooks are initialized.
2015-06-19 22:31:05 +02:00
Gina Häußge
633d1ae594 Fix: capture TypeError caused by dynamic reloading on settings save and load
Usage of super(MyClass, self) is henceforth discouraged due to dynamic reloading within OctoPrint's plugin subsystem. Refer to https://thingspython.wordpress.com/2010/09/27/another-super-wrinkle-raising-typeerror/ for details on this problem.

Action by plugin authors is needed to remove the super(...) call and substitute it with octoprint.plugin.SettingsPlugin.on_settings_save(self, data) and octoprint.plugin.SettingsPlugin.on_settings_load(self). Without these modifications, calls to plugin methods utilizing super(...) will fail after a call to the plugin managers reload_plugins method.

Closes #942
2015-06-19 13:18:21 +02:00
Gina Häußge
d5af7b9b48 SettingsPlugins may now track configuration versions
OctoPrint will take care of calling a migration function on the plugin if the plugin demands a newer configuration version than currently stored in config.yaml.
2015-06-19 11:10:07 +02:00
Gina Häußge
6e90c9d730 Reintroduced minification
Still opt-in though.
2015-06-18 13:49:40 +02:00
Gina Häußge
31d7eaad90 Add ";" delimiters between bundled JS files
This is to make sure that they all end on a ; and hence stuff doesn't break if a file included directly after starts with a (...) construct. Of course it would be better if all bundled files are valid in that matter, however since we can't enforce that, we'll add this slight overhead to reduce the risk of stuff breaking.

See for example: http://stackoverflow.com/questions/20307462/js-cant-combine-lib-files
2015-06-18 13:00:18 +02:00
Gina Häußge
cbc6f20fa6 Split assets up a bit to allow better debugging of issues with webassets 2015-06-17 18:43:38 +02:00
Gina Häußge
06fb249f2e Send frontend translations with javascript mime type
Thanks @markwal
2015-06-10 09:14:39 +02:00
Gina Häußge
592cad5b99 Deprecated AppPlugin mixin and introduced octoprint.accesscontrol.appkey hook instead
Plugins implementing the mixin will automatically be migrated to providing the single mixin method as hook handler.
2015-06-09 18:50:55 +02:00
Gina Häußge
4b896fc327 Fixed webassets cache method to not hiccup on vanished files
Utilizing a monkey patch to catch ENOENT errors when calculating the hash of cached files.
2015-06-09 10:49:59 +02:00
Gina Häußge
be5a5f3c69 Fix: Also take configuration changes into account for update-necessary-check on assets
This way, changes to the minify parameter actually change behaviour...
2015-06-08 18:06:45 +02:00
Gina Häußge
fde543f19e [doc] octoprint.ui.web.templatetypes hook is now documented 2015-06-08 12:05:29 +02:00
Gina Häußge
bbba7f2817 Assets are no longer needed in index view renderer
They are now bundled via Flask-Assets instead
2015-06-08 08:22:11 +02:00
Gina Häußge
0d7d4cb142 Custom webassets filter that rewrites LESS imports
Need to point to ../less folder
2015-06-04 09:06:04 +02:00
Gina Häußge
8d3f933562 Fixed webassets cache method to also allow overwriting files under windows
Utilizing a monkey patch to swap os.rename for shutil.move, which also works if the target file already exists.
2015-06-04 09:05:31 +02:00
Gina Häußge
3dc0452a45 Adjusted docs to describe new web asset handling 2015-06-03 20:21:12 +02:00
Gina Häußge
261f6709a3 Depend on Flask-Assets 0.10
Compatibility adjustments and version pinning
2015-06-03 19:36:38 +02:00
Gina Häußge
b63f842210 Webassets are now written to ~/.octoprint/generated
Same holds true for cache files, so there should be no problem anymore with installs where the static folder is not writable.

Also introduced two new devel config vars to disable merging and minifying of the assets, solved the empty-less-bundle problem and made sure babel knows about the jinja extension.
2015-06-03 18:27:30 +02:00
Gina Häußge
157b78a052 WIP: Use Flask-Assets to merge js, css and less files
Should reduce number of requests and hence load times needed for loading web interface.

TODO: Handling of empty bundles needs to be fixed
2015-06-03 16:42:57 +02:00
Gina Häußge
b714c59004 Allow specification of known long running commands through settings
This should allow users to adjust the behaviour of the communication stack more granularly in case the regular settings which only consider G4, G28, G29, G30, G32 to be real long runners without output are not sufficient.
2015-06-03 12:34:00 +02:00
Gina Häußge
d2bca10ac9 Slight refactoring of API key evaluation in restricted_access decorator
Actual test whether key is provided or not happens in before_request handler of flask app, hence the more granular processing in the decorator was unecessary since around november '14. Adjusted to only do the actual processing necessary to replicate login_required behaviour/login users if necessary.

Closes #516 (actually, that was solved since introduction of the before_request handler which took that work off the hands of the decorator, but now it's properly documented too)
2015-06-03 11:55:32 +02:00
Gina Häußge
02b7085543 Merge branch 'dev/translationsAsPackages' into devel
Conflicts:
	src/octoprint/server/__init__.py
2015-06-02 13:58:40 +02:00