Compare commits

...
45 Commits
Author SHA1 Message Date
Gina Häußge 45d3e7c864 🔖 Preparing hotfix release of 1.4.2 2020-08-06 12:41:11 +02:00
Gina Häußge 89412a761a 🐛 Work around for a watchdog Py2 bug
If the PollingObserver is used under Py2 on a directory that contains
utf8 file names, the default listdir implementation (scandir isn't
natively available under Py2) will generate unicode instead of str. Due
to an insufficent instance check in watchdog that will lead to a
misidentification of an entry as an DirEntry object instead of a str,
and the attempt to read the name property from that will cause an
AttributeError.

We monkey patch watchdog to use our bundled scandir backport where
needed instead of trying to fix the instance check, as that will perform
better anyhow.

Closes #3676
2020-08-06 12:19:41 +02:00
Gina Häußge b8b3cdde53 🥅 Better resilience against watchdog errors on startup
See #3676
2020-08-06 12:19:41 +02:00
Gina Häußge 8c829048af 🐛 pmgr: fix max upload size
Closes #3674
2020-08-06 12:19:41 +02:00
Gina Häußge 14a5f89b59 🐛 Fix download filename parsing
Closes #3678
2020-08-06 12:19:41 +02:00
Khoi 65d5d8963b remove any double quotes from filename obtained from content-disposition header, if any 2020-08-06 12:19:41 +02:00
Gina Häußge ea58e48dad 🔖 staging/hotfix is 1.4.2.dev, maintenance is 1.4.3.dev 2020-08-06 12:19:41 +02:00
Gina Häußge 0a605ccb12 👷‍️ Action based issue labeling 2020-08-05 16:24:12 +02:00
Gina Häußge 0364130dd3 ⬆️ Upgrade cypress 2020-08-04 14:14:47 +02:00
Gina Häußge 3ab84ed7e4 Merge branch 'master' into staging/maintenance 2020-08-04 10:34:21 +02:00
Gina Häußge 3f7bc1ebb5 🔖 Preparing release of 1.4.1 2020-08-04 10:27:21 +02:00
Gina Häußge 57b8d0b88e 🔖 staging/maintenance is now 1.4.1rc5.dev 2020-07-29 12:20:33 +02:00
Gina Häußge 458ab91f91 🔖 Preparing release of 1.4.1rc4 2020-07-29 10:35:49 +02:00
Gina Häußge ab8ad72bc3 🥅 PMGR: Ensure validity of latest release data
Closes #3661
2020-07-28 19:33:48 +02:00
Gina Häußge e9b6d22932 👷‍️ Trigger for docker builds 2020-07-28 14:15:28 +02:00
Gina Häußge 57b085ff5c 🐛 Remove accidentally committed debug code
See #3653
2020-07-27 16:00:39 +02:00
Gina Häußge 0cfc08748b 🐛 Set closed state even if not yet open
And also ensure we only attempt serial auto detect if we are still in
the correct state for it.

Closes #3653
2020-07-27 15:59:47 +02:00
Gina Häußge 0188745d05 🐛 Fix 500 on /api/files/local
Closes #3655
2020-07-27 12:08:39 +02:00
Gina Häußge 5246e2ccb4 🐛 Fix for some bugs in auto detection
Probably related to #3653
2020-07-27 11:35:07 +02:00
Gina Häußge f1d4cb670a 🐛 Fix held back messages not actually being sent
Probably part of #3653
2020-07-27 11:35:07 +02:00
Gina Häußge 9dd1e95eae 🐛 Fix a potential race condition
If the comm layer starts sending state changes (e.g. to auto detect)
before the constructor returns, self._comm in the printer interface is
still None and thus states can't be decoded.

Probably part of #3653
2020-07-27 11:34:55 +02:00
Gina Häußge 6083943e03 🚸 Improve disconnect response while not operational
We don't want to try to send our beforeDisconnect script if we aren't
properly connected, as that will severely delay Disconnect execution, so
we now limit that to operational states and thus allow a quick(er)
connection abort during auto detection or connection attempt.
2020-07-24 13:55:03 +02:00
Gina Häußge a8ba43308e 🐛 Don't drop state messages due to rate limits
Instead hold them back until the next slot.

Otherwise we might never get the final switch to Offline as after that
there are no current data upgrades anymore.
2020-07-24 13:54:56 +02:00
Gina Häußge 4511d8667b ✅ E2E: Add basic upload test 2020-07-22 14:02:36 +02:00
Gina Häußge af3a63fd9b 🐛 Fix a duplicated id 2020-07-21 17:50:12 +02:00
Gina Häußge 93e54f57e0 🔖 staging/maintenance is now 1.4.1rc4.dev 2020-07-15 14:21:32 +02:00
Gina Häußge a884888caa ⬆️ Ensure current versions of itsdangerous 2020-07-15 12:33:13 +02:00
Gina Häußge c40ae9f181 🐛 Don't show restore wizard on Windows
Restore doesn't work on Windows, so the wizard also shouldn't be shown.
2020-07-15 12:11:18 +02:00
Gina Häußge e33b3b5883 📝 Update dev environment docs 2020-07-15 11:25:31 +02:00
Gina Häußge 1da4c2b7ab 🔖 Preparing release of 1.4.1rc3 2020-07-15 10:49:29 +02:00
Gina Häußge c5baa05b5e 🐛 Fix file list title in case of CSS :after
Compare eyal0/OctoPrint-PrintTimeGenius#202

Closes #3642
2020-07-14 21:26:25 +02:00
Gina Häußge 719c3e3b0b 💚 And now REALLY reenable them 😅 2020-07-14 18:23:15 +02:00
Gina Häußge 123266d0ff 💚 Forgot to re-enable some E2E tests 2020-07-14 17:52:42 +02:00
Gina Häußge aa0ba6881c 💚 Improve E2E tests
Way less flaky now, and sprinkled with some helpers to ensure stuff has
loaded fine before trying to fire off tests 🥳
2020-07-14 17:48:36 +02:00
Gina Häußge b8246d41e3 💚 Improving testability of UI in E2E tests 2020-07-14 17:44:58 +02:00
Gina Häußge 7d037ab1a4 🐛 Fix potential race condition
Static assets where being sent with session cookies. That doesn't make
sense and might actually cause issues if an asset takes *just* long
enough to load to be overtaken by a login request from something like
the loginui.

Found with the E2E tests, which turned out to be less flaky themselves
than thought 🥳
2020-07-14 17:43:01 +02:00
Gina Häußge 01940bbb10 💚 (Hopefully) fix & re-enable E2E tests
We now wait for full app initialization (OctoPrint.coreui.startedUp &
OctoPrint.loginui.startedUp) before trying to test against things.

At least in local test runs that solved the flakiness.
2020-07-13 16:06:28 +02:00
Gina Häußge 6ef5b5001e 💚 Disable E2E for now
They sadly are flaky due to some weird race condition issues inside
cypress. Need to investigate.
2020-07-13 14:27:14 +02:00
Gina Häußge 2a4853bbd4 ✨ New flag devel.webassets.minify_plugins
As suggested in @b-morgan in #3638, to allow plugin authors to detect
minification issues with their code during development.

See also #3640
2020-07-13 14:22:29 +02:00
Gina Häußge 6bac39c193 🥅 Disable minification only for third party plugins
Better solution than 7915e6c04e.

Closes #3640
2020-07-10 18:55:40 +02:00
Gina Häußge 7915e6c04e 🥅 Disable minification again by default
It might cause SyntaxErrors in third party plugins that cannot be
caught by the system and which then nuke ALL other third party plugins.

See Sebclem/OctoPrint-SimpleEmergencyStop#14 and
FormerLurker/Octolapse#567

This change can manually be applied by setting

``` yaml
devel:
  webassets:
    minify: false
```

in config.yaml
2020-07-10 18:32:26 +02:00
Gina Häußge d2a23c3dc7 ♻ Improve timeout handling during auto connect
That should work around issues when the printer takes longer to boot up
and respond properly.

See #3627
2020-07-08 18:19:20 +02:00
Gina Häußge 27191f5202 🐛 Don't trigger error handling on autodetect failure
See #3627
2020-07-08 14:15:09 +02:00
Gina Häußge 87cd6de96c 🔖 staging/maintenance is now 1.4.1rc3.dev 2020-07-08 13:58:20 +02:00
Gina Häußge b150989286 👷‍️ Add workflow_dispatch trigger for install test 2020-07-07 11:35:58 +02:00
51 changed files with 6403 additions and 2423 deletions

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
name: "Issue Labeler"
on:
issues:
types: [opened, edited]
jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let labels = [];
if (context.payload.issue.title.match(/\[request\]|feature request/i)) {
labels.push('type:request');
}
if (context.payload.issue.title.match(/\[brainstorming\]/i)) {
labels.push('type:brainstorming');
}
if (context.payload.issue.title.match(/\[rc feedback\]/i)) {
labels.push('type:rc feedback');
}
if (labels.length > 0) {
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels
})
}
+4
View File
@@ -1,6 +1,10 @@
name: Test install of branches and latest release twice per day name: Test install of branches and latest release twice per day
on: on:
push:
branches:
- master
workflow_dispatch:
schedule: schedule:
- cron: '0 */12 * * *' - cron: '0 */12 * * *'
+18
View File
@@ -0,0 +1,18 @@
name: Trigger docker build
on:
release:
types:
- released
- prereleased
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: 🚀 Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.DOCKER_ACCESS_TOKEN }}
repository: OctoPrint/docker
event-type: octoprint-release
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "event-name": "${{ github.event_name }}", "event-type": "${{ github.event.action }}"}'
+14 -11
View File
@@ -18,19 +18,22 @@ prerelease
HEAD HEAD
\(detached.* \(detached.*
# maintenance is currently the branch for preparation of maintenance release 1.4.1 # maintenance is currently the branch for preparation of maintenance release 1.4.3
# so are any fix/... and improve/... branches # so are any fix/... and improve/... branches
maintenance 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev maintenance 1.4.3 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
fix/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev fix/.* 1.4.3 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
improve/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev improve/.* 1.4.3 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.4.0rc7 # staging/hotfix is the branch for preparation of the 1.4.2 hotfix release
staging/hotfix 1.4.2 3ab84ed7e4c3aaaf71fe0f184b465f25d689f929 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.4.1rc5
# so is regressionfix/... # so is regressionfix/...
staging/maintenance 1.4.1rc2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev staging/maintenance 1.4.1rc5 458ab91f915307857941f839a1b743430b8786a4 pep440-dev
regressionfix/.* 1.4.1rc2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev regressionfix/.* 1.4.1rc5 458ab91f915307857941f839a1b743430b8786a4 pep440-dev
# staging/devel is currently inactive (but has the 1.4.1rc2 namespace) # staging/devel is currently inactive (but has the 1.4.1rc4 namespace)
staging/devel 1.4.1rc2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
# every other branch is a development branch and thus gets resolved to 1.5.0-dev for now # every other branch is a development branch and thus gets resolved to 2.0.0.dev for now
.* 1.5.0 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev .* 2.0.0 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
+2 -6
View File
@@ -12,12 +12,12 @@ thanks to everyone who contributed!
* BigTreeTech * BigTreeTech
* Boris Hussein * Boris Hussein
* Brad Jackson * Brad Jackson
* BuildBee
* Christian Petropolis * Christian Petropolis
* Christian Wolf * Christian Wolf
* D Brian Kimmel * D Brian Kimmel
* DeltaMaker 3D Printers * DeltaMaker 3D Printers
* Dennis Breining * Dennis Breining
* Dorian Gray
* Eric Betts * Eric Betts
* Ernesto Martinez * Ernesto Martinez
* Franziska Kunsmann * Franziska Kunsmann
@@ -35,7 +35,6 @@ thanks to everyone who contributed!
* Kaile Riser * Kaile Riser
* Kale Stedman * Kale Stedman
* Kazuhiro Ogura * Kazuhiro Ogura
* Kelly C McNiece
* Kenneth Jiang * Kenneth Jiang
* Kurt Wubbels * Kurt Wubbels
* Kyle Menigoz * Kyle Menigoz
@@ -43,19 +42,16 @@ thanks to everyone who contributed!
* Lee Dohm * Lee Dohm
* Makespace Madrid * Makespace Madrid
* Mark Walker * Mark Walker
* Marvin Nahmias
* Michael Aumock * Michael Aumock
* Miles Flavel * Miles Flavel
* Mosaic Manufacturing * Mosaic Manufacturing
* Neil R. Goldberg * Neil R. Goldberg
* Patrick Glyré
* Patrick McGinnis * Patrick McGinnis
* Prof Yuh Wen Chen * Prof Yuh Wen Chen
* Raise3D * Raise3D
* Randy C. Will * Randy C. Will
* Ranjib Dey * Ranjib Dey
* Richard Michaud * Richard Michaud
* Rigid3D
* Robert Gusek * Robert Gusek
* Ronald Griehsler * Ronald Griehsler
* Sacha Telgenhof * Sacha Telgenhof
@@ -66,4 +62,4 @@ thanks to everyone who contributed!
* Sven Mueller * Sven Mueller
* Ulrich Kempken * Ulrich Kempken
and 1892 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)! and 1943 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
+5 -1
View File
@@ -283,10 +283,14 @@ The following settings are only relevant to you if you want to do OctoPrint deve
# false, no minification will take place regardless of the minify setting below. # false, no minification will take place regardless of the minify setting below.
bundle: true bundle: true
# If set to true, OctoPrint will minify its viewmodels (that includes those of plugins). Note: if bundle is # If set to true, OctoPrint will the core and library javascript assets. Note: if bundle is
# set to false, no minification will take place either. # set to false, no minification will take place either.
minify: true minify: true
# If set to true, OctoPrint will also minify the third party plugin javascript assets. Note: if bundle or
# minify are set to false, no minification of the plugin assets will take place either.
minify_plugins: false
# Whether to delete generated web assets on server startup (forcing a regeneration) # Whether to delete generated web assets on server startup (forcing a regeneration)
clean_on_startup: true clean_on_startup: true
+72 -54
View File
@@ -22,9 +22,9 @@ below.
* ``git clone https://github.com/OctoPrint/OctoPrint.git`` * ``git clone https://github.com/OctoPrint/OctoPrint.git``
* Enter the checked out source folder: ``cd OctoPrint`` * Enter the checked out source folder: ``cd OctoPrint``
* Create virtual environments in the checked out source folder for both Python 2.7 and Python 3.7 to use for * Create virtual environments in the checked out source folder for both Python 2 and Python 3 to use for
installing and running OctoPrint and its dependencies (this avoids potential versioning issues for the dependencies installing and running OctoPrint and its dependencies. Creating virtual environments avoids potential versioning
with system wide installed instances): issues for the dependencies with system wide installed instances:
* PY2: ``virtualenv --python=python2 venv2`` * PY2: ``virtualenv --python=python2 venv2``
* PY3: ``virtualenv --python=python3 venv3`` * PY3: ``virtualenv --python=python3 venv3``
@@ -52,46 +52,42 @@ below.
When the virtual environment is activated you can then: When the virtual environment is activated you can then:
* run the OctoPrint server via ``octoprint serve`` * run the OctoPrint server via ``octoprint serve``
* run the test suite from the checked out source folder via ``nosetests --with-doctest`` * run the test suite from the checked out source folder via ``pytest``
* build the documentation from the ``docs`` sub folder of the checked out sources via ``sphinx-build -b html . _build``
To switch the activated virtual environment, simply activate the new environment as described above. To switch the activated virtual environment, simply activate the new environment as described above.
To deactivate the virtual environment and return to the system's default Python: ``deactivate``. To deactivate the virtual environment and return to the system's default Python: ``deactivate``.
If you also want to be able to build the documentation that resides in the ``docs`` subfolder, you need to activate
the *Python 3* environment and install the docs dependencies as well:
* ``source venv3/bin/activate`` (Linux, macOS) or ``source venv3/Scripts/activate`` (Git Bash under Windows, see below)
* ``pip install -e .[develop,plugins,docs]``
You can then build the documentation:
* ``sphinx-build -b html . _build``
.. _sec-development-environment-source-linux: .. _sec-development-environment-source-linux:
Linux Linux
..... .....
.. todo::
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
location, please substitute accordingly. location, please substitute accordingly.
First make sure you have python including its header files, pip, setuptools, virtualenv, git and some build requirements First make sure you have python 2 and 3 including their header files, pip, setuptools, virtualenv, git and some build requirements
installed: installed:
* On apt based distributions (e.g. Debian, Ubuntu, ...): * On apt based distributions (e.g. Debian, Ubuntu, ...):
.. code-block:: none .. code-block:: none
sudo apt-get install python python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential sudo apt-get install python python-pip python-dev python-setuptools python-virtualenv python3 python3-virtualenv python3-dev git libyaml-dev build-essential
* On zypper based distributions (example below for SLES 12 SP2):
.. code-block:: none
sudo zypper ar https://download.opensuse.org/repositories/devel:/languages:/python/SLE_12_SP2/ python_devel
sudo zypper ref
sudo zypper in python python-pip python-devel python-setuptools python-virtualenv git libyaml-devel
sudo zypper in -t pattern Basis-Devel
.. todo:: .. todo::
Using a Linux distribution that doesn't use ``apt`` or ``zypper``? Please send a Using a Linux distribution that doesn't use ``apt``? Please send a
`Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary `Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
steps into this guide! steps into this guide!
@@ -100,36 +96,42 @@ Then:
.. code-block:: none .. code-block:: none
cd ~/devel cd ~/devel
git clone -b devel https://github.com/OctoPrint/OctoPrint.git git clone https://github.com/OctoPrint/OctoPrint.git
cd OctoPrint cd OctoPrint
virtualenv venv virtualenv --python=python2 venv2
source ./venv/bin/activate virtualenv --python=python3 venv3
source ./venv2/bin/activate
pip install --upgrade pip pip install --upgrade pip
pip install -e .[develop,plugins] pip install -e .[develop,plugins]
source ./venv3/bin/activate
pip install --upgrade pip
pip install -e .[develop,plugins,docs]
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual You can then start OctoPrint via ``octoprint`` after activating one of the two virtual environments.
environment.
.. _sec-development-environment-windows: .. _sec-development-environment-windows:
Windows Windows
....... .......
.. todo::
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
location, please substitute accordingly. location, please substitute accordingly.
First download & install: First download & install:
* `Python 2.7.15 Windows x86 MSI installer <https://www.python.org/downloads/release/python-2715/>`_ * `Git for Windows <https://git-for-windows.github.io/>`_
* `Latest *stable* Python 2.7 and Python 3.8 releases from python.org <https://www.python.org/downloads/windows/>`_
(at the time of writing those are ``2.7.18`` and ``3.8.4``)
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too * make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
* it's recommended to install Python 2.7 into ``C:\Python27`` and Python 3 into ``C:\Python38`` - if you select
different install locations please substitute accordingly
* `Microsoft Visual C++ Compiler for Python 2.7 <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_ * `Microsoft Visual C++ Compiler for Python 2.7 <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_
* `Git for Windows <https://git-for-windows.github.io/>`_ * `Build Tools For Visual Studio 2019 <https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019>`_
* install "C++ build tools" and ensure the latest versions of "MSVCv142 - VS 2019 C++ x64/x86 build tools" and
"Windows 10 SDK" are checked.
Open the Git Bash you just installed and in that: Open the Git Bash you just installed and in that:
@@ -139,10 +141,14 @@ Open the Git Bash you just installed and in that:
cd /c/Devel cd /c/Devel
git clone https://github.com/OctoPrint/OctoPrint.git git clone https://github.com/OctoPrint/OctoPrint.git
cd OctoPrint cd OctoPrint
virtualenv venv virtualenv --python=C:\Python27\python.exe venv2
source ./venv/Scripts/activate virtualenv --python=C:\Python38\python.exe venv3
source ./venv2/Scripts/activate
pip install --upgrade pip pip install --upgrade pip
pip install -e .[develop,plugins] pip install -e .[develop,plugins]
source ./venv3/Scripts/activate
pip install --upgrade pip
pip install -e .[develop,plugins,docs]
.. _sec-development-environment-mac: .. _sec-development-environment-mac:
@@ -156,7 +162,9 @@ Mac OS X
.. todo:: .. todo::
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development. This guide is not yet adapted to the concurrent use of Python 2 and 3 environments during development. Please send a
`Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
steps into this guide!
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
location, please substitute accordingly. location, please substitute accordingly.
@@ -196,10 +204,6 @@ You'll need a user account with administrator privileges.
IDE Setup IDE Setup
--------- ---------
.. todo::
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
.. todo:: .. todo::
Using another IDE than the ones below? Please send a Using another IDE than the ones below? Please send a
@@ -212,18 +216,23 @@ PyCharm
....... .......
- "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``) - "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
- **(Linux, Windows)** "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...", select OctoPrint venv - Register virtual environments:
folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint\venv``)
- **(macOS)** "PyCharm" > "Preferences ..." > "Project: OctoPrint" > "Project Interpreter" > "Add ..." > - **(Linux, Windows)** "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...",
"Virtualenv Environment > "Existing Environment", select OctoPrint venv folder (e.g. ``~/devel/OctoPrint/venv``) select OctoPrint ``venv2`` folder (e.g. ``~/devel/OctoPrint/venv2`` or ``C:\Devel\OctoPrint\venv2``).
- **(macOS)** "PyCharm" > "Preferences ..." > "Project: OctoPrint" > "Project Interpreter" > "Add ..." >
"Virtualenv Environment > "Existing Environment", select OctoPrint ``venv2`` folder (e.g. ``~/devel/OctoPrint/venv2``).
Repeat for the ``venv3`` folder.
- Right click "src" in project tree, mark as source folder - Right click "src" in project tree, mark as source folder
- Add Run/Debug Configuration, select "Python": - Add Run/Debug Configuration, select "Python":
* Name: OctoPrint server * Name: OctoPrint server
* Module name: ``octoprint`` * Module name: ``octoprint``
* Module parameters: ``serve --debug`` * Parameters: ``serve --debug``
* Project: ``OctoPrint`` * Project: ``OctoPrint``
* Python interpreter: the ``venv`` local virtual environment * Python interpreter: Project Default
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``) * Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
* If you want build artifacts to be cleaned up on run (recommended): "Before Launch" > "+" > "Run external tool" > "+" * If you want build artifacts to be cleaned up on run (recommended): "Before Launch" > "+" > "Run external tool" > "+"
@@ -239,29 +248,38 @@ PyCharm
* Parameters: ``-m pip install -e .[develop,plugins]`` * Parameters: ``-m pip install -e .[develop,plugins]``
* Working directory: ``$ProjectFileDir$`` * Working directory: ``$ProjectFileDir$``
Note that sadly that seems to cause some hiccups on current PyCharm versions due to ``$PyInterpreterDirectory$``
being empty sometimes, so if this fails to run on your installation, you should update your dependencies manually
for now.
- Add Run/Debug Configuration, select "Python tests" and therein "pytest": - Add Run/Debug Configuration, select "Python tests" and therein "pytest":
* Name: OctoPrint pytest * Name: OctoPrint tests
* Target: Custom * Target: Custom
* Project: ``OctoPrint`` * Project: ``OctoPrint``
* Python interpreter: the ``venv`` local virtual environment * Python interpreter: Project Default
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``) * Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
* Just like with the run configuration for the server you can also have the dependencies auto-update on run of * Just like with the run configuration for the server you can also have the dependencies auto-update on run of
the tests, see above on how to set this up. the tests, see above on how to set this up.
- Add Run/Debug Configuration, select "Python docs" and therein "Sphinx task" - Add Run/Debug Configuration, select "Python":
* Name: OctoPrint docs * Name: OctoPrint docs
* Command: ``html`` * Module name: ``sphinx.cmd.build``
* Input: the ``docs`` folder in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/docs`` or * Parameters: ``-v -T -E ./docs ./docs/_build -b html``
``C:\Devel\OctoPrint\docs``)
* Output: the ``docs/_build`` folder in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/docs/_build`` or
``C:\Devel\OctoPrint\docs\_build``)
* Project: ``OctoPrint`` * Project: ``OctoPrint``
* Python interpreter: the ``venv`` local virtual environment * Python interpreter: ``venv3`` environment (the docs build requires Python 3)
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
* Just like with the run configuration for the server you can also have the dependencies auto-update when building * Just like with the run configuration for the server you can also have the dependencies auto-update when building
the documentation, see above on how to set this up. the documentation, see above on how to set this up.
Note that this requires you to also have installed the additional ``docs`` dependencies into the Python 3 venv as
described above via ``pip install -e .[develop,plugins,docs]``.
To switch between Python 2 and 3, all you need to do now is change the Project Default Interpreter and restart
OctoPrint. On current PyCharm versions you can do that right from a small selection field in the footer of the IDE.
Otherwise go through Settings.
.. note:: .. note::
Make sure you are running a PyCharm version of 2016.1 or later, or manually fix Make sure you are running a PyCharm version of 2016.1 or later, or manually fix
+1
View File
@@ -44,6 +44,7 @@ INSTALL_REQUIRES = [
"Flask-Babel>=1.0,<2", "Flask-Babel>=1.0,<2",
"Flask-Assets>=2.0,<3", "Flask-Assets>=2.0,<3",
"werkzeug>=1.0.1,<2", "werkzeug>=1.0.1,<2",
"itsdangerous>=1.1.0,<2",
"cachelib>=0.1,<1", "cachelib>=0.1,<1",
"PyYAML>=5.3.1,<6", "PyYAML>=5.3.1,<6",
"pyserial>=3.4,<4", "pyserial>=3.4,<4",
+1 -1
View File
@@ -331,7 +331,7 @@ class BackupPlugin(octoprint.plugin.SettingsPlugin,
##~~ WizardPlugin ##~~ WizardPlugin
def is_wizard_required(self): def is_wizard_required(self):
return self._settings.global_get(["server", "firstRun"]) return self._settings.global_get(["server", "firstRun"]) and is_os_compatible(["!windows"])
def get_wizard_details(self): def get_wizard_details(self):
return dict(required=self.is_wizard_required()) return dict(required=self.is_wizard_required())
@@ -13,8 +13,8 @@ from octoprint.util.version import get_octoprint_version_string, is_released_oct
from flask import jsonify from flask import jsonify
from flask_babel import gettext from flask_babel import gettext
SENTRY_URL_SERVER = "https://183f89aa959044fa8ff4e2a55383ed36@o118517.ingest.sentry.io/1373987" SENTRY_URL_SERVER = "https://d479a74f172d4ac2b959a9a7d0536a82@o118517.ingest.sentry.io/1373987"
SENTRY_URL_COREUI = "https://fcd757c96a204000828449be1ba53d3b@o118517.ingest.sentry.io/1374096" SENTRY_URL_COREUI = "https://040577fb88b241ff985e408c11775720@o118517.ingest.sentry.io/1374096"
SETTINGS_DEFAULTS = dict(enabled=False, SETTINGS_DEFAULTS = dict(enabled=False,
enabled_unreleased=False, enabled_unreleased=False,
@@ -4,6 +4,12 @@
*/ */
$(function() { $(function() {
var OctoPrint = window.OctoPrint;
OctoPrint.loginui = {
startedUp: false
}
var overlayElement = $("#login-overlay"); var overlayElement = $("#login-overlay");
var errorElement = $("#login-error"); var errorElement = $("#login-error");
var offlineElement = $("#login-offline"); var offlineElement = $("#login-offline");
@@ -37,8 +43,6 @@ $(function() {
return false; return false;
}); });
var OctoPrint = window.OctoPrint;
OctoPrint.options.baseurl = BASE_URL; OctoPrint.options.baseurl = BASE_URL;
OctoPrint.socket.onConnected = function() { OctoPrint.socket.onConnected = function() {
@@ -56,4 +60,5 @@ $(function() {
}); });
OctoPrint.socket.connect(); OctoPrint.socket.connect();
OctoPrint.loginui.startedUp = true;
}); });
@@ -16,18 +16,18 @@
<body> <body>
<div class="container"> <div class="container">
<form class="form-signin"> <form class="form-signin">
<h2 class="form-signin-heading">{{ _('Please log in') }}</h2> <h2 class="form-signin-heading" data-test-id="login-title">{{ _('Please log in') }}</h2>
<div id="login-error" class="alert alert-error">{{ _('Incorrect username or password.') }}</div> <div id="login-error" class="alert alert-error" data-test-id="login-error">{{ _('Incorrect username or password.') }}</div>
<div id="login-offline" class="alert alert-error">{{ _('Server is currently offline.') }} <a id="login-reconnect" href="javascript:void(0)">{{ _('Reconnect...') }}</a></div> <div id="login-offline" class="alert alert-error">{{ _('Server is currently offline.') }} <a id="login-reconnect" href="javascript:void(0)">{{ _('Reconnect...') }}</a></div>
<input type="text" id="login-user" class="input-block-level" placeholder="{{ _('Username')|edq }}" autofocus> <input type="text" id="login-user" data-test-id="login-username" class="input-block-level" placeholder="{{ _('Username')|edq }}" autofocus>
<input type="password" id="login-password" class="input-block-level" placeholder="{{ _('Password')|edq }}"> <input type="password" id="login-password" data-test-id="login-password" class="input-block-level" placeholder="{{ _('Password')|edq }}">
<span class="pull-right"><small><a href="https://faq.octoprint.org/forgotten-password" id="login-forgotpassword" target="_blank" tabindex="-1">{{ _('Forgot password?') }}</a></small></span> <span class="pull-right"><small><a href="https://faq.octoprint.org/forgotten-password" id="login-forgotpassword" target="_blank" tabindex="-1">{{ _('Forgot password?') }}</a></small></span>
<label class="checkbox"> <label class="checkbox">
<input type="checkbox" id="login-remember"> {{ _('Remember me') }} <input type="checkbox" id="login-remember" data-test-id="login-remember-me"> {{ _('Remember me') }}
</label> </label>
<button class="btn btn-block btn-large btn-primary" id="login-button" type="submit">{{ _('Log in') }}</button> <button class="btn btn-block btn-large btn-primary" id="login-button" data-test-id="login-submit" type="submit">{{ _('Log in') }}</button>
</form> </form>
</div> </div>
@@ -157,7 +157,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
def increase_upload_bodysize(self, current_max_body_sizes, *args, **kwargs): def increase_upload_bodysize(self, current_max_body_sizes, *args, **kwargs):
# set a maximum body size of 50 MB for plugin archive uploads # set a maximum body size of 50 MB for plugin archive uploads
return [("POST", r"/upload_archive", 50 * 1024 * 1024)] return [("POST", r"/upload_file", 50 * 1024 * 1024)]
# Additional permissions hook # Additional permissions hook
@@ -268,7 +268,7 @@
<small class="prop" data-bind="visible: $data.stats !== undefined" title="{{ _('Active instances past month')|edq }}"><i class="fa fa-server"></i> <span data-bind="text: $data.stats !== undefined ? formatNumberK($data.stats.instances_month) : 0"></span></small> <small class="prop" data-bind="visible: $data.stats !== undefined" title="{{ _('Active instances past month')|edq }}"><i class="fa fa-server"></i> <span data-bind="text: $data.stats !== undefined ? formatNumberK($data.stats.instances_month) : 0"></span></small>
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.stars !== undefined" title="{{ _('Github stars')|edq }}"><i class="fa fa-star"></i> <span data-bind="text: ($data.github !== undefined && $data.github.stars !== undefined) ? formatNumberK($data.github.stars) : 0"></span></small> <small class="prop" data-bind="visible: $data.github !== undefined && $data.github.stars !== undefined" title="{{ _('Github stars')|edq }}"><i class="fa fa-star"></i> <span data-bind="text: ($data.github !== undefined && $data.github.stars !== undefined) ? formatNumberK($data.github.stars) : 0"></span></small>
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.last_push !== undefined" title="{{ _('Last push to main branch')|edq }}"><i class="fa fa-refresh"></i> <span data-bind="text: ($data.github !== undefined && $data.github.last_push !== undefined) ? $data.github.last_push.substring(0, 10) : ''"></span></small> <small class="prop" data-bind="visible: $data.github !== undefined && $data.github.last_push !== undefined" title="{{ _('Last push to main branch')|edq }}"><i class="fa fa-refresh"></i> <span data-bind="text: ($data.github !== undefined && $data.github.last_push !== undefined) ? $data.github.last_push.substring(0, 10) : ''"></span></small>
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.latest_release != undefined" title="{{ _('Latest release & date')|edq }}"><i class="fa fa-tag"></i> <span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined ? $data.github.latest_release.tag : ''"></span> (<span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined ? $data.github.latest_release.date.substring(0, 10) : ''"></span>)</small> <small class="prop" data-bind="visible: $data.github !== undefined && $data.github.latest_release != undefined && $data.github.latest_release.tag && $data.github.latest_release.date" title="{{ _('Latest release & date')|edq }}"><i class="fa fa-tag"></i> <span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined && $data.github.latest_release.tag ? $data.github.latest_release.tag : ''"></span> (<span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined && $data.github.latest_release.date ? $data.github.latest_release.date.substring(0, 10) : ''"></span>)</small>
</div> </div>
</div> </div>
+4 -1
View File
@@ -267,6 +267,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
logging.getLogger("SERIAL").info("serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log") logging.getLogger("SERIAL").info("serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log")
self._comm = comm.MachineCom(port, baudrate, callbackObject=self, printerProfileManager=self._printerProfileManager) self._comm = comm.MachineCom(port, baudrate, callbackObject=self, printerProfileManager=self._printerProfileManager)
self._comm.start()
def disconnect(self, *args, **kwargs): def disconnect(self, *args, **kwargs):
""" """
@@ -1505,7 +1506,9 @@ class StateMonitor(object):
self._last_update = monotonic_time() self._last_update = monotonic_time()
self._change_event.clear() self._change_event.clear()
except Exception: except Exception:
logging.getLogger(__name__).exception("Looks like something crashed inside the state update worker. Please report this on the OctoPrint issue tracker (make sure to include logs!)") logging.getLogger(__name__).exception("Looks like something crashed inside the state update worker. "
"Please report this on the OctoPrint issue tracker (make sure "
"to include logs!)")
def get_current_data(self): def get_current_data(self):
with self._progress_lock: with self._progress_lock:
+23 -14
View File
@@ -283,6 +283,7 @@ class Server(object):
util.tornado.fix_json_encode() util.tornado.fix_json_encode()
util.tornado.fix_websocket_check_origin() util.tornado.fix_websocket_check_origin()
util.flask.fix_flask_jsonify() util.flask.fix_flask_jsonify()
util.watchdog.fix_scandir()
self._setup_mimetypes() self._setup_mimetypes()
@@ -818,18 +819,22 @@ class Server(object):
self._logger.exception("Something went wrong while attempting to automatically connect to the printer") self._logger.exception("Something went wrong while attempting to automatically connect to the printer")
# start up watchdogs # start up watchdogs
watched = self._settings.getBaseFolder("watched") try:
watchdog_handler = util.watchdog.GcodeWatchdogHandler(fileManager, printer) watched = self._settings.getBaseFolder("watched")
watchdog_handler.initial_scan(watched) watchdog_handler = util.watchdog.GcodeWatchdogHandler(fileManager, printer)
watchdog_handler.initial_scan(watched)
if self._settings.getBoolean(["feature", "pollWatched"]): if self._settings.getBoolean(["feature", "pollWatched"]):
# use less performant polling observer if explicitly configured # use less performant polling observer if explicitly configured
observer = PollingObserver() observer = PollingObserver()
else: else:
# use os default # use os default
observer = Observer() observer = Observer()
observer.schedule(watchdog_handler, watched, recursive=True)
observer.start() observer.schedule(watchdog_handler, watched, recursive=True)
observer.start()
except Exception:
self._logger.exception("Error starting watched folder observer")
# run our startup plugins # run our startup plugins
octoprint.plugin.call_plugin(octoprint.plugin.StartupPlugin, octoprint.plugin.call_plugin(octoprint.plugin.StartupPlugin,
@@ -1605,7 +1610,11 @@ class Server(object):
filters.append("rjsmin") filters.append("rjsmin")
filters.append("gzip") filters.append("gzip")
js_filters = js_plugin_filters = filters js_filters = filters
if self._settings.getBoolean(["devel", "webassets", "minify_plugins"]):
js_plugin_filters = js_filters
else:
js_plugin_filters = [x for x in js_filters if x not in ("rjsmin",)]
def js_bundles_for_plugins(collection, filters=None): def js_bundles_for_plugins(collection, filters=None):
"""Produces JsPluginBundle instances that output IIFE wrapped assets""" """Produces JsPluginBundle instances that output IIFE wrapped assets"""
@@ -1645,7 +1654,7 @@ class Server(object):
js_app_bundle = Bundle(js_plugins_bundle, js_core_bundle, js_app_bundle = Bundle(js_plugins_bundle, js_core_bundle,
output="webassets/packed_app.js", output="webassets/packed_app.js",
filters=",".join(js_filters)) filters=",".join(js_plugin_filters))
js_client_core_bundle = Bundle(*clientjs_core, js_client_core_bundle = Bundle(*clientjs_core,
output="webassets/packed_client_core.js", output="webassets/packed_client_core.js",
@@ -1660,7 +1669,7 @@ class Server(object):
js_client_bundle = Bundle(js_client_core_bundle, js_client_plugins_bundle, js_client_bundle = Bundle(js_client_core_bundle, js_client_plugins_bundle,
output="webassets/packed_client.js", output="webassets/packed_client.js",
filters=",".join(js_filters)) filters=",".join(js_plugin_filters))
# -- CSS ------------------------------------------------------------------------------------------------------- # -- CSS -------------------------------------------------------------------------------------------------------
+6 -1
View File
@@ -63,7 +63,12 @@ def _create_lastmodified(path, recursive):
return max(lms) return max(lms)
else: else:
storage, path_in_storage = path.split("/", 1) if "/" in path:
storage, path_in_storage = path.split("/", 1)
else:
storage = path
path_in_storage = None
try: try:
return fileManager.last_modified(storage, path=path_in_storage, recursive=recursive) return fileManager.last_modified(storage, path=path_in_storage, recursive=recursive)
except Exception: except Exception:
+5 -3
View File
@@ -145,7 +145,8 @@ def getSettings():
"baudrateOptions": connectionOptions["baudrates"], "baudrateOptions": connectionOptions["baudrates"],
"autoconnect": s.getBoolean(["serial", "autoconnect"]), "autoconnect": s.getBoolean(["serial", "autoconnect"]),
"timeoutConnection": s.getFloat(["serial", "timeout", "connection"]), "timeoutConnection": s.getFloat(["serial", "timeout", "connection"]),
"timeoutDetection": s.getFloat(["serial", "timeout", "detection"]), "timeoutDetectionFirst": s.getFloat(["serial", "timeout", "detectionFirst"]),
"timeoutDetectionConsecutive": s.getFloat(["serial", "timeout", "detectionConsecutive"]),
"timeoutCommunication": s.getFloat(["serial", "timeout", "communication"]), "timeoutCommunication": s.getFloat(["serial", "timeout", "communication"]),
"timeoutCommunicationBusy": s.getFloat(["serial", "timeout", "communicationBusy"]), "timeoutCommunicationBusy": s.getFloat(["serial", "timeout", "communicationBusy"]),
"timeoutTemperature": s.getFloat(["serial", "timeout", "temperature"]), "timeoutTemperature": s.getFloat(["serial", "timeout", "temperature"]),
@@ -442,8 +443,9 @@ def _saveSettings(data):
if "baudrate" in data["serial"]: s.setInt(["serial", "baudrate"], data["serial"]["baudrate"]) if "baudrate" in data["serial"]: s.setInt(["serial", "baudrate"], data["serial"]["baudrate"])
if "exclusive" in data["serial"]: s.setBoolean(["serial", "exclusive"], data["serial"]["exclusive"]) if "exclusive" in data["serial"]: s.setBoolean(["serial", "exclusive"], data["serial"]["exclusive"])
if "timeoutConnection" in data["serial"]: s.setFloat(["serial", "timeout", "connection"], data["serial"]["timeoutConnection"], min=1.0) if "timeoutConnection" in data["serial"]: s.setFloat(["serial", "timeout", "connection"], data["serial"]["timeoutConnection"], min=1.0)
if "timeoutDetection" in data["serial"]: s.setFloat(["serial", "timeout", "detection"], data["serial"]["timeoutDetection"], min=1.0) if "timeoutDetectionFirst" in data["serial"]: s.setFloat(["serial", "timeout", "detectionFirst"], data["serial"]["timeoutDetectionFirst"], min=1.0)
if "timeoutCommunication" in data["serial"]: s.setFloat(["serial", "timeout", "communication"], data["serial"]["timeoutCommunication"], min=1.0) if "timeoutDetectionConsecutive" in data["serial"]: s.setFloat(["serial", "timeout", "detectionConsecutive"], data["serial"]["timeoutDetectionConsecutive"], min=1.0)
if "timeoutCommunication" in data["serial"]: s.setFloat(["serial", "timeout", "communication"], data["serial"]["timeoutCommunicationFirst"], min=1.0)
if "timeoutCommunicationBusy" in data["serial"]: s.setFloat(["serial", "timeout", "communicationBusy"], data["serial"]["timeoutCommunicationBusy"], min=1.0) if "timeoutCommunicationBusy" in data["serial"]: s.setFloat(["serial", "timeout", "communicationBusy"], data["serial"]["timeoutCommunicationBusy"], min=1.0)
if "timeoutTemperature" in data["serial"]: s.setFloat(["serial", "timeout", "temperature"], data["serial"]["timeoutTemperature"], min=1.0) if "timeoutTemperature" in data["serial"]: s.setFloat(["serial", "timeout", "temperature"], data["serial"]["timeoutTemperature"], min=1.0)
if "timeoutTemperatureTargetSet" in data["serial"]: s.setFloat(["serial", "timeout", "temperatureTargetSet"], data["serial"]["timeoutTemperatureTargetSet"], min=1.0) if "timeoutTemperatureTargetSet" in data["serial"]: s.setFloat(["serial", "timeout", "temperatureTargetSet"], data["serial"]["timeoutTemperatureTargetSet"], min=1.0)
+4
View File
@@ -10,6 +10,7 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
import tornado.web import tornado.web
import flask import flask
import flask.json import flask.json
import flask.sessions
import flask_login import flask_login
import octoprint.vendor.flask_principal as flask_principal import octoprint.vendor.flask_principal as flask_principal
import flask_assets import flask_assets
@@ -531,6 +532,9 @@ class OctoPrintFlaskResponse(flask.Response):
class OctoPrintSessionInterface(flask.sessions.SecureCookieSessionInterface): class OctoPrintSessionInterface(flask.sessions.SecureCookieSessionInterface):
def should_set_cookie(self, app, session):
return flask.request.endpoint != "static"
def save_session(self, app, session, response): def save_session(self, app, session, response):
if flask.g.get("login_via_apikey", False): if flask.g.get("login_via_apikey", False):
return return
+21 -9
View File
@@ -117,9 +117,12 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection,
self._remoteAddress = None self._remoteAddress = None
self._user = self._userManager.anonymous_user_factory() self._user = self._userManager.anonymous_user_factory()
self._throttleFactor = 1 self._throttle_factor = 1
self._lastCurrent = 0 self._last_current = 0
self._baseRateLimit = 0.5 self._base_rate_limit = 0.5
self._held_back_current = None
self._held_back_mutex = threading.RLock()
self._register_hooks = self._pluginManager.get_hooks("octoprint.server.sockjs.register") self._register_hooks = self._pluginManager.get_hooks("octoprint.server.sockjs.register")
self._authed_hooks = self._pluginManager.get_hooks("octoprint.server.sockjs.authed") self._authed_hooks = self._pluginManager.get_hooks("octoprint.server.sockjs.authed")
@@ -222,18 +225,27 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection,
except ValueError: except ValueError:
self._logger.warning("Got invalid throttle factor from client {}, ignoring: {!r}".format(self._remoteAddress, message["throttle"])) self._logger.warning("Got invalid throttle factor from client {}, ignoring: {!r}".format(self._remoteAddress, message["throttle"]))
else: else:
self._throttleFactor = throttle self._throttle_factor = throttle
self._logger.debug("Set throttle factor for client {} to {}".format(self._remoteAddress, self._throttleFactor)) self._logger.debug("Set throttle factor for client {} to {}".format(self._remoteAddress, self._throttle_factor))
def on_printer_send_current_data(self, data): def on_printer_send_current_data(self, data):
if not self._user.has_permission(Permissions.STATUS): if not self._user.has_permission(Permissions.STATUS):
return return
# make sure we rate limit the updates according to our throttle factor # make sure we rate limit the updates according to our throttle factor
now = time.time() with self._held_back_mutex:
if now < self._lastCurrent + self._baseRateLimit * self._throttleFactor: if self._held_back_current is not None:
return self._held_back_current.cancel()
self._lastCurrent = now self._held_back_current = None
now = time.time()
delta = self._last_current + self._base_rate_limit * self._throttle_factor - now
if delta > 0:
self._held_back_current = threading.Timer(delta, lambda: self.on_printer_send_current_data(data))
self._held_back_current.start()
return
self._last_current = now
# add current temperature, log and message backlogs to sent data # add current temperature, log and message backlogs to sent data
with self._temperatureBacklogMutex: with self._temperatureBacklogMutex:
+24
View File
@@ -17,6 +17,30 @@ import octoprint.filemanager.util
import octoprint.util import octoprint.util
def fix_scandir():
try:
from os import scandir
# nothing to fix, natively available, return
return
except ImportError:
# not natively available, use backport
from scandir import scandir
import watchdog.utils.dirsnapshot
OriginalDirectorySnapshot = watchdog.utils.dirsnapshot.DirectorySnapshot
class FixedDirectorySnapshot(OriginalDirectorySnapshot):
def __init__(self, listdir=scandir, *args, **kwargs):
OriginalDirectorySnapshot.__init__(self, listdir=listdir, *args, **kwargs)
watchdog.utils.dirsnapshot.DirectorySnapshot = FixedDirectorySnapshot
import watchdog.observers.polling
OriginalPollingEmitter = watchdog.observers.polling.PollingEmitter
class FixedPollingEmitter(OriginalPollingEmitter):
def __init__(self, listdir=scandir, *args, **kwargs):
OriginalPollingEmitter.__init__(self, listdir=listdir, *args, **kwargs)
watchdog.observers.polling.PollingEmitter = FixedPollingEmitter
class GcodeWatchdogHandler(watchdog.events.PatternMatchingEventHandler): class GcodeWatchdogHandler(watchdog.events.PatternMatchingEventHandler):
""" """
+4 -2
View File
@@ -98,7 +98,8 @@ default_settings = {
"autoconnect": False, "autoconnect": False,
"log": False, "log": False,
"timeout": { "timeout": {
"detection": 1, "detectionFirst": 10,
"detectionConsecutive": 2,
"connection": 10, "connection": 10,
"communication": 30, "communication": 30,
"communicationBusy": 3, "communicationBusy": 3,
@@ -414,7 +415,8 @@ default_settings = {
"webassets": { "webassets": {
"bundle": True, "bundle": True,
"clean_on_startup": True, "clean_on_startup": True,
"minify": True "minify": True,
"minify_plugins": False
}, },
"useFrozenDictForPrinterState": True, "useFrozenDictForPrinterState": True,
"showLoadingAnimation": True, "showLoadingAnimation": True,
+1 -1
View File
@@ -1 +1 @@
.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn.active,.btn.disabled,.btn:active,.btn:focus,.btn:hover,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn.active,.btn:active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:focus,.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class*=" icon-"],.btn-large [class^=icon-]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class*=" icon-"],.btn-small [class^=icon-]{margin-top:0}.btn-mini [class*=" icon-"],.btn-mini [class^=icon-]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary.active,.btn-primary.disabled,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary.active,.btn-primary:active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning.active,.btn-warning.disabled,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning.active,.btn-warning:active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#da4f49;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeaLine truncated .btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn.active,.btn.disabled,.btn:active,.btn:focus,.btn:hover,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn.active,.btn:active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:focus,.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class*=" icon-"],.btn-large [class^=icon-]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class*=" icon-"],.btn-small [class^=icon-]{margin-top:0}.btn-mini [class*=" icon-"],.btn-mini [class^=icon-]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary.active,.btn-primary.disabled,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary.active,.btn-primary:active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning.active,.btn-warning.disabled,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning.active,.btn-warning:active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#da4f49;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeaLine truncated
+4 -1
View File
@@ -39,7 +39,8 @@ $(function() {
mobile: false, mobile: false,
desktop: false desktop: false
}, },
viewmodels: {} viewmodels: {},
startedUp: false
}; };
var browserVisibilityCallbacks = []; var browserVisibilityCallbacks = [];
@@ -734,6 +735,8 @@ $(function() {
// Use bootstrap tabdrop for tabs and pills // Use bootstrap tabdrop for tabs and pills
$('.nav-pills, .nav-tabs').tabdrop(); $('.nav-pills, .nav-tabs').tabdrop();
OctoPrint.coreui.startedUp = true;
}; };
var fetchSettings = function() { var fetchSettings = function() {
@@ -158,7 +158,8 @@ $(function() {
self.serial_baudrateOptions = ko.observableArray([]); self.serial_baudrateOptions = ko.observableArray([]);
self.serial_autoconnect = ko.observable(undefined); self.serial_autoconnect = ko.observable(undefined);
self.serial_timeoutConnection = ko.observable(undefined); self.serial_timeoutConnection = ko.observable(undefined);
self.serial_timeoutDetection = ko.observable(undefined); self.serial_timeoutDetectionFirst = ko.observable(undefined);
self.serial_timeoutDetectionConsecutive = ko.observable(undefined);
self.serial_timeoutCommunication = ko.observable(undefined); self.serial_timeoutCommunication = ko.observable(undefined);
self.serial_timeoutCommunicationBusy = ko.observable(undefined); self.serial_timeoutCommunicationBusy = ko.observable(undefined);
self.serial_timeoutTemperature = ko.observable(undefined); self.serial_timeoutTemperature = ko.observable(undefined);
+1 -1
View File
@@ -728,10 +728,10 @@ ul.dropdown-menu li a {
.title { .title {
text-overflow: ellipsis; text-overflow: ellipsis;
word-break: break-all; word-break: break-all;
margin-right: 30px;
} }
.toggleAdditionalData { .toggleAdditionalData {
margin-left: 5px;
} }
.internal, .uploaded, .size, .additionalInfo { .internal, .uploaded, .size, .additionalInfo {
@@ -173,13 +173,21 @@
</div> </div>
</div> </div>
</div> </div>
<div class="control-group" title="{{ _('Time after which to consider an auto detection attempt to have failed if no successful connection is detected')|edq }}"> <div class="control-group" title="{{ _('Time after which to consider the auto detection handshake attempt to have failed if no successful connection is detected')|edq }}">
<label class="control-label" for="settings-serialTimeoutDetection">{{ _('Autodetection timeout') }}</label> <label class="control-label" for="settings-serialTimeoutDetectionFirst">{{ _('Autodetection timeout') }}</label>
<div class="controls"> <div class="controls">
<div class="input-append"> <div class="input-append">
<input type="number" step="any" min="1" class="input-mini text-right" data-bind="value: serial_timeoutDetection" id="settings-serialTimeoutDetection"> <input type="number" step="any" min="1" class="input-mini text-right" data-bind="value: serial_timeoutDetectionFirst" id="settings-serialTimeoutDetectionFirst">
<span class="add-on">s</span> <span class="add-on">s</span>
</div> </div>
<span class="help-inline">{{ _('First handshake attempt')}}</span>
</div>
<div class="controls">
<div class="input-append">
<input type="number" step="any" min="1" class="input-mini text-right" data-bind="value: serial_timeoutDetectionConsecutive" id="settings-serialTimeoutDetectionConsecutive">
<span class="add-on">s</span>
</div>
<span class="help-inline">{{ _('Consecutive handshake attempts')}}</span>
</div> </div>
</div> </div>
<div class="control-group" title="{{ _('Time after which to consider a position query on pause or cancel to have failed')|edq }}"> <div class="control-group" title="{{ _('Time after which to consider a position query on pause or cancel to have failed')|edq }}">
+2 -2
View File
@@ -96,7 +96,7 @@
{% if "styles_wrapper" in data %} style="{{ data.styles_wrapper|join(', ') }}" {% elif "styles" in data %} style="{{ data.styles|join(', ') }}" {% endif %} {% if "styles_wrapper" in data %} style="{{ data.styles_wrapper|join(', ') }}" {% elif "styles" in data %} style="{{ data.styles|join(', ') }}" {% endif %}
> >
<div class="accordion-heading"> <div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-target="#{{ data._div }}"> <a class="accordion-toggle" data-toggle="collapse" data-test-id="sidebar-{{ data._div }}-toggle" data-target="#{{ data._div }}">
{% if "icon" in data %}<i class="fa icon-black fa-{{ data.icon }}"></i> {% endif %}{{ entry|e }} {% if "icon" in data %}<i class="fa icon-black fa-{{ data.icon }}"></i> {% endif %}{{ entry|e }}
</a> </a>
{% if "template_header" in data %} {% if "template_header" in data %}
@@ -107,7 +107,7 @@
class="accordion-body collapse in {% if "classes_content" in data %}{{ data.classes_content|join(' ') }}{% elif "classes" in data %}{{ data.classes|join(' ') }}{% endif %}" class="accordion-body collapse in {% if "classes_content" in data %}{{ data.classes_content|join(' ') }}{% elif "classes" in data %}{{ data.classes|join(' ') }}{% endif %}"
{% if "styles_content" in data %} style="{{ data.styles_content|join(', ') }}" {% elif "styles" in data %} style="{{ data.styles|join(', ') }}"{% endif %} {% if "styles_content" in data %} style="{{ data.styles_content|join(', ') }}" {% elif "styles" in data %} style="{{ data.styles|join(', ') }}"{% endif %}
> >
<div class="accordion-inner"> <div class="accordion-inner" data-test-id="sidebar-{{ data._div }}-content">
{% try "There was an error with the template {filename} at line number {lineno}: {exception}" %}{% include data.template ignore missing %}{% endtry %} {% try "There was an error with the template {filename} at line number {lineno}: {exception}" %}{% include data.template ignore missing %}{% endtry %}
</div> </div>
</div> </div>
+7 -7
View File
@@ -1,21 +1,21 @@
<a href="javascript:void(0)" class="dropdown-toggle"> <a href="javascript:void(0)" data-test-id="login-menu" class="dropdown-toggle">
<i class="fa fa-user"></i> <span data-bind="text: loginState.userMenuText, attr: {title: loginState.userMenuTitle}">{{ _('Login') }}</span> <i class="fa fa-user"></i> <span data-test-id="login-menu-title" data-bind="text: loginState.userMenuText, attr: {title: loginState.userMenuTitle}">{{ _('Login') }}</span>
<b class="caret"></b> <b class="caret"></b>
</a> </a>
<div id="login_dropdown_loggedout" style="padding: 15px" class="dropdown-menu" data-bind="css: {hide: loginState.loggedIn(), 'dropdown-menu': !loginState.loggedIn()}"> <div id="login_dropdown_loggedout" style="padding: 15px" class="dropdown-menu" data-bind="css: {hide: loginState.loggedIn(), 'dropdown-menu': !loginState.loggedIn()}">
<form id="loginForm" data-bind="event: {'submit': loginState.prepareLogin }" onsubmit="return false; // this gets overwritten on view model bind"> <form id="loginForm" data-bind="event: {'submit': loginState.prepareLogin }" onsubmit="return false; // this gets overwritten on view model bind">
<label for="login_user">{{ _('Username') }}</label> <label for="login_user">{{ _('Username') }}</label>
<input type="text" id="login_user" name="username" data-bind="valueWithInit: loginState.loginUser" placeholder="{{ _('Username')|edq }}" autocapitalize="none" autocorrect="off"> <input type="text" id="login_user" data-test-id="login-username" name="username" data-bind="valueWithInit: loginState.loginUser" placeholder="{{ _('Username')|edq }}" autocapitalize="none" autocorrect="off">
<span class="pull-right"><small><a href="https://faq.octoprint.org/forgotten-password" target="_blank" rel="noreferrer noopener" tabindex="-1">{{ _('Forgot password?') }}</a></small></span> <span class="pull-right"><small><a href="https://faq.octoprint.org/forgotten-password" target="_blank" rel="noreferrer noopener" tabindex="-1">{{ _('Forgot password?') }}</a></small></span>
<label for="login_pass">{{ _('Password') }}</label> <label for="login_pass">{{ _('Password') }}</label>
<input type="password" id="login_pass" name="password" data-bind="valueWithInit: loginState.loginPass" placeholder="{{ _('Password')|edq }}"> <input type="password" id="login_pass" data-test-id="login-password" name="password" data-bind="valueWithInit: loginState.loginPass" placeholder="{{ _('Password')|edq }}">
<label class="checkbox"> <label class="checkbox">
<input type="checkbox" id="login_remember" data-bind="checked: loginState.loginRemember"> {{ _('Remember me') }} <input type="checkbox" id="login_remember" data-test-id="login-remember-me" data-bind="checked: loginState.loginRemember"> {{ _('Remember me') }}
</label> </label>
<button type="submit" class="btn btn-block btn-primary" id="login_button">{{ _('Login') }}</button> <button type="submit" class="btn btn-block btn-primary" id="login_button" data-test-id="login-submit">{{ _('Login') }}</button>
</form> </form>
</div> </div>
<ul id="login_dropdown_loggedin" class="hide" data-bind="css: {hide: !loginState.loggedIn(), 'dropdown-menu': loginState.loggedIn()}"> <ul id="login_dropdown_loggedin" class="hide" data-bind="css: {hide: !loginState.loggedIn(), 'dropdown-menu': loginState.loggedIn()}">
<li><a href="#" id="usersettings_button" data-bind="click: function() { usersettings.show(); }">{{ _('User Settings') }}</a></li> <li><a href="#" id="usersettings_button" data-bind="click: function() { usersettings.show(); }">{{ _('User Settings') }}</a></li>
<li><a href="#" id="logout_button" data-bind="click: loginState.logout">{{ _('Logout') }}</a></li> <li><a href="#" id="logout_button" data-bind="click: loginState.logout" data-test-id="logout-submit">{{ _('Logout') }}</a></li>
</ul> </ul>
@@ -1,13 +1,13 @@
<label for="connection_ports" data-bind="css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()">{{ _('Serial Port') }}</label> <label for="connection_ports" data-bind="css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()">{{ _('Serial Port') }}</label>
<select id="connection_ports" data-bind="options: portOptions, optionsCaption: 'AUTO', value: selectedPort, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"></select> <select id="connection_ports" data-test-id="connection-ports" data-bind="options: portOptions, optionsCaption: 'AUTO', value: selectedPort, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"></select>
<label for="connection_baudrates" data-bind="css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()">{{ _('Baudrate') }}</label> <label for="connection_baudrates" data-bind="css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()">{{ _('Baudrate') }}</label>
<select id="connection_baudrates" data-bind="options: baudrateOptions, optionsCaption: 'AUTO', value: selectedBaudrate, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"></select> <select id="connection_baudrates" data-test-id="connection-baudrates" data-bind="options: baudrateOptions, optionsCaption: 'AUTO', value: selectedBaudrate, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"></select>
<label for="connection_printers" data-bind="css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()">{{ _('Printer Profile') }}</label> <label for="connection_printers" data-bind="css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()">{{ _('Printer Profile') }}</label>
<select id="connection_printers" data-bind="options: printerOptions, optionsText: 'name', optionsValue: 'id', value: selectedPrinter, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"></select> <select id="connection_printers" data-test-id="connection-printer-profiles" data-bind="options: printerOptions, optionsText: 'name', optionsValue: 'id', value: selectedPrinter, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"></select>
<label class="checkbox"> <label class="checkbox">
<input type="checkbox" id="connection_save" data-bind="checked: saveSettings, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"> {{ _('Save connection settings') }} <input type="checkbox" id="connection_save" data-bind="checked: saveSettings, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"> {{ _('Save connection settings') }}
</label> </label>
<label class="checkbox"> <label class="checkbox">
<input type="checkbox" id="connection_autoconnect" data-bind="checked: settings.serial_autoconnect, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"> {{ _('Auto-connect on server startup') }} <input type="checkbox" id="connection_autoconnect" data-bind="checked: settings.serial_autoconnect, css: {disabled: !isErrorOrClosed()}, enable: isErrorOrClosed()"> {{ _('Auto-connect on server startup') }}
</label> </label>
<button class="btn btn-block" id="printer_connect" data-bind="click: connect, text: buttonText">{{ _('Connect') }}</button> <button class="btn btn-block" id="printer_connect" data-test-id="connection-connect" data-bind="click: connect, text: buttonText">{{ _('Connect') }}</button>
+4 -4
View File
@@ -4,7 +4,7 @@
<span class="search-clear" data-bind="click: clearSearchQuery"><i class="fa fa-remove"></i></span> <span class="search-clear" data-bind="click: clearSearchQuery"><i class="fa fa-remove"></i></span>
</div> </div>
</form> </form>
<div class="gcode_files" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.FILES_LIST)"> <div class="gcode_files" data-test-id="files-list" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.FILES_LIST)">
<div class="entry back clickable" data-bind="visible: currentPath() != '', click: function() { $root.navigateUp(); }" style="display: none"> <div class="entry back clickable" data-bind="visible: currentPath() != '', click: function() { $root.navigateUp(); }" style="display: none">
<div class="back-arrow"><i class="fa fa-arrow-left"></i> {{ _('Back') }}</div> <div class="back-arrow"><i class="fa fa-arrow-left"></i> {{ _('Back') }}</div>
<div class="back-path"><small class="muted">{{ _('Currently in') }} <span data-bind="text: currentPath"></span></small></div> <div class="back-path"><small class="muted">{{ _('Currently in') }} <span data-bind="text: currentPath"></span></small></div>
@@ -67,18 +67,18 @@
<span class="btn btn-primary fileinput-button span6" style="margin-bottom: 10px"> <span class="btn btn-primary fileinput-button span6" style="margin-bottom: 10px">
<i class="fa fa-upload"></i> <i class="fa fa-upload"></i>
<span>{{ _('Upload') }}</span> <span>{{ _('Upload') }}</span>
<input id="gcode_upload" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button"> <input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
</span> </span>
<span class="btn btn-primary fileinput-button span6" data-bind="enable: $root.isSdReady() && !$root.isPrinting(), css: {disabled: !$root.isSdReady() || $root.isPrinting()}" style="margin-bottom: 10px"> <span class="btn btn-primary fileinput-button span6" data-bind="enable: $root.isSdReady() && !$root.isPrinting(), css: {disabled: !$root.isSdReady() || $root.isPrinting()}" style="margin-bottom: 10px">
<i class="fa fa-upload"></i> <i class="fa fa-upload"></i>
<span>{{ _('Upload to SD') }}</span> <span>{{ _('Upload to SD') }}</span>
<input id="gcode_upload_sd" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" data-bind="enable: isSdReady()"> <input id="gcode_upload_sd" data-test-id="upload-sd" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" data-bind="enable: isSdReady()">
</span> </span>
{% else %} {% else %}
<span class="btn btn-primary fileinput-button span12" style="margin-bottom: 10px"> <span class="btn btn-primary fileinput-button span12" style="margin-bottom: 10px">
<i class="icon-upload-alt icon-white"></i> <i class="icon-upload-alt icon-white"></i>
<span>{{ _('Upload') }}</span> <span>{{ _('Upload') }}</span>
<input id="gcode_upload" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button"> <input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
</span> </span>
{% endif %} {% endif %}
</div> </div>
+1 -1
View File
@@ -1,4 +1,4 @@
<span title="{{ _('Current printer state')|edq }}">{{ _('State') }}</span>: <strong data-bind="text: stateString"></strong><br> <span title="{{ _('Current printer state')|edq }}">{{ _('State') }}</span>: <strong data-test-id="state-string" data-bind="text: stateString"></strong><br>
<hr> <hr>
<span title="{{ _('Name of file currently selected for printing')|edq }}">{{ _('File') }}</span>: <strong data-bind="text: filedisplay, attr: {title: filepath}"></strong>&nbsp;<strong data-bind="visible: sd">(SD)</strong><br> <span title="{{ _('Name of file currently selected for printing')|edq }}">{{ _('File') }}</span>: <strong data-bind="text: filedisplay, attr: {title: filepath}"></strong>&nbsp;<strong data-bind="visible: sd">(SD)</strong><br>
<span title="{{ _('Upload date of the file currently selected or printing')|edq }}">{{ _('Uploaded') }}</span>: <strong data-bind="text: dateString"></strong><br> <span title="{{ _('Upload date of the file currently selected or printing')|edq }}">{{ _('Uploaded') }}</span>: <strong data-bind="text: dateString"></strong><br>
+1 -1
View File
@@ -109,7 +109,7 @@
<button class="btn btn-block control-box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendRetractCommand() }">{{ _('Retract') }}</button> <button class="btn btn-block control-box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendRetractCommand() }">{{ _('Retract') }}</button>
<!-- Flow rate --> <!-- Flow rate -->
<div id="control-jog-feedrate" class="jog-panel"> <div id="control-jog-flowrate" class="jog-panel">
<label>{{ _('Flow rate modifier:') }} <a class="text-info" href="javascript:void(0)" data-bind="popover: {placement: 'top', trigger: 'hover', title: '{{ _('Please note!') }}', content: '{{ _('The flow rate can only be set, it cannot be read back from the firmware due to a limitation of the communication protocol. There is no way to show the current setting.') }}'}"><i class="fa fa-info-circle"></i></a></label> <label>{{ _('Flow rate modifier:') }} <a class="text-info" href="javascript:void(0)" data-bind="popover: {placement: 'top', trigger: 'hover', title: '{{ _('Please note!') }}', content: '{{ _('The flow rate can only be set, it cannot be read back from the firmware due to a limitation of the communication protocol. There is no way to show the current setting.') }}'}"><i class="fa fa-info-circle"></i></a></label>
<div class="input-append control-box"> <div class="input-append control-box">
<input type="number" class="input-mini" min="1" step="1" data-bind="value: flowRate, event: { blur: resetFlowRateDisplay, focus: cancelFlowRateDisplayReset }, css: { pulsate_text_opacity: flowRateResetter() !== undefined }"> <input type="number" class="input-mini" min="1" step="1" data-bind="value: flowRate, event: { blur: resetFlowRateDisplay, focus: cancelFlowRateDisplayReset }, css: { pulsate_text_opacity: flowRateResetter() !== undefined }">
File diff suppressed because it is too large. Load diff
+56 -28
View File
@@ -648,12 +648,17 @@ class MachineCom(object):
self._monitoring_active = True self._monitoring_active = True
self.monitoring_thread = threading.Thread(target=self._monitor, name="comm._monitor") self.monitoring_thread = threading.Thread(target=self._monitor, name="comm._monitor")
self.monitoring_thread.daemon = True self.monitoring_thread.daemon = True
self.monitoring_thread.start()
# sending thread # sending thread
self._send_queue_active = True self._send_queue_active = True
self.sending_thread = threading.Thread(target=self._send_loop, name="comm.sending_thread") self.sending_thread = threading.Thread(target=self._send_loop, name="comm.sending_thread")
self.sending_thread.daemon = True self.sending_thread.daemon = True
def start(self):
# doing this here instead of __init__ combats a race condition where
# self._comm in the printer interface is still None on first pushs from
# the comm layer during detection
self.monitoring_thread.start()
self.sending_thread.start() self.sending_thread.start()
def __del__(self): def __del__(self):
@@ -959,7 +964,7 @@ class MachineCom(object):
self._send_queue_active = False self._send_queue_active = False
if self._serial is not None: if self._serial is not None:
if not is_error: if not is_error and self._state in self.OPERATIONAL_STATES:
self.sendGcodeScript("beforePrinterDisconnected") self.sendGcodeScript("beforePrinterDisconnected")
if wait: if wait:
if timeout is not None: if timeout is not None:
@@ -990,15 +995,17 @@ class MachineCom(object):
self._logger.exception("Error while trying to close serial port") self._logger.exception("Error while trying to close serial port")
is_error = True is_error = True
# if we are printing, this will also make sure of firing PRINT_FAILED
if is_error:
self._changeState(self.STATE_CLOSED_WITH_ERROR)
else:
self._changeState(self.STATE_CLOSED)
else: else:
deactivate_monitoring_and_send_queue() deactivate_monitoring_and_send_queue()
self._serial = None self._serial = None
# if we are printing, this will also make sure of firing PRINT_FAILED
if is_error:
self._changeState(self.STATE_CLOSED_WITH_ERROR)
else:
self._changeState(self.STATE_CLOSED)
if settings().getBoolean(["feature", "sdSupport"]): if settings().getBoolean(["feature", "sdSupport"]):
self._sdFileList = [] self._sdFileList = []
@@ -1672,14 +1679,17 @@ class MachineCom(object):
return return
try_hello = not settings().getBoolean(["serial", "waitForStartOnConnect"]) try_hello = not settings().getBoolean(["serial", "waitForStartOnConnect"])
self._changeState(self.STATE_CONNECTING) self._changeState(self.STATE_CONNECTING)
self._timeout = self._ok_timeout = self._get_new_communication_timeout()
else: else:
self._changeState(self.STATE_DETECT_SERIAL) self._changeState(self.STATE_DETECT_SERIAL)
self._perform_detection_step(init=True) self._perform_detection_step(init=True)
self._log("Connected to: %s, starting monitor" % self._serial) if not self._state in (self.STATE_CONNECTING, self.STATE_DETECT_SERIAL):
# we got cancelled during connection, bail
return
#Start monitoring the serial port. # Start monitoring the serial port
self._timeout = self._ok_timeout = self._get_new_communication_timeout() self._log("Connected to: %s, starting monitor" % self._serial)
startSeen = False startSeen = False
supportRepetierTargetTemp = settings().getBoolean(["serial", "repetierTargetTemp"]) supportRepetierTargetTemp = settings().getBoolean(["serial", "repetierTargetTemp"])
@@ -1839,7 +1849,8 @@ class MachineCom(object):
and (not self.job_on_hold or self._resendActive) and (not self.job_on_hold or self._resendActive)
and not self._long_running_command and not self._long_running_command
and not self._heating and now >= self._ok_timeout)) \ and not self._heating and now >= self._ok_timeout)) \
and (not self._blockWhileDwelling or not self._dwelling_until or now > self._dwelling_until): and (not self._blockWhileDwelling or not self._dwelling_until or now > self._dwelling_until)\
and not self._state in (self.STATE_DETECT_SERIAL,):
# We have two timeout variants: # We have two timeout variants:
# #
# Variant 1: No line at all received within the communication timeout. This can always happen. # Variant 1: No line at all received within the communication timeout. This can always happen.
@@ -2218,7 +2229,7 @@ class MachineCom(object):
### Serial detection ### Serial detection
if self._state == self.STATE_DETECT_SERIAL: if self._state == self.STATE_DETECT_SERIAL:
if line == '' or monotonic_time() > self._timeout: if line == '' or monotonic_time() > self._ok_timeout:
self._perform_detection_step() self._perform_detection_step()
elif 'start' in line or line.startswith('ok'): elif 'start' in line or line.startswith('ok'):
self._onConnected() self._onConnected()
@@ -2377,7 +2388,6 @@ class MachineCom(object):
self._logger.info("Serial detection: {}".format(message)) self._logger.info("Serial detection: {}".format(message))
if init: if init:
timeout = settings().getFloat(["serial", "timeout", "connection"])
port = self._port port = self._port
baudrate = self._baudrate baudrate = self._baudrate
@@ -2396,28 +2406,38 @@ class MachineCom(object):
baudrate_candidates = baudrateList([115200, 250000]) baudrate_candidates = baudrateList([115200, 250000])
self._detection_candidates = [(p, b) for p in port_candidates for b in baudrate_candidates] self._detection_candidates = [(p, b) for p in port_candidates for b in baudrate_candidates]
self._detection_retry = self.DETECTION_RETRIES
log("Performing autodetection with {} " \ log("Performing autodetection with {} " \
"port/baudrate candidates: {}".format(len(self._detection_candidates), "port/baudrate candidates: {}".format(len(self._detection_candidates),
", ".join(map(lambda x: "{}@{}".format(x[0], x[1]), ", ".join(map(lambda x: "{}@{}".format(x[0], x[1]),
self._detection_candidates)))) self._detection_candidates))))
else:
timeout = settings().getFloat(["serial", "timeout", "detection"])
def attempt_handshake(): def attempt_handshake():
if self._serial.timeout != timeout:
self._serial.timeout = timeout
self._timeout = monotonic_time() + timeout
log("Handshake attempt #{}".format(self._detection_retry + 1))
self._detection_retry += 1 self._detection_retry += 1
self._do_send_without_checksum(b"", log=False) # new line to reset things timeout = self._get_communication_timeout_interval()
self.sayHello(tags={"trigger:detection", })
log("Handshake attempt #{} with timeout {}s".format(self._detection_retry, timeout))
try:
if self._serial.timeout != timeout:
self._serial.timeout = timeout
self._timeout = self._ok_timeout = monotonic_time() + timeout
except Exception:
self._log("Unexpected error while setting timeout {}: {}".format(timeout, get_exception_string()))
self._logger.exception("Unexpected error while setting timeout {}".format(timeout))
else:
self._do_send_without_checksum(b"", log=False) # new line to reset things
self.sayHello(tags={"trigger:detection", })
while len(self._detection_candidates) > 0 or self._detection_retry < self.DETECTION_RETRIES:
if self._state not in (self.STATE_DETECT_SERIAL,):
return
while len(self._detection_candidates) > 0:
if self._detection_retry < self.DETECTION_RETRIES: if self._detection_retry < self.DETECTION_RETRIES:
if self._serial is None:
self._detection_retry = self.DETECTION_RETRIES
continue
attempt_handshake() attempt_handshake()
return return
@@ -2425,6 +2445,7 @@ class MachineCom(object):
(p, b) = self._detection_candidates.pop(0) (p, b) = self._detection_candidates.pop(0)
try: try:
log("Trying port {}, baudrate {}".format(p, b))
if self._serial is None or self._serial.port != p: if self._serial is None or self._serial.port != p:
if not self._open_serial(p, b, trigger_errors=False): if not self._open_serial(p, b, trigger_errors=False):
log("Could not open port {}, baudrate {}, skipping".format(p, b)) log("Could not open port {}, baudrate {}, skipping".format(p, b))
@@ -2432,7 +2453,6 @@ class MachineCom(object):
else: else:
self._serial.baudrate = b self._serial.baudrate = b
log("Trying port {}, baudrate {}".format(p, b))
self._detection_retry = 0 self._detection_retry = 0
attempt_handshake() attempt_handshake()
@@ -2654,6 +2674,15 @@ class MachineCom(object):
return interval return interval
def _get_communication_timeout_interval(self): def _get_communication_timeout_interval(self):
# special rules during serial detection
if self._state in (self.STATE_DETECT_SERIAL,):
if self._detection_retry == 0:
# first try
return self._timeout_intervals.get("detectionFirst", 10.0)
else:
# consecutive tries
return self._timeout_intervals.get("detectionConsecutive", 2.0)
# communication timeout # communication timeout
if self._busy_protocol_support: if self._busy_protocol_support:
comm_timeout = self._timeout_intervals.get("communicationBusy", 2.0) comm_timeout = self._timeout_intervals.get("communicationBusy", 2.0)
@@ -2875,8 +2904,7 @@ class MachineCom(object):
eventManager().fire(Events.ERROR, {"error": self.getErrorString(), "reason": reason}) eventManager().fire(Events.ERROR, {"error": self.getErrorString(), "reason": reason})
if close: if close:
if self._send_m112_on_error and not self.isSdPrinting() and reason not in ("connection", if self._send_m112_on_error and not self.isSdPrinting() and reason not in ("connection",
"autodetect_baudrate", "autodetect"):
"autodetect_port"):
self._trigger_emergency_stop(close=False) self._trigger_emergency_stop(close=False)
self.close(is_error=True) self.close(is_error=True)
+6 -2
View File
@@ -15,6 +15,7 @@ import re
import netifaces import netifaces
import requests import requests
import werkzeug.http
_cached_check_v6 = None _cached_check_v6 = None
def check_v6(): def check_v6():
@@ -201,9 +202,12 @@ def resolve_host(host):
def download_file(url, folder, max_length=None): def download_file(url, folder, max_length=None):
with requests.get(url, stream=True) as r: with requests.get(url, stream=True) as r:
r.raise_for_status() r.raise_for_status()
filename = None
if "Content-Disposition" in r.headers.keys(): if "Content-Disposition" in r.headers.keys():
filename = re.findall("filename=(.+)", r.headers["Content-Disposition"])[0] _, options = werkzeug.http.parse_options_header(r.headers["Content-Disposition"])
else: filename = options.get('filename')
if filename is None:
filename = url.split("/")[-1] filename = url.split("/")[-1]
assert len(filename) > 0 assert len(filename) > 0
+3
View File
@@ -0,0 +1,3 @@
M117 I'm just a test upload during E2E
G28 X0 Y0
M117 That is all folks!
+18 -29
View File
@@ -1,60 +1,49 @@
describe('Connection test against virtual printer', () => { import { prepare_server, login, disconnect, await_coreui } from "../util/util"
context('Connection test against virtual printer', () => {
const username = 'admin'; const username = 'admin';
const password = 'test'; const password = 'test';
beforeEach(() => { beforeEach(() => {
prepare_server();
// login // login
cy.request({ login(username, password);
method: 'POST',
url: '/api/login',
body: {
"user": username,
"pass": password
}
});
// ensure we are disconnected // ensure we are disconnected
cy.request({ disconnect();
method: 'POST',
url: '/api/connection',
body: {
"command": "disconnect"
}
});
cy.visit('/'); cy.visit('/');
await_coreui();
cy.get('#navbar', {timeout: 10000})
.should('be.visible');
}); });
it('connect & disconnect', () => { it('connect & disconnect', () => {
cy.get('#state .accordion-inner strong:first') cy.get('[data-test-id=state-string]', {timeout: 10000})
.should('contain', 'Offline'); .should('contain', 'Offline');
cy.get('#connection_printers') cy.get('[data-test-id=connection-printer-profiles]')
.should('have.length.greaterThan', 0); .should('have.length.greaterThan', 0);
cy.get('#connection_ports') cy.get('[data-test-id=connection-ports]')
.select('VIRTUAL'); .select('VIRTUAL');
cy.get('#connection_baudrates') cy.get('[data-test-id=connection-baudrates]')
.select('AUTO'); .select('AUTO');
cy.get('#printer_connect') cy.get('[data-test-id=connection-connect]')
.should('contain', 'Connect') .should('contain', 'Connect')
.click(); .click();
cy.get('#connection .accordion-inner', {timeout: 10000}) cy.get('[data-test-id=sidebar-connection-content]', {timeout: 10000})
.should('not.be.visible'); .should('not.be.visible');
cy.get('#state .accordion-inner strong:first') cy.get('[data-test-id=state-string]')
.should('contain', 'Operational'); .should('contain', 'Operational');
cy.get('#connection_wrapper a.accordion-toggle') cy.get('[data-test-id=sidebar-connection-toggle]')
.click(); .click();
cy.get('#printer_connect') cy.get('[data-test-id=connection-connect]')
.should('be.visible') .should('be.visible')
.should('contain', 'Disconnect') .should('contain', 'Disconnect')
.click(); .click();
cy.get('#state .accordion-inner strong:first') cy.get('[data-test-id=state-string]')
.should('contain', 'Offline'); .should('contain', 'Offline');
}); });
}); });
+66 -53
View File
@@ -1,46 +1,58 @@
describe('Login tests', () => { import { prepare_server, await_coreui, await_loginui, login } from "../util/util"
context('Login tests', () => {
const username = 'admin'; const username = 'admin';
const password = 'test'; const password = 'test';
describe.skip('Successful login', () => { beforeEach(() => {
prepare_server();
});
context('Successful login', () => {
beforeEach(() => {
cy.visit('/?l10n=en');
await_loginui();
});
it('logs in', () => { it('logs in', () => {
cy.visit('/'); cy.get('[data-test-id=login-username]')
cy.get('#login-user')
.type(username); .type(username);
cy.get('#login-password') cy.get('[data-test-id=login-password]')
.type(password); .type(password);
cy.get('#login-button') cy.get('[data-test-id=login-submit]')
.click(); .click({ force: true });
cy.wait("@login");
cy.get('#navbar', {timeout: 10000}) await_coreui();
.should('be.visible');
cy.get('#navbar_login a.dropdown-toggle span') cy.get('[data-test-id=login-menu-title]')
.should('contain', username); .should('contain', username);
cy.getCookie('session_P5000') cy.getCookie('session_P5000')
.should('exist'); .should('exist');
cy.getCookie('remember_token_P5000') cy.getCookie('remember_token_P5000')
.should('not.exist'); .should('not.exist');
cy.url() cy.location()
.should('contain', '#temp'); .should((loc) => {
expect(loc.hash).to.eq("#temp");
});
}); });
it('logs in with remember me', () => { it('logs in with remember me', () => {
cy.visit('/'); cy.get('[data-test-id=login-username]')
cy.get('#login-user')
.type(username); .type(username);
cy.get('#login-password') cy.get('[data-test-id=login-password]')
.type(password); .type(password);
cy.get('[data-test-id=login-remember-me]')
cy.get('#login-remember')
.click();
cy.get('#login-button')
.click(); .click();
cy.get('#navbar', {timeout: 10000}) cy.get('[data-test-id=login-submit]')
.should('be.visible'); .click({ force: true });
cy.get('#navbar_login a.dropdown-toggle span') cy.wait("@login");
await_coreui();
cy.get('[data-test-id=login-menu-title]')
.should('contain', username); .should('contain', username);
cy.getCookie('session_P5000') cy.getCookie('session_P5000')
.should('exist'); .should('exist');
@@ -49,62 +61,63 @@ describe('Login tests', () => {
expect($cookie).to.have.property('value'); expect($cookie).to.have.property('value');
expect($cookie.value).to.match(new RegExp('^' + username + '\|')); expect($cookie.value).to.match(new RegExp('^' + username + '\|'));
}); });
cy.url() cy.location()
.should('contain', '#temp'); .should((loc) => {
expect(loc.hash).to.eq("#temp");
});
}); });
});
it('logs in and logs out again', () => { context('Successful logout', () => {
cy.visit('/'); it('logs out', () => {
cy.get('#login-user') Cypress.currentTest.retries(3);
.type(username);
cy.get('#login-password')
.type(password);
cy.get('#login-button') // login
login(username, password);
cy.visit('/?l10n=en');
await_coreui();
cy.get('[data-test-id=login-menu]')
.click(); .click();
cy.get('[data-test-id=logout-submit]')
cy.get('#navbar', {timeout: 10000})
.should('be.visible');
cy.get('#navbar_login a.dropdown-toggle')
.click();
cy.get('#logout_button')
.click(); .click();
cy.wait("@logout");
cy.get('h2.form-signin-heading') await_loginui();
.should('be.visible')
.should('contain', 'Please log in');
}) })
}); });
context('Unauthorized login attempts', () => { context('Unauthorized login attempts', () => {
it('uses wrong user name', () => { beforeEach(() => {
cy.visit('/'); cy.visit('/?l10n=en');
await_loginui();
})
cy.get('#login-user') it('uses wrong user name', () => {
cy.get('[data-test-id=login-username]')
.type('idonotexist'); .type('idonotexist');
cy.get('#login-password') cy.get('[data-test-id=login-password]')
.type('test'); .type('test');
cy.get('#login-button') cy.get('[data-test-id=login-submit]')
.click(); .click();
}); });
it('uses wrong password', () => { it('uses wrong password', () => {
cy.visit('/'); cy.get('[data-test-id=login-username]')
cy.get('#login-user')
.type('admin'); .type('admin');
cy.get('#login-password') cy.get('[data-test-id=login-password]')
.type('wrongpassword'); .type('wrongpassword');
cy.get('#login-button') cy.get('[data-test-id=login-submit]')
.click(); .click();
}); });
afterEach(() => { afterEach(() => {
cy.get('h2.form-signin-heading') cy.get('[data-test-id=login-title]')
.should('be.visible') .should('be.visible')
.should('contain', 'Please log in'); .should('contain', 'Please log in');
cy.get('#login-error') cy.get('[data-test-id=login-error]')
.should('be.visible') .should('be.visible')
.should('contain', 'Incorrect username or password'); .should('contain', 'Incorrect username or password');
}); });
+29
View File
@@ -0,0 +1,29 @@
import { prepare_server, login, await_coreui } from "../util/util"
context("Error free page load", () => {
let spy;
Cypress.on('uncaught:exception', (err, runnable) => {
console.error(err);
return false;
});
Cypress.on("window:before:load", (win) => {
spy = cy.spy(win.console, "error");
});
const username = 'admin';
const password = 'test';
beforeEach(() => {
prepare_server();
login(username, password);
cy.visit('/');
await_coreui();
});
it("loads without error", () => {
expect(spy).not.to.be.called;
});
})
+24
View File
@@ -0,0 +1,24 @@
import { prepare_server, login, await_coreui } from "../util/util"
context('Upload tests', () => {
const username = 'admin';
const password = 'test';
beforeEach(() => {
prepare_server();
// login
login(username, password);
cy.visit('/');
await_coreui();
});
it("uploads file to local via button", () => {
cy.get('[data-test-id=upload-local]')
.attachFile("e2e-test.gcode");
cy.wait("@files");
cy.get('[data-test-id=files-list]')
.contains("e2e-test.gcode");
});
});
+143 -27
View File
@@ -46,7 +46,7 @@
"extend": "3.0.2", "extend": "3.0.2",
"forever-agent": "0.6.1", "forever-agent": "0.6.1",
"form-data": "2.3.3", "form-data": "2.3.3",
"har-validator": "5.1.3", "har-validator": "5.1.5",
"http-signature": "1.2.0", "http-signature": "1.2.0",
"is-typedarray": "1.0.0", "is-typedarray": "1.0.0",
"isstream": "0.1.2", "isstream": "0.1.2",
@@ -88,6 +88,11 @@
"any-observable": "0.3.0" "any-observable": "0.3.0"
} }
}, },
"@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
},
"@types/sinonjs__fake-timers": { "@types/sinonjs__fake-timers": {
"version": "6.0.1", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.1.tgz",
@@ -99,9 +104,9 @@
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==" "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg=="
}, },
"ajv": { "ajv": {
"version": "6.12.2", "version": "6.12.3",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz",
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==",
"requires": { "requires": {
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"fast-json-stable-stringify": "2.1.0", "fast-json-stable-stringify": "2.1.0",
@@ -375,9 +380,9 @@
} }
}, },
"cypress": { "cypress": {
"version": "4.9.0", "version": "4.12.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-4.9.0.tgz", "resolved": "https://registry.npmjs.org/cypress/-/cypress-4.12.0.tgz",
"integrity": "sha512-qGxT5E0j21FPryzhb0OBjCdhoR/n1jXtumpFFSBPYWsaZZhNaBvc3XlBUDEZKkkXPsqUFYiyhWdHN/zo0t5FcA==", "integrity": "sha512-ZDngKMwoQ2UYmeSUJikLMZG6t2N7lTHHlzBzh5W0MbPfXSMv36YUgL2ZVD+t4ZLA63WWkvhwxIkDG+WJknBgHw==",
"requires": { "requires": {
"@cypress/listr-verbose-renderer": "0.4.1", "@cypress/listr-verbose-renderer": "0.4.1",
"@cypress/request": "2.88.5", "@cypress/request": "2.88.5",
@@ -393,7 +398,7 @@
"commander": "4.1.1", "commander": "4.1.1",
"common-tags": "1.8.0", "common-tags": "1.8.0",
"debug": "4.1.1", "debug": "4.1.1",
"eventemitter2": "6.4.2", "eventemitter2": "6.4.3",
"execa": "1.0.0", "execa": "1.0.0",
"executable": "4.1.1", "executable": "4.1.1",
"extract-zip": "1.7.0", "extract-zip": "1.7.0",
@@ -403,10 +408,10 @@
"is-installed-globally": "0.3.2", "is-installed-globally": "0.3.2",
"lazy-ass": "1.6.0", "lazy-ass": "1.6.0",
"listr": "0.14.3", "listr": "0.14.3",
"lodash": "4.17.15", "lodash": "4.17.19",
"log-symbols": "3.0.0", "log-symbols": "3.0.0",
"minimist": "1.2.5", "minimist": "1.2.5",
"moment": "2.26.0", "moment": "2.27.0",
"ospath": "1.2.2", "ospath": "1.2.2",
"pretty-bytes": "5.3.0", "pretty-bytes": "5.3.0",
"ramda": "0.26.1", "ramda": "0.26.1",
@@ -418,6 +423,107 @@
"yauzl": "2.10.0" "yauzl": "2.10.0"
} }
}, },
"cypress-commands": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/cypress-commands/-/cypress-commands-1.1.0.tgz",
"integrity": "sha512-Q8Jr25pHJQFXwln6Hp8O+Hgs8Z506Y2wA9F1Te2cTajjc5L9gtt9WPOcw1Ogh+OgyqaMHF+uq31vdfImRTio5Q=="
},
"cypress-file-upload": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/cypress-file-upload/-/cypress-file-upload-4.0.7.tgz",
"integrity": "sha512-rFFmnoZ2bWyWFpSV09AhkSUgYEiVy70pcQ6nf/mGTMTrVHvKCCCIfRu3TbgVYHbgBq+0hqjfjQrtz4IbgH7qZA==",
"requires": {
"mime": "2.4.6"
}
},
"cypress-plugin-retries": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/cypress-plugin-retries/-/cypress-plugin-retries-1.5.2.tgz",
"integrity": "sha512-o1xVIGtv4WvNVxoVJ2X08eAuvditPHrePRzHqhwwHbMKu3C2rtxCdanRCZdO5fjh8ww+q4v4V0e9GmysbOvu3A==",
"requires": {
"chalk": "3.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"requires": {
"@types/color-name": "1.1.1",
"color-convert": "2.0.1"
}
},
"chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
"requires": {
"ansi-styles": "4.2.1",
"supports-color": "7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
}
}
},
"cypress-terminal-report": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/cypress-terminal-report/-/cypress-terminal-report-1.4.1.tgz",
"integrity": "sha512-Oyx7VQCSh4Nh1q0ROo9Wq6KrxxbP8adhUQRxVpNlXeyyfLj2X8AXxqbIh6Ct3V8oENKh5iHHhuOfRfQ1tmE4Tw==",
"requires": {
"chalk": "3.0.0",
"methods": "1.1.2"
},
"dependencies": {
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"requires": {
"@types/color-name": "1.1.1",
"color-convert": "2.0.1"
}
},
"chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
"requires": {
"ansi-styles": "4.2.1",
"supports-color": "7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
}
}
},
"cypress-wait-until": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/cypress-wait-until/-/cypress-wait-until-1.7.1.tgz",
"integrity": "sha512-8DL5IsBTbAxBjfYgCzdbohPq/bY+IKc63fxtso1C8RWhLnQkZbVESyaclNr76jyxfId6uyzX8+Xnt0ZwaXNtkA=="
},
"dashdash": { "dashdash": {
"version": "1.14.1", "version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
@@ -472,9 +578,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
}, },
"eventemitter2": { "eventemitter2": {
"version": "6.4.2", "version": "6.4.3",
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.2.tgz", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.3.tgz",
"integrity": "sha512-r/Pwupa5RIzxIHbEKCkNXqpEQIIT4uQDxmP4G/Lug/NokVUWj0joz/WzWl3OxRpC5kDrH/WdiUJoR+IrwvXJEw==" "integrity": "sha512-t0A2msp6BzOf+QAcI6z9XMktLj52OjGQg+8SJH6v5+3uxNpWYRR3wQmfA+6xtMU9kOC59qk9licus5dYcrYkMQ=="
}, },
"execa": { "execa": {
"version": "1.0.0", "version": "1.0.0",
@@ -652,11 +758,11 @@
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
}, },
"har-validator": { "har-validator": {
"version": "5.1.3", "version": "5.1.5",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
"requires": { "requires": {
"ajv": "6.12.2", "ajv": "6.12.3",
"har-schema": "2.0.0" "har-schema": "2.0.0"
} }
}, },
@@ -829,7 +935,7 @@
"listr-update-renderer": "0.5.0", "listr-update-renderer": "0.5.0",
"listr-verbose-renderer": "0.5.0", "listr-verbose-renderer": "0.5.0",
"p-map": "2.1.0", "p-map": "2.1.0",
"rxjs": "6.6.0" "rxjs": "6.6.2"
} }
}, },
"listr-silent-renderer": { "listr-silent-renderer": {
@@ -926,9 +1032,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
}, },
"lodash.once": { "lodash.once": {
"version": "4.1.1", "version": "4.1.1",
@@ -980,6 +1086,16 @@
} }
} }
}, },
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "2.4.6",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
},
"mime-db": { "mime-db": {
"version": "1.44.0", "version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
@@ -1020,9 +1136,9 @@
} }
}, },
"moment": { "moment": {
"version": "2.26.0", "version": "2.27.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz",
"integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==" "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ=="
}, },
"ms": { "ms": {
"version": "2.1.2", "version": "2.1.2",
@@ -1201,9 +1317,9 @@
} }
}, },
"rxjs": { "rxjs": {
"version": "6.6.0", "version": "6.6.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.0.tgz", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
"integrity": "sha512-3HMA8z/Oz61DUHe+SdOiQyzIf4tOx5oQHmMir7IZEu6TMqCLHT4LRcmNaUS0NwOz8VLvmmBduMsoaUvMaIiqzg==", "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
"requires": { "requires": {
"tslib": "1.13.0" "tslib": "1.13.0"
} }
+6 -1
View File
@@ -17,6 +17,11 @@
}, },
"homepage": "https://octoprint.org", "homepage": "https://octoprint.org",
"dependencies": { "dependencies": {
"cypress": "^4.9.0" "cypress": "^4.12.0",
"cypress-commands": "^1.1.0",
"cypress-file-upload": "^4.0.7",
"cypress-plugin-retries": "^1.5.2",
"cypress-terminal-report": "^1.4.1",
"cypress-wait-until": "^1.7.1"
} }
} }
+2
View File
@@ -18,4 +18,6 @@
module.exports = (on, config) => { module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits // `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config // `config` is the resolved Cypress config
require("cypress-terminal-report/src/installLogsPrinter")(on);
require("cypress-plugin-retries/lib/plugin")(on);
} }
+2 -25
View File
@@ -1,25 +1,2 @@
// *********************************************** import 'cypress-wait-until';
// This example commands.js shows you how to import 'cypress-file-upload';
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
+4
View File
@@ -18,3 +18,7 @@ import './commands'
// Alternatively you can use CommonJS syntax: // Alternatively you can use CommonJS syntax:
// require('./commands') // require('./commands')
require('cypress-terminal-report/src/installLogsCollector')();
require('cypress-commands');
require('cypress-plugin-retries');
+67
View File
@@ -0,0 +1,67 @@
export const prepare_server = () => {
cy.server();
cy.route("POST", "/api/login").as("login");
cy.route("POST", "/api/logout").as("logout");
cy.route("GET", "/api/settings").as("settings");
cy.route("GET", "/api/files?recursive=true").as("files")
cy.route("GET", "/plugin/softwareupdate/check").as("softwareupdate");
cy.route("GET", "/api/plugin/pluginmanager").as("pluginmanager");
}
export const await_loginui = () => {
cy.get('[data-test-id=login-title]')
.should('be.visible')
.should('contain', 'Please log in');
cy.window()
.its('OctoPrint.loginui.startedUp', { timeout: 30000 })
.should('be.true');
}
export const await_coreui = () => {
cy.wait(["@login", "@settings", "@files", "@softwareupdate", "@pluginmanager"]);
cy.window()
.its('OctoPrint.coreui.startedUp', { timeout: 30000 })
.should('be.true');
}
export const login = (username, password) => {
cy.request({
method: 'POST',
url: '/api/login',
body: {
"user": username,
"pass": password
}
});
}
export const logout = () => {
cy.request({
method: 'POST',
url: '/api/logout'
});
}
export const connect = (port, baudrate) => {
port = port || "AUTO";
baudrate = baudrate || 0;
cy.request({
method: 'POST',
url: '/api/connection',
body: {
"command": "connect",
"port": port,
"baudrate": baudrate
}
});
}
export const disconnect = () => {
cy.request({
method: 'POST',
url: '/api/connection',
body: {
"command": "disconnect"
}
});
}
Binary file not shown.
File diff suppressed because it is too large. Load diff
+147 -139
View File
@@ -6,9 +6,9 @@
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OctoPrint 1.4.1.dev393+g32b655451.dirty\n" "Project-Id-Version: OctoPrint 1.4.1rc5.dev1+g57b8d0b88.dirty\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n" "Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2020-07-06 09:41+0200\n" "POT-Creation-Date: 2020-08-04 10:26+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -210,16 +210,16 @@ msgstr ""
#: src/octoprint/plugins/action_command_prompt/templates/action_command_prompt_settings.jinja2:11 #: src/octoprint/plugins/action_command_prompt/templates/action_command_prompt_settings.jinja2:11
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:72 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:72
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:303 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:311
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:357 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:365
msgid "Always" msgid "Always"
msgstr "" msgstr ""
#: src/octoprint/plugins/action_command_prompt/templates/action_command_prompt_settings.jinja2:14 #: src/octoprint/plugins/action_command_prompt/templates/action_command_prompt_settings.jinja2:14
#: src/octoprint/templates/dialogs/settings/features.jinja2:70 #: src/octoprint/templates/dialogs/settings/features.jinja2:70
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:79 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:79
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:306 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:314
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:360 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:368
msgid "Never" msgid "Never"
msgstr "" msgstr ""
@@ -228,9 +228,9 @@ msgstr ""
#: src/octoprint/plugins/pi_support/templates/pi_support_settings.jinja2:16 #: src/octoprint/plugins/pi_support/templates/pi_support_settings.jinja2:16
#: src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2:327 #: src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2:327
#: src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2:105 #: src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2:105
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:195 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:203
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:312 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:320
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:399 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:407
#: src/octoprint/templates/dialogs/settings/webcam.jinja2:10 #: src/octoprint/templates/dialogs/settings/webcam.jinja2:10
#: src/octoprint/templates/dialogs/settings/webcam.jinja2:25 #: src/octoprint/templates/dialogs/settings/webcam.jinja2:25
#: src/octoprint/templates/snippets/settings/server/serverPluginBlacklist.jinja2:5 #: src/octoprint/templates/snippets/settings/server/serverPluginBlacklist.jinja2:5
@@ -1270,7 +1270,7 @@ msgstr ""
#: src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js:310 #: src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js:310
#: src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js:336 #: src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js:336
#: src/octoprint/static/js/app/viewmodels/loginstate.js:110 #: src/octoprint/static/js/app/viewmodels/loginstate.js:110
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:447 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:455
msgid "Ignore" msgid "Ignore"
msgstr "" msgstr ""
@@ -1539,10 +1539,10 @@ msgstr ""
#: src/octoprint/plugins/gcodeviewer/templates/gcodeviewer_tab.jinja2:117 #: src/octoprint/plugins/gcodeviewer/templates/gcodeviewer_tab.jinja2:117
#: src/octoprint/templates/dialogs/settings/folders.jinja2:67 #: src/octoprint/templates/dialogs/settings/folders.jinja2:67
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:90 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:90
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:447 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:455
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:463 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:471
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:472 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:480
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:487 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:495
#: src/octoprint/templates/snippets/settings/accesscontrol/groups.jinja2:87 #: src/octoprint/templates/snippets/settings/accesscontrol/groups.jinja2:87
#: src/octoprint/templates/snippets/settings/accesscontrol/permission_list.jinja2:6 #: src/octoprint/templates/snippets/settings/accesscontrol/permission_list.jinja2:6
msgid "Warning" msgid "Warning"
@@ -3153,8 +3153,8 @@ msgstr ""
msgid "OctoPrint version tracking" msgid "OctoPrint version tracking"
msgstr "" msgstr ""
#: src/octoprint/plugins/tracking/__init__.py:151
#: src/octoprint/plugins/tracking/__init__.py:152 #: src/octoprint/plugins/tracking/__init__.py:152
#: src/octoprint/plugins/tracking/__init__.py:153
#: src/octoprint/plugins/tracking/templates/tracking_settings.jinja2:1 #: src/octoprint/plugins/tracking/templates/tracking_settings.jinja2:1
msgid "Anonymous Usage Tracking" msgid "Anonymous Usage Tracking"
msgstr "" msgstr ""
@@ -3694,77 +3694,77 @@ msgstr ""
msgid "Progress" msgid "Progress"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:205 #: src/octoprint/static/js/app/main.js:206
msgid "Offline" msgid "Offline"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:206 #: src/octoprint/static/js/app/main.js:207
msgid "Opening serial connection" msgid "Opening serial connection"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:207 #: src/octoprint/static/js/app/main.js:208
msgid "Detecting serial connection" msgid "Detecting serial connection"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:208 #: src/octoprint/static/js/app/main.js:209
msgid "Connecting" msgid "Connecting"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:209 #: src/octoprint/static/js/app/main.js:210
msgid "Operational" msgid "Operational"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:210 #: src/octoprint/static/js/app/main.js:211
msgid "Starting" msgid "Starting"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:211 #: src/octoprint/static/js/app/main.js:212
msgid "Starting print from SD" msgid "Starting print from SD"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:212 #: src/octoprint/static/js/app/main.js:213
msgid "Printing from SD" msgid "Printing from SD"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:213 #: src/octoprint/static/js/app/main.js:214
msgid "Sending file to SD" msgid "Sending file to SD"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:214 #: src/octoprint/static/js/app/main.js:215
msgid "Printing" msgid "Printing"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:215 #: src/octoprint/static/js/app/main.js:216
msgid "Paused" msgid "Paused"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:216 #: src/octoprint/static/js/app/main.js:217
msgid "Closed" msgid "Closed"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:217 #: src/octoprint/static/js/app/main.js:218
msgid "Transferring file to SD" msgid "Transferring file to SD"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:218 #: src/octoprint/static/js/app/main.js:219
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:460 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:468
msgid "Pausing" msgid "Pausing"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:219 #: src/octoprint/static/js/app/main.js:220
msgid "Resuming" msgid "Resuming"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:220 #: src/octoprint/static/js/app/main.js:221
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:469 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:477
msgid "Cancelling" msgid "Cancelling"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:221 #: src/octoprint/static/js/app/main.js:222
msgid "Finishing" msgid "Finishing"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/main.js:833 #: src/octoprint/static/js/app/main.js:836
msgid "Loading OctoPrint's UI, please wait..." msgid "Loading OctoPrint's UI, please wait..."
msgstr "" msgstr ""
@@ -4273,23 +4273,23 @@ msgstr ""
msgid "Autodetect from browser" msgid "Autodetect from browser"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:348 #: src/octoprint/static/js/app/viewmodels/settings.js:349
msgid "If you see your webcam stream below, the entered stream URL is ok." msgid "If you see your webcam stream below, the entered stream URL is ok."
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:356 #: src/octoprint/static/js/app/viewmodels/settings.js:357
msgid "Stream test" msgid "Stream test"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:374 #: src/octoprint/static/js/app/viewmodels/settings.js:375
msgid "Could not retrieve snapshot URL, please double check the URL" msgid "Could not retrieve snapshot URL, please double check the URL"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:375 #: src/octoprint/static/js/app/viewmodels/settings.js:376
msgid "Snapshot test failed" msgid "Snapshot test failed"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:390 #: src/octoprint/static/js/app/viewmodels/settings.js:391
#, python-format #, python-format
msgid "" msgid ""
"Could retrieve the snapshot URL, but it didn't look like an image. Got " "Could retrieve the snapshot URL, but it didn't look like an image. Got "
@@ -4298,66 +4298,66 @@ msgid ""
"or videos." "or videos."
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:415 #: src/octoprint/static/js/app/viewmodels/settings.js:416
msgid "" msgid ""
"If you see your webcam snapshot picture below, the entered snapshot URL " "If you see your webcam snapshot picture below, the entered snapshot URL "
"is ok." "is ok."
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:417 #: src/octoprint/static/js/app/viewmodels/settings.js:418
msgid "Snapshot test" msgid "Snapshot test"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:450 #: src/octoprint/static/js/app/viewmodels/settings.js:451
msgid "The path doesn't exist" msgid "The path doesn't exist"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:452 #: src/octoprint/static/js/app/viewmodels/settings.js:453
msgid "The path is not a file" msgid "The path is not a file"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:454 #: src/octoprint/static/js/app/viewmodels/settings.js:455
msgid "The path is not an executable" msgid "The path is not an executable"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:457 #: src/octoprint/static/js/app/viewmodels/settings.js:458
#: src/octoprint/static/js/app/viewmodels/settings.js:538 #: src/octoprint/static/js/app/viewmodels/settings.js:539
msgid "The path is valid" msgid "The path is valid"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:477 #: src/octoprint/static/js/app/viewmodels/settings.js:478
msgid "The server is not reachable" msgid "The server is not reachable"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:479 #: src/octoprint/static/js/app/viewmodels/settings.js:480
msgid "The server is reachable" msgid "The server is reachable"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:498 #: src/octoprint/static/js/app/viewmodels/settings.js:499
msgid "Name cannot be resolved" msgid "Name cannot be resolved"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:500 #: src/octoprint/static/js/app/viewmodels/settings.js:501
msgid "Name can be resolved" msgid "Name can be resolved"
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:529 #: src/octoprint/static/js/app/viewmodels/settings.js:530
msgid "The path is a broken symlink." msgid "The path is a broken symlink."
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:531 #: src/octoprint/static/js/app/viewmodels/settings.js:532
msgid "The path does not exist and cannot be created." msgid "The path does not exist and cannot be created."
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:533 #: src/octoprint/static/js/app/viewmodels/settings.js:534
msgid "The path is not a folder." msgid "The path is not a folder."
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:535 #: src/octoprint/static/js/app/viewmodels/settings.js:536
msgid "The path is not writable." msgid "The path is not writable."
msgstr "" msgstr ""
#: src/octoprint/static/js/app/viewmodels/settings.js:660 #: src/octoprint/static/js/app/viewmodels/settings.js:661
#: src/octoprint/static/js/app/viewmodels/usersettings.js:101 #: src/octoprint/static/js/app/viewmodels/usersettings.js:101
msgid "" msgid ""
"This will generate a new API Key. The old API Key will cease to function " "This will generate a new API Key. The old API Key will cease to function "
@@ -5505,87 +5505,95 @@ msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:176 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:176
msgid "" msgid ""
"Time after which to consider an auto detection attempt to have failed if " "Time after which to consider the auto detection handshake attempt to have"
"no successful connection is detected" " failed if no successful connection is detected"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:177 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:177
msgid "Autodetection timeout" msgid "Autodetection timeout"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:185 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:183
msgid "First handshake attempt"
msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:190
msgid "Consecutive handshake attempts"
msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:193
msgid "" msgid ""
"Time after which to consider a position query on pause or cancel to have " "Time after which to consider a position query on pause or cancel to have "
"failed" "failed"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:186 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:194
msgid "Position query timeout" msgid "Position query timeout"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:197 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:205
msgid "" msgid ""
"Time to wait after opening the serial connection before starting baudrate" "Time to wait after opening the serial connection before starting baudrate"
" detection" " detection"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:198 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:206
msgid "Initial baudrate detection pause" msgid "Initial baudrate detection pause"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:204 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:212
msgid "" msgid ""
"Some controllers need a bit of a breather before baudrate detection after" "Some controllers need a bit of a breather before baudrate detection after"
" initial connect. If baudrate detection fails due to a hanging " " initial connect. If baudrate detection fails due to a hanging "
"controller, try increasing this value." "controller, try increasing this value."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:207 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:215
msgid "" msgid ""
"Maximum consecutive communication timeouts while idle. More than this and" "Maximum consecutive communication timeouts while idle. More than this and"
" the printer will be considered to be gone. Set to 0 to disable." " the printer will be considered to be gone. Set to 0 to disable."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:208 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:216
msgid "Max. consecutive timeouts while idle" msgid "Max. consecutive timeouts while idle"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:211 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:219
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:218 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:226
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:225 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:233
msgid "Set to 0 to disable consecutive timeout detection and handling." msgid "Set to 0 to disable consecutive timeout detection and handling."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:214 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:222
msgid "" msgid ""
"Maximum consecutive communication timeouts while printing. More than this" "Maximum consecutive communication timeouts while printing. More than this"
" and the printer will be considered to be gone. Set to 0 to disable." " and the printer will be considered to be gone. Set to 0 to disable."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:215 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:223
msgid "Max. consecutive timeouts while printing" msgid "Max. consecutive timeouts while printing"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:221 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:229
msgid "" msgid ""
"Maximum consecutive communication timeouts while a long running command " "Maximum consecutive communication timeouts while a long running command "
"is active. More than this and the printer will be considered to be gone. " "is active. More than this and the printer will be considered to be gone. "
"Set to 0 to disable." "Set to 0 to disable."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:222 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:230
msgid "Max. consecutive timeouts during long running commands" msgid "Max. consecutive timeouts during long running commands"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:234 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:242
msgid "Firmware specific settings" msgid "Firmware specific settings"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:238 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:246
msgid "Enable automatic firmware detection" msgid "Enable automatic firmware detection"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:239 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:247
msgid "" msgid ""
"\n" "\n"
" If enabled, OctoPrint will try to figure " " If enabled, OctoPrint will try to figure "
@@ -5597,85 +5605,85 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:250 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:258
msgid "Select SD files by relative path" msgid "Select SD files by relative path"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:250 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:258
msgid "RepRap Firmware" msgid "RepRap Firmware"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:257 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:265
msgid "Always assume SD card is present" msgid "Always assume SD card is present"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:257 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:265
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:271 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:279
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:278 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:286
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:285 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:293
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:292 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:300
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:303 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:311
msgid "Repetier" msgid "Repetier"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:264 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:272
msgid "Disable SD printing detection" msgid "Disable SD printing detection"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:264 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:272
msgid "Ultimaker 2/2+" msgid "Ultimaker 2/2+"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:271 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:279
msgid "Ignore consecutive resend requests for the same line" msgid "Ignore consecutive resend requests for the same line"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:278 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:286
#, python-format #, python-format
msgid "" msgid ""
"Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target " "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target "
"temperature format" "temperature format"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:285 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:293
msgid "Disable detection of external heatups" msgid "Disable detection of external heatups"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:292 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:300
msgid "Actively pause communication during <code>G4</code> dwell command" msgid "Actively pause communication during <code>G4</code> dwell command"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:297 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:305
msgid "Send a checksum with the command" msgid "Send a checksum with the command"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:300 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:308
msgid "When printing" msgid "When printing"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:317 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:325
msgid "Support temperature autoreporting by firmware, if detected" msgid "Support temperature autoreporting by firmware, if detected"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:324 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:332
msgid "Support sd status autoreporting by firmware, if detected" msgid "Support sd status autoreporting by firmware, if detected"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:331 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:339
msgid "" msgid ""
"Send emergency GCODES <code>M108</code> and <code>M410</code> without " "Send emergency GCODES <code>M108</code> and <code>M410</code> without "
"waiting for acknowledgement, if detected as supported by the firmware" "waiting for acknowledgement, if detected as supported by the firmware"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:338 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:346
msgid "Support <code>busy</code> protocol, if detected" msgid "Support <code>busy</code> protocol, if detected"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:345 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:353
msgid "Simulate <code>ok</code> for <code>M29</code>" msgid "Simulate <code>ok</code> for <code>M29</code>"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:346 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:354
msgid "" msgid ""
"Most Marlin forks that were derived from Marlin versions &lt; v1.1.0 do " "Most Marlin forks that were derived from Marlin versions &lt; v1.1.0 do "
"not send an acknowledging <code>ok</code> for a <code>M29</code>. Check " "not send an acknowledging <code>ok</code> for a <code>M29</code>. Check "
@@ -5683,40 +5691,40 @@ msgid ""
"to your printer's SD." "to your printer's SD."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:351 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:359
msgid "Simulate <code>ok</code> for resend requests" msgid "Simulate <code>ok</code> for resend requests"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:354 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:362
msgid "If detected as necessary" msgid "If detected as necessary"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:362 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:370
msgid "" msgid ""
"Some Marlin forks lack an acknowledging <code>ok</code> with their resend" "Some Marlin forks lack an acknowledging <code>ok</code> with their resend"
" requests. Set this to \"always\" or \"if detected as necessary\" if you " " requests. Set this to \"always\" or \"if detected as necessary\" if you "
"run into communication stalls on resend requests." "run into communication stalls on resend requests."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:369 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:377
msgid "Protocol fine tuning" msgid "Protocol fine tuning"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:373 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:381
msgid "Wait for <code>start</code> on connect" msgid "Wait for <code>start</code> on connect"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:374 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:382
msgid "" msgid ""
"Try checking this if you run into connection timeouts due to your printer" "Try checking this if you run into connection timeouts due to your printer"
" taking too long to respond to OctoPrint's handshake attempts on connect." " taking too long to respond to OctoPrint's handshake attempts on connect."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:379 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:387
msgid "Blocked commands" msgid "Blocked commands"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:382 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:390
msgid "" msgid ""
"Use this to specify commands that should never be sent to the printer. " "Use this to specify commands that should never be sent to the printer. "
"Just the G or M code, comma separated. Defaults to <code>M0</code> and " "Just the G or M code, comma separated. Defaults to <code>M0</code> and "
@@ -5724,22 +5732,22 @@ msgid ""
"controller has been pressed if it receives either of those two commands." "controller has been pressed if it receives either of those two commands."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:386 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:394
msgid "Pausing commands" msgid "Pausing commands"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:389 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:397
msgid "" msgid ""
"Use this to specify commands on which OctoPrint should pause the print " "Use this to specify commands on which OctoPrint should pause the print "
"job. Just the G or M code, comma separated. Defaults to <code>M0</code>, " "job. Just the G or M code, comma separated. Defaults to <code>M0</code>, "
"<code>M1</code> and <code>M25</code>." "<code>M1</code> and <code>M25</code>."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:393 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:401
msgid "Emergency commands" msgid "Emergency commands"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:396 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:404
msgid "" msgid ""
"Use this to specify emergency commands which should jump any queues and -" "Use this to specify emergency commands which should jump any queues and -"
" if supported by the firmware - be force sent. Just the G or M code, " " if supported by the firmware - be force sent. Just the G or M code, "
@@ -5747,123 +5755,123 @@ msgid ""
"<code>M410</code>." "<code>M410</code>."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:401 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:409
msgid "Command to send to the firmware on first handshake attempt." msgid "Command to send to the firmware on first handshake attempt."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:402 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:410
msgid "\"Hello\" command" msgid "\"Hello\" command"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:405 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:413
msgid "" msgid ""
"Use this to specify a different command than the default " "Use this to specify a different command than the default "
"<code>M110</code> to send to the printer on initial connection to trigger" "<code>M110</code> to send to the printer on initial connection to trigger"
" a communication handshake." " a communication handshake."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:408 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:416
msgid "" msgid ""
"Commands that are know to run long and hence should suppress " "Commands that are know to run long and hence should suppress "
"communication timeouts from being triggered." "communication timeouts from being triggered."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:409 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:417
msgid "Long running commands" msgid "Long running commands"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:412 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:420
msgid "" msgid ""
"Use this to specify the commands known to take a long time to complete " "Use this to specify the commands known to take a long time to complete "
"without output from your printer and hence might cause timeout issues. " "without output from your printer and hence might cause timeout issues. "
"Just the G or M code, comma separated." "Just the G or M code, comma separated."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:415 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:423
msgid "" msgid ""
"Commands that always require a line number and checksum to be sent with " "Commands that always require a line number and checksum to be sent with "
"them." "them."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:416 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:424
msgid "Commands that always require a checksum" msgid "Commands that always require a checksum"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:419 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:427
msgid "" msgid ""
"Use this to specify which commands <strong>always</strong> need to be " "Use this to specify which commands <strong>always</strong> need to be "
"sent with a checksum. Comma separated list." "sent with a checksum. Comma separated list."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:422 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:430
msgid "ok buffer size" msgid "ok buffer size"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:423 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:431
msgid "<code>ok</code> buffer size" msgid "<code>ok</code> buffer size"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:426 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:434
msgid "Only modify if told to do so" msgid "Only modify if told to do so"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:435 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:443
msgid "Error handling" msgid "Error handling"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:437 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:445
msgid "What to do on a firmware error (<code>Error:</code> or <code>!!</code>)" msgid "What to do on a firmware error (<code>Error:</code> or <code>!!</code>)"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:440 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:448
msgid "Disconnect from the printer" msgid "Disconnect from the printer"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:443 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:451
msgid "Cancel any ongoing prints but stay connected to the printer" msgid "Cancel any ongoing prints but stay connected to the printer"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:444 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:452
msgid "" msgid ""
"Please note that if you choose this, OctoPrint will still disconnect from" "Please note that if you choose this, OctoPrint will still disconnect from"
" the printer in case of <em>fatal</em> errors reported by your firmware " " the printer in case of <em>fatal</em> errors reported by your firmware "
"(e.g. <code>kill() called</code>, <code>fatal:</code>)." "(e.g. <code>kill() called</code>, <code>fatal:</code>)."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:448 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:456
msgid "" msgid ""
"Only choose this if your firmware sends error messages that are not " "Only choose this if your firmware sends error messages that are not "
"actual errors. Might mask printer issues (even fatal errors!), be " "actual errors. Might mask printer issues (even fatal errors!), be "
"careful!" "careful!"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:454 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:462
msgid "Send <code>M112</code> on disconnect due to error" msgid "Send <code>M112</code> on disconnect due to error"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:455 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:463
msgid "" msgid ""
"If this is checked, OctoPrint will try to send an <code>M112</code> prior" "If this is checked, OctoPrint will try to send an <code>M112</code> prior"
" to a disconnect due to a (fatal) error in order to disable heaters and " " to a disconnect due to a (fatal) error in order to disable heaters and "
"motors." "motors."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:463 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:471
msgid "Log position on pause" msgid "Log position on pause"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:464 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:472
msgid "" msgid ""
"If you disable this, the <code>pause_position</code> placeholders in your" "If you disable this, the <code>pause_position</code> placeholders in your"
" pause/resume GCODE scripts will stay unpopulated! However, pausing speed" " pause/resume GCODE scripts will stay unpopulated! However, pausing speed"
" might improve slightly." " might improve slightly."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:472 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:480
msgid "Log position on cancel" msgid "Log position on cancel"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:473 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:481
msgid "" msgid ""
"If you disable this, the <code>cancel_position</code> placeholders in " "If you disable this, the <code>cancel_position</code> placeholders in "
"your cancel GCODE script and the corresponding data in the print recovery" "your cancel GCODE script and the corresponding data in the print recovery"
@@ -5871,25 +5879,25 @@ msgid ""
"slightly." "slightly."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:478 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:486
msgid "Attempt to abort any blocking heatups on cancel via <code>M108</code>." msgid "Attempt to abort any blocking heatups on cancel via <code>M108</code>."
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:479 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:487
msgid "" msgid ""
"Uncheck this if your firmware doesn't support <code>M108</code> for " "Uncheck this if your firmware doesn't support <code>M108</code> for "
"aborting blocking heatups!" "aborting blocking heatups!"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:484 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:492
msgid "Sanity Checking" msgid "Sanity Checking"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:487 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:495
msgid "Sanity check tool commands" msgid "Sanity check tool commands"
msgstr "" msgstr ""
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:488 #: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:496
msgid "" msgid ""
"If enabled, OctoPrint will not send tool commands to your printer that " "If enabled, OctoPrint will not send tool commands to your printer that "
"exceed the number of extruders configured in the active printer profile, " "exceed the number of extruders configured in the active printer profile, "