Merge branch 'maintenance' of github.com:OctoPrint/OctoPrint into maintenance

This commit is contained in:
Gina Häußge committed 2021-01-13 14:39:14 +01:00
commit d2ef14b438
4 files changed
+19 -6

No files matched your search

+4
View File
@@ -259,6 +259,10 @@ onUserSettingsShown()
onUserSettingsHidden()
Called when the user settings dialog is hidden.
onUserSettingsBeforeSave()
Called just before the user settings view model is sent to the server. This is useful, for example, if your plugin
needs to compute persisted settings from a custom view model.
onWizardDetails(response)
Called with the response from the wizard detail API call initiated before opening the wizard dialog. Will contain
the data from all :class:`~octoprint.plugin.WizardPlugin` implementations returned by their :meth:`~octoprint.plugin.WizardPlugin.get_wizard_details`
@@ -11,7 +11,7 @@
OctoPrint comes preconfigured to perform the connectivity check every 15 minutes. You may change the value here.
{% endtrans %}</p>
<form class="form-horizontal" data-bind="with: settingsViewModel, enable: !setup(), css {disabled: setup()}" onsubmit="return false;">
<form class="form-horizontal" data-bind="with: settingsViewModel" onsubmit="return false;">
{% include "snippets/settings/server/serverOnlineCheckInterval.jinja2" %}
</form>
@@ -21,7 +21,7 @@
trust and that has a high availability.
{% endtrans %}</p>
<form class="form-horizontal" data-bind="with: settingsViewModel, enable: !setup(), css {disabled: setup()}" onsubmit="return false;">
<form class="form-horizontal" data-bind="with: settingsViewModel" onsubmit="return false;">
{% include "snippets/settings/server/serverOnlineCheckHost.jinja2" %}
{% include "snippets/settings/server/serverOnlineCheckPort.jinja2" %}
{% include "snippets/settings/server/serverOnlineCheckTestConnectivity.jinja2" %}
@@ -34,7 +34,7 @@
side with the general connectivity check, leave the field empty.
{% endtrans %}</p>
<form class="form-horizontal" data-bind="with: settingsViewModel, enable: !setup(), css {disabled: setup()}" onsubmit="return false;">
<form class="form-horizontal" data-bind="with: settingsViewModel" onsubmit="return false;">
<div class="control-group">
{% include "snippets/settings/server/serverOnlineCheckName.jinja2" %}
{% include "snippets/settings/server/serverOnlineCheckTestResolution.jinja2" %}
@@ -47,8 +47,12 @@
{% endtrans %}</p>
<div class="row-fluid">
<a href="#" class="btn span6" data-bind="click: function() { if(!setup()){disableOnlineCheck()}}, enable: !setup(), css: {disabled: setup()}">{{ _('Disable Connectivity Check') }}</a>
<a href="#" class="btn btn-primary span6" data-bind="click: function() { if(!setup()){enableOnlineCheck()}}, enable: !setup(), css: {disabled: setup()}">{{ _('Enable Connectivity Check') }}</a>
<a href="#" class="btn span6" data-bind="click: function() { if(!setup() || decision()){disableOnlineCheck()}}, enable: !setup() || decision(), css: {disabled: setup() && !decision()}">
{{ _('Disable Connectivity Check') }}
</a>
<a href="#" class="btn btn-primary span6" data-bind="click: function() { if(!setup() || !decision()){enableOnlineCheck()}}, enable: !setup() || !decision(), css: {disabled: setup() && decision()}">
{{ _('Enable Connectivity Check') }}
</a>
</div>
<div class="onlinecheck_decision" style="display: none" data-bind="visible: setup()">
@@ -13,7 +13,7 @@
<i class="fas fa-spinner fa-spin" style="display: none" data-bind="visible: active() && decision() === false"></i>
{{ _('Disable Anonymous Usage Tracking') }}
</a>
<a href="javascript:void(0)" class="btn btn-primary span6" data-bind="click: function() { if(!setup() || !decision()){enableUsage()}}, enable: !setup() || !decision(), css: {disabled: setup() && decision}">
<a href="javascript:void(0)" class="btn btn-primary span6" data-bind="click: function() { if(!setup() || !decision()){enableUsage()}}, enable: !setup() || !decision(), css: {disabled: setup() && decision()}">
<i class="fas fa-spinner fa-spin" style="display: none" data-bind="visible: active() && decision() === true"></i>
{{ _('Enable Anonymous Usage Tracking') }}
</a>
@@ -79,6 +79,8 @@ $(function () {
self.save = function () {
if (!CONFIG_ACCESS_CONTROL) return;
self.userSettingsDialog.trigger("beforeSave");
if (self.access_password() && !self.passwordMismatch()) {
self.users.updatePassword(
self.currentUser().name,
@@ -162,6 +164,9 @@ $(function () {
self.userSettingsDialog.on("hidden", function () {
callViewModels(allViewModels, "onUserSettingsHidden");
});
self.userSettingsDialog.on("beforeSave", function () {
callViewModels(allViewModels, "onUserSettingsBeforeSave");
});
};
}