add ability to override frequency per plant and adjust timezone, fix missing workhour for plants

This commit is contained in:
2025-05-06 22:33:33 +02:00
parent f8274ea7a8
commit 5fe1dc8f40
10 changed files with 257 additions and 94 deletions

View File

@@ -8,9 +8,14 @@ export class TimeView {
auto_refresh: HTMLInputElement;
controller: Controller;
timer: NodeJS.Timeout | undefined;
timezoneSelect: HTMLSelectElement;
constructor(controller:Controller) {
(document.getElementById("timeview") as HTMLElement).innerHTML = require("./timeview.html")
this.timezoneSelect = document.getElementById('timezone_select') as HTMLSelectElement;
this.timezoneSelect.onchange = function(){
controller.configChanged()
}
this.auto_refresh = document.getElementById("timeview_auto_refresh") as HTMLInputElement;
this.esp_time = document.getElementById("timeview_esp_time") as HTMLDivElement;
@@ -44,4 +49,26 @@ export class TimeView {
}
}
}
timezones(timezones: string[]) {
timezones.forEach(tz => {
const option = document.createElement('option');
option.value = tz;
option.textContent = tz;
this.timezoneSelect.appendChild(option);
});
}
getTimeZone() {
return this.timezoneSelect.value;
}
setTimeZone(timezone: string | undefined) {
if (timezone != undefined) {
this.timezoneSelect.value = timezone;
} else {
this.timezoneSelect.value = "UTC";
}
}
}