From b0b978388292e269285a1df35de8ea4b3620aecb Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Wed, 30 Mar 2022 15:36:15 +0200 Subject: [PATCH] Water switch is only visible id auto water is off --- greenhouseui/static/scripts/greenhouse.js | 5 ++++- greenhouseui/templates/index.html | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/greenhouseui/static/scripts/greenhouse.js b/greenhouseui/static/scripts/greenhouse.js index ae1b8f2..8b71eb4 100644 --- a/greenhouseui/static/scripts/greenhouse.js +++ b/greenhouseui/static/scripts/greenhouse.js @@ -105,21 +105,24 @@ var parse_config = function (event) { } document.getElementById("heat_switch_label").style.visibility = visibility_heat document.getElementById("heat_switch").style.visibility = visibility_heat - document.getElementById("heat_auto_switch").value = output; document.getElementById("config_temperatures").style.visibility = visibility } output = "einschalten" visibility = 'hidden' + var visibility_water = "visible" if(config.water && config.water.id == '1') { if(config.water.autostate) { output = "ausschalten" visibility = "visible" + visibility_water = "hidden" document.getElementById("water_on_one").value = config.water.times[0].on_time; document.getElementById("water_off_one").value = config.water.times[0].off_time; document.getElementById("water_on_two").value = config.water.times[1].on_time; document.getElementById("water_off_two").value = config.water.times[1].off_time; } + document.getElementById("water_switch_label").style.visibility = visibility_water + document.getElementById("water_switch").style.visibility = visibility_water document.getElementById("water_auto_switch").value = output; document.getElementById("water_times").style.visibility = visibility } diff --git a/greenhouseui/templates/index.html b/greenhouseui/templates/index.html index 82f76c9..5f5b6cf 100644 --- a/greenhouseui/templates/index.html +++ b/greenhouseui/templates/index.html @@ -28,8 +28,6 @@ - -
Frostwächter @@ -65,9 +63,9 @@
- +
Bewässerung - +