Mercurial > personal > weather-server
annotate weather_server/templates/location.html @ 21:beb42c835c52
Make weather server handle arbitrary data:
- Make logfile record arbitrary BSONs
- Make server handlers OK with same
- Make location type a normal class rather than attrs;
have it handle its own logger.
- Bump version number.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sat, 19 Oct 2019 18:40:48 -0400 |
parents | a7fe635d1c88 |
children | 88249e451566 |
rev | line source |
---|---|
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
1 <!doctype html> |
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
2 <html> |
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
3 <head> |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
4 <title>{{ location.name }}</title> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
5 <meta name="viewport" content="width=device-width, initial-scale=1"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
6 <link |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
7 rel="stylesheet" |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
8 href="{{ url_for('static', filename='style.css') }}"> |
20 | 9 <link |
10 rel="shortcut icon" | |
11 href="{{ url_for('static', filename='thermometer.png') }}"> | |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
12 </head> |
19
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
13 <body class="plain"> |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
14 <h1><span>{{ location.name }} conditions</span></h1> |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
15 {% if last_reading %} |
19
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
16 <p class="important" id="temp"> |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
17 <span class="key">Temperature</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
18 <span class="value"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
19 <span class="pad"> </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
20 <span class="n"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
21 {{- last_reading.temp_f|round|int -}} |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
22 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
23 <span class="unit">°F</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
24 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
25 </p> |
19
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
26 <p class="important" id="dewpoint"> |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
27 <span class="key">Dew point</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
28 <span class="value"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
29 <span class="pad"> </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
30 <span class="n"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
31 {{- last_reading.dew_point_f|round|int -}} |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
32 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
33 <span class="unit">°F</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
34 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
35 </p> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
36 <p id="timestamp"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
37 <span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
38 <span class="key">Reported</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
39 <span class="value">{{ "{:%H:%M}".format(date) }}</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
40 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
41 </p> |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
42 {% else %} |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
43 <p id="big-question-mark">?</p> |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
44 {% endif %} |
19
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
45 <script src="{{ url_for('static', filename='amd/mad.js') }}"></script> |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
46 <script>new MADRegistry().install(self);</script> |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
47 <script src="{{ url_for('static', filename='graph.js') }}"></script> |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
48 <script> |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
49 require('graph').setUp( |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
50 document.body, |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
51 document.getElementById('temp'), |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
52 document.getElementById('dewpoint')); |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
53 </script> |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
54 </body> |
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
55 </html> |