aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMatt Kohls <mattkohls13@gmail.com>2021-04-23 23:42:42 -0400
committerMatt Kohls <mattkohls13@gmail.com>2021-04-23 23:42:42 -0400
commit437c1179b545927197637c26bb2d87d20401e5f2 (patch)
tree590e57b5dd6f0d707d8e95a7a5242bd1e892053f /templates
parent352c56375b4ec2af8f0b593b450069271bcd65e2 (diff)
downloadSensor-Server-master.tar.gz
Sensor-Server-master.tar.bz2
Sensor-Server-master.zip
Update based on what is used nowHEADmaster
Many changes, mostly to make landing page more readable Oh and a file to read a sensor attached via i2c on a Raspberry Pi and add that to the db
Diffstat (limited to 'templates')
-rw-r--r--templates/interactive.html39
-rw-r--r--templates/layout.html16
-rw-r--r--templates/show_entries.html43
3 files changed, 81 insertions, 17 deletions
diff --git a/templates/interactive.html b/templates/interactive.html
new file mode 100644
index 0000000..1756865
--- /dev/null
+++ b/templates/interactive.html
@@ -0,0 +1,39 @@
+{% extends "layout.html" %}
+{% block body %}
+ <form id="query">
+ <p>
+ <label>Location</label>
+ <select id="deviceId" name="deviceId">
+ <option value="1">Bedroom</option>
+ <option value="2">Mainfloor</option>
+ </select>
+ </p>
+ <p>
+ <label>Graph Type</label>
+ <select id="graph" name="graph">
+ <option value="htgraph.png">Humidity &amp; Temperature</option>
+ <option value="tgraph.png">Temperature</option>
+ <option value="hgraph.png">Humidity</option>
+ <option value="pgraph.png">Pressure</option>
+ <option value="bgraph.png">Battery</option>
+ </select>
+ </p>
+ <p>
+ <label>Start Date</label>
+ <input type="date" name="sd" id="sd">
+ <input type="time" name="st" id="st">
+ </p>
+ <p>
+ <label>End Date</label>
+ <input type="date" name="ed" id="ed">
+ <input type="time" name="et" id="et">
+ </p>
+ </form>
+ <button id='submit'>Submit</button>
+
+ <figure>
+ <embed id="figure" type="image/png" src="/htgraph.png?deviceId=2" />
+ </figure>
+
+ <script src="static/interactive.js"></script>
+{% endblock %}
diff --git a/templates/layout.html b/templates/layout.html
index 2a06690..a49f142 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -1,12 +1,12 @@
<!doctype html>
-<title>Weather</title>
-<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}">
+<title>Sensor</title>
+<link rel=stylesheet type=text/css href="{{ url_for('static', filename='pagedown.css') }}">
<div class=page>
- <h1>Weather</h1>
- <div class=metanav>
- </div>
- {% for message in get_flashed_messages() %}
- <div class=flash>{{ message }}</div>
- {% endfor %}
+ <h1>Sensor Readings</h1>
+ <hr>
+ <a href="bedroom">Bedroom</a> <a href="mainfloor">Mainfloor</a> <a href="interactive">Interactive</a>
+ <hr>
+ <main>
{% block body %}{% endblock %}
+ </main>
</div>
diff --git a/templates/show_entries.html b/templates/show_entries.html
index 572f360..86451df 100644
--- a/templates/show_entries.html
+++ b/templates/show_entries.html
@@ -1,19 +1,44 @@
{% extends "layout.html" %}
{% block body %}
+ <aside>
+ <b>{% if devId == 1 %}Bedroom
+ {% else %}Mainfloor
+ {% endif %}Currently:</b>
+ <ul class=current>
+ <li>{{ current.temperature }}&#176;F</li>
+ <li>{{ current.humidity }}% humidity</li>
+ </ul>
+ </aside>
<figure>
- <embed type="image/svg+xml" src="/tgraph.svg" />
+ <embed type="image/png" src="/htgraph.png?deviceId={{ devId }}" />
</figure>
<figure>
- <embed type="image/svg+xml" src="/hgraph.svg" />
+ <embed type="image/png" src="/pgraph.png?deviceId={{ devId }}" />
</figure>
+ {% if devId == 2 %}
<figure>
- <embed type="image/svg+xml" src="/pgraph.svg" />
+ <embed type="image/png" src="/bgraph.png?deviceId={{ devId }}" />
</figure>
- <ul class=weather>
- {% for entry in weather %}
- <li><h2>{{ entry.date }}</h2>Temp: {{ entry.temperature }}, Humidity: {{ entry.humidity }}, Pressure: {{ entry.pressure }}
- {% else %}
- <li><em>No entries here so far</em>
+ {% endif %}
+
+ <hr>
+ <h2>Readings from the past 24 hours</h2>
+ <p>
+ <table class=log>
+ <tr>
+ <th>Timestamp</th>
+ <th>Temperature (C)</th>
+ <th>Humidity (%)</th>
+ <th>Pressure (hPa)</th>
+ </tr>
+ {% for entry in log %}
+ <tr>
+ <td>{{ entry.date }}</td>
+ <td>{{ entry.temperature }}</td>
+ <td>{{ entry.humidity }}</td>
+ <td>{{ entry.pressure }}</td>
+ </tr>
{% endfor %}
- </ul>
+ </table>
+ </p>
{% endblock %}