Commit graph

1571 commits

Author SHA1 Message Date
Gina Häußge
1fc50b9940 Merge branch 'fix/terminalMemoryUsage' into devel 2015-11-27 15:06:17 +01:00
Gina Häußge
40fe74ef45 Cut off terminal after 3000 lines
When autoscroll was disabled, terminal could run on endlessly, eating
memory until the browser crashes. Now a hard upper limit ensures
that not more than 3000 lines are ever stored in the terminal. If autoscroll
is disabled and the limit is reached, no more log lines will be added. That
ensures that the log will not scroll and the current log excerpt will stay put.
2015-11-27 15:05:55 +01:00
Gina Häußge
8eab664a34 Merge branch 'fix/wrongJsReference' into devel
Conflicts:
	src/octoprint/static/js/app/dataupdater.js
2015-11-27 11:32:41 +01:00
Gina Häußge
043b213a96 Move event processing for gcodefiles into corresponding viewmodel
Also fixes a javascript error (gcodeFileViewModel unknown)
2015-11-27 11:31:17 +01:00
Gina Häußge
8a7cf88f8d A method that's called putJson should actually put JSON and not formdata... 2015-11-27 10:06:34 +01:00
Gina Häußge
6f83a175da Replaced way too lax SourceRootFileLoader with SelectedFileLoader 2015-11-26 19:51:57 +01:00
Gina Häußge
fc4e786745 Merge branch 'fix/betterUiCaching' into dev/betterUiCaching
Conflicts:
	src/octoprint/util/jinja.py
2015-11-26 19:49:32 +01:00
Gina Häußge
63d095ab00 Refactored implementation of get_all_template_paths 2015-11-26 19:48:44 +01:00
Gina Häußge
4fc43ebd1c Merge branch 'fix/betterUiCaching' into dev/betterUiCaching
Conflicts:
	src/octoprint/server/util/flask.py
	src/octoprint/server/views.py
	src/octoprint/static/js/app/dataupdater.js
	src/octoprint/util/jinja.py
2015-11-26 19:45:17 +01:00
Gina Häußge
47670a1bbd Merge branch 'fix/1120' into devel 2015-11-26 16:07:53 +01:00
Gina Häußge
6db57122b4 Catch and log all exceptions that might be raised in the watchdog
Solves #1120
2015-11-26 16:07:29 +01:00
Gina Häußge
c595d02f22 reload(true) shouldn't be necessary any more
UI + assets should actually have ETag and LastModified headers and proper
IfMatch handling on the server side and hence the server should do the
right thing on its own.
2015-11-26 14:15:06 +01:00
Gina Häußge
2e23cd39a4 Added ETag and LastModified headers + processing to UI index
That should improve performance tremendously.

Both ETag and LastModified depend on all files the template rendering
depends on. If any of the depended on files changes, both values will
change as well. That allows us to track whether our cached copy is
still current (and force a refresh if not) and also process IfMatch request
headers and reply with a 304 directly so that we do not even have to
transfer the data if nothing changed and the browser still has it.
2015-11-26 13:32:32 +01:00
Gina Häußge
b3e6fe622d Merge branch 'fix/preemptiveUiCaching' into dev/preemptiveUiCachingWithUiPlugins
Conflicts:
	src/octoprint/server/__init__.py
	src/octoprint/server/views.py
2015-11-24 18:46:58 +01:00
Gina Häußge
3de4f91f50 Decoupled decorator from PreemptiveCache class
Coupling it led to problems (naturally) when there was no
PreemptiveCache instance available yet.
2015-11-24 18:41:53 +01:00
Gina Häußge
53a2e6e27e Merge branch 'fix/preemptiveUiCaching' into dev/preemptiveUiCachingWithUiPlugins
Conflicts:
	src/octoprint/server/__init__.py
	src/octoprint/server/util/flask.py
	src/octoprint/server/views.py
	src/octoprint/util/__init__.py
2015-11-24 17:18:55 +01:00
Gina Häußge
6473937b75 Refactore preemptive flask cache into a proper class
Also now tracks timestamps of last access to a preemptively cached
resource and cleans up stuff that hasn't been accessed in a while (7 days
by default)
2015-11-24 14:37:30 +01:00
Gina Häußge
0ef9f85a94 Merge branch 'fix/preemptiveUiCaching' into devel
Conflicts:
	src/octoprint/server/views.py
2015-11-23 19:55:13 +01:00
Gina Häußge
fab5fc4899 Added preemptive caching of / and /i18n/<locale>/messages.js
Introduced a @preemptively_cached decorator that for decorated views
persists the provided data in ~/.octoprint/data/preemptive_flask_cache.yaml
in a list indexed by the view's path if the data is not yet part of the list.

During initialization the server will iterate over the persisted paths and data
and for each persisted path and entry in the list initialize a temporary WSGI
environment based on the data (which is interpretated as keyword arguments
to werkzeug's EnvironmentBuilder) which will then be used to call the view
function in the correct context.

The current implementation for / and /i18n/<locale>/messages.js utilizes
that decorator to allow preemptive caching of those views (/ being probably
the most expensive one in the whole core application) utilizing request base URLs
(internal access, external access, reverse proxy with prefix url etc) that had been
encountered in the past.

Through the new config setting server.preemptiveCaching.exceptions it is
possible to define a set of base URLs to never cache. Preemptive caching can
be globally disabled by setting devel.cache.preemptive to false.
2015-11-23 17:35:25 +01:00
Gina Häußge
ab13a99b09 Merge branch 'fix/prefixAwareCache' into devel
Conflicts:
	src/octoprint/server/views.py
2015-11-23 12:21:42 +01:00
Gina Häußge
d0eca800fb Make the current request's baseurl to a part of the cache key
This way we create separate caches for URLs access via different schemes/prefixes/etc.
Otherwise our generated page might not work when accessing OctoPrint from external
after accessing it from internal once.
2015-11-23 12:17:57 +01:00
Gina Häußge
a379724963 Fixed a bug in octoprint dev plugin:new command 2015-11-23 11:13:50 +01:00
Gina Häußge
3ea77c76ef Fixed an import error introduced through moving the jinja trycatch extension 2015-11-20 11:46:28 +01:00
Gina Häußge
91ade13ded Merge branch 'fix/browserTabAwareness' into devel
Conflicts:
	src/octoprint/static/js/app/main.js
	src/octoprint/static/js/app/viewmodels/control.js
	src/octoprint/static/js/app/viewmodels/gcode.js
2015-11-20 11:44:09 +01:00
Gina Häußge
a52a5ca338 GCodeViewer: Even if off screen render 100% view on PrintDone event
Otherwise the GCODE Viewer will get stuck "half way through" if
"sync with progress" is enabled but the tab/browser tab loses focus
during printing and only regains it after the print has finished.
2015-11-20 11:40:06 +01:00
Gina Häußge
acc85127c5 Track browser tab visibility, only activate webcam/gcode viewer when visible
This might help with #1065 if indeed is related to background tab suspending behaviours in
browsers, but is a completely blind guess at this point since I still have not been able to
reproduce that issue myself.

Backported.

(cherry picked from commit 720cdad)
2015-11-20 11:06:25 +01:00
Gina Häußge
73d8ff9991 Merge branch 'fix/useIsHiddenPath' into devel
Conflicts:
	tests/util/test_file_helpers.py
2015-11-20 10:07:46 +01:00
Gina Häußge
a731f748d9 Moved existing hidden file checks to utilize octoprint.util.is_hidden_path 2015-11-20 10:02:06 +01:00
Gina Häußge
3d0fc8d674 Moved jinja ExceptionHandlerExtension to octoprint.util.jinja 2015-11-19 19:08:10 +01:00
Gina Häußge
1f90096a89 Merge branch 'fix/hiddenTemplatesListed' into devel
Conflicts:
	src/octoprint/util/__init__.py
	tests/util/test_file_helpers.py
2015-11-19 19:04:21 +01:00
Gina Häußge
9a7bddd530 Also don't include hidden files in other templates 2015-11-19 19:03:04 +01:00
Gina Häußge
83f66e133e Do not include hidden files in listed gcode scripts 2015-11-19 18:58:56 +01:00
Gina Häußge
ab97abf13e Some fixes and unit tests for octoprint.util.atomic_write, .bom_aware_open and .tempdir
(cherry picked from commit 4fcb853)
2015-11-19 15:15:35 +01:00
Gina Häußge
a4e805685a Merge branch 'dev/folderSupport' into devel 2015-11-19 12:52:49 +01:00
Gina Häußge
5062c1ce68 Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/plugins/cura/__init__.py
	src/octoprint/plugins/cura/templates/cura_settings.jinja2
2015-11-19 11:51:16 +01:00
Gina Häußge
7820c17d08 [Cura] Make plugin a bit more verbose regarding usage & setup 2015-11-19 11:42:12 +01:00
Gina Häußge
f1f55036e8 Simplistic folder add dialog 2015-11-18 18:36:23 +01:00
Gina Häußge
da890b036f Bugfix: emptyFolder filter was always active 2015-11-18 18:34:09 +01:00
Gina Häußge
1a20665729 Minor code style corrections 2015-11-18 17:45:15 +01:00
Gina Häußge
3db21f1a70 Fixed highlighting for files in folders
While at it also adjusted highlighting so that the folder containing
the currently selected file will be highlighted if the selected file is
not within the current folder but in one of its sub folders.
2015-11-18 17:44:11 +01:00
Gina Häußge
8b4aecde35 Merge branch 'devel' into dev/folderSupport 2015-11-18 17:16:12 +01:00
Gina Häußge
720cdadfbb Track browser tab visibility, only activate webcam/gcode viewer when visible
This might help with #1065 if indeed is related to background tab suspending behaviours in
browsers, but is a completely blind guess at this point since I still have not been able to
reproduce that issue myself.
2015-11-18 17:13:41 +01:00
Gina Häußge
50c3f99a42 virtual_printer: usage "screen" for the !!DEBUG commands 2015-11-18 13:56:39 +01:00
Gina Häußge
5d03b02baf virtual_printer: Refactoring for less error prone and more flexible command matching 2015-11-18 13:36:08 +01:00
Gina Häußge
66ad1150d5 Add toggle button to hide/show empty folders 2015-11-18 12:20:12 +01:00
Gina Häußge
d744c7e561 File search now operates recursively 2015-11-18 12:12:49 +01:00
Gina Häußge
306fd164d7 Refactoring of localstorage and added tests
* improved internal metadata handling
  * less code duplication
  * individual locks per metadata file
  * unit tests for copy and move operations
2015-11-18 10:47:49 +01:00
Salandora
9ed79adb8d Fix SD Support deactivated bug and added "unknown command" to the whitelist of errors 2015-11-17 19:32:34 +01:00
Gina Häußge
d85e93e79d Merge branch 'dev/clickClient' into devel 2015-11-17 08:41:37 +01:00
Gina Häußge
46e54b9d35 [SWU] First version of working CLI 2015-11-16 16:07:29 +01:00
Gina Häußge
21520f7fc5 Added octoprint client listen command and fixed socket client 2015-11-16 16:06:55 +01:00
Gina Häußge
77f34c47a3 Merge branch 'fix/indexCacheDuration' into devel
Conflicts:
	src/octoprint/server/views.py
2015-11-06 11:47:16 +01:00
Gina Häußge
b98348de02 Cache rendered page and translation files indefinitely 2015-11-06 11:46:12 +01:00
Gina Häußge
a5094d403a Merge branch 'maintenance' of github.com:foosel/OctoPrint into maintenance 2015-11-05 17:58:51 +01:00
Gina Häußge
c1afaa23f8 Merge branch 'fix/m25AsPause' into devel 2015-11-05 17:55:12 +01:00
Gina Häußge
6b0dee26e5 Interpret M25 as a pause when not printing from SD too 2015-11-05 17:33:27 +01:00
Gina Häußge
169aff4f8f CLI for the software update plugin 2015-11-05 17:09:37 +01:00
Gina Häußge
affb062c1d Refactored command line client to also include sockjs client
Also changed the calling parameters a bit to also allow for GET request parameters.
2015-11-05 17:05:08 +01:00
Gina Häußge
2214b2ac42 First steps towards API based CLI commands - "octoprint client" 2015-11-04 18:54:51 +01:00
Gina Häußge
4fcb853ef2 Some fixes and unit tests for octoprint.util.atomic_write, .bom_aware_open and .tempdir 2015-11-03 18:11:54 +01:00
Gina Häußge
1728e579b1 Merge branch 'fix/temperatureYaxisCutoff' into devel
Conflicts:
	AUTHORS.md
2015-10-30 16:54:17 +01:00
Gina Häußge
b6a5cb47a1 Merge branch 'km/hotfix-flot-yaxis-cutoff' of https://github.com/kevingelion/OctoPrint into pr/kevingelion/km/hotfix-flot-yaxis-cutoff 2015-10-30 16:49:35 +01:00
Gina Häußge
03124ecc28 Merge remote-tracking branch 'origin/devel' into devel 2015-10-30 16:35:51 +01:00
Gina Häußge
8ed3bcb094 Slight changes in CLI structure for performance reasons
Having the plugin commands on the first level of --help proved to be
a bad idea since it basically kills every chance of lazy loading the (expensive)
plugin context. Using a sub command for anything plugin related allows us
to only fire up the plugin context if a plugin command is expected, saving us
some precious seconds of operation in all other cases.

For conformity reasons the dev sub commands were now restructured
similarly.
2015-10-30 16:28:34 +01:00
Kevin Murphy
65efcec008 Change instance of row to row-fluid to avoid conflict with responsive CSS 2015-10-30 11:18:44 -04:00
Gina Häußge
221b497932 Maker CLI a bit faster in responding
We don't actually need the pip caller, which necessitates version
detection and hence increases waiting times tremendously - a simple
command line call with the auto detected pip command for
uninstalling stuff is enough and cuts off a lot of the CLI response times.
2015-10-30 13:49:05 +01:00
Gina Häußge
32bb4dd50a Fixed a bug in the log_duration decorator 2015-10-30 13:45:49 +01:00
Gina Häußge
2d1b198261 Some development utils in the octoprint.util package... 2015-10-30 13:02:22 +01:00
Gina Häußge
e3fa916364 Forgot to declare self.hooks on OctoPrintPluginCommands 2015-10-30 12:56:49 +01:00
Gina Häußge
c6f1088ccf <plugin identifier>:<command> => plugin:<plugin identifier> command 2015-10-30 10:14:21 +01:00
Gina Häußge
ec491c3d0d devel:newplugin => dev:plugin new, +dev:plugin install, +dev:plugin uninstall 2015-10-30 10:10:47 +01:00
Gina Häußge
bc7b17b66f Fixed an issue with compatibility across cookiecutter versions 2015-10-29 18:58:51 +01:00
Gina Häußge
628b9edbab CLI command devel:newplugin now allows specifying most of the parameters of the template 2015-10-29 18:41:51 +01:00
Gina Häußge
3c2d2b579d Documention for CLI and its development 2015-10-29 17:37:05 +01:00
Gina Häußge
d9f0fb1667 Consolidated common options into custom decorators 2015-10-29 16:26:50 +01:00
Gina Häußge
f68ce34351 Moved urllib3 ssl message to more suitable logging location 2015-10-29 15:26:58 +01:00
Gina Häußge
70fb385650 Try to ensure a sound SSL environment for the process
If the python version is < 2.7.9, we try to patch urllib3 with pyopenssl
to get rid of any InsecurePlatform issues.

That only works if pyopenssl plus dependencies are installed however,
hence we also log that.
2015-10-29 14:55:04 +01:00
Gina Häußge
d373d257e3 Slight changes on logging verbosity
Changed the intensity of logged warnings and ensured everything
but the octoprint package's log level to be WARN be default.
2015-10-29 14:52:14 +01:00
Gina Häußge
56805ab13d Refactored Daemon helper, added status command and added unit tests for all of it 2015-10-29 12:45:58 +01:00
Gina Häußge
4476545a55 Forgot to specify default value for daemon pidfile 2015-10-29 09:53:15 +01:00
Gina Häußge
9c56b2fd4e Variable output verbosity via CLI parameter -v 2015-10-28 19:18:40 +01:00
Paul de Vries
32de1fd088 Merge branch 'devel' of https://github.com/foosel/OctoPrint into devel 2015-10-28 15:55:05 +00:00
Paul de Vries
cbbf8f45ce Change target temperature input type from text to number 2015-10-28 15:50:24 +00:00
Gina Häußge
4cc1f6f03e Merge pull request #1099 from BillyBlaze/devel-control-ids
Added HTML id's to control tab panels
2015-10-28 16:37:56 +01:00
Paul de Vries
fba4648e37 Update controls-* to control-* 2015-10-28 15:32:31 +00:00
Paul de Vries
19a43a82ed Prevent 'Advanced options' link from propagating hastag 2015-10-28 15:28:19 +00:00
Paul de Vries
4b0ef23f34 Moved HTML id's before class for better readability 2015-10-28 14:57:11 +00:00
Paul de Vries
13df74e3d8 Added HTML id's to control tab panels 2015-10-28 14:45:47 +00:00
Gina Häußge
55c0e2ca95 Fixed a couple of bugs with daemon and serve commands 2015-10-27 18:15:24 +01:00
Gina Häußge
a6f11b9744 Started work on devel CLI commands
For now only devel:newplugin is available (if cookiecutter is installed)
2015-10-27 18:10:51 +01:00
Gina Häußge
2dd04574ce Moved CLI into its own module with submodules
Less chaos in one file
2015-10-27 18:08:27 +01:00
Salandora
68e78c93ea Fixed a misarranged closing tag and wrapped it into a dropdown div
Thanks @BillyBlaze
2015-10-27 15:02:47 +01:00
Salandora
962dc490aa Forgot to include a change 2015-10-27 14:38:16 +01:00
Gina Häußge
81dce6161a Moved startup log entry "up" a bit
Now that the plugin manager gets initialized before the server gets even constructed, we need
to log that entry right after we've set up logging in order to post any plugin manager related
log entries after.
2015-10-27 14:25:41 +01:00
Gina Häußge
150763fe2b CLI: debug is now part of the octoprint command context 2015-10-27 13:47:00 +01:00
Salandora
46faa286e6 Little refactorings and bugfixes 2015-10-27 13:04:47 +01:00
Salandora
bb7ab5224f Merge branch 'devel' of github.com:foosel/OctoPrint into dev/folderSupport 2015-10-27 11:54:03 +01:00
Gina Häußge
12b1da9732 Some more comments to structure new click based CLI code 2015-10-27 11:13:19 +01:00
Gina Häußge
03830990ac New helper plugin_settings_for_settings_plugin, to use from cli hooks and internally 2015-10-27 10:48:23 +01:00
Gina Häußge
f4ae7b58e5 Renamed hook: octoprint.cli.command => octoprint.cli.commands 2015-10-27 10:22:08 +01:00