diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 057d9d623..6e9a6b433 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,52 +90,52 @@ jobs: run: | pip install dist/OctoPrint-*.tar.gz - test-e2e: - name: ๐งช E2E tests - needs: build - runs-on: ubuntu-16.04 - steps: - - name: โฌ Checkout code - uses: actions/checkout@v2 - - - name: โฌ Download build result - uses: actions/download-artifact@v1 - with: - name: dist - path: dist - - name: ๐ Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: ๐ Install wheel - run: | - pip install dist/OctoPrint-*-py2.py3-none-any.whl - - - name: ๐ Create base config for test server - run: | - mkdir e2econfig - cp -r .github/fixtures/with_acl/* e2econfig - - - name: ๐ Run Cypress - uses: cypress-io/github-action@v2 - with: - working-directory: tests/cypress - browser: chrome - start: 'octoprint -b ${{ github.workspace }}/e2econfig serve --host 127.0.0.1 --port 5000' - wait-on: 'http://127.0.0.1:5000/online.txt' - - - name: โฌ Upload screenshots - uses: actions/upload-artifact@v1 - if: failure() - with: - name: cypress-screenshots - path: tests/cypress/screenshots - - name: โฌ Upload videos - uses: actions/upload-artifact@v1 - if: always() - with: - name: cypress-videos - path: tests/cypress/videos + #test-e2e: + # name: ๐งช E2E tests + # needs: build + # runs-on: ubuntu-16.04 + # steps: + # - name: โฌ Checkout code + # uses: actions/checkout@v2 + # + # - name: โฌ Download build result + # uses: actions/download-artifact@v1 + # with: + # name: dist + # path: dist + # - name: ๐ Set up Python 3.7 + # uses: actions/setup-python@v1 + # with: + # python-version: 3.7 + # - name: ๐ Install wheel + # run: | + # pip install dist/OctoPrint-*-py2.py3-none-any.whl + # + # - name: ๐ Create base config for test server + # run: | + # mkdir e2econfig + # cp -r .github/fixtures/with_acl/* e2econfig + # + # - name: ๐ Run Cypress + # uses: cypress-io/github-action@v2 + # with: + # working-directory: tests/cypress + # browser: chrome + # start: 'octoprint -b ${{ github.workspace }}/e2econfig serve --host 127.0.0.1 --port 5000' + # wait-on: 'http://127.0.0.1:5000/online.txt' + # + # - name: โฌ Upload screenshots + # uses: actions/upload-artifact@v1 + # if: failure() + # with: + # name: cypress-screenshots + # path: tests/cypress/screenshots + # - name: โฌ Upload videos + # uses: actions/upload-artifact@v1 + # if: always() + # with: + # name: cypress-videos + # path: tests/cypress/videos publish-on-testpypi: name: ๐ฆ Publish on TestPyPI @@ -143,7 +143,7 @@ jobs: needs: - test-unit - test-install - - test-e2e + #- test-e2e runs-on: ubuntu-latest steps: - name: โฌ Download build result diff --git a/docs/configuration/config_yaml.rst b/docs/configuration/config_yaml.rst index f96751326..9b2fc337c 100644 --- a/docs/configuration/config_yaml.rst +++ b/docs/configuration/config_yaml.rst @@ -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. 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. 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) clean_on_startup: true diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index b31f11597..2f667995d 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -1605,7 +1605,11 @@ class Server(object): filters.append("rjsmin") 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): """Produces JsPluginBundle instances that output IIFE wrapped assets""" @@ -1645,7 +1649,7 @@ class Server(object): js_app_bundle = Bundle(js_plugins_bundle, js_core_bundle, output="webassets/packed_app.js", - filters=",".join(js_filters)) + filters=",".join(js_plugin_filters)) js_client_core_bundle = Bundle(*clientjs_core, output="webassets/packed_client_core.js", @@ -1660,7 +1664,7 @@ class Server(object): js_client_bundle = Bundle(js_client_core_bundle, js_client_plugins_bundle, output="webassets/packed_client.js", - filters=",".join(js_filters)) + filters=",".join(js_plugin_filters)) # -- CSS ------------------------------------------------------------------------------------------------------- diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py index 9967022ae..791cbde28 100644 --- a/src/octoprint/server/api/settings.py +++ b/src/octoprint/server/api/settings.py @@ -145,7 +145,8 @@ def getSettings(): "baudrateOptions": connectionOptions["baudrates"], "autoconnect": s.getBoolean(["serial", "autoconnect"]), "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"]), "timeoutCommunicationBusy": s.getFloat(["serial", "timeout", "communicationBusy"]), "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 "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 "timeoutDetection" in data["serial"]: s.setFloat(["serial", "timeout", "detection"], data["serial"]["timeoutDetection"], min=1.0) - if "timeoutCommunication" in data["serial"]: s.setFloat(["serial", "timeout", "communication"], data["serial"]["timeoutCommunication"], min=1.0) + if "timeoutDetectionFirst" in data["serial"]: s.setFloat(["serial", "timeout", "detectionFirst"], data["serial"]["timeoutDetectionFirst"], 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 "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) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index de9e7d63e..485cf1738 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -98,7 +98,8 @@ default_settings = { "autoconnect": False, "log": False, "timeout": { - "detection": 1, + "detectionFirst": 10, + "detectionConsecutive": 2, "connection": 10, "communication": 30, "communicationBusy": 3, @@ -414,7 +415,8 @@ default_settings = { "webassets": { "bundle": True, "clean_on_startup": True, - "minify": True + "minify": True, + "minify_plugins": False }, "useFrozenDictForPrinterState": True, "showLoadingAnimation": True, diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js index e04568caa..57520e5bf 100644 --- a/src/octoprint/static/js/app/viewmodels/settings.js +++ b/src/octoprint/static/js/app/viewmodels/settings.js @@ -158,7 +158,8 @@ $(function() { self.serial_baudrateOptions = ko.observableArray([]); self.serial_autoconnect = 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_timeoutCommunicationBusy = ko.observable(undefined); self.serial_timeoutTemperature = ko.observable(undefined); diff --git a/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 b/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 index 93be8ae92..f9c86634d 100644 --- a/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 +++ b/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 @@ -173,14 +173,25 @@ -