Merge branch 'maintenance' of github.com:foosel/OctoPrint into maintenance
This commit is contained in:
commit
204d212323
87 files changed
+2901
-1969
No files matched your search
@@ -17,6 +17,7 @@ from .destinations import FileDestinations
|
||||
from .analysis import QueueEntry, AnalysisQueue
|
||||
from .storage import LocalFileStorage
|
||||
from .util import AbstractFileWrapper, StreamWrapper, DiskFileWrapper
|
||||
from octoprint.util import get_fully_qualified_classname as fqcn
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -429,7 +430,8 @@ class FileManager(object):
|
||||
self._last_slicing_progress = progress_int
|
||||
for callback in self._slicing_progress_callbacks:
|
||||
try: callback.sendSlicingProgress(slicer, source_location, source_path, dest_location, dest_path, progress_int)
|
||||
except: self._logger.exception("Exception while pushing slicing progress")
|
||||
except: self._logger.exception("Exception while pushing slicing progress",
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
if progress_int:
|
||||
def call_plugins(slicer, source_location, source_path, dest_location, dest_path, progress):
|
||||
|
||||
@@ -19,6 +19,7 @@ import time
|
||||
from octoprint.events import Events, eventManager
|
||||
from octoprint.settings import settings
|
||||
from octoprint.util import monotonic_time
|
||||
from octoprint.util import get_fully_qualified_classname as fqcn
|
||||
|
||||
|
||||
class QueueEntry(collections.namedtuple("QueueEntry", "name, path, type, location, absolute_path, printer_profile, analysis")):
|
||||
@@ -109,7 +110,11 @@ class AnalysisQueue(object):
|
||||
|
||||
def _analysis_finished(self, entry, result):
|
||||
for callback in self._callbacks:
|
||||
callback(entry, result)
|
||||
try:
|
||||
callback(entry, result)
|
||||
except:
|
||||
self._logger.exception(u"Error while pushing analysis data to callback {}".format(callback),
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
eventManager().fire(Events.METADATA_ANALYSIS_FINISHED, {"name": entry.name,
|
||||
"path": entry.path,
|
||||
"origin": entry.location,
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
<a id="navbar_show_prompt" class="pull-right" style="display: none" href="javascript:void(0)" data-bind="click: function() { showPrompt(); }, visible: active() && !visible()" title="{{ _('Message from your printer') }}">
|
||||
<a id="navbar_show_prompt" class="pull-right" style="display: none" href="javascript:void(0)" data-bind="click: function() { showPrompt(); }, visible: active() && !visible()" title="{{ _('Message from your printer')|edq }}">
|
||||
<i class="fa fa-commenting-o"></i>
|
||||
</a>
|
||||
@@ -1,3 +1,3 @@
|
||||
<a id="navbar_show_announcements" class="pull-right" href="javascript:void(0)" data-bind="click: function() { showAnnouncementDialog(); }" title="{{ _('Announcements') }}">
|
||||
<a id="navbar_show_announcements" class="pull-right" href="javascript:void(0)" data-bind="click: function() { showAnnouncementDialog(); }" title="{{ _('Announcements')|edq }}">
|
||||
<i class="fa" data-bind="css: {'fa-bell-o': !unread(), 'fa-bell': unread()}"></i>
|
||||
</a>
|
||||
@@ -43,6 +43,12 @@ class PendingDecision(object):
|
||||
user_id=self.user_id,
|
||||
user_token=self.user_token)
|
||||
|
||||
def __repr__(self):
|
||||
return u"PendingDecision({!r}, {!r}, {!r}, {!r}, timeout_callback=...)".format(self.app_id,
|
||||
self.app_token,
|
||||
self.user_id,
|
||||
self.user_token)
|
||||
|
||||
|
||||
class ReadyDecision(object):
|
||||
def __init__(self, app_id, app_token, user_id):
|
||||
@@ -54,6 +60,11 @@ class ReadyDecision(object):
|
||||
def for_pending(cls, pending, user_id):
|
||||
return cls(pending.app_id, pending.app_token, user_id)
|
||||
|
||||
def __repr__(self):
|
||||
return u"ReadyDecision({!r}, {!r}, {!r})".format(self.app_id,
|
||||
self.app_token,
|
||||
self.user_id)
|
||||
|
||||
|
||||
class ActiveKey(object):
|
||||
def __init__(self, app_id, api_key, user_id):
|
||||
@@ -74,6 +85,11 @@ class ActiveKey(object):
|
||||
def for_internal(cls, internal, user_id):
|
||||
return cls(internal["app_id"], internal["api_key"], user_id)
|
||||
|
||||
def __repr__(self):
|
||||
return u"ActiveKey({!r}, {!r}, {!r})".format(self.app_id,
|
||||
self.api_key,
|
||||
self.user_id)
|
||||
|
||||
|
||||
class AppKeysPlugin(octoprint.plugin.AssetPlugin,
|
||||
octoprint.plugin.BlueprintPlugin,
|
||||
@@ -121,12 +137,15 @@ class AppKeysPlugin(octoprint.plugin.AssetPlugin,
|
||||
@no_firstrun_access
|
||||
def handle_request(self):
|
||||
data = flask.request.json
|
||||
if data is None:
|
||||
return flask.make_response("Missing key request", 400)
|
||||
|
||||
if not "app" in data:
|
||||
return flask.make_response("No app name provided", 400)
|
||||
|
||||
app_name = data["app"]
|
||||
user_id = None
|
||||
if "user" in data:
|
||||
if "user" in data and data["user"]:
|
||||
user_id = data["user"]
|
||||
|
||||
app_token, user_token = self._add_pending_decision(app_name, user_id=user_id)
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
<tr>
|
||||
<td class="settings_plugin_appkeys_checkbox"><input type="checkbox" data-bind="value: api_key, checked: $root.markedForDeletion"></td>
|
||||
<td class="settings_plugin_appkeys_user"><span data-bind="text: user_id"></span></td>
|
||||
<td class="settings_plugin_appkeys_app"><span data-bind="text: app_id"></span><br /><small class="muted">{{ _('API Key') }}: <span data-bind="text: api_key"></span> <a href="javascript:void(0)" title="{{ _('Copy API Key to clipboard') }}" data-bind="click: function() { copyToClipboard(api_key) }"><i class="fa fa-copy"></i></a></small></td>
|
||||
<td class="settings_plugin_appkeys_actions"><a href="javascript:void(0)" title="{{ _('Revoke') }}" class="fa fa-trash-o" data-bind="click: function() { $parent.revokeKey($data.api_key, $data.user_id) }"></a></td>
|
||||
<td class="settings_plugin_appkeys_app"><span data-bind="text: app_id"></span><br /><small class="muted">{{ _('API Key') }}: <span data-bind="text: api_key"></span> <a href="javascript:void(0)" title="{{ _('Copy API Key to clipboard')|edq }}" data-bind="click: function() { copyToClipboard(api_key) }"><i class="fa fa-copy"></i></a></small></td>
|
||||
<td class="settings_plugin_appkeys_actions"><a href="javascript:void(0)" title="{{ _('Revoke')|edq }}" class="fa fa-trash-o" data-bind="click: function() { $parent.revokeKey($data.api_key, $data.user_id) }"></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
</thead>
|
||||
<tbody data-bind="foreach: keys.paginatedItems">
|
||||
<tr>
|
||||
<td class="settings_plugin_appkeys_app"><span data-bind="text: app_id"></span><br /><small class="muted">{{ _('API Key') }}: <span data-bind="text: api_key"></span> <a href="javascript:void(0)" title="{{ _('Copy API Key to clipboard') }}" data-bind="click: function() { copyToClipboard(api_key) }"><i class="fa fa-copy"></i></a></small></td>
|
||||
<td class="settings_plugin_appkeys_actions"><a href="javascript:void(0)" title="{{ _('Revoke') }}" class="fa fa-trash-o" data-bind="click: function() { $parent.revokeKey($data.api_key) }"></a></td>
|
||||
<td class="settings_plugin_appkeys_app"><span data-bind="text: app_id"></span><br /><small class="muted">{{ _('API Key') }}: <span data-bind="text: api_key"></span> <a href="javascript:void(0)" title="{{ _('Copy API Key to clipboard')|edq }}" data-bind="click: function() { copyToClipboard(api_key) }"><i class="fa fa-copy"></i></a></small></td>
|
||||
<td class="settings_plugin_appkeys_actions"><a href="javascript:void(0)" title="{{ _('Revoke')|edq }}" class="fa fa-trash-o" data-bind="click: function() { $parent.revokeKey($data.api_key) }"></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<td class="settings_plugin_backup_name" data-bind="text: name"></td>
|
||||
<td class="settings_plugin_backup_date" data-bind="text: formatDate(date)"></td>
|
||||
<td class="settings_plugin_backup_size" data-bind="text: formatSize(size)"></td>
|
||||
<td class="settings_plugin_backup_actions"><a href="javascript:void(0)" title="{{ _('Delete') }}" class="fa fa-trash-o" data-bind="click: function() { $parent.removeBackup($data.name) }, css: {disabled: $root.backupInProgress() || $root.restoreInProgress()"></a> | <a href="javascript:void(0)" title="{{ _('Download') }}" class="fa fa-download" data-bind="attr: {href: url}"></a><span data-bind="visible: $parent.restoreSupported()"> | <a href="javascript:void(0)" title="{{ _('Restore') }}" data-bind="click: function() { $parent.restoreBackup($data.name) }, css: {disabled: $root.backupInProgress() || $root.restoreInProgress()"><i class="fa fa-refresh"></i></a></span></td>
|
||||
<td class="settings_plugin_backup_actions"><a href="javascript:void(0)" title="{{ _('Delete')|edq }}" class="fa fa-trash-o" data-bind="click: function() { $parent.removeBackup($data.name) }, css: {disabled: $root.backupInProgress() || $root.restoreInProgress()"></a> | <a href="javascript:void(0)" title="{{ _('Download')|edq }}" class="fa fa-download" data-bind="attr: {href: url}"></a><span data-bind="visible: $parent.restoreSupported()"> | <a href="javascript:void(0)" title="{{ _('Restore')|edq }}" data-bind="click: function() { $parent.restoreBackup($data.name) }, css: {disabled: $root.backupInProgress() || $root.restoreInProgress()"><i class="fa fa-refresh"></i></a></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -7,13 +7,14 @@ __copyright__ = "Copyright (C) 2019 The OctoPrint Project - Released under terms
|
||||
import octoprint.plugin
|
||||
import logging
|
||||
|
||||
from octoprint.util import get_fully_qualified_classname as fqcn
|
||||
from octoprint.util.version import get_octoprint_version_string, is_released_octoprint_version
|
||||
|
||||
from flask import jsonify
|
||||
from flask_babel import gettext
|
||||
|
||||
SENTRY_URL_SERVER = "https://4069187705ab4e76921eb19db2e9ccbb@sentry.io/1373987"
|
||||
SENTRY_URL_COREUI = "https://a4ab48f27daf4c129392b78be15412b8@sentry.io/1374096"
|
||||
SENTRY_URL_SERVER = "https://2eecd116552e4d498caa75d2e67edc5a@sentry.io/1373987"
|
||||
SENTRY_URL_COREUI = "https://f5e6d16d17d64d588b5d8221eb9eeb39@sentry.io/1374096"
|
||||
|
||||
SETTINGS_DEFAULTS = dict(enabled=False,
|
||||
enabled_unreleased=False,
|
||||
@@ -29,19 +30,24 @@ import tornado.websocket
|
||||
|
||||
IGNORED_EXCEPTIONS = [
|
||||
# serial exceptions in octoprint.util.comm
|
||||
(serial.SerialException, lambda exc, logger, plugin: logger == "octoprint.util.comm"),
|
||||
(serial.SerialException, lambda exc, logger, plugin, cb: logger == "octoprint.util.comm"),
|
||||
|
||||
# isp errors during port auto detection in octoprint.util.comm
|
||||
(octoprint.util.avr_isp.ispBase.IspError, lambda exc, logger, plugin: logger == "octoprint.util.comm"),
|
||||
(octoprint.util.avr_isp.ispBase.IspError, lambda exc, logger, plugin, cb: logger == "octoprint.util.comm"),
|
||||
|
||||
# IOErrors of any kind due to a full file system
|
||||
(IOError, lambda exc, logger, plugin: getattr(exc, "errno") and exc.errno in (getattr(errno, "ENOSPC"),)),
|
||||
(IOError, lambda exc, logger, plugin, cb: getattr(exc, "errno") and exc.errno in (getattr(errno, "ENOSPC"),)),
|
||||
|
||||
# RequestExceptions of any kind
|
||||
requests.exceptions.RequestException,
|
||||
|
||||
# Tornado WebSocketErrors of any kind
|
||||
tornado.websocket.WebSocketError
|
||||
tornado.websocket.WebSocketError,
|
||||
|
||||
# Anything triggered by or in third party plugin Astroprint
|
||||
(Exception, lambda exc, logger, plugin, cb: logger.startswith("octoprint.plugins.astroprint")
|
||||
or plugin == "astroprint"
|
||||
or cb.startswith("octoprint_astroprint."))
|
||||
]
|
||||
|
||||
try:
|
||||
@@ -138,6 +144,7 @@ def _enable_errortracking():
|
||||
handled = True
|
||||
logger = event.get("logger", "")
|
||||
plugin = event.get("extra", dict()).get("plugin", None)
|
||||
callback = event.get("extra", dict()).get("callback", None)
|
||||
|
||||
for ignore in IGNORED_EXCEPTIONS:
|
||||
if isinstance(ignore, tuple):
|
||||
@@ -147,8 +154,8 @@ def _enable_errortracking():
|
||||
matcher = lambda *args: True
|
||||
|
||||
exc = hint["exc_info"][1]
|
||||
if isinstance(exc, ignored_exc) and matcher(exc, logger, plugin):
|
||||
# exception ignored for logger
|
||||
if isinstance(exc, ignored_exc) and matcher(exc, logger, plugin, callback):
|
||||
# exception ignored for logger, plugin and/or callback
|
||||
return None
|
||||
|
||||
elif isinstance(ignore, type):
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" title="{{ _('Random unique instance ID') }}">{{ _('Instance ID') }}</label>
|
||||
<label class="control-label" title="{{ _('Random unique instance ID')|edq }}">{{ _('Instance ID') }}</label>
|
||||
<div class="controls">
|
||||
<span style="padding-top: 5px; margin-bottom: 5px; display: inline-block" data-bind="text: settings.plugins.errortracking.unique_id() || 'N/A'"></span>
|
||||
</div>
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<div id="login-error" class="alert alert-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>
|
||||
|
||||
<input type="text" id="login-user" class="input-block-level" placeholder="{{ _('Username') }}" autofocus>
|
||||
<input type="password" id="login-password" class="input-block-level" placeholder="{{ _('Password') }}">
|
||||
<input type="text" id="login-user" class="input-block-level" placeholder="{{ _('Username')|edq }}" autofocus>
|
||||
<input type="password" 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>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" id="login-remember"> {{ _('Remember me') }}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="span1">
|
||||
<a title="{{ _('Remove') }}" class="btn btn-danger" data-bind="click: $parent.removeLogger"><i class="icon-trash"></i></a>
|
||||
<a title="{{ _('Remove')|edq }}" class="btn btn-danger" data-bind="click: $parent.removeLogger"><i class="icon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -103,7 +103,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="span1">
|
||||
<a title="{{ _('Add') }}" class="btn btn-primary" data-bind="click: $root.addLogger"><i class="icon-plus"></i></a>
|
||||
<a title="{{ _('Add')|edq }}" class="btn btn-primary" data-bind="click: $root.addLogger"><i class="icon-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<a href="https://faq.octoprint.org/pi-issues" target="_blank" rel="noopener noreferrer" data-bind="visible: currentIssue() || pastIssue(), popover: { placement: 'bottom', title: '{{ _('What do the symbols mean?') }}', html: true, content: popoverContent, trigger: 'hover' }" style="display: none">
|
||||
<span data-bind="visible: currentUndervoltage() || pastUndervoltage(), css: {'pi_support_state_pulsate': currentUndervoltage}" title="{{ _('Undervoltage') }}"><i class="fa fa-bolt"></i><i class="fa fa-exclamation"></i></span>
|
||||
<span data-bind="visible: currentOverheat() || pastOverheat(), css: {'pi_support_state_pulsate': currentOverheat}" title="{{ _('Overheat') }}"><i class="fa fa-thermometer-full"></i><i class="fa fa-exclamation"></i></span>
|
||||
<a href="https://faq.octoprint.org/pi-issues" target="_blank" rel="noopener noreferrer" data-bind="visible: currentIssue() || pastIssue(), popover: { placement: 'bottom', title: '{{ _('What do the symbols mean?')|esq }}', html: true, content: popoverContent, trigger: 'hover' }" style="display: none">
|
||||
<span data-bind="visible: currentUndervoltage() || pastUndervoltage(), css: {'pi_support_state_pulsate': currentUndervoltage}" title="{{ _('Undervoltage')|edq }}"><i class="fa fa-bolt"></i><i class="fa fa-exclamation"></i></span>
|
||||
<span data-bind="visible: currentOverheat() || pastOverheat(), css: {'pi_support_state_pulsate': currentOverheat}" title="{{ _('Overheat')|edq }}"><i class="fa fa-thermometer-full"></i><i class="fa fa-exclamation"></i></span>
|
||||
</a>
|
||||
@@ -40,7 +40,7 @@
|
||||
{{ pluginmanager_throttled() }}
|
||||
|
||||
<div class="pull-right">
|
||||
<button class="btn btn-small" data-bind="click: function() { $root.showPluginSettings(); }" title="{{ _('Plugin Configuration') }}"><i class="fa fa-wrench"></i></button>
|
||||
<button class="btn btn-small" data-bind="click: function() { $root.showPluginSettings(); }" title="{{ _('Plugin Configuration')|edq }}"><i class="fa fa-wrench"></i></button>
|
||||
</div>
|
||||
|
||||
<h3>{{ _('Installed Plugins') }}</h3>
|
||||
@@ -56,7 +56,7 @@
|
||||
<tbody data-bind="foreach: plugins.paginatedItems">
|
||||
<tr>
|
||||
<td class="settings_plugin_plugin_manager_plugins_name">
|
||||
<div data-bind="css: {muted: !enabled}"><span data-bind="text: name"></span> <span data-bind="visible: version">(<span data-bind="text: version"></span>)</span> <i title="{{ _('Bundled with OctoPrint') }}" class="fa fa-th-large" data-bind="visible: bundled"></i> <i class="fa fa-lock" title="{{ _('Cannot be uninstalled through OctoPrint') }}" data-bind="visible: !managable"></i> <i title="{{ _('Restart of OctoPrint needed for changes to take effect') }}" class="fa fa-refresh" data-bind="visible: pending_enable || pending_disable || pending_install || pending_uninstall"></i> <i title="{{ _('Pending install') }}" class="fa fa-plus" data-bind="visible: pending_install"></i> <i title="{{ _('Pending uninstall') }}" class="fa fa-minus" data-bind="visible: pending_uninstall"></i> <i title="{{ _('Disabled due to safe mode') }}" class="fa fa-medkit" data-bind="visible: safe_mode_victim"></i> <i class="fa fa-exclamation-triangle" title="{{ _('There are notices available regarding this plugin') }}" data-bind="visible: notifications && notifications.length"></i> <i class="fa fa-ban" title="{{ _('This plugin is blacklisted') }}" data-bind="visible: blacklisted"></i></div>
|
||||
<div data-bind="css: {muted: !enabled}"><span data-bind="text: name"></span> <span data-bind="visible: version">(<span data-bind="text: version"></span>)</span> <i title="{{ _('Bundled with OctoPrint')|edq }}" class="fa fa-th-large" data-bind="visible: bundled"></i> <i class="fa fa-lock" title="{{ _('Cannot be uninstalled through OctoPrint')|edq }}" data-bind="visible: !managable"></i> <i title="{{ _('Restart of OctoPrint needed for changes to take effect')|edq }}" class="fa fa-refresh" data-bind="visible: pending_enable || pending_disable || pending_install || pending_uninstall"></i> <i title="{{ _('Pending install')|edq }}" class="fa fa-plus" data-bind="visible: pending_install"></i> <i title="{{ _('Pending uninstall')|edq }}" class="fa fa-minus" data-bind="visible: pending_uninstall"></i> <i title="{{ _('Disabled due to safe mode')|edq }}" class="fa fa-medkit" data-bind="visible: safe_mode_victim"></i> <i class="fa fa-exclamation-triangle" title="{{ _('There are notices available regarding this plugin')|edq }}" data-bind="visible: notifications && notifications.length"></i> <i class="fa fa-ban" title="{{ _('This plugin is blacklisted')|edq }}" data-bind="visible: blacklisted"></i></div>
|
||||
<div data-bind="visible: notifications && notifications.length"><a href="javascript:void(0)" class="text-error" style="text-decoration: underline" data-bind="click: function() { $root.showPluginNotifications($data) }, text: $root.showPluginNotificationsLinkText($data)"></a></div>
|
||||
<div><small class="muted" data-bind="text: description"> </small></div>
|
||||
<div data-bind="css: {muted: !enabled}">
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="settings_plugin_plugin_manager_plugins_actions">
|
||||
<a href="#" data-bind="css: $root.toggleButtonCss($data), attr: {title: $root.toggleButtonTitle($data)}, enable: $root.enableToggle($data), click: function() { $root.togglePlugin($data) }"></a> | <a href="#" class="fa fa-trash-o" title="{{ _('Uninstall Plugin') }}" data-bind="css: {disabled: !$root.enableUninstall($data)}, enable: $root.enableUninstall($data), click: function() { $root.uninstallPlugin($data) }"></a>
|
||||
<a href="#" data-bind="css: $root.toggleButtonCss($data), attr: {title: $root.toggleButtonTitle($data)}, enable: $root.enableToggle($data), click: function() { $root.togglePlugin($data) }"></a> | <a href="#" class="fa fa-trash-o" title="{{ _('Uninstall Plugin')|edq }}" data-bind="css: {disabled: !$root.enableUninstall($data)}, enable: $root.enableUninstall($data), click: function() { $root.uninstallPlugin($data) }"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -151,7 +151,7 @@
|
||||
</h4>
|
||||
|
||||
<form class="form-search" data-bind="submit: performRepositorySearch">
|
||||
<input type="text" class="input-block search-query" data-bind="value: repositorySearchQuery, valueUpdate: 'input'" placeholder="{{ _('Search...') }}">
|
||||
<input type="text" class="input-block search-query" data-bind="value: repositorySearchQuery, valueUpdate: 'input'" placeholder="{{ _('Search...')|edq }}">
|
||||
</form>
|
||||
|
||||
<div data-bind="visible: repositoryAvailable()">
|
||||
@@ -193,7 +193,7 @@
|
||||
<form class="form-inline">
|
||||
<div class="control-group row-fluid" data-bind="css: {error: invalidUrl}">
|
||||
<div class="span9">
|
||||
<input type="text" class="input-block-level" data-bind="value: installUrl, valueUpdate: 'input'" placeholder="{{ _('Enter URL...') }}" >
|
||||
<input type="text" class="input-block-level" data-bind="value: installUrl, valueUpdate: 'input'" placeholder="{{ _('Enter URL...')|edq }}" >
|
||||
</div>
|
||||
<button class="btn btn-primary span3" data-bind="enable: enableUrlInstall, css: {disabled: !enableUrlInstall()}, click: function() { if (enableUrlInstall()) { $root.installPlugin(); } }">{{ _('Install') }}</button>
|
||||
</div>
|
||||
@@ -246,14 +246,14 @@
|
||||
<fieldset>
|
||||
<legend>{{ _('Confirmations') }}</legend>
|
||||
|
||||
<div class="control-group" title="{{ _('Confirm before uninstalling a plugin') }}">
|
||||
<div class="control-group" title="{{ _('Confirm before uninstalling a plugin')|edq }}">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: config_confirmUninstall"> {{ _('Confirm before uninstalling a plugin') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Confirm before disabling a plugin') }}">
|
||||
<div class="control-group" title="{{ _('Confirm before disabling a plugin')|edq }}">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: config_confirmDisable"> {{ _('Confirm before disabling a plugin') }}
|
||||
@@ -267,13 +267,13 @@
|
||||
<fieldset>
|
||||
<legend>{{ _('Plugin repository configuration') }}</legend>
|
||||
|
||||
<div class="control-group" title="{{ _('URL of the Plugin Repository to use. You should normally not have to change this.') }}">
|
||||
<div class="control-group" title="{{ _('URL of the Plugin Repository to use. You should normally not have to change this.')|edq }}">
|
||||
<label class="control-label">{{ _('Repository URL') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: config_repositoryUrl">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('How long to cache repository data, in minutes. You should normally not have to change this.') }}">
|
||||
<div class="control-group" title="{{ _('How long to cache repository data, in minutes. You should normally not have to change this.')|edq }}">
|
||||
<label class="control-label">{{ _('Repository cache TTL') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -287,13 +287,13 @@
|
||||
<fieldset>
|
||||
<legend>{{ _('Notices configuration') }}</legend>
|
||||
|
||||
<div class="control-group" title="{{ _('URL of the Notices source to use. You should normally not have to change this.') }}">
|
||||
<div class="control-group" title="{{ _('URL of the Notices source to use. You should normally not have to change this.')|edq }}">
|
||||
<label class="control-label">{{ _('Notices URL') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: config_noticesUrl">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('How long to cache notices, in minutes. You should normally not have to change this.') }}">
|
||||
<div class="control-group" title="{{ _('How long to cache notices, in minutes. You should normally not have to change this.')|edq }}">
|
||||
<label class="control-label">{{ _('Notices cache TTL') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -307,7 +307,7 @@
|
||||
<fieldset>
|
||||
<legend>{{ _('pip configuration') }}</legend>
|
||||
|
||||
<div class="control-group" title="{{ _('Additional arguments for the pip command. You should normally not have to change this.') }}">
|
||||
<div class="control-group" title="{{ _('Additional arguments for the pip command. You should normally not have to change this.')|edq }}">
|
||||
<label class="control-label">{{ _('Additional arguments') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: config_pipAdditionalArgs">
|
||||
|
||||
@@ -32,9 +32,10 @@ from octoprint.util.pip import LocalPipCaller
|
||||
import octoprint.settings
|
||||
|
||||
|
||||
# OctoPi 0.15+
|
||||
MINIMUM_PYTHON = "2.7.9"
|
||||
MINIMUM_SETUPTOOLS = "5.5.1"
|
||||
MINIMUM_PIP = "9.0.1"
|
||||
MINIMUM_SETUPTOOLS = "39.0.1"
|
||||
MINIMUM_PIP = "9.0.3"
|
||||
|
||||
|
||||
##~~ Plugin
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
{% endtrans %}</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<button class="btn btn-small" data-bind="click: function() { $root.showPluginSettings(); }" title="{{ _('Plugin Configuration') }}"><i class="fa fa-wrench"></i></button>
|
||||
<button class="btn btn-small" data-bind="click: function() { $root.showPluginSettings(); }" title="{{ _('Plugin Configuration')|edq }}"><i class="fa fa-wrench"></i></button>
|
||||
</div>
|
||||
|
||||
<h3>{{ _('Current versions') }}</h3>
|
||||
@@ -64,7 +64,7 @@
|
||||
<tbody data-bind="foreach: versions.paginatedItems">
|
||||
<tr data-bind="attr: {title: displayName}">
|
||||
<td class="settings_plugin_softwareupdate_column_update">
|
||||
<span data-bind="invisible: !updateAvailable"><i class="fa fa-bell-o" title="{{ _('Update available') }}"></i></span>
|
||||
<span data-bind="invisible: !updateAvailable"><i class="fa fa-bell-o" title="{{ _('Update available')|edq }}"></i></span>
|
||||
</td>
|
||||
<td class="settings_plugin_softwareupdate_column_information">
|
||||
<a href="javascript:void(0)" data-bind="click: function() { $root.update(false, [$data]) }, visible: $root.enableUpdate() && updateAvailable && updatePossible" class="btn btn-primary pull-right">{{ _('Update') }}</a>
|
||||
|
||||
@@ -179,7 +179,7 @@ class TrackingPlugin(octoprint.plugin.SettingsPlugin,
|
||||
if ping_interval:
|
||||
self._ping_worker = RepeatedTimer(ping_interval, self._track_ping, run_first=True)
|
||||
self._ping_worker.start()
|
||||
|
||||
|
||||
if self._pong_worker is None:
|
||||
pong_interval = self._settings.get(["pong"])
|
||||
if pong_interval:
|
||||
@@ -208,7 +208,9 @@ class TrackingPlugin(octoprint.plugin.SettingsPlugin,
|
||||
|
||||
plugins = self._plugin_manager.enabled_plugins
|
||||
plugins_thirdparty = [plugin for plugin in plugins.values() if not plugin.bundled]
|
||||
payload = dict(plugins=",".join(map(lambda x: "{}:{}".format(x.key.lower(), x.version.lower()), plugins_thirdparty)))
|
||||
payload = dict(plugins=",".join(map(lambda x: "{}:{}".format(x.key.lower(),
|
||||
x.version.lower() if x.version else "?"),
|
||||
plugins_thirdparty)))
|
||||
|
||||
self._track("pong", body=True, **payload)
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" title="{{ _('Random unique instance ID') }}">{{ _('Instance ID') }}</label>
|
||||
<label class="control-label" title="{{ _('Random unique instance ID')|edq }}">{{ _('Instance ID') }}</label>
|
||||
<div class="controls">
|
||||
<span style="padding-top: 5px; margin-bottom: 5px; display: inline-block" data-bind="text: settings.plugins.tracking.unique_id() || 'N/A'"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" title="{{ _('Events to track. The ping is mandatory.') }}">{{ _('Tracked events') }}</label>
|
||||
<label class="control-label" title="{{ _('Events to track. The ping is mandatory.')|edq }}">{{ _('Tracked events') }}</label>
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" checked="checked" disabled="disabled"> {{ _('Regular ping every 15min (incl. uptime)') }}
|
||||
|
||||
@@ -319,14 +319,21 @@ class PrinterProfileManager(object):
|
||||
except InvalidProfileError:
|
||||
return None
|
||||
|
||||
def remove(self, identifier):
|
||||
def remove(self, identifier, trigger_event=False):
|
||||
if self._current is not None and self._current["id"] == identifier:
|
||||
return False
|
||||
elif settings().get(["printerProfiles", "default"]) == identifier:
|
||||
return False
|
||||
return self._remove_from_path(self._get_profile_path(identifier))
|
||||
|
||||
def save(self, profile, allow_overwrite=False, make_default=False):
|
||||
removed = self._remove_from_path(self._get_profile_path(identifier))
|
||||
if removed and trigger_event:
|
||||
from octoprint.events import eventManager, Events
|
||||
payload = dict(identifier=identifier)
|
||||
eventManager().fire(Events.PRINTER_PROFILE_DELETED, payload=payload)
|
||||
|
||||
return removed
|
||||
|
||||
def save(self, profile, allow_overwrite=False, make_default=False, trigger_event=False):
|
||||
if "id" in profile:
|
||||
identifier = profile["id"]
|
||||
elif "name" in profile:
|
||||
@@ -341,7 +348,10 @@ class PrinterProfileManager(object):
|
||||
profile = dict_sanitize(profile, self.__class__.default)
|
||||
profile = dict_merge(self.__class__.default, profile)
|
||||
|
||||
self._save_to_path(self._get_profile_path(identifier), profile, allow_overwrite=allow_overwrite)
|
||||
path = self._get_profile_path(identifier)
|
||||
is_overwrite = os.path.exists(path)
|
||||
|
||||
self._save_to_path(path, profile, allow_overwrite=allow_overwrite)
|
||||
|
||||
if make_default:
|
||||
settings().set(["printerProfiles", "default"], identifier)
|
||||
@@ -349,6 +359,13 @@ class PrinterProfileManager(object):
|
||||
|
||||
if self._current is not None and self._current["id"] == identifier:
|
||||
self.select(identifier)
|
||||
|
||||
from octoprint.events import eventManager, Events
|
||||
if trigger_event:
|
||||
payload = dict(identifier=identifier)
|
||||
event = Events.PRINTER_PROFILE_MODIFIED if is_overwrite else Events.PRINTER_PROFILE_ADDED
|
||||
eventManager().fire(event, payload=payload)
|
||||
|
||||
return self.get(identifier)
|
||||
|
||||
def is_default_unmodified(self):
|
||||
|
||||
@@ -30,6 +30,7 @@ from octoprint.util import comm as comm
|
||||
from octoprint.util import InvariantContainer
|
||||
from octoprint.util import to_unicode
|
||||
from octoprint.util import monotonic_time
|
||||
from octoprint.util import get_fully_qualified_classname as fqcn
|
||||
|
||||
|
||||
class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
@@ -174,28 +175,32 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
try:
|
||||
callback.on_printer_add_temperature(data)
|
||||
except:
|
||||
self._logger.exception(u"Exception while adding temperature data point to callback {}".format(callback))
|
||||
self._logger.exception(u"Exception while adding temperature data point to callback {}".format(callback),
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
def _sendAddLogCallbacks(self, data):
|
||||
for callback in self._callbacks:
|
||||
try:
|
||||
callback.on_printer_add_log(data)
|
||||
except:
|
||||
self._logger.exception(u"Exception while adding communication log entry to callback {}".format(callback))
|
||||
self._logger.exception(u"Exception while adding communication log entry to callback {}".format(callback),
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
def _sendAddMessageCallbacks(self, data):
|
||||
for callback in self._callbacks:
|
||||
try:
|
||||
callback.on_printer_add_message(data)
|
||||
except:
|
||||
self._logger.exception(u"Exception while adding printer message to callback {}".format(callback))
|
||||
self._logger.exception(u"Exception while adding printer message to callback {}".format(callback),
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
def _sendCurrentDataCallbacks(self, data):
|
||||
for callback in self._callbacks:
|
||||
try:
|
||||
callback.on_printer_send_current_data(copy.deepcopy(data))
|
||||
except:
|
||||
self._logger.exception(u"Exception while pushing current data to callback {}".format(callback))
|
||||
self._logger.exception(u"Exception while pushing current data to callback {}".format(callback),
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
#~~ callback from metadata analysis event
|
||||
|
||||
@@ -1020,7 +1025,8 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
})
|
||||
callback.on_printer_send_initial_data(data)
|
||||
except:
|
||||
self._logger.exception("Error while trying to send initial state update")
|
||||
self._logger.exception(u"Error while pushing initial state update to callback {}".format(callback),
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
def _getStateFlags(self):
|
||||
return self._dict(operational=self.is_operational(),
|
||||
|
||||
@@ -261,7 +261,11 @@ class Server(object):
|
||||
# monkey patch a bunch of stuff
|
||||
util.tornado.fix_json_encode()
|
||||
util.flask.fix_flask_jsonify()
|
||||
util.flask.enable_additional_translations(additional_folders=[self._settings.getBaseFolder("translations")])
|
||||
|
||||
additional_translation_folders = []
|
||||
if not safe_mode:
|
||||
additional_translation_folders += [self._settings.getBaseFolder("translations")]
|
||||
util.flask.enable_additional_translations(additional_folders=additional_translation_folders)
|
||||
|
||||
# setup app
|
||||
self._setup_app(app)
|
||||
@@ -1024,10 +1028,20 @@ class Server(object):
|
||||
return u"<{tag}>{content}</a>".format(tag=tag, content=content)
|
||||
return html_link_regex.sub(repl, text)
|
||||
|
||||
single_quote_regex = re.compile("(?<!\\\\)'")
|
||||
def escape_single_quote(text):
|
||||
return single_quote_regex.sub("\\'", text)
|
||||
|
||||
double_quote_regex = re.compile('(?<!\\\\)"')
|
||||
def escape_double_quote(text):
|
||||
return double_quote_regex.sub('\\"', text)
|
||||
|
||||
app.jinja_env.filters["regex_replace"] = regex_replace
|
||||
app.jinja_env.filters["offset_html_headers"] = offset_html_headers
|
||||
app.jinja_env.filters["offset_markdown_headers"] = offset_markdown_headers
|
||||
app.jinja_env.filters["externalize_links"] = externalize_links
|
||||
app.jinja_env.filters["escape_single_quote"] = app.jinja_env.filters["esq"] = escape_single_quote
|
||||
app.jinja_env.filters["escape_double_quote"] = app.jinja_env.filters["edq"] = escape_double_quote
|
||||
|
||||
# configure additional template folders for jinja2
|
||||
import jinja2
|
||||
|
||||
@@ -85,7 +85,8 @@ def printerProfilesAdd():
|
||||
return make_response("Profile does not contain mandatory 'name' field", 400)
|
||||
|
||||
try:
|
||||
saved_profile = printerProfileManager.save(profile, allow_overwrite=False, make_default=make_default)
|
||||
saved_profile = printerProfileManager.save(profile, allow_overwrite=False, make_default=make_default,
|
||||
trigger_event=True)
|
||||
except InvalidProfileError:
|
||||
return make_response("Profile is invalid", 400)
|
||||
except CouldNotOverwriteError:
|
||||
@@ -114,7 +115,7 @@ def printerProfilesDelete(identifier):
|
||||
if default_profile and default_profile["id"] == identifier:
|
||||
return make_response("Cannot delete default profile: {}".format(identifier), 409)
|
||||
|
||||
printerProfileManager.remove(identifier)
|
||||
printerProfileManager.remove(identifier, trigger_event=True)
|
||||
return NO_CONTENT
|
||||
|
||||
@api.route("/printerprofiles/<string:identifier>", methods=["PATCH"])
|
||||
@@ -146,7 +147,8 @@ def printerProfilesUpdate(identifier):
|
||||
merged_profile["id"] = identifier
|
||||
|
||||
try:
|
||||
saved_profile = printerProfileManager.save(merged_profile, allow_overwrite=True, make_default=make_default)
|
||||
saved_profile = printerProfileManager.save(merged_profile, allow_overwrite=True, make_default=make_default,
|
||||
trigger_event=True)
|
||||
except InvalidProfileError:
|
||||
return make_response("Profile is invalid", 400)
|
||||
except CouldNotOverwriteError:
|
||||
|
||||
@@ -124,6 +124,7 @@ def getSettings():
|
||||
"keyboardControl": s.getBoolean(["feature", "keyboardControl"]),
|
||||
"pollWatched": s.getBoolean(["feature", "pollWatched"]),
|
||||
"modelSizeDetection": s.getBoolean(["feature", "modelSizeDetection"]),
|
||||
"printStartConfirmation": s.getBoolean(["feature", "printStartConfirmation"]),
|
||||
"printCancelConfirmation": s.getBoolean(["feature", "printCancelConfirmation"]),
|
||||
"g90InfluencesExtruder": s.getBoolean(["feature", "g90InfluencesExtruder"]),
|
||||
"autoUppercaseBlacklist": s.get(["feature", "autoUppercaseBlacklist"])
|
||||
@@ -417,6 +418,7 @@ def _saveSettings(data):
|
||||
if "keyboardControl" in data["feature"]: s.setBoolean(["feature", "keyboardControl"], data["feature"]["keyboardControl"])
|
||||
if "pollWatched" in data["feature"]: s.setBoolean(["feature", "pollWatched"], data["feature"]["pollWatched"])
|
||||
if "modelSizeDetection" in data["feature"]: s.setBoolean(["feature", "modelSizeDetection"], data["feature"]["modelSizeDetection"])
|
||||
if "printStartConfirmation" in data["feature"]: s.setBoolean(["feature", "printStartConfirmation"], data["feature"]["printStartConfirmation"])
|
||||
if "printCancelConfirmation" in data["feature"]: s.setBoolean(["feature", "printCancelConfirmation"], data["feature"]["printCancelConfirmation"])
|
||||
if "g90InfluencesExtruder" in data["feature"]: s.setBoolean(["feature", "g90InfluencesExtruder"], data["feature"]["g90InfluencesExtruder"])
|
||||
if "autoUppercaseBlacklist" in data["feature"] and isinstance(data["feature"]["autoUppercaseBlacklist"], (list, tuple)): s.set(["feature", "autoUppercaseBlacklist"], data["feature"]["autoUppercaseBlacklist"])
|
||||
|
||||
@@ -257,6 +257,7 @@ default_settings = {
|
||||
"keyboardControl": True,
|
||||
"pollWatched": False,
|
||||
"modelSizeDetection": True,
|
||||
"printStartConfirmation": False,
|
||||
"printCancelConfirmation": True,
|
||||
"autoUppercaseBlacklist": ["M117", "M118"],
|
||||
"g90InfluencesExtruder": False
|
||||
|
||||
@@ -73,13 +73,13 @@ GCODE.gCodeReader = (function(){
|
||||
return tmpModel;
|
||||
};
|
||||
|
||||
var prepareLinesIndex = function(){
|
||||
var prepareLinesIndex = function(m){
|
||||
percentageTree = undefined;
|
||||
|
||||
for (var l = 0; l < model.length; l++) {
|
||||
if (model[l] === undefined) continue;
|
||||
for (var i = 0; i < model[l].length; i++) {
|
||||
var percentage = model[l][i].percentage;
|
||||
for (var l = 0; l < m.length; l++) {
|
||||
if (m[l] === undefined) continue;
|
||||
for (var i = 0; i < m[l].length; i++) {
|
||||
var percentage = m[l][i].percentage;
|
||||
var value = {layer: l, cmd: i};
|
||||
if (!percentageTree) {
|
||||
percentageTree = new AVLTree({key: percentage, value: value}, "key");
|
||||
@@ -178,11 +178,12 @@ GCODE.gCodeReader = (function(){
|
||||
},
|
||||
|
||||
passDataToRenderer: function(){
|
||||
var m = model;
|
||||
var m = _.cloneDeep(model);
|
||||
if (gCodeOptions["sortLayers"]) m = sortLayers(m);
|
||||
if (gCodeOptions["purgeEmptyLayers"]) m = purgeLayers(m);
|
||||
prepareLinesIndex();
|
||||
prepareLinesIndex(m);
|
||||
GCODE.renderer.doRender(m, 0);
|
||||
return m;
|
||||
},
|
||||
|
||||
processLayerFromWorker: function(msg){
|
||||
|
||||
@@ -59,7 +59,7 @@ GCODE.ui = (function(){
|
||||
setProgress("done", 100);
|
||||
|
||||
GCODE.gCodeReader.processAnalyzeModelDone(data.msg);
|
||||
GCODE.gCodeReader.passDataToRenderer();
|
||||
var activeModel = GCODE.gCodeReader.passDataToRenderer();
|
||||
|
||||
if (uiOptions["onModelLoaded"]) {
|
||||
uiOptions.onModelLoaded({
|
||||
@@ -70,7 +70,8 @@ GCODE.ui = (function(){
|
||||
printTime: data.msg.printTime,
|
||||
layerHeight: data.msg.layerHeight,
|
||||
layersPrinted: data.msg.layerCnt,
|
||||
layersTotal: data.msg.layerTotal
|
||||
layersTotal: data.msg.layerTotal,
|
||||
layersActive: activeModel.length
|
||||
});
|
||||
}
|
||||
switchLayer(0);
|
||||
|
||||
@@ -153,7 +153,7 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) {
|
||||
if (self._safeModePopup) self._safeModePopup.remove();
|
||||
if (data["safe_mode"]) {
|
||||
// safe mode is active, let's inform the user
|
||||
log.info("Safe mode is active. Third party plugins are disabled and cannot be enabled.");
|
||||
log.info("Safe mode is active. Third party plugins and language packs are disabled and cannot be enabled.");
|
||||
log.info("Reason for safe mode: " + data["safe_mode"]);
|
||||
|
||||
var reason = gettext("Unknown");
|
||||
@@ -174,7 +174,7 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) {
|
||||
|
||||
self._safeModePopup = new PNotify({
|
||||
title: gettext("Safe mode is active"),
|
||||
text: _.sprintf(gettext("<p>The server is currently running in safe mode. Third party plugins are disabled and cannot be enabled.</p><p>Reason: %(reason)s</p>"), {reason: reason}),
|
||||
text: _.sprintf(gettext("<p>The server is currently running in safe mode. Third party plugins and language packs are disabled and cannot be enabled.</p><p>Reason: %(reason)s</p>"), {reason: reason}),
|
||||
hide: false
|
||||
});
|
||||
}
|
||||
|
||||
@@ -203,9 +203,8 @@ $(function() {
|
||||
});
|
||||
}
|
||||
|
||||
var js;
|
||||
if (control.hasOwnProperty("javascript")) {
|
||||
js = control.javascript;
|
||||
var js = control.javascript;
|
||||
|
||||
// if js is a function everything's fine already, but if it's a string we need to eval that first
|
||||
if (!_.isFunction(js)) {
|
||||
@@ -216,12 +215,12 @@ $(function() {
|
||||
}
|
||||
|
||||
if (control.hasOwnProperty("enabled")) {
|
||||
js = control.enabled;
|
||||
var enabled = control.enabled;
|
||||
|
||||
// if js is a function everything's fine already, but if it's a string we need to eval that first
|
||||
if (!_.isFunction(js)) {
|
||||
if (!_.isFunction(enabled)) {
|
||||
control.enabled = function (data) {
|
||||
return eval(js);
|
||||
return eval(enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,7 +460,20 @@ $(function() {
|
||||
var withinPrintDimensions = self.evaluatePrintDimensions(data, true);
|
||||
var print = printAfterLoad && withinPrintDimensions;
|
||||
|
||||
OctoPrint.files.select(data.origin, data.path, print);
|
||||
if (print && self.settingsViewModel.feature_printStartConfirmation()) {
|
||||
showConfirmationDialog({
|
||||
message: gettext("This will start a new print job. Please check that the print bed is clear."),
|
||||
question: gettext("Do you want to start the print job now?"),
|
||||
cancel: gettext("No"),
|
||||
proceed: gettext("Yes"),
|
||||
onproceed: function() {
|
||||
OctoPrint.files.select(data.origin, data.path, print);
|
||||
},
|
||||
nofade: true
|
||||
});
|
||||
} else {
|
||||
OctoPrint.files.select(data.origin, data.path, print);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -531,7 +531,7 @@ $(function() {
|
||||
|
||||
self.ui_modelInfo(output.join("<br>"));
|
||||
|
||||
self.maxLayer = model.layersPrinted - 1;
|
||||
self.maxLayer = model.layersActive - 1;
|
||||
if (self.layerSlider !== undefined) {
|
||||
self.layerSlider.slider("enable");
|
||||
self.layerSlider.slider("setMax", self.maxLayer);
|
||||
|
||||
@@ -326,7 +326,21 @@ $(function() {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
OctoPrint.job.start();
|
||||
if (!self.settings.feature_printStartConfirmation()) {
|
||||
OctoPrint.job.start();
|
||||
} else {
|
||||
showConfirmationDialog({
|
||||
message: gettext("This will start a new print job. Please check that the print bed is clear."),
|
||||
question: gettext("Do you want to start the print job now?"),
|
||||
cancel: gettext("No"),
|
||||
proceed: gettext("Yes"),
|
||||
onproceed: function() {
|
||||
OctoPrint.job.start();
|
||||
},
|
||||
nofade: true
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ $(function() {
|
||||
self.feature_keyboardControl = ko.observable(undefined);
|
||||
self.feature_pollWatched = ko.observable(undefined);
|
||||
self.feature_modelSizeDetection = ko.observable(undefined);
|
||||
self.feature_printStartConfirmation = ko.observable(undefined);
|
||||
self.feature_printCancelConfirmation = ko.observable(undefined);
|
||||
self.feature_g90InfluencesExtruder = ko.observable(undefined);
|
||||
self.feature_autoUppercaseBlacklist = ko.observable(undefined);
|
||||
|
||||
@@ -38,25 +38,28 @@ $(function() {
|
||||
self.changePasswordDialog = undefined;
|
||||
|
||||
self.currentUser.subscribe(function(newValue) {
|
||||
if (newValue === undefined) {
|
||||
self.editorUsername(undefined);
|
||||
self.editorAdmin(undefined);
|
||||
self.editorActive(undefined);
|
||||
self.editorApikey(undefined);
|
||||
} else {
|
||||
self.resetEditUser();
|
||||
if (newValue !== undefined) {
|
||||
self.editorUsername(newValue.name);
|
||||
self.editorAdmin(newValue.admin);
|
||||
self.editorActive(newValue.active);
|
||||
self.editorApikey(newValue.apikey);
|
||||
}
|
||||
self.editorPassword(undefined);
|
||||
self.editorRepeatedPassword(undefined);
|
||||
});
|
||||
|
||||
self.editorPasswordMismatch = ko.pureComputed(function() {
|
||||
return self.editorPassword() !== self.editorRepeatedPassword();
|
||||
});
|
||||
|
||||
self.resetEditUser = function() {
|
||||
self.editorUsername(undefined);
|
||||
self.editorAdmin(undefined);
|
||||
self.editorActive(undefined);
|
||||
self.editorApikey(undefined);
|
||||
self.editorPassword(undefined);
|
||||
self.editorRepeatedPassword(undefined);
|
||||
};
|
||||
|
||||
self.requestData = function() {
|
||||
if (!CONFIG_ACCESS_CONTROL) return;
|
||||
if (!self.loginState.isAdmin()) return;
|
||||
@@ -178,8 +181,19 @@ $(function() {
|
||||
|
||||
self.onStartup = function() {
|
||||
self.addUserDialog = $("#settings-usersDialogAddUser");
|
||||
self.addUserDialog.on("hidden", function() {
|
||||
self.resetEditUser();
|
||||
});
|
||||
|
||||
self.editUserDialog = $("#settings-usersDialogEditUser");
|
||||
self.editUserDialog.on("hidden", function() {
|
||||
self.resetEditUser();
|
||||
});
|
||||
|
||||
self.changePasswordDialog = $("#settings-usersDialogChangePassword");
|
||||
self.changePasswordDialog.on("hidden", function() {
|
||||
self.resetEditUser();
|
||||
});
|
||||
};
|
||||
|
||||
//~~ API calls
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
</thead>
|
||||
<tbody data-bind="foreach: users.listHelper.paginatedItems">
|
||||
<tr>
|
||||
<td class="settings_users_name"><span data-bind="text: name"></span><span class="muted" data-bind="visible: apikey"><br /><small>{{ _('API Key') }}: <span data-bind="text: apikey"></span> <a href="javascript:void(0)" title="{{ _('Copy API Key to clipboard') }}" data-bind="click: function() { copyToClipboard(apikey) }"><i class="fa fa-copy"></i></a></small></span></td>
|
||||
<td class="settings_users_name"><span data-bind="text: name"></span><span class="muted" data-bind="visible: apikey"><br /><small>{{ _('API Key') }}: <span data-bind="text: apikey"></span> <a href="javascript:void(0)" title="{{ _('Copy API Key to clipboard')|edq }}" data-bind="click: function() { copyToClipboard(apikey) }"><i class="fa fa-copy"></i></a></small></span></td>
|
||||
<td class="settings_users_active"><i class="fa" data-bind="css: { 'fa-check-square-o': active, 'fa-square-o': !active }"></i></td>
|
||||
<td class="settings_users_admin"><i class="fa" data-bind="css: { 'fa-check-square-o': admin, 'fa-square-o': !admin }"></i></td>
|
||||
<td class="settings_users_actions">
|
||||
<a href="#" class="fa fa-pencil" title="{{ _('Update User') }}" data-bind="click: function() { $root.users.showEditUserDialog($data); }"></a> | <a href="#" class="fa fa-key" title="{{ _('Change password') }}" data-bind="click: function() { $root.users.showChangePasswordDialog($data); }"></a> | <a href="#" class="fa fa-trash-o" title="{{ _('Delete user') }}" data-bind="click: function() { $root.users.removeUser($data); }"></a>
|
||||
<a href="#" class="fa fa-pencil" title="{{ _('Update User')|edq }}" data-bind="click: function() { $root.users.showEditUserDialog($data); }"></a> | <a href="#" class="fa fa-key" title="{{ _('Change password')|edq }}" data-bind="click: function() { $root.users.showChangePasswordDialog($data); }"></a> | <a href="#" class="fa fa-trash-o" title="{{ _('Delete user')|edq }}" data-bind="click: function() { $root.users.removeUser($data); }"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -137,7 +137,7 @@
|
||||
<label class="control-label">{{ _('Current API Key') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append input-block-level">
|
||||
<input type="text" readonly="readonly" data-bind="value: $root.users.editorApikey, valueUpdate: 'input', attr: {placeholder: '{{ _('N/A') }}'}">
|
||||
<input type="text" readonly="readonly" data-bind="value: $root.users.editorApikey, valueUpdate: 'input', attr: {placeholder: '{{ _('N/A')|esq }}'}">
|
||||
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: $root.users.copyApikey, css: {'disabled': !$root.users.editorApikey()}"><i class="fa fa-copy"></i></a>
|
||||
<a class="btn add-on" title="Generate new API Key" data-bind="click: function() { $root.users.confirmGenerateApikey(); }"><i class="fa fa-refresh"></i></a>
|
||||
<a class="btn add-on btn-danger" title="Delete API Key" data-bind="click: function() { $root.users.confirmDeleteApikey(); }, css: {'disabled': !$root.users.editorApikey()}"><i class="fa fa-trash-o"></i></a>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<label class="control-label" for="settings-apikey">{{ _('API Key') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append input-block-level">
|
||||
<input type="text" readonly="readonly" id="settings-apikey" data-bind="value: api_key, attr: {placeholder: '{{ _('N/A') }}'}">
|
||||
<input type="text" readonly="readonly" id="settings-apikey" data-bind="value: api_key, attr: {placeholder: '{{ _('N/A')|esq }}'}">
|
||||
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApiKey, css: {'disabled': !api_key()}"><i class="fa fa-copy"></i></a>
|
||||
<a class="btn add-on" title="Generate new API Key" data-bind="click: generateApiKey"><i class="fa fa-refresh"></i></a>
|
||||
</div>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<form class="form-horizontal">
|
||||
<div class="control-group" title="{{ _('Name of this OctoPrint instance, will be shown in the navigation bar and broadcast on the network') }}">
|
||||
<div class="control-group" title="{{ _('Name of this OctoPrint instance, will be shown in the navigation bar and broadcast on the network')|edq }}">
|
||||
<label class="control-label" for="settings-appearanceName">{{ _('Title') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: appearance_name" id="settings-appearanceName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Personalize the color of the navigation bar - maybe to match your printer?') }}">
|
||||
<div class="control-group" title="{{ _('Personalize the color of the navigation bar - maybe to match your printer?')|edq }}">
|
||||
<label class="control-label" for="settings-appearanceColor">{{ _('Color') }}</label>
|
||||
<div class="controls">
|
||||
<select id="settings-appearanceColor" data-bind="value: appearance_color, options: appearance_available_colors, optionsText: 'name', optionsValue: 'key'">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('For acrylic printers ;)') }}">
|
||||
<div class="control-group" title="{{ _('For acrylic printers ;)')|edq }}">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: appearance_colorTransparent"> {{ _('Transparent color') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Also personalize the icon of the browser tab') }}">
|
||||
<div class="control-group" title="{{ _('Also personalize the icon of the browser tab')|edq }}">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: appearance_colorIcon"> {{ _('Colorize favicon (in supported browsers)') }}
|
||||
|
||||
@@ -13,6 +13,13 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: feature_printStartConfirmation" id="settings-printStartConfirmation"> {{ _('Confirm before starting a print') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
@@ -42,7 +49,7 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Commands to not completely auto uppercase in the terminal tab') }}">
|
||||
<div class="control-group" title="{{ _('Commands to not completely auto uppercase in the terminal tab')|edq }}">
|
||||
<label class="control-label" for="settings-featureAutoUppercaseBlacklist">{{ _('Terminal Auto Uppercase Blacklist') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" id="settings-featureAutoUppercaseBlacklist" data-bind="value: feature_autoUppercaseBlacklist">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Maximum size the GCodeViewer autoloads the file for preview') }}">
|
||||
<div class="control-group" title="{{ _('Maximum size the GCodeViewer autoloads the file for preview')|edq }}">
|
||||
<label class="control-label" for="settings-featureSizeThreshold">{{ _('GCode Visualizer file size threshold') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
<div id="settings_serial_general" class="tab-pane active">
|
||||
<fieldset id="settings_serial_general_connection">
|
||||
<legend>{{ _('Connection') }}</legend>
|
||||
<div class="control-group" title="{{ _('Serial port to connect to, setting this to AUTO will make OctoPrint try to automatically find the right setting') }}">
|
||||
<div class="control-group" title="{{ _('Serial port to connect to, setting this to AUTO will make OctoPrint try to automatically find the right setting')|edq }}">
|
||||
<label class="control-label" for="settings-serialPort">{{ _('Serial Port') }}</label>
|
||||
<div class="controls">
|
||||
<select id="settings-serialPort" data-bind="options: serial_portOptions, optionsCaption: 'AUTO', value: serial_port"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Serial baud rate to connect with, setting this to AUTO will make OctoPrint try to automatically find the right setting') }}">
|
||||
<div class="control-group" title="{{ _('Serial baud rate to connect with, setting this to AUTO will make OctoPrint try to automatically find the right setting')|edq }}">
|
||||
<label class="control-label" for="settings-baudrate">{{ _('Baudrate') }}</label>
|
||||
<div class="controls">
|
||||
<select id="settings-baudrate" data-bind="options: serial_baudrateOptions, optionsCaption: 'AUTO', value: serial_baudrate"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Makes OctoPrint try to connect to the printer automatically during start up') }}">
|
||||
<div class="control-group" title="{{ _('Makes OctoPrint try to connect to the printer automatically during start up')|edq }}">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: serial_autoconnect" id="settings-serialAutoconnect"> {{ _('Auto-connect to printer on server start') }}
|
||||
@@ -83,7 +83,7 @@
|
||||
<div id="settings_serial_timeouts" class="tab-pane">
|
||||
<fieldset id="settings_serial_timeouts_intervals">
|
||||
<legend>{{ _('Query intervals') }}</legend>
|
||||
<div class="control-group" title="{{ _('Interval in which to poll for the temperature information from the printer') }}">
|
||||
<div class="control-group" title="{{ _('Interval in which to poll for the temperature information from the printer')|edq }}">
|
||||
<label class="control-label" for="settings-serialTimeoutTemperature">{{ _('Temperature interval (polling)') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -110,7 +110,7 @@
|
||||
<span class="help-inline">{{ _('Autoreport interval to request from firmware')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Interval in which to poll for the SD printing status information from the printer while printing') }}">
|
||||
<div class="control-group" title="{{ _('Interval in which to poll for the SD printing status information from the printer while printing')|edq }}">
|
||||
<label class="control-label" for="settings-serialTimeoutSdStatus">{{ _('SD status interval (polling)') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -120,7 +120,7 @@
|
||||
<span class="help-inline">{{ _('When printing from the printer\'s SD')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('SD status interval to request from autoreport capable firmwares. A value of 0 disables autoreporting by the firmware and forces polling.') }}">
|
||||
<div class="control-group" title="{{ _('SD status interval to request from autoreport capable firmwares. A value of 0 disables autoreporting by the firmware and forces polling.')|edq }}">
|
||||
<label class="control-label" for="settings-serialTimeoutSdStatusAutoreport">{{ _('SD status interval (autoreport)') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -133,7 +133,7 @@
|
||||
</fieldset>
|
||||
<fieldset id="settings_serial_timeouts_timeouts">
|
||||
<legend>{{ _('Timeouts') }}</legend>
|
||||
<div class="control-group" title="{{ _('Time after which the communication with your printer will be considered timed out if nothing was sent by your printer (and an attempt to get it talking again will be done). Increase this if your printer takes longer than this for some moves.') }}">
|
||||
<div class="control-group" title="{{ _('Time after which the communication with your printer will be considered timed out if nothing was sent by your printer (and an attempt to get it talking again will be done). Increase this if your printer takes longer than this for some moves.')|edq }}">
|
||||
<label class="control-label" for="settings-serialTimeoutCommunication">{{ _('Communication timeout') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -150,7 +150,7 @@
|
||||
<span class="help-inline">{{ _('<code>busy</code> protocol support detected')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Time after which a connection attempt to the printer will be considered as having failed') }}">
|
||||
<div class="control-group" title="{{ _('Time after which a connection attempt to the printer will be considered as having failed')|edq }}">
|
||||
<label class="control-label" for="settings-serialTimeoutConnection">{{ _('Connection timeout') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -159,7 +159,7 @@
|
||||
</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') }}">
|
||||
<div class="control-group" title="{{ _('Time after which to consider an auto detection attempt to have failed if no successful connection is detected')|edq }}">
|
||||
<label class="control-label" for="settings-serialTimeoutDetection">{{ _('Autodetection timeout') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -168,7 +168,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Time after which to consider a position query on pause or cancel to have failed') }}">
|
||||
<div class="control-group" title="{{ _('Time after which to consider a position query on pause or cancel to have failed')|edq }}">
|
||||
<label class="control-label" for="settings-serialTimeoutPositionLogWait">{{ _('Position query timeout') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -180,7 +180,7 @@
|
||||
<div>
|
||||
<div><small><a href="#" class="muted" data-bind="toggleContent: { class: 'fa-caret-right fa-caret-down', container: '#settings_serial_timeouts_timeouts .hide' }"><i class="fa fa-caret-right"></i> {{ _('Advanced options') }}</a></small></div>
|
||||
<div class="hide">
|
||||
<div class="control-group" title="{{ _('Time to wait after opening the serial connection before starting baudrate detection') }}">
|
||||
<div class="control-group" title="{{ _('Time to wait after opening the serial connection before starting baudrate detection')|edq }}">
|
||||
<label class="control-label" for="settings-serialTimeoutBaudrateDetectionPause">{{ _('Initial baudrate detection pause') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
@@ -190,21 +190,21 @@
|
||||
<span class="help-block">{{ _('Some controllers need a bit of a breather before baudrate detection after initial connect. If baudrate detection fails due to a hanging controller, try increasing this value.') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Maximum consecutive communication timeouts while idle. More than this and the printer will be considered to be gone. Set to 0 to disable.') }}">
|
||||
<div class="control-group" title="{{ _('Maximum consecutive communication timeouts while idle. More than this and the printer will be considered to be gone. Set to 0 to disable.')|edq }}">
|
||||
<label class="control-label" for="settings-serialMaxTimeoutsIdle">{{ _('Max. consecutive timeouts while idle') }}</label>
|
||||
<div class="controls">
|
||||
<input type="number" min="0" class="input-mini text-right" id="settings-serialMaxTimeoutsIdle" data-bind="value: serial_maxTimeoutsIdle">
|
||||
<span class="help-block">{{ _('Set to 0 to disable consecutive timeout detection and handling.') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Maximum consecutive communication timeouts while printing. More than this and the printer will be considered to be gone. Set to 0 to disable.') }}">
|
||||
<div class="control-group" title="{{ _('Maximum consecutive communication timeouts while printing. More than this and the printer will be considered to be gone. Set to 0 to disable.')|edq }}">
|
||||
<label class="control-label" for="settings-serialMaxTimeoutsPrinting">{{ _('Max. consecutive timeouts while printing') }}</label>
|
||||
<div class="controls">
|
||||
<input type="number" min="0" class="input-mini text-right" id="settings-serialMaxTimeoutsPrinting" data-bind="value: serial_maxTimeoutsPrinting">
|
||||
<span class="help-block">{{ _('Set to 0 to disable consecutive timeout detection and handling.') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Maximum consecutive communication timeouts while a long running command is active. More than this and the printer will be considered to be gone. Set to 0 to disable.') }}">
|
||||
<div class="control-group" title="{{ _('Maximum consecutive communication timeouts while a long running command is active. More than this and the printer will be considered to be gone. Set to 0 to disable.')|edq }}">
|
||||
<label class="control-label" for="settings-serialMaxTimeoutsLong">{{ _('Max. consecutive timeouts during long running commands') }}</label>
|
||||
<div class="controls">
|
||||
<input type="number" min="0" class="input-mini text-right" id="settings-serialMaxTimeoutsLong" data-bind="value: serial_maxTimeoutsLong">
|
||||
@@ -377,21 +377,21 @@
|
||||
<div>
|
||||
<div><small><a href="#" class="muted" data-bind="toggleContent: { class: 'fa-caret-right fa-caret-down', container: '#settings_serial_protocol_finetuning .hide' }"><i class="fa fa-caret-right"></i> {{ _('Advanced options') }}</a></small></div>
|
||||
<div class="hide">
|
||||
<div class="control-group" title="{{ _('Command to send to the firmware on first handshake attempt.') }}">
|
||||
<div class="control-group" title="{{ _('Command to send to the firmware on first handshake attempt.')|edq }}">
|
||||
<label class="control-label" for="settings-serialHelloCommand">{{ _('"Hello" command') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" id="settings-serialHelloCommand" data-bind="value: serial_helloCommand">
|
||||
<span class="help-inline">{{ _('Use this to specify a different command than the default <code>M110</code> to send to the printer on initial connection to trigger a communication handshake.') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Commands that are know to run long and hence should suppress communication timeouts from being triggered.') }}">
|
||||
<div class="control-group" title="{{ _('Commands that are know to run long and hence should suppress communication timeouts from being triggered.')|edq }}">
|
||||
<label class="control-label" for="settings-serialLongRunningCommands">{{ _('Long running commands') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" id="settings-serialLongRunningCommands" data-bind="value: serial_longRunningCommands">
|
||||
<span class="help-inline">{{ _('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. Just the G or M code, comma separated.') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Commands that always require a line number and checksum to be sent with them.') }}">
|
||||
<div class="control-group" title="{{ _('Commands that always require a line number and checksum to be sent with them.')|edq }}">
|
||||
<label class="control-label" for="settings-checksumRequiringCommands">{{ _('Commands that always require a checksum') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" id="settings-checksumRequiringCommands" data-bind="value: serial_checksumRequiringCommands">
|
||||
|
||||
@@ -13,26 +13,26 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Slicer') }}</label>
|
||||
<div class="controls">
|
||||
<select data-bind="options: matchingSlicers, optionsText: 'name', optionsValue: 'key', optionsCaption: '{{ _('Select a slicer...') }}', value: slicer, valueAllowUnset: true"></select>
|
||||
<select data-bind="options: matchingSlicers, optionsText: 'name', optionsValue: 'key', optionsCaption: '{{ _('Select a slicer...')|esq }}', value: slicer, valueAllowUnset: true"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Runs locally') }}</label>
|
||||
<div class="controls">
|
||||
<strong data-bind="text: slicerSameDevice() ? gettext('Yes') : gettext('No')"></strong>
|
||||
<span class="help-block"><small>{{ _('For performance reasons locally run slicers are disabled while printing') }}</small></span>
|
||||
<span class="help-block"><small>{{ _('For performance reasons locally run slicers are disabled while printing')|esq }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Slicing Profile') }}</label>
|
||||
<div class="controls">
|
||||
<select data-bind="options: profiles, optionsText: 'name', optionsValue: 'key', optionsCaption: '{{ _('Select a slicing profile...') }}', value: profile, valueAllowUnset: true"></select>
|
||||
<select data-bind="options: profiles, optionsText: 'name', optionsValue: 'key', optionsCaption: '{{ _('Select a slicing profile...')|esq }}', value: profile, valueAllowUnset: true"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Printer Profile') }}</label>
|
||||
<div class="controls">
|
||||
<select data-bind="options: printerProfiles.profiles.items, optionsText: 'name', optionsValue: 'id', value: printerProfile, optionsCaption: '{{ _('Select a printer profile...') }}'"></select>
|
||||
<select data-bind="options: printerProfiles.profiles.items, optionsText: 'name', optionsValue: 'id', value: printerProfile, optionsCaption: '{{ _('Select a printer profile...')|esq }}'"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
<label class="control-label">{{ _('New Offset') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-prepend input-append">
|
||||
<button type="button" class="btn btn-input-dec" data-bind="click: $root.decrementChangeOffset" title="{{ _('-1') }}"><i class="fa fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-input-dec" data-bind="click: $root.decrementChangeOffset" title="{{ _('-1')|edq }}"><i class="fa fa-minus"></i></button>
|
||||
<input type="number" min="-50" max="50" class="input-mini input-nospin" style="width: 30px" data-bind="value: changingOffset.newOffset, event: { focus: function(d, e) {$root.handleFocus(e, 'target', changingOffset.item);}, keyup: function(d, e) {$root.handleEnter(e, 'offset', changingOffset.item);} }">
|
||||
<span class="add-on">°C</span>
|
||||
<button type="button" class="btn btn-input-inc" data-bind="click: $root.incrementChangeOffset" title="{{ _('+1') }}"><i class="fa fa-plus"></i></button>
|
||||
<button type="button" class="btn btn-input-inc" data-bind="click: $root.incrementChangeOffset" title="{{ _('+1')|edq }}"><i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<button type="button" class="btn" data-bind="click: $root.deleteChangeOffset" title="{{ _('Delete Offset') }}"><i class="fa fa-trash"></i></button>
|
||||
<button type="button" class="btn" data-bind="click: $root.deleteChangeOffset" title="{{ _('Delete Offset')|edq }}"><i class="fa fa-trash"></i></button>
|
||||
<span class="help-block">{{ _('Hint: Hitting <kbd>Enter</kbd> in the input field will also submit the form') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<label class="control-label" for="userSettings-access_apikey">{{ _('Current API Key') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append input-block-level">
|
||||
<input type="text" readonly="readonly" id="userSettings-access_apikey" data-bind="value: access_apikey, attr: {placeholder: '{{ _('N/A') }}'}">
|
||||
<input type="text" readonly="readonly" id="userSettings-access_apikey" data-bind="value: access_apikey, attr: {placeholder: '{{ _('N/A')|esq }}'}">
|
||||
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApikey, css: {'disabled': !access_apikey()}"><i class="fa fa-copy"></i></a>
|
||||
<a class="btn add-on" title="Generate new API Key" data-bind="click: generateApikey"><i class="fa fa-refresh"></i></a>
|
||||
<a class="btn btn-danger add-on" title="Delete API Key" data-bind="click: deleteApikey, css: {'disabled': !access_apikey()}"><i class="fa fa-trash-o"></i></a>
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<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">
|
||||
<label for="login_user">{{ _('Username') }}</label>
|
||||
<input type="text" id="login_user" name="username" data-bind="valueWithInit: loginState.loginUser" placeholder="{{ _('Username') }}" autocapitalize="none" autocorrect="off">
|
||||
<input type="text" id="login_user" 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>
|
||||
<label for="login_pass">{{ _('Password') }}</label>
|
||||
<input type="password" id="login_pass" name="password" data-bind="valueWithInit: loginState.loginPass" placeholder="{{ _('Password') }}">
|
||||
<input type="password" id="login_pass" name="password" data-bind="valueWithInit: loginState.loginPass" placeholder="{{ _('Password')|edq }}">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" id="login_remember" data-bind="checked: loginState.loginRemember"> {{ _('Remember me') }}
|
||||
</label>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<a id="navbar_show_settings" title="{{ _('Settings') }}" class="pull-right" href="#settings_dialog" data-bind="click: function() { $root.show(); }">
|
||||
<a id="navbar_show_settings" title="{{ _('Settings')|edq }}" class="pull-right" href="#settings_dialog" data-bind="click: function() { $root.show(); }">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
@@ -1,4 +1,4 @@
|
||||
<a href="javascript:void(0)" title="{{ _('System') }}" class="dropdown-toggle" data-toggle="dropdown" data-bind="visible: system.systemActions().length > 0">
|
||||
<a href="javascript:void(0)" title="{{ _('System')|edq }}" class="dropdown-toggle" data-toggle="dropdown" data-bind="visible: system.systemActions().length > 0">
|
||||
<i class="fa fa-power-off"></i>
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
web interface now by clicking the button below.
|
||||
{% endtrans %}</p>
|
||||
<p>
|
||||
<button class="btn btn-primary btn-large" title="{{ _('Reload now') }}" onclick="var event = arguments[0] || window.event; var source = event.target || event.srcElement; if (source.disabled) return; source.disabled = true; source.className += ' disabled'; source.firstChild.style.display = ''; location.reload(true); return false;"><i class="fa fa-spinner fa-spin" style="display: none"></i> {{ _('Reload now') }}</button>
|
||||
<button class="btn btn-primary btn-large" title="{{ _('Reload now')|edq }}" onclick="var event = arguments[0] || window.event; var source = event.target || event.srcElement; if (source.disabled) return; source.disabled = true; source.className += ' disabled'; source.firstChild.style.display = ''; location.reload(true); return false;"><i class="fa fa-spinner fa-spin" style="display: none"></i> {{ _('Reload now') }}</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="refresh-trigger accordion-heading-button btn-group" data-bind="visible: $root.refreshVisible">
|
||||
<a href="#" data-bind="click: function() { $root.requestData(); }" title="{{ _('Refresh connection options') }}">
|
||||
<a href="#" data-bind="click: function() { $root.requestData(); }" title="{{ _('Refresh connection options')|edq }}">
|
||||
<i class="fa fa-refresh"></i>
|
||||
</a>
|
||||
</div>
|
||||
@@ -1,6 +1,6 @@
|
||||
<form class="form-search" data-bind="submit: performSearch">
|
||||
<div class="search-query-with-clear" data-bind="css: {'active-clear': searchQuery}">
|
||||
<input type="search" class="input-block search-query" data-bind="value: searchQuery, valueUpdate: 'input'" placeholder="{{ _('Search...') }}">
|
||||
<input type="search" class="input-block search-query" data-bind="value: searchQuery, valueUpdate: 'input'" placeholder="{{ _('Search...')|edq }}">
|
||||
<span class="search-clear" data-bind="click: clearSearchQuery"><i class="fa fa-remove"></i></span>
|
||||
</div>
|
||||
</form>
|
||||
@@ -21,11 +21,11 @@
|
||||
<div class="size">{{ _('Size') }}: <span data-bind="text: formatSize(size)"></span></div>
|
||||
<div class="additionalInfo hide" data-bind="html: $root.getAdditionalData($data)"></div>
|
||||
<div class="btn-group action-buttons">
|
||||
<div class="btn btn-mini toggleAdditionalData" data-bind="click: function() { if ($root.enableAdditionalData($data)) { $root.toggleAdditionalData($data); } else { return; } }, css: { disabled: !$root.enableAdditionalData($data) }" title="{{ _('Additional data') }}"><i class="fa fa-chevron-down"></i></div>
|
||||
<a class="btn btn-mini" data-bind="attr: {href: $root.downloadLink($data)}, css: {disabled: !$root.downloadLink($data)}" title="{{ _('Download') }}"><i class="fa fa-download"></i></a>
|
||||
<div class="btn btn-mini" data-bind="click: function(data, event) { if ($root.enableRemove($data)) { $root.removeFile($data, event); } else { return; } }, css: {disabled: !$root.enableRemove($data)}" title="{{ _('Remove') }}"><i class="fa fa-trash-o"></i></div>
|
||||
<div class="btn btn-mini" data-bind="click: function() { if ($root.enableSelect($data)) { $root.loadFile($data, false); } else { return; } }, css: {disabled: !$root.enableSelect($data)}" title="{{ _('Load') }}"><i class="fa fa-folder-open"></i></div>
|
||||
<div class="btn btn-mini" data-bind="click: function() { if ($root.enablePrint($data)) { $root.loadFile($data, true); } else { return; } }, css: {disabled: !$root.enablePrint($data)}" title="{{ _('Load and Print') }}"><i class="fa fa-print"></i></div>
|
||||
<div class="btn btn-mini toggleAdditionalData" data-bind="click: function() { if ($root.enableAdditionalData($data)) { $root.toggleAdditionalData($data); } else { return; } }, css: { disabled: !$root.enableAdditionalData($data) }" title="{{ _('Additional data')|edq }}"><i class="fa fa-chevron-down"></i></div>
|
||||
<a class="btn btn-mini" data-bind="attr: {href: $root.downloadLink($data)}, css: {disabled: !$root.downloadLink($data)}" title="{{ _('Download')|edq }}"><i class="fa fa-download"></i></a>
|
||||
<div class="btn btn-mini" data-bind="click: function(data, event) { if ($root.enableRemove($data)) { $root.removeFile($data, event); } else { return; } }, css: {disabled: !$root.enableRemove($data)}" title="{{ _('Remove')|edq }}"><i class="fa fa-trash-o"></i></div>
|
||||
<div class="btn btn-mini" data-bind="click: function() { if ($root.enableSelect($data)) { $root.loadFile($data, false); } else { return; } }, css: {disabled: !$root.enableSelect($data)}" title="{{ _('Load')|edq }}"><i class="fa fa-folder-open"></i></div>
|
||||
<div class="btn btn-mini" data-bind="click: function() { if ($root.enablePrint($data)) { $root.loadFile($data, true); } else { return; } }, css: {disabled: !$root.enablePrint($data)}" title="{{ _('Load and Print')|edq }}"><i class="fa fa-print"></i></div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
<div class="uploaded">{{ _('Uploaded') }}: <span data-bind="text: formatTimeAgo(date), attr: {title: formatDate(date)}"></span></div>
|
||||
<div class="size">{{ _('Size') }}: <span data-bind="text: formatSize(size)"></span></div>
|
||||
<div class="btn-group action-buttons">
|
||||
<a class="btn btn-mini" data-bind="attr: {href: $root.downloadLink($data), css: {disabled: !$root.downloadLink($data)}}" title="{{ _('Download') }}"><i class="fa fa-download"></i></a>
|
||||
<div class="btn btn-mini" data-bind="click: function(data, event) { if ($root.enableRemove($data)) { $root.removeFile($data, event); } else { return; } }, css: {disabled: !$root.enableRemove($data)}" title="{{ _('Remove') }}"><i class="fa fa-trash-o"></i></div>
|
||||
<div class="btn btn-mini" data-bind="click: function() { if ($root.enableSlicing($data)) { $root.sliceFile($data); } else { return; } }, css: {disabled: !$root.enableSlicing($data)}" title="{{ _('Slice') }}"><i class="fa fa-magic"></i></div>
|
||||
<a class="btn btn-mini" data-bind="attr: {href: $root.downloadLink($data), css: {disabled: !$root.downloadLink($data)}}" title="{{ _('Download')|edq }}"><i class="fa fa-download"></i></a>
|
||||
<div class="btn btn-mini" data-bind="click: function(data, event) { if ($root.enableRemove($data)) { $root.removeFile($data, event); } else { return; } }, css: {disabled: !$root.enableRemove($data)}" title="{{ _('Remove')|edq }}"><i class="fa fa-trash-o"></i></div>
|
||||
<div class="btn btn-mini" data-bind="click: function() { if ($root.enableSlicing($data)) { $root.sliceFile($data); } else { return; } }, css: {disabled: !$root.enableSlicing($data)}" title="{{ _('Slice')|edq }}"><i class="fa fa-magic"></i></div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="settings-trigger accordion-heading-button btn-group" data-bind="visible: $root.filesListVisible">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="{{ _('File list settings') }}">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="{{ _('File list settings')|edq }}">
|
||||
<span class="fa fa-wrench"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -33,14 +33,14 @@
|
||||
</div>
|
||||
|
||||
<div class="refresh-trigger accordion-heading-button btn-group" data-bind="visible: $root.filesListVisible">
|
||||
<a href="#" data-bind="click: function() { $root.requestData({force: true}); }" title="{{ _('Refresh file list') }}">
|
||||
<a href="#" data-bind="click: function() { $root.requestData({force: true}); }" title="{{ _('Refresh file list')|edq }}">
|
||||
<i class="fa fa-refresh"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if enableSdSupport %}
|
||||
<div class="sd-trigger accordion-heading-button btn-group" data-bind="visible: $root.filesListVisible">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="{{ _('SD Card operations') }}">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="{{ _('SD Card operations')|edq }}">
|
||||
<span class="icon-sd-black-14"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<span title="{{ _('Current printer state') }}">{{ _('State') }}</span>: <strong data-bind="text: stateString"></strong><br>
|
||||
<span title="{{ _('Current printer state')|edq }}">{{ _('State') }}</span>: <strong data-bind="text: stateString"></strong><br>
|
||||
<hr>
|
||||
<span title="{{ _('Name of file currently selected for printing') }}">{{ _('File') }}</span>: <strong data-bind="text: filedisplay, attr: {title: filepath}"></strong> <strong data-bind="visible: sd">(SD)</strong><br>
|
||||
<span title="{{ _('Upload date of the file currently selected or printing') }}">{{ _('Uploaded') }}</span>: <strong data-bind="text: dateString"></strong><br>
|
||||
<span title="{{ _('Name of file currently selected for printing')|edq }}">{{ _('File') }}</span>: <strong data-bind="text: filedisplay, attr: {title: filepath}"></strong> <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>
|
||||
<!-- ko if: userString -->
|
||||
<span title="{{ _('User who selected this file for printing') }}">{{ _('User') }}</span>: <strong data-bind="text: userString"></strong><br>
|
||||
<span title="{{ _('User who selected this file for printing')|edq }}">{{ _('User') }}</span>: <strong data-bind="text: userString"></strong><br>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: settings.webcam_timelapseEnabled -->
|
||||
<span title="{{ _('Current timelapse configuration') }}">{{ _('Timelapse') }}</span>: <strong data-bind="text: timelapseString"></strong><br>
|
||||
<span title="{{ _('Current timelapse configuration')|edq }}">{{ _('Timelapse') }}</span>: <strong data-bind="text: timelapseString"></strong><br>
|
||||
<!-- /ko -->
|
||||
<!-- ko foreach: filament -->
|
||||
<span data-bind="text: 'Filament (' + name() + '): ', title: 'Filament usage for ' + name()"></span><strong data-bind="text: formatFilament(data())"></strong><br>
|
||||
<!-- /ko -->
|
||||
<span title="{{ _('Estimated total print time based on analysis of the file or past prints') }}">{{ _('Approx. Total Print Time') }}</span>: <strong data-bind="text: estimatedPrintTimeString, attr: {title: estimatedPrintTimeExactString}"></strong><br>
|
||||
<span title="{{ _('Estimated total print time based on analysis of the file or past prints')|edq }}">{{ _('Approx. Total Print Time') }}</span>: <strong data-bind="text: estimatedPrintTimeString, attr: {title: estimatedPrintTimeExactString}"></strong><br>
|
||||
<hr>
|
||||
<span title="{{ _('Total print time so far') }}">{{ _('Print Time') }}</span>: <strong data-bind="text: printTimeString"></strong><br>
|
||||
<span title="{{ _('Estimated time until the print job is done. This is only an estimate and accuracy depends heavily on various factors!') }}">{{ _('Print Time Left') }}</span>: <strong data-bind="text: printTimeLeftString, attr: {title: printTimeLeftExactString}"></strong> <span id="state_printtimeleft_popover" style="display: none" data-bind="visible: printTimeLeftOrigin, attr: {title: printTimeLeftOriginString}, css: printTimeLeftOriginClass">●</span><br>
|
||||
<span title="{{ _('Bytes printed vs total bytes of file') }}">{{ _('Printed') }}</span>: <strong data-bind="text: byteString"></strong><br>
|
||||
<span title="{{ _('Total print time so far')|edq }}">{{ _('Print Time') }}</span>: <strong data-bind="text: printTimeString"></strong><br>
|
||||
<span title="{{ _('Estimated time until the print job is done. This is only an estimate and accuracy depends heavily on various factors!')|edq }}">{{ _('Print Time Left') }}</span>: <strong data-bind="text: printTimeLeftString, attr: {title: printTimeLeftExactString}"></strong> <span id="state_printtimeleft_popover" style="display: none" data-bind="visible: printTimeLeftOrigin, attr: {title: printTimeLeftOriginString}, css: printTimeLeftOriginClass">●</span><br>
|
||||
<span title="{{ _('Bytes printed vs total bytes of file')|edq }}">{{ _('Printed') }}</span>: <strong data-bind="text: byteString"></strong><br>
|
||||
|
||||
|
||||
<div class="progress progress-text-centered">
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row-fluid print-control" style="display: none;" data-bind="visible: loginState.isUser">
|
||||
<button class="btn btn-primary span4" data-bind="click: print, enable: enablePrint, css: {'btn-danger': isPaused()}, attr: {title: titlePrintButton}" id="job_print"><i class="fa" data-bind="css: {'fa-print': !isPaused(), 'fa-undo': isPaused()}"></i> <span data-bind="text: (isPaused() ? '{{ _('Restart') }}' : '{{ _('Print') }}')">{{ _('Print') }}</span></button>
|
||||
<button class="btn btn-primary span4" data-bind="click: print, enable: enablePrint, css: {'btn-danger': isPaused()}, attr: {title: titlePrintButton}" id="job_print"><i class="fa" data-bind="css: {'fa-print': !isPaused(), 'fa-undo': isPaused()}"></i> <span data-bind="text: (isPaused() ? '{{ _('Restart')|esq }}' : '{{ _('Print')|esq }}')">{{ _('Print')|esq }}</span></button>
|
||||
<button class="btn span4" id="job_pause" data-bind="click: function() { isPaused() ? onlyResume() : onlyPause(); }, enable: enablePause, css: {active: isPaused()}, attr: {title: titlePauseButton}"><i class="fa" data-bind="css: {'fa-pause': !isPaused(), 'fa-play': isPaused()}"></i> <span data-bind="visible: !isPaused()">{{ _('Pause') }}</span><span data-bind="visible: isPaused()">{{ _('Resume') }}</span></button>
|
||||
<button class="btn span4" id="job_cancel" data-bind="click: cancel, enable: enableCancel" title="{{ _('Cancels the print job') }}"><i class="fa fa-stop"></i> {{ _('Cancel') }}</button>
|
||||
<button class="btn span4" id="job_cancel" data-bind="click: cancel, enable: enableCancel" title="{{ _('Cancels the print job')|edq }}"><i class="fa fa-stop"></i> {{ _('Cancel') }}</button>
|
||||
</div>
|
||||
@@ -11,7 +11,7 @@
|
||||
<td class="settings_printerProfiles_profiles_name"><span class="fa fa-star" data-bind="invisible: !isdefault()"></span> <span data-bind="text: name, style: { 'font-weight': iscurrent() ? 'bold' : 'normal' }"></span></td>
|
||||
<td class="settings_printerProfiles_profiles_model" data-bind="text: model"></td>
|
||||
<td class="settings_printerProfiles_profiles_action">
|
||||
<a href="#" class="fa fa-star" title="{{ _('Set as default profile') }}" data-bind="click: function() { if ($root.printerProfiles.canMakeDefault($data) && !$root.printerProfiles.requestInProgress()) { $root.printerProfiles.makeDefault($data); } }, css: {disabled: !$root.printerProfiles.canMakeDefault($data) || $root.printerProfiles.requestInProgress()}, enabled: $root.printerProfile.canMakeDefault($data) && !$root.printerProfiles.requestInProgress()"></a> | <a href="#" class="fa fa-pencil" title="{{ _('Edit Profile') }}" data-bind="click: function() { if (!$root.printerProfiles.requestInProgress()) { $root.printerProfiles.showEditProfileDialog($data); } }, css: {disabled: $root.printerProfiles.requestInProgress()}, enabled: !$root.printerProfiles.requestInProgress()"></a> | <a href="#" class="fa fa-trash-o" title="{{ _('Delete Profile') }}" data-bind="click: function() { if ($root.printerProfiles.canRemove($data) && !$root.printerProfiles.requestInProgress()) { $root.printerProfiles.removeProfile($data); } }, css: {disabled: !$root.printerProfiles.canRemove($data) || $root.printerProfiles.requestInProgress()}, enabled: $root.printerProfiles.canRemove($data) && !$root.printerProfiles.requestInProgress()"></a>
|
||||
<a href="#" class="fa fa-star" title="{{ _('Set as default profile')|edq }}" data-bind="click: function() { if ($root.printerProfiles.canMakeDefault($data) && !$root.printerProfiles.requestInProgress()) { $root.printerProfiles.makeDefault($data); } }, css: {disabled: !$root.printerProfiles.canMakeDefault($data) || $root.printerProfiles.requestInProgress()}, enabled: $root.printerProfile.canMakeDefault($data) && !$root.printerProfiles.requestInProgress()"></a> | <a href="#" class="fa fa-pencil" title="{{ _('Edit Profile')|edq }}" data-bind="click: function() { if (!$root.printerProfiles.requestInProgress()) { $root.printerProfiles.showEditProfileDialog($data); } }, css: {disabled: $root.printerProfiles.requestInProgress()}, enabled: !$root.printerProfiles.requestInProgress()"></a> | <a href="#" class="fa fa-trash-o" title="{{ _('Delete Profile')|edq }}" data-bind="click: function() { if ($root.printerProfiles.canRemove($data) && !$root.printerProfiles.requestInProgress()) { $root.printerProfiles.removeProfile($data); } }, css: {disabled: !$root.printerProfiles.canRemove($data) || $root.printerProfiles.requestInProgress()}, enabled: $root.printerProfiles.canRemove($data) && !$root.printerProfiles.requestInProgress()"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Command to restart the OctoPrint server') }}">
|
||||
<div class="control-group" title="{{ _('Command to restart the OctoPrint server')|edq }}">
|
||||
<label class="control-label" for="settings-serverRestartCommand">{{ _('Restart OctoPrint') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: server_commands_serverRestartCommand" id="settings-serverRestartCommand">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Command to restart the system OctoPrint is running on') }}">
|
||||
<div class="control-group" title="{{ _('Command to restart the system OctoPrint is running on')|edq }}">
|
||||
<label class="control-label" for="settings-systemRestartCommand">{{ _('Restart system') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: server_commands_systemRestartCommand" id="settings-systemRestartCommand">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Command to shut down the system OctoPrint is running on') }}">
|
||||
<div class="control-group" title="{{ _('Command to shut down the system OctoPrint is running on')|edq }}">
|
||||
<label class="control-label" for="settings-systemShutdownCommand">{{ _('Shutdown system') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: server_commands_systemShutdownCommand" id="settings-systemShutdownCommand">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Host against which to check for internet connectivity') }}" data-bind="css: {error: server_onlineCheckBroken, success: server_onlineCheckOk}">
|
||||
<div class="control-group" title="{{ _('Host against which to check for internet connectivity')|edq }}" data-bind="css: {error: server_onlineCheckBroken, success: server_onlineCheckOk}">
|
||||
<label class="control-label" for="settings-serverOnlineCheckHost">{{ _('Host IP') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-small" data-bind="value: server_onlineCheck_host" id="settings-serverOnlineCheckHost">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Interval in which to check for internet connectivity') }}">
|
||||
<div class="control-group" title="{{ _('Interval in which to check for internet connectivity')|edq }}">
|
||||
<label class="control-label" for="settings-serverOnlineCheckInterval">{{ _('Check interval') }}</label>
|
||||
<div class="controls">
|
||||
<span class="input-append">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Port against which to check for internet connectivity') }}" data-bind="css: {error: server_onlineCheckBroken, success: server_onlineCheckOk}">
|
||||
<div class="control-group" title="{{ _('Port against which to check for internet connectivity')|edq }}" data-bind="css: {error: server_onlineCheckBroken, success: server_onlineCheckOk}">
|
||||
<label class="control-label" for="settings-serverOnlineCheckPort">{{ _('Port') }}</label>
|
||||
<div class="controls">
|
||||
<input type="number" min="1" max="65535" step="1" class="input-small" data-bind="value: server_onlineCheck_port" id="settings-serverOnlineCheckPort">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Test') }}" data-bind="css: {error: server_onlineCheckBroken, success: server_onlineCheckOk}">
|
||||
<div class="control-group" title="{{ _('Test')|edq }}" data-bind="css: {error: server_onlineCheckBroken, success: server_onlineCheckOk}">
|
||||
<div class="controls">
|
||||
<button class="btn" data-bind="click: testOnlineConnectivityConfig, enable: server_onlineCheck_host() && server_onlineCheck_port() && !testOnlineConnectivityConfigBusy(), css: {disabled: !server_onlineCheck_host() || !server_onlineCheck_port() || testOnlineConnectivityConfigBusy()}"><i class="fa fa-spinner fa-spin" data-bind="visible: testOnlineConnectivityConfigBusy"></i> {{ _('Test host & port') }}</button>
|
||||
<span class="help-block" data-bind="visible: server_onlineCheckBroken() || server_onlineCheckOk(), text: server_onlineCheckText"></span>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('How long to cache the blacklist, in minutes. You should normally not have to change this.') }}">
|
||||
<div class="control-group" title="{{ _('How long to cache the blacklist, in minutes. You should normally not have to change this.')|edq }}">
|
||||
<label class="control-label" for="settings-serverPluginBlacklistTtl">{{ _('Blacklist cache TTL') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Plugin blacklist URL. You should normally not have to change this.') }}">
|
||||
<div class="control-group" title="{{ _('Plugin blacklist URL. You should normally not have to change this.')|edq }}">
|
||||
<label class="control-label" for="settings-serverPluginBlacklistUrl">{{ _('Blacklist URL') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: server_pluginBlacklist_url" id="settings-serverPluginBlacklistUrl">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Bitrate to use for encoding the timelapse video') }}">
|
||||
<div class="control-group" title="{{ _('Bitrate to use for encoding the timelapse video')|edq }}">
|
||||
<label class="control-label" for="settings-webcamBitrate">{{ _('Timelapse bitrate') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Full path to the FFMPEG binary') }}" data-bind="css: {error: webcam_ffmpegPathBroken, success: webcam_ffmpegPathOk}">
|
||||
<div class="control-group" title="{{ _('Full path to the FFMPEG binary')|edq }}" data-bind="css: {error: webcam_ffmpegPathBroken, success: webcam_ffmpegPathOk}">
|
||||
<label class="control-label" for="settings-webcamFfmpegPath">{{ _('Path to FFMPEG') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Number of FFMPEG encoding threads') }}">
|
||||
<div class="control-group" title="{{ _('Number of FFMPEG encoding threads')|edq }}">
|
||||
<label class="control-label" for="settings-webcamFfmpegThreads">{{ _('FFMPEG threads') }}</label>
|
||||
<div class="controls">
|
||||
<input class="input-mini" data-bind="value: webcam_ffmpegThreads" id="settings-webcamFfmpegThreads" type="number" step="1" min="1">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Timeout for taking a snapshot') }}">
|
||||
<div class="control-group" title="{{ _('Timeout for taking a snapshot')|edq }}">
|
||||
<label class="control-label" for="settings-webcamSnapshotTimeout">{{ _('Snapshot timeout') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('URL to use for retrieving webcam snapshot images for timelapse creation') }}">
|
||||
<div class="control-group" title="{{ _('URL to use for retrieving webcam snapshot images for timelapse creation')|edq }}">
|
||||
<label class="control-label" for="settings-webcamSnapshotUrl">{{ _('Snapshot URL') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Aspect ratio of the webcam stream, either 16:9 or 4:3') }}">
|
||||
<div class="control-group" title="{{ _('Aspect ratio of the webcam stream, either 16:9 or 4:3')|edq }}">
|
||||
<label class="control-label" for="settings-webcamStreamRatio">{{ _('Stream aspect ratio') }}</label>
|
||||
<div class="controls">
|
||||
<select data-bind="options: webcam_available_ratios, value: webcam_streamRatio" id="settings-webcamStreamRatio"></select>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('Timeout after which to unload the stream if the control tab is not visible') }}">
|
||||
<div class="control-group" title="{{ _('Timeout after which to unload the stream if the control tab is not visible')|edq }}">
|
||||
<label class="control-label" for="settings-webcamStreamTimeout">{{ _('Stream timeout') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="control-group" title="{{ _('URL to embed into the UI for live viewing of the webcam stream') }}">
|
||||
<div class="control-group" title="{{ _('URL to embed into the UI for live viewing of the webcam stream')|edq }}">
|
||||
<label class="control-label" for="settings-webcamStreamUrl">{{ _('Stream URL') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<table id="temperature-table" class="table table-bordered table-hover">
|
||||
<tr>
|
||||
<th class="temperature_tool"></th>
|
||||
<th class="temperature_actual" title="{{ _('Current actual temperature as reported by your printer') }}">{{ _('Actual') }}</th>
|
||||
<th class="temperature_target" title="{{ _('Current target temperature as reported by your printer') }}">{{ _('Target') }}</th>
|
||||
<th class="temperature_offset" title="{{ _('Offset to apply to temperature commands sent from files') }}">{{ _('Offset') }}</th>
|
||||
<th class="temperature_actual" title="{{ _('Current actual temperature as reported by your printer')|edq }}">{{ _('Actual') }}</th>
|
||||
<th class="temperature_target" title="{{ _('Current target temperature as reported by your printer')|edq }}">{{ _('Target') }}</th>
|
||||
<th class="temperature_offset" title="{{ _('Offset to apply to temperature commands sent from files')|edq }}">{{ _('Offset') }}</th>
|
||||
</tr>
|
||||
<!-- ko foreach: tools -->
|
||||
<tr data-bind="template: { name: 'temprow-template' }"></tr>
|
||||
@@ -25,13 +25,13 @@
|
||||
<td class="temperature_target">
|
||||
<form class="form-inline" style="margin:0" data-bind="submit: function(element) { $root.setTarget($data, element) }">
|
||||
<div class="input-prepend input-append">
|
||||
<button type="button" class="btn btn-input-dec" data-bind="click: $root.decrementTarget, enable: $root.isOperational() && $root.loginState.isUser()" title="{{ _('Fine adjust: -1°C') }}"><i class="fa fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-input-dec" data-bind="click: $root.decrementTarget, enable: $root.isOperational() && $root.loginState.isUser()" title="{{ _('Fine adjust: -1°C')|edq }}"><i class="fa fa-minus"></i></button>
|
||||
<input type="number" min="0" max="999" class="input-mini input-nospin" style="width: 30px" data-bind="attr: {placeholder: cleanTemperature(target(), 1)}, value: newTarget, valueUpdate: 'input', enable: $root.isOperational() && $root.loginState.isUser(), event: { focus: function(d, e) {$root.handleFocus(e, 'target', $data) } }">
|
||||
<span class="add-on">°C</span>
|
||||
<button type="button" class="btn btn-input-inc" data-bind="click: $root.incrementTarget, enable: $root.isOperational() && $root.loginState.isUser()" title="{{ _('Fine adjust: +1°C') }}"><i class="fa fa-plus"></i></button>
|
||||
<button type="button" class="btn btn-input-inc" data-bind="click: $root.incrementTarget, enable: $root.isOperational() && $root.loginState.isUser()" title="{{ _('Fine adjust: +1°C')|edq }}"><i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="submit" data-bind="enable: $root.isOperational() && $root.loginState.isUser() && $data.newTargetValid()" class="btn btn-primary" title="{{ _('Set') }}"><i class="fa fa-check"></i></button>
|
||||
<button type="submit" data-bind="enable: $root.isOperational() && $root.loginState.isUser() && $data.newTargetValid()" class="btn btn-primary" title="{{ _('Set')|edq }}"><i class="fa fa-check"></i></button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" data-bind="enable: $root.isOperational() && $root.loginState.isUser()">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
@@ -54,8 +54,8 @@
|
||||
<div class="input-append">
|
||||
<span class="input-mini uneditable-input text-right" style="width: 30px" data-bind="text: offset"></span>
|
||||
<span class="add-on">°C</span>
|
||||
<button class="btn" title="{{ _('Change Offset') }}" data-bind="click: $root.changeOffset, enable: $root.isOperational() && $root.loginState.isUser()"><i class="fa fa-pencil"></i></button>
|
||||
<button class="btn" title="{{ _('Delete Offset') }}" data-bind="click: $root.setOffsetToZero, enable: $root.isOperational() && $root.loginState.isUser()"><i class="fa fa-trash"></i></button>
|
||||
<button class="btn" title="{{ _('Change Offset')|edq }}" data-bind="click: $root.changeOffset, enable: $root.isOperational() && $root.loginState.isUser()"><i class="fa fa-pencil"></i></button>
|
||||
<button class="btn" title="{{ _('Delete Offset')|edq }}" data-bind="click: $root.setOffsetToZero, enable: $root.isOperational() && $root.loginState.isUser()"><i class="fa fa-trash"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<span data-bind="visible: !autoscrollEnabled() && enableFancyFunctionality()" style="display: none">(<a href="javascript:void(0)" data-bind="click: scrollToEnd">{{ _("Scroll to end") }}</a>)</span>
|
||||
</small>
|
||||
<small class="pull-right">
|
||||
<a href="javascript:void(0)" data-bind="click: copyAll"><i class="fa fa-copy" title="{{ _('Copy all') }}"></i> {{ _('Copy all') }}</a><br>
|
||||
<a href="javascript:void(0)" data-bind="click: clearAllLogs"><i class="fa fa-trash-o" title="{{ _('Clear log window') }}"></i> {{ _('Clear all') }}</a>
|
||||
<a href="javascript:void(0)" data-bind="click: copyAll"><i class="fa fa-copy" title="{{ _('Copy all')|edq }}"></i> {{ _('Copy all') }}</a><br>
|
||||
<a href="javascript:void(0)" data-bind="click: clearAllLogs"><i class="fa fa-trash-o" title="{{ _('Clear log window')|edq }}"></i> {{ _('Clear all') }}</a>
|
||||
</small>
|
||||
<small class="pull-left text-warning" data-bind="visible: !fancyFunctionality()" style="display: none">
|
||||
{{ _('For performance reasons only a limited amount of terminal functionality is enabled right now.') }}
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
<td class="timelapse_unrendered_size" data-bind="text: size"></td>
|
||||
<td class="timelapse_unrendered_action">
|
||||
<span data-bind="visible: processing"><i class="fa fa-refresh fa-spin"></i></span>
|
||||
<span data-bind="visible: !processing"><a href="javascript:void(0)" title="{{ _('Delete unrendered timelapse') }}" class="fa fa-trash-o" data-bind="click: function() { if ($root.loginState.isUser()) { $parent.removeUnrendered($data.name); } else { return; } }, css: {disabled: !$root.loginState.isUser()}"></a> | <a href="javascript:void(0)" title="{{ _('Render timelapse') }}" class="fa fa-video-camera" data-bind="click: function() { if ($root.loginState.isUser() && !$root.isBusy()) { $parent.renderUnrendered($data.name); } else { return; } }, css: {disabled: !$root.loginState.isUser() || $root.isBusy()}"></a></span>
|
||||
<span data-bind="visible: !processing"><a href="javascript:void(0)" title="{{ _('Delete unrendered timelapse')|edq }}" class="fa fa-trash-o" data-bind="click: function() { if ($root.loginState.isUser()) { $parent.removeUnrendered($data.name); } else { return; } }, css: {disabled: !$root.loginState.isUser()}"></a> | <a href="javascript:void(0)" title="{{ _('Render timelapse')|edq }}" class="fa fa-video-camera" data-bind="click: function() { if ($root.loginState.isUser() && !$root.isBusy()) { $parent.renderUnrendered($data.name); } else { return; } }, css: {disabled: !$root.loginState.isUser() || $root.isBusy()}"></a></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -23,6 +23,7 @@ from octoprint.settings import settings
|
||||
from octoprint.events import eventManager, Events
|
||||
from octoprint.plugin import plugin_manager
|
||||
from octoprint.util import monotonic_time
|
||||
from octoprint.util import get_fully_qualified_classname as fqcn
|
||||
|
||||
import sarge
|
||||
import collections
|
||||
@@ -304,7 +305,8 @@ def notify_callbacks(timelapse):
|
||||
config = timelapse.config_data()
|
||||
for callback in _update_callbacks:
|
||||
try: callback.sendTimelapseConfig(config)
|
||||
except: logging.getLogger(__name__).exception("Exception while pushing timelapse configuration")
|
||||
except: logging.getLogger(__name__).exception("Exception while pushing timelapse configuration",
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
|
||||
def configure_timelapse(config=None, persist=False):
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
@@ -21,6 +21,7 @@ from builtins import range, bytes
|
||||
from octoprint.settings import settings as s
|
||||
|
||||
from octoprint.util import atomic_write, to_bytes, deprecated, monotonic_time
|
||||
from octoprint.util import get_fully_qualified_classname as fqcn
|
||||
|
||||
class UserManager(object):
|
||||
valid_roles = ["user", "admin"]
|
||||
@@ -90,7 +91,8 @@ class UserManager(object):
|
||||
try:
|
||||
callback("login", user)
|
||||
except:
|
||||
self._logger.exception("Error while calling login callback {!r}".format(callback))
|
||||
self._logger.exception("Error while calling login callback {!r}".format(callback),
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
return user
|
||||
|
||||
@@ -122,7 +124,8 @@ class UserManager(object):
|
||||
try:
|
||||
callback("logout", user)
|
||||
except:
|
||||
self._logger.exception("Error while calling logout callback {!r}".format(callback))
|
||||
self._logger.exception("Error while calling logout callback {!r}".format(callback),
|
||||
extra=dict(callback=fqcn(callback)))
|
||||
|
||||
def _cleanup_sessions(self):
|
||||
for session, user in self._session_users_by_session.items():
|
||||
|
||||
@@ -228,6 +228,25 @@ def get_class(name):
|
||||
raise ImportError("No module named " + name)
|
||||
|
||||
|
||||
def get_fully_qualified_classname(o):
|
||||
"""
|
||||
Returns the fully qualified class name for an object.
|
||||
|
||||
Based on https://stackoverflow.com/a/2020083
|
||||
|
||||
Args:
|
||||
o: the object of which to determine the fqcn
|
||||
|
||||
Returns:
|
||||
(str) the fqcn of the object
|
||||
"""
|
||||
|
||||
module = getattr(o.__class__, "__module__", None)
|
||||
if module is None:
|
||||
return o.__class__.__name__
|
||||
return module + "." + o.__class__.__name__
|
||||
|
||||
|
||||
def get_exception_string():
|
||||
"""
|
||||
Retrieves the exception info of the last raised exception and returns it as a string formatted as
|
||||
|
||||
@@ -123,7 +123,7 @@ def get_python_version_string():
|
||||
|
||||
# Debian has the python version set to 2.7.15+ which is not PEP440 compliant (bug 914072)
|
||||
if version_string.endswith("+"):
|
||||
version_string = python_version[:-1]
|
||||
version_string = version_string[:-1]
|
||||
|
||||
return version_string
|
||||
|
||||
|
||||
Reference in new issue
Block a user