{{ translater.getTranslation("Dashboard") }}
+ + +{{ translater.getTranslation("planed irrigationjobs") }}
++ +
+diff --git a/SystemSettings.py b/SystemSettings.py index 1891b36..211f132 100644 --- a/SystemSettings.py +++ b/SystemSettings.py @@ -1,7 +1,8 @@ class SystemSettings: - def __init__(self, dataDir="/Data", multiZoneIrrigation=False, defaultAutoIrrigationDuration=10, defaultManualIrrigationDuration=10, defaultManualOffDuration=10, webDurationOptions=[5, 10, 15, 20, 25, 30, 45, 60]): + def __init__(self, cronJobFrequency=2, dataDir="/Data", multiZoneIrrigation=False, defaultAutoIrrigationDuration=10, defaultManualIrrigationDuration=10, defaultManualOffDuration=10, webDurationOptions=[5, 10, 15, 20, 25, 30, 45, 60]): + self.cronJobFrequency = cronJobFrequency self.dataDir = dataDir self.multiZoneIrrigation = multiZoneIrrigation self.defaultAutoIrrigationDuration = defaultAutoIrrigationDuration diff --git a/Webserver/Templates/dashboard/dashboard.html b/Webserver/Templates/dashboard/dashboard.html new file mode 100644 index 0000000..18c83ec --- /dev/null +++ b/Webserver/Templates/dashboard/dashboard.html @@ -0,0 +1,82 @@ + + +
+ + ++ +
+ID | +{{ translater.getTranslation("Zone") }} | +{{ translater.getTranslation("planed duration") }} | +|
{{ job.id }} | +{{ job.zone.number|string + ": " + job.zone.name }} | +{{ ((job.duration/60)|int)|string + " " + translater.getTranslation("minutes")}} | ++ |
+ + + + | +{{ translater.getTranslation("state") }}: | ++ {{ translater.getTranslation("switched on") if zone.state else translater.getTranslation("switched off") }} + | ++ + + | ++ + | + +
+ | + | + {{translater.getTranslation("until") + zone.endTimeSetState|string}} + | ++ + | +|
+ | + | + {{translater.getTranslation("irragation is planed for") + " " + ((zone.planedDuration/60)|int)|string + " " + translater.getTranslation("minutes") + "." }} + | ++ + | +|
+
+ {{'A' if zone.autoMode else 'M'}} + + |
+ + + | +{{ translater.getTranslation("operating mode") }}: | +{{translater.getTranslation("automatic mode") if zone.autoMode else translater.getTranslation("manual mode")}} | ++ + | +
+ + + + | +{{ translater.getTranslation("actual humidity") }}: | +{{ zone.actualHumidity}} | +||
+ + | +{{ translater.getTranslation("desired humidity") }}: | +{{ zone.desiredHumidity }} | +
{{ zone.number }}
\ No newline at end of file diff --git a/Webserver/Templates/header.html b/Webserver/Templates/header.html index 9751ae0..ecb074d 100644 --- a/Webserver/Templates/header.html +++ b/Webserver/Templates/header.html @@ -14,6 +14,52 @@ var varString = 'command=' + command + '&index=' + index + '&value=' + value; send_web_request(url, messageString, varString, elementId); } + function executeActionByValueID(command, index, valueID, valueFactor){ + var value = document.getElementById(valueID).value * valueFactor; + executeAction(command, index, value); + } + + + + function switchZoneMode(autoMode, zone) { + executeAction('switch_zone_mode' ,zone, (autoMode ? 'automatic' : 'manual')); + sleep(1000).then(() => { + refreshZone(zone); + refreshPipeline(); + }); + + } + function switchZoneState(command, zone, value) { + executeAction(command, zone, value); + sleep(1000).then(() => { + refreshZone(zone); + refreshPipeline(); + }); + } + function switchZoneStateByValueID(command, zone, valueID, valueFactor) { + executeActionByValueID(command, zone, valueID, valueFactor); + sleep(1000).then(() => { + refreshZone(zone); + refreshPipeline(); + }); + } + function deleteJobsForZone(command, zone) { + executeAction(command, zone); + sleep(1000).then(() => { + refreshZone(zone); + refreshPipeline(); + }); + } + function deleteJobById(command, jobId, zone) { + executeAction(command, jobId); + sleep(1000).then(() => { + refreshZone(zone); + refreshPipeline(); + }); + } + + +setInterval(refreshContent, {{ (zoneManager.systemSettings.cronJobFrequency + 1) * 1000 }}) diff --git a/Webserver/Templates/zone.html b/Webserver/Templates/zones/zone.html similarity index 100% rename from Webserver/Templates/zone.html rename to Webserver/Templates/zones/zone.html diff --git a/Webserver/Templates/zones.html b/Webserver/Templates/zones/zones.html similarity index 100% rename from Webserver/Templates/zones.html rename to Webserver/Templates/zones/zones.html diff --git a/Webserver/__init__.py b/Webserver/__init__.py index 92e15c9..c638980 100644 --- a/Webserver/__init__.py +++ b/Webserver/__init__.py @@ -91,6 +91,8 @@ class Webserver: if (index): zone = self.zoneManager.getZone(index) return render_template('dashboard/zone.html', translater=self.translater, zoneManager=self.zoneManager, zone=zone) + case "get_dashboard_pipeline_html": + return render_template("dashboard/pipeline.html", translater=self.translater, zoneManager=self.zoneManager) case "get_zone_list": return self.zoneManager.zonesToJSON() case "get_zone_info": @@ -111,9 +113,9 @@ class Webserver: @app.route('/zones/