Always include timelapse view model in bundled js files

Even if the webcam URLs and the FFMPEG path is not yet configured. Otherwise
setting those URLs and the path will require a restart of OctoPrint to enable properly -
that's overkill.
This commit is contained in:
Gina Häußge 2015-08-21 10:30:03 +02:00
parent 6691cc00a5
commit 1425b20bd6
2 changed files with 2 additions and 5 deletions

View file

@ -808,13 +808,11 @@ class Server():
assets.updater = UpdaterType
enable_gcodeviewer = settings().getBoolean(["gcodeViewer", "enabled"])
enable_timelapse = (settings().get(["webcam", "snapshot"]) and settings().get(["webcam", "ffmpeg"]))
preferred_stylesheet = settings().get(["devel", "stylesheet"])
minify = settings().getBoolean(["devel", "webassets", "minify"])
dynamic_assets = util.flask.collect_plugin_assets(
enable_gcodeviewer=enable_gcodeviewer,
enable_timelapse=enable_timelapse,
preferred_stylesheet=preferred_stylesheet
)

View file

@ -600,7 +600,7 @@ class SettingsCheckUpdater(webassets.updater.BaseUpdater):
##~~ plugin assets collector
def collect_plugin_assets(enable_gcodeviewer=True, enable_timelapse=True, preferred_stylesheet="css"):
def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
logger = logging.getLogger(__name__ + ".collect_plugin_assets")
supported_stylesheets = ("css", "less")
@ -622,6 +622,7 @@ def collect_plugin_assets(enable_gcodeviewer=True, enable_timelapse=True, prefer
'js/app/viewmodels/slicing.js',
'js/app/viewmodels/temperature.js',
'js/app/viewmodels/terminal.js',
'js/app/viewmodels/timelapse.js',
'js/app/viewmodels/users.js',
'js/app/viewmodels/log.js',
'js/app/viewmodels/usersettings.js',
@ -634,8 +635,6 @@ def collect_plugin_assets(enable_gcodeviewer=True, enable_timelapse=True, prefer
'gcodeviewer/js/gCodeReader.js',
'gcodeviewer/js/renderer.js'
]
if enable_timelapse:
assets["js"].append('js/app/viewmodels/timelapse.js')
if preferred_stylesheet == "less":
assets["less"].append('less/octoprint.less')