Use stations table on index.html.
This commit is contained in:
13
api_app.py
13
api_app.py
@ -69,6 +69,17 @@ def select_all_frames(conn):
|
||||
rows = cur.fetchall()
|
||||
return rows
|
||||
|
||||
def select_all_stations(conn):
|
||||
"""
|
||||
Query all rows in the stations table
|
||||
:param conn: the Connection object
|
||||
:return:
|
||||
"""
|
||||
cur = conn.cursor()
|
||||
cur.execute("SELECT * FROM stations ORDER BY last_heard_unix DESC")
|
||||
rows = cur.fetchall()
|
||||
return rows
|
||||
|
||||
def unique_stations(conn):
|
||||
"""
|
||||
Query all rows in the frames table
|
||||
@ -109,7 +120,7 @@ def index():
|
||||
response = json.loads(requests.get("https://digi.w1cdn.net/aprs_api/packets").text)['data']
|
||||
|
||||
# Play with function to create station list
|
||||
stations = unique_stations(get_db_connection())
|
||||
stations = select_all_stations(get_db_connection())
|
||||
|
||||
return render_template('index.html',
|
||||
station_call = config['Settings']['station_call'],
|
||||
|
Reference in New Issue
Block a user