clean peer location on map
This commit is contained in:
parent
ceb42fac61
commit
c08fa3badd
87
web/app.py
87
web/app.py
@ -735,6 +735,54 @@ def hbnet_web_service():
|
||||
|
||||
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')
|
||||
@login_required
|
||||
def map_page():
|
||||
@ -796,43 +844,28 @@ def hbnet_web_service():
|
||||
## ''', 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='''
|
||||
<table border="1">
|
||||
<table style="width: 100px; height: 100px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td> <strong><h4>''' + l.callsign + '''</strong></h4> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table border="1">
|
||||
<td>
|
||||
<table>
|
||||
<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>
|
||||
<p><h4><a href="''' + url + '/map/' + str(l.dmr_id) + '''" target="_blank" rel="noopener"><strong>''' + l.callsign + '''</strong></a></h4></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>
|
||||
<td>''' + l.loc + '''</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
''', icon=folium.Icon(color="red", icon="record"), tooltip='<strong>' + l.callsign + '</strong>').add_to(f_map)
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
''', icon=folium.Icon(color="red", icon="record"), tooltip='<strong>' + l.callsign + '</strong>').add_to(f_map)
|
||||
content = f_map._repr_html_()
|
||||
|
||||
return render_template('map.html', markup_content = Markup(content))
|
||||
|
Loading…
Reference in New Issue
Block a user