This commit is contained in:
David Zingg 2019-11-19 21:55:31 +01:00
parent 4c159fbabc
commit 5119ab736d
7 changed files with 113 additions and 113 deletions

View File

@ -2,9 +2,11 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="7e2e0eec-b22e-4d48-8f24-196d1ed9b51a" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/__init__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/setup.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/static/css/shutdownprinter.css" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/static/css/mystromswitch.css" afterDir="false" />
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/static/js/shutdownprinter.js" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/static/js/mystromswitch.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/templates/shutdownprinter_settings.jinja2" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/templates/mystromswitch_settings.jinja2" afterDir="false" />
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/templates/shutdownprinter_sidebar.jinja2" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/templates/mystromswitch_sidebar.jinja2" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />

View File

@ -14,8 +14,6 @@ from octoprint.util import RepeatedTimer
class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plugin.SimpleApiPlugin,
octoprint.plugin.EventHandlerPlugin,
octoprint.plugin.StartupPlugin):
def __init__(self):
@ -124,7 +122,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
self._shutdown_printer_enabled = self.lastCheckBoxValue
def get_assets(self):
return dict(js=["js/shutdownprinter.js"], css=["css/shutdownprinter.css"])
return dict(js=["js/mystromswitch.js"], css=["css/mystromswitch.css"])
def get_template_configs(self):
return [dict(type="sidebar",
@ -171,13 +169,13 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
eventManager().fire(Events.SETTINGS_UPDATED)
if data["eventView"] == True:
self._plugin_manager.send_plugin_message(self._identifier,
dict(shutdownprinterEnabled=self._shutdown_printer_enabled,
dict(mystromswitchEnabled=self._shutdown_printer_enabled,
type="timeout", timeout_value=self._timeout_value))
def on_event(self, event, payload):
# if event == Events.CLIENT_OPENED:
# self._plugin_manager.send_plugin_message(self._identifier, dict(shutdownprinterEnabled=self._shutdown_printer_enabled, type="timeout", timeout_value=self._timeout_value))
# self._plugin_manager.send_plugin_message(self._identifier, dict(mystromswitchEnabled=self._shutdown_printer_enabled, type="timeout", timeout_value=self._timeout_value))
# return
if not self._shutdown_printer_enabled:
@ -258,12 +256,12 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
self._timeout_value -= 1
self._plugin_manager.send_plugin_message(self._identifier,
dict(shutdownprinterEnabled=self._shutdown_printer_enabled,
dict(mystromswitchEnabled=self._shutdown_printer_enabled,
type="timeout", timeout_value=self._timeout_value))
if self._printer.get_state_id() == "PRINTING" and self._printer.is_printing() == True:
self._timeout_value = 0
self._plugin_manager.send_plugin_message(self._identifier,
dict(shutdownprinterEnabled=self._shutdown_printer_enabled,
dict(mystromswitchEnabled=self._shutdown_printer_enabled,
type="timeout", timeout_value=self._timeout_value))
self._abort_timer.cancel()
self._abort_timer = None
@ -412,7 +410,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
def get_update_information(self):
return dict(
shutdownprinter=dict(
mystromswitch=dict(
displayName="OctoPrint-MyStromSwitch",
displayVersion=self._plugin_version,

View File

@ -0,0 +1,38 @@
/* #touch body #sidebar_plugin_mystromswitch_wrapper .accordion-heading { */
/* display: block !important; */
/* pointer-events: none; */
/* margin: 40px -30px 0; */
/* padding: .5rem 30px; */
/* background-color: #00B0FF; */
/* color: black; */
/* } */
/* #touch body #sidebar_plugin_mystromswitch_wrapper .accordion-heading>a, #touch body #sidebar_plugin_mystromswitch_wrapper .accordion-heading>a i { */
/* color: black; */
/* font-size: 1.4375rem; */
/* padding-right: 0; */
/* padding-left: 0; */
/* } */
/* #touch body #sidebar_plugin_mystromswitch > label { */
/* display: block; */
/* background:#333; */
/* padding-left: 50px; */
/* padding-top: 15px; */
/* padding-bottom: 15px; */
/* } */
/* #touch body #sidebar_plugin_mystromswitch { */
/* pointer-events: auto; */
/* margin: 0px -30px 0; */
/* padding-right: 15px; */
/* padding-left: 15px; */
/* } */
.shutdownPrinterHideCancelBtnConfirm {
display:none;
}
#touch body #tabs #sidebar_plugin_mystromswitch_wrapper_link a:before, #touch body #navbar #all_touchui_settings #sidebar_plugin_mystromswitch_wrapper_link a:before,#touch body #tabs #sidebar_plugin_mystromswitch_wrapper_link2 a:before, #touch body #navbar #all_touchui_settings #sidebar_plugin_mystromswitch_wrapper_link2 a:before {
content: "\f011";
}

View File

@ -1,38 +0,0 @@
/* #touch body #sidebar_plugin_shutdownprinter_wrapper .accordion-heading { */
/* display: block !important; */
/* pointer-events: none; */
/* margin: 40px -30px 0; */
/* padding: .5rem 30px; */
/* background-color: #00B0FF; */
/* color: black; */
/* } */
/* #touch body #sidebar_plugin_shutdownprinter_wrapper .accordion-heading>a, #touch body #sidebar_plugin_shutdownprinter_wrapper .accordion-heading>a i { */
/* color: black; */
/* font-size: 1.4375rem; */
/* padding-right: 0; */
/* padding-left: 0; */
/* } */
/* #touch body #sidebar_plugin_shutdownprinter > label { */
/* display: block; */
/* background:#333; */
/* padding-left: 50px; */
/* padding-top: 15px; */
/* padding-bottom: 15px; */
/* } */
/* #touch body #sidebar_plugin_shutdownprinter { */
/* pointer-events: auto; */
/* margin: 0px -30px 0; */
/* padding-right: 15px; */
/* padding-left: 15px; */
/* } */
.shutdownPrinterHideCancelBtnConfirm {
display:none;
}
#touch body #tabs #sidebar_plugin_shutdownprinter_wrapper_link a:before, #touch body #navbar #all_touchui_settings #sidebar_plugin_shutdownprinter_wrapper_link a:before,#touch body #tabs #sidebar_plugin_shutdownprinter_wrapper_link2 a:before, #touch body #navbar #all_touchui_settings #sidebar_plugin_shutdownprinter_wrapper_link2 a:before {
content: "\f011";
}

View File

@ -1,5 +1,5 @@
$(function() {
function ShutdownPrinterViewModel(parameters) {
function mystromswitchViewModel(parameters) {
var self = this;
self.loginState = parameters[0];
@ -7,12 +7,12 @@ $(function() {
self.printer = parameters[2];
self.shutdownprinterEnabled = ko.observable();
self.mystromswitchEnabled = ko.observable();
self.testButtonChangeStatus = function (stat) {
$("#tester_shutdownprinter_gcode").prop("disabled", stat);
$("#tester_shutdownprinter_api").prop("disabled", stat);
$("#tester_shutdownprinter_api_custom").prop("disabled", stat);
$("#tester_mystromswitch_gcode").prop("disabled", stat);
$("#tester_mystromswitch_api").prop("disabled", stat);
$("#tester_mystromswitch_api_custom").prop("disabled", stat);
}
self.eventChangeCheckToRadio = function (id, listOff) {
@ -34,12 +34,12 @@ $(function() {
})
}
$("#tester_shutdownprinter_gcode").on("click", function () {
$("#tester_mystromswitch_gcode").on("click", function () {
self.settings.saveData();
$(this).children("i").show();
setTimeout(function (current) {
$.ajax({
url: API_BASEURL + "plugin/shutdownprinter",
url: API_BASEURL + "plugin/mystromswitch",
type: "POST",
dataType: "json",
data: JSON.stringify({
@ -55,12 +55,12 @@ $(function() {
}, 1000, $(this));
});
$("#tester_shutdownprinter_api").on("click", function () {
$("#tester_mystromswitch_api").on("click", function () {
self.settings.saveData();
$(this).children("i").show();
setTimeout(function (current) {
$.ajax({
url: API_BASEURL + "plugin/shutdownprinter",
url: API_BASEURL + "plugin/mystromswitch",
type: "POST",
dataType: "json",
data: JSON.stringify({
@ -76,12 +76,12 @@ $(function() {
});
$("#tester_shutdownprinter_api_custom").on("click", function () {
$("#tester_mystromswitch_api_custom").on("click", function () {
self.settings.saveData();
$(this).children("i").show();
setTimeout(function (current) {
$.ajax({
url: API_BASEURL + "plugin/shutdownprinter",
url: API_BASEURL + "plugin/mystromswitch",
type: "POST",
dataType: "json",
data: JSON.stringify({
@ -97,22 +97,22 @@ $(function() {
});
self.listOffMode = [
{"id" : "#shutdownprinter_mode_shutdown_gcode"},
{"id" : "#shutdownprinter_mode_shutdown_api"},
{"id" : "#shutdownprinter_mode_shutdown_api_custom"},
{"id" : "#mystromswitch_mode_shutdown_gcode"},
{"id" : "#mystromswitch_mode_shutdown_api"},
{"id" : "#mystromswitch_mode_shutdown_api_custom"},
]
self.listOffHTTPMethode = [
{"id" : "#shutdownprinter_api_custom_GET"},
{"id" : "#shutdownprinter_api_custom_POST"},
{"id" : "#shutdownprinter_api_custom_PUT"}
{"id" : "#mystromswitch_api_custom_GET"},
{"id" : "#mystromswitch_api_custom_POST"},
{"id" : "#mystromswitch_api_custom_PUT"}
]
self.eventChangeCheckToRadio("#shutdownprinter_mode_shutdown_gcode", self.listOffMode);
self.eventChangeCheckToRadio("#shutdownprinter_mode_shutdown_api", self.listOffMode);
self.eventChangeCheckToRadio("#shutdownprinter_mode_shutdown_api_custom", self.listOffMode);
self.eventChangeCheckToRadio("#mystromswitch_mode_shutdown_gcode", self.listOffMode);
self.eventChangeCheckToRadio("#mystromswitch_mode_shutdown_api", self.listOffMode);
self.eventChangeCheckToRadio("#mystromswitch_mode_shutdown_api_custom", self.listOffMode);
self.eventChangeCheckToRadio("#shutdownprinter_api_custom_GET", self.listOffHTTPMethode);
self.eventChangeCheckToRadio("#shutdownprinter_api_custom_POST", self.listOffHTTPMethode);
self.eventChangeCheckToRadio("#shutdownprinter_api_custom_PUT", self.listOffHTTPMethode);
self.eventChangeCheckToRadio("#mystromswitch_api_custom_GET", self.listOffHTTPMethode);
self.eventChangeCheckToRadio("#mystromswitch_api_custom_POST", self.listOffHTTPMethode);
self.eventChangeCheckToRadio("#mystromswitch_api_custom_PUT", self.listOffHTTPMethode);
// Hack to remove automatically added Cancel button
// See https://github.com/sciactive/pnotify/issues/141
@ -135,7 +135,7 @@ $(function() {
notice.get().trigger("pnotify.cancel", [notice, value]);
}
}, {
addClass: 'shutdownPrinterHideCancelBtnConfirm',
addClass: 'mystromswitchHideCancelBtnConfirm',
promptTrigger: true,
click: function(notice, value){
notice.remove();
@ -162,7 +162,7 @@ $(function() {
if (counter < 10) {
if (document.getElementById("touch") != null && document.getElementById("printer") != null && document.getElementById("printer") != null && document.getElementById("touch").querySelector("#printer").querySelector("#files_wrapper")) {
var newParent = document.getElementById("files_wrapper").parentNode;
newParent.insertBefore(document.getElementById('sidebar_plugin_shutdownprinter_wrapper'), document.getElementById("files_wrapper"));
newParent.insertBefore(document.getElementById('sidebar_plugin_mystromswitch_wrapper'), document.getElementById("files_wrapper"));
} else {
setTimeout(self.touchUIMoveElement, 1000, self, ++counter);
}
@ -183,7 +183,7 @@ $(function() {
self.onUserLoggedIn = function() {
$.ajax({
url: API_BASEURL + "plugin/shutdownprinter",
url: API_BASEURL + "plugin/mystromswitch",
type: "POST",
dataType: "json",
data: JSON.stringify({
@ -193,7 +193,7 @@ $(function() {
contentType: "application/json; charset=UTF-8"
})
$.ajax({
url: API_BASEURL + "plugin/shutdownprinter",
url: API_BASEURL + "plugin/mystromswitch",
type: "POST",
data: JSON.stringify({
command: "status"
@ -201,7 +201,7 @@ $(function() {
context:self,
contentType: "application/json; charset=UTF-8"
}).done(function(data, textStatus, jqXHR ){
this.shutdownprinterEnabled(data == "True" ? true : false);
this.mystromswitchEnabled(data == "True" ? true : false);
})
}
@ -216,10 +216,10 @@ $(function() {
}
}
self.onShutdownPrinterEvent = function() {
if (self.shutdownprinterEnabled()) {
self.onmystromswitchEvent = function() {
if (self.mystromswitchEnabled()) {
$.ajax({
url: API_BASEURL + "plugin/shutdownprinter",
url: API_BASEURL + "plugin/mystromswitch",
type: "POST",
dataType: "json",
data: JSON.stringify({
@ -230,7 +230,7 @@ $(function() {
})
} else {
$.ajax({
url: API_BASEURL + "plugin/shutdownprinter",
url: API_BASEURL + "plugin/mystromswitch",
type: "POST",
dataType: "json",
data: JSON.stringify({
@ -242,14 +242,14 @@ $(function() {
}
}
self.shutdownprinterEnabled.subscribe(self.onShutdownPrinterEvent, self);
self.mystromswitchEnabled.subscribe(self.onmystromswitchEvent, self);
self.onDataUpdaterPluginMessage = function(plugin, data) {
if (plugin != "shutdownprinter" && plugin != "octoprint_shutdownprinter") {
if (plugin != "mystromswitch" && plugin != "octoprint_mystromswitch") {
return;
}
self.shutdownprinterEnabled(data.shutdownprinterEnabled);
self.mystromswitchEnabled(data.mystromswitchEnabled);
if (data.type == "timeout") {
if ((data.timeout_value != null) && (data.timeout_value > 0)) {
self.timeoutPopupOptions.text = self.timeoutPopupText + data.timeout_value;
@ -272,7 +272,7 @@ $(function() {
self.timeoutPopup.remove();
self.timeoutPopup = undefined;
$.ajax({
url: API_BASEURL + "plugin/shutdownprinter",
url: API_BASEURL + "plugin/mystromswitch",
type: "POST",
dataType: "json",
data: JSON.stringify({
@ -285,8 +285,8 @@ $(function() {
}
OCTOPRINT_VIEWMODELS.push([
ShutdownPrinterViewModel,
mystromswitchViewModel,
["loginStateViewModel", "settingsViewModel", "printerStateViewModel"],
$(".sidebar_plugin_shutdownprinter").get(0)
$(".sidebar_plugin_mystromswitch").get(0)
]);
});

View File

@ -5,25 +5,25 @@
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" id="shutdownprinter_mode_shutdown_gcode" data-bind="checked: settings.plugins.shutdownprinter._mode_shutdown_gcode">activate this mode
<input type="checkbox" id="mystromswitch_mode_shutdown_gcode" data-bind="checked: settings.plugins.mystromswitch._mode_shutdown_gcode">activate this mode
</label>
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('GCODE') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: settings.plugins.shutdownprinter.gcode">
<input type="text" class="input-block-level" data-bind="value: settings.plugins.mystromswitch.gcode">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Parameter (IP or other)') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: settings.plugins.shutdownprinter.url">
<input type="text" class="input-block-level" data-bind="value: settings.plugins.mystromswitch.url">
</div>
</div>
<div class="control-group">
<div class="controls">
<button id="tester_shutdownprinter_gcode" type="button" class="btn btn-primary pull-right"><i class="fa fa-spinner fa-spin" data-bind="visible: sending" style="display: none;"></i>Test</button>
<button id="tester_mystromswitch_gcode" type="button" class="btn btn-primary pull-right"><i class="fa fa-spinner fa-spin" data-bind="visible: sending" style="display: none;"></i>Test</button>
</div>
</div>
@ -32,7 +32,7 @@
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" id="shutdownprinter_mode_shutdown_api" data-bind="checked: settings.plugins.shutdownprinter._mode_shutdown_api">activate this mode
<input type="checkbox" id="mystromswitch_mode_shutdown_api" data-bind="checked: settings.plugins.mystromswitch._mode_shutdown_api">activate this mode
</label>
</div>
</div>
@ -40,7 +40,7 @@
<label class="control-label">{{ _('api key (key octoprint)') }}</label>
<div class="controls">
<div class="input-append">
<input type="text" class="input" data-bind="value: settings.plugins.shutdownprinter.api_key_plugin">
<input type="text" class="input" data-bind="value: settings.plugins.mystromswitch.api_key_plugin">
</div>
</div>
@ -49,7 +49,7 @@
<label class="control-label">{{ _('Plugin ID') }}</label>
<div class="controls">
<div class="input-append">
<input type="text" class="input" data-bind="value: settings.plugins.shutdownprinter.api_plugin_name">
<input type="text" class="input" data-bind="value: settings.plugins.mystromswitch.api_plugin_name">
</div>
</div>
@ -58,19 +58,19 @@
<label class="control-label">{{ _('Port') }}</label>
<div class="controls">
<div class="input-append">
<input type="number" min='0' class="input-mini text-right" data-bind="value: settings.plugins.shutdownprinter.api_plugin_port">
<input type="number" min='0' class="input-mini text-right" data-bind="value: settings.plugins.mystromswitch.api_plugin_port">
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">JSON</label>
<div class="controls">
<textarea rows="4" class="block" data-bind="value: settings.plugins.shutdownprinter.api_json_command"></textarea>
<textarea rows="4" class="block" data-bind="value: settings.plugins.mystromswitch.api_json_command"></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<button id="tester_shutdownprinter_api" type="button" class="btn btn-primary pull-right"><i class="fa fa-spinner fa-spin" data-bind="visible: sending" style="display: none;"></i>Test</button>
<button id="tester_mystromswitch_api" type="button" class="btn btn-primary pull-right"><i class="fa fa-spinner fa-spin" data-bind="visible: sending" style="display: none;"></i>Test</button>
</div>
</div>
<hr>
@ -78,44 +78,44 @@
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" id="shutdownprinter_mode_shutdown_api_custom" data-bind="checked: settings.plugins.shutdownprinter._mode_shutdown_api_custom">activate this mode
<input type="checkbox" id="mystromswitch_mode_shutdown_api_custom" data-bind="checked: settings.plugins.mystromswitch._mode_shutdown_api_custom">activate this mode
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" id="shutdownprinter_api_custom_GET" data-bind="checked: settings.plugins.shutdownprinter.api_custom_GET">GET
<input type="checkbox" id="mystromswitch_api_custom_GET" data-bind="checked: settings.plugins.mystromswitch.api_custom_GET">GET
</label>
<label class="checkbox">
<input type="checkbox" id="shutdownprinter_api_custom_POST" data-bind="checked: settings.plugins.shutdownprinter.api_custom_POST">POST
<input type="checkbox" id="mystromswitch_api_custom_POST" data-bind="checked: settings.plugins.mystromswitch.api_custom_POST">POST
</label>
<label class="checkbox">
<input type="checkbox" id="shutdownprinter_api_custom_PUT" data-bind="checked: settings.plugins.shutdownprinter.api_custom_PUT">PUT
<input type="checkbox" id="mystromswitch_api_custom_PUT" data-bind="checked: settings.plugins.mystromswitch.api_custom_PUT">PUT
</label>
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('URL') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: settings.plugins.shutdownprinter.api_custom_url">
<input type="text" class="input-block-level" data-bind="value: settings.plugins.mystromswitch.api_custom_url">
</div>
</div>
<div class="control-group">
<label class="control-label">header (json format)</label>
<div class="controls">
<textarea rows="4" class="block" data-bind="value: settings.plugins.shutdownprinter.api_custom_json_header"></textarea>
<textarea rows="4" class="block" data-bind="value: settings.plugins.mystromswitch.api_custom_json_header"></textarea>
</div>
</div>
<div class="control-group">
<label class="control-label">body</label>
<div class="controls">
<textarea rows="4" class="block" data-bind="value: settings.plugins.shutdownprinter.api_custom_body"></textarea>
<textarea rows="4" class="block" data-bind="value: settings.plugins.mystromswitch.api_custom_body"></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<button id="tester_shutdownprinter_api_custom" type="button" class="btn btn-primary pull-right"><i class="fa fa-spinner fa-spin" data-bind="visible: sending" style="display: none;"></i>Test</button>
<button id="tester_mystromswitch_api_custom" type="button" class="btn btn-primary pull-right"><i class="fa fa-spinner fa-spin" data-bind="visible: sending" style="display: none;"></i>Test</button>
</div>
</div>
<hr>
@ -124,7 +124,7 @@
<label class="control-label">Abort Timeout</label>
<div class="controls">
<div class="input-append">
<input type="number" class="input-mini text-right" data-bind="value: settings.plugins.shutdownprinter.abortTimeout">
<input type="number" class="input-mini text-right" data-bind="value: settings.plugins.mystromswitch.abortTimeout">
<span class="add-on">sec</span>
</div>
</div>
@ -132,7 +132,7 @@
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: settings.plugins.shutdownprinter.rememberCheckBox"> Remember the value of "Shutdown Printer after print finishes"
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.rememberCheckBox"> Remember the value of "Shutdown Printer after print finishes"
</label>
</div>
</div>
@ -141,14 +141,14 @@
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: settings.plugins.shutdownprinter.printFailed"> Event print failed
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.printFailed"> Event print failed
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: settings.plugins.shutdownprinter.printCancelled"> Event print cancelled
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.printCancelled"> Event print cancelled
</label>
</div>
</div>
@ -157,7 +157,7 @@
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" shutdownPrinterTemperatureTarget="true" data-bind="checked: settings.plugins.shutdownprinter.temperatureTarget"> Enable temperature target
<input type="checkbox" mystromswitchTemperatureTarget="true" data-bind="checked: settings.plugins.mystromswitch.temperatureTarget"> Enable temperature target
</label>
</div>
</div>
@ -165,7 +165,7 @@
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="text" class="input" data-bind="value: settings.plugins.shutdownprinter.extraCommand">
<input type="text" class="input" data-bind="value: settings.plugins.mystromswitch.extraCommand">
</label>
</div>
</div>
@ -173,7 +173,7 @@
<label class="control-label">{{ _('Temperature') }}</label>
<div class="controls">
<div class="input-append">
<input type="number" min='0' class="input-mini text-right" data-bind="value: settings.plugins.shutdownprinter.temperatureValue">
<input type="number" min='0' class="input-mini text-right" data-bind="value: settings.plugins.mystromswitch.temperatureValue">
<span class="add-on">°C</span>
</div>
</div>

View File

@ -1,6 +1,6 @@
<div class="sidebar_plugin_shutdownprinter">
<div class="sidebar_plugin_mystromswitch">
<label class="checkbox">
<input type="checkbox" data-bind="enable: loginState.isUser(), checked: shutdownprinterEnabled">
<input type="checkbox" data-bind="enable: loginState.isUser(), checked: mystromswitchEnabled">
{{ _('Shutdown Printer after print finishes') }}
</label>
</div>