From d9b57bd86765056946efd919bc2b478097ba5706 Mon Sep 17 00:00:00 2001 From: David Zingg Date: Wed, 20 Nov 2019 22:07:47 +0100 Subject: [PATCH] #6 UI Updates senden und anzeigen --- octoprint_mystromswitch/static/js/mystromswitch.js | 2 ++ octoprint_mystromswitch/templates/mystromswitch_sidebar.jinja2 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/octoprint_mystromswitch/static/js/mystromswitch.js b/octoprint_mystromswitch/static/js/mystromswitch.js index 8a19619..b67e285 100644 --- a/octoprint_mystromswitch/static/js/mystromswitch.js +++ b/octoprint_mystromswitch/static/js/mystromswitch.js @@ -7,6 +7,7 @@ $(function() { self.printer = parameters[2]; self.mystromswitchEnabled = ko.observable(); + self.mystromswitchPowerValue = document.getElementById("mystromswitchPowerValue") // Hack to remove automatically added Cancel button // See https://github.com/sciactive/pnotify/issues/141 @@ -145,6 +146,7 @@ $(function() { self.mystromswitchEnabled(data.mystromswitchEnabled); if (data.power != null) { + self.mystromswitchPowerValue.innerHTML = "Power Consumption"+data.power+"W" self.timeoutPopupOptions.text = self.timeoutPopupText + data.power; if (typeof self.timeoutPopup != "undefined") { self.timeoutPopup.update(self.timeoutPopupOptions); diff --git a/octoprint_mystromswitch/templates/mystromswitch_sidebar.jinja2 b/octoprint_mystromswitch/templates/mystromswitch_sidebar.jinja2 index 75e5106..842d78b 100644 --- a/octoprint_mystromswitch/templates/mystromswitch_sidebar.jinja2 +++ b/octoprint_mystromswitch/templates/mystromswitch_sidebar.jinja2 @@ -1,4 +1,6 @@