clean peer location on map
This commit is contained in:
parent
ceb42fac61
commit
c08fa3badd
85
web/app.py
85
web/app.py
@ -735,6 +735,54 @@ def hbnet_web_service():
|
|||||||
|
|
||||||
return render_template('flask_user_layout.html', markup_content = Markup(content))
|
return render_template('flask_user_layout.html', markup_content = Markup(content))
|
||||||
|
|
||||||
|
@app.route('/map/<dmr_id>')
|
||||||
|
@login_required
|
||||||
|
def single_peer(dmr_id):
|
||||||
|
try:
|
||||||
|
l = PeerLoc.query.filter_by(dmr_id=dmr_id).first()
|
||||||
|
|
||||||
|
content = '''
|
||||||
|
<table border="1">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td> <strong><h4>''' + l.callsign + '''</strong></h4> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table border="1">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 64.4667px;"><strong>DMR ID:</strong></td>
|
||||||
|
<td> ''' + str(l.dmr_id) + ''' </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 64.4667px;"><strong>Location:</strong></td>
|
||||||
|
<td> ''' + l.loc + ''' </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 64.4667px;"><strong>Lat, Lon:</strong></td>
|
||||||
|
<td> ''' + l.lat + ''', ''' + l.lon + ''' </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 64.4667px;"><strong>Description:</strong></td>
|
||||||
|
<td> ''' + l.comment + ''' </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 64.4667px;"><p><strong>URL:</strong></p>
|
||||||
|
</td>
|
||||||
|
<td><a href="''' + l.url + '''"> ''' + l.url + ''' </a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 64.4667px;"><strong>Device:</strong></td>
|
||||||
|
<td> ''' + l.software + ''' </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
'''
|
||||||
|
except:
|
||||||
|
content = 'No peer found.'
|
||||||
|
return render_template('single_map_peer.html', markup_content = Markup(content))
|
||||||
|
|
||||||
@app.route('/map')
|
@app.route('/map')
|
||||||
@login_required
|
@login_required
|
||||||
def map_page():
|
def map_page():
|
||||||
@ -796,42 +844,27 @@ def hbnet_web_service():
|
|||||||
## ''', icon=folium.Icon(color="red", icon="record"), tooltip='<strong>' + l[1][0] + '</strong>').add_to(f_map)
|
## ''', icon=folium.Icon(color="red", icon="record"), tooltip='<strong>' + l[1][0] + '</strong>').add_to(f_map)
|
||||||
|
|
||||||
folium.Marker([float(l.lat), float(l.lon)], popup='''
|
folium.Marker([float(l.lat), float(l.lon)], popup='''
|
||||||
<table border="1">
|
<table style="width: 100px; height: 100px;">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td> <strong><h4>''' + l.callsign + '''</strong></h4> </td>
|
<td>
|
||||||
</tr>
|
<table>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<table border="1">
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 64.4667px;"><strong>DMR ID:</strong></td>
|
<td>
|
||||||
<td> ''' + str(l.dmr_id) + ''' </td>
|
<p><h4><a href="''' + url + '/map/' + str(l.dmr_id) + '''" target="_blank" rel="noopener"><strong>''' + l.callsign + '''</strong></a></h4></p>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="width: 64.4667px;"><strong>Location:</strong></td>
|
|
||||||
<td> ''' + l.loc + ''' </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="width: 64.4667px;"><strong>Lat, Lon:</strong></td>
|
|
||||||
<td> ''' + l.lat + ''', ''' + l.lon + ''' </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="width: 64.4667px;"><strong>Description:</strong></td>
|
|
||||||
<td> ''' + l.comment + ''' </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="width: 64.4667px;"><p><strong>URL:</strong></p>
|
|
||||||
</td>
|
</td>
|
||||||
<td><a href="''' + l.url + '''"> ''' + l.url + ''' </a></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 64.4667px;"><strong>Device:</strong></td>
|
<td>''' + l.loc + '''</td>
|
||||||
<td> ''' + l.software + ''' </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
''', icon=folium.Icon(color="red", icon="record"), tooltip='<strong>' + l.callsign + '</strong>').add_to(f_map)
|
''', icon=folium.Icon(color="red", icon="record"), tooltip='<strong>' + l.callsign + '</strong>').add_to(f_map)
|
||||||
content = f_map._repr_html_()
|
content = f_map._repr_html_()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user