Skip to content

Commit

Permalink
Add version info and callsign to web interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Jessop authored and Mark Jessop committed Nov 16, 2024
1 parent 6477769 commit 99e9c2a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
19 changes: 17 additions & 2 deletions rx/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@

setup_fft_plot();

$.ajax({
// Get Wenet configuration information
url: "get_config",
dataType: 'json',
async: true,
success: function(data) {
// Update the current version field.
$('#wenet-version').text("Wenet RX v" + data.version);
$('#my-callsign').text(data.callsign);
}
});

// Handle an image update.
socket.on('image_update', function(msg) {
if(document.visibilityState == "hidden"){
Expand Down Expand Up @@ -250,7 +262,7 @@
<div class="container-fluid">
<div class="row">
<div class="col-3">
<h3 class="masthead-brand">Wenet Dashboard</h3>
<h3 class="masthead-brand" id="wenet-version">Wenet RX</h3>
</div>
<div class="col-5">
<h4 class="snr-display" id="time-data"></h4>
Expand All @@ -263,7 +275,10 @@ <h4 class="snr-display" id="snr-data">SNR: 0 dB</h4>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="col-2">
<h5 id="my-callsign">N0CALL</h5>
</div>
<div class="col-4">
<h5 class="orientation-display" id="orientation-data"></h5>
</div>
<div class="col-6">
Expand Down
8 changes: 8 additions & 0 deletions rx/wenetserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ def flask_index():
""" Render main index page """
return flask.render_template('index.html')

@app.route("/get_config")
def serve_config():
""" Return Configuration Information """
global my_callsign
return json.dumps({
"version": WENET_VERSION,
"callsign": my_callsign
})

@app.route("/latest.jpg")
def serve_latest_image():
Expand Down

0 comments on commit 99e9c2a

Please sign in to comment.