Add station info
This commit is contained in:
parent
b6da7dc2ce
commit
b3c5a0bec2
@ -10,6 +10,8 @@ class Stations(db.Model):
|
|||||||
lon = db.Column(db.Integer)
|
lon = db.Column(db.Integer)
|
||||||
dwd_id = db.Column(db.String)
|
dwd_id = db.Column(db.String)
|
||||||
dwd_last_update = db.Column(db.TIMESTAMP)
|
dwd_last_update = db.Column(db.TIMESTAMP)
|
||||||
|
state = db.Column(db.String)
|
||||||
|
sea_level = db.Column(db.Integer)
|
||||||
|
|
||||||
class Climate(db.Model):
|
class Climate(db.Model):
|
||||||
__tablename__ = 'climate'
|
__tablename__ = 'climate'
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
mymap.setView([stations[0]["lat"], stations[0]["lon"]], 6);
|
mymap.setView([stations[0]["lat"], stations[0]["lon"]], 6);
|
||||||
}
|
}
|
||||||
stations.forEach((station, i, j) => {
|
stations.forEach((station, i, j) => {
|
||||||
L.marker([station["lat"], station["lon"]]).addTo(mymap).bindPopup("<h3>" + station["name"] + "</h3><a href=\"/station/" + station["dwd_id"] + "/export/\" class=\"btn btn-secondary\">Export</a> <a href=\"/station/" + station["dwd_id"] + "/\" class=\"btn btn-primary\">Info</a>");
|
L.marker([station["lat"], station["lon"]]).addTo(mymap).bindPopup("<h3>" + station["name"] + "</h3><p>" + station["state"] + "</p><a href=\"/station/" + station["dwd_id"] + "/export/\" class=\"btn btn-secondary\">Export</a> <a href=\"/station/" + station["dwd_id"] + "/\" class=\"btn btn-primary\">Info</a>");
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -20,14 +20,28 @@
|
|||||||
<div class="card-group">
|
<div class="card-group">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">Ort</h5>
|
<h5 class="card-title">Latitude</h5>
|
||||||
<p class="card-text"></p>
|
<p class="card-text">{{ station.lat }}°</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Longitude</h5>
|
||||||
|
<p class="card-text">{{ station.lon}}°</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Höhe über nn</h5>
|
||||||
|
<p class="card-text">{{ station.sea_level }}m</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-group">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">Bundesland</h5>
|
<h5 class="card-title">Bundesland</h5>
|
||||||
<p class="card-text"></p>
|
<p class="card-text">{{ station.state }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
<th>Bundesland</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -21,6 +22,7 @@
|
|||||||
{% for station in stations %}
|
{% for station in stations %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ station.name }}</td>
|
<td>{{ station.name }}</td>
|
||||||
|
<td>{{ station.state }}</td>
|
||||||
<td><a href="/station/{{ station.dwd_id }}/export/" class="btn btn-secondary">Export</a> <a href="/station/{{ station.dwd_id }}/" class="btn btn-primary">Info</a></td>
|
<td><a href="/station/{{ station.dwd_id }}/export/" class="btn btn-secondary">Export</a> <a href="/station/{{ station.dwd_id }}/" class="btn btn-primary">Info</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -156,6 +156,7 @@ def api_station():
|
|||||||
"lat": float(s.lat),
|
"lat": float(s.lat),
|
||||||
"lon": float(s.lon),
|
"lon": float(s.lon),
|
||||||
"dwd_id": str(s.dwd_id),
|
"dwd_id": str(s.dwd_id),
|
||||||
|
"state": str(s.state),
|
||||||
})
|
})
|
||||||
|
|
||||||
return jsonify(out)
|
return jsonify(out)
|
||||||
|
Loading…
Reference in New Issue
Block a user