Skip to content

Commit

Permalink
Add TAR1090 and Graphs1090 Frames
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Putt authored and Robert Putt committed Jul 4, 2024
1 parent c0e137c commit 0dbc299
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hw_diag/templates/wingbits.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ <h3 class="text-center mb-4">Wingbits Configuration</h3>
<div class="card">
<br/>
<center>
<input type="submit" class="btn btn-primary" style="width:35%;" value="Update Configuration" />
<input type="submit" class="btn btn-primary" style="width:25%;" value="Update Configuration" />
&nbsp;&nbsp;
<a href="/wingbits/tar1090" class="btn btn-secondary" style="width:25%;" />Live Map</a>
&nbsp;&nbsp;
<a href="/wingbits/graphs1090" class="btn btn-secondary" style="width:25%;" />Statistics</a>
</center>
<br />
</div>
Expand Down
24 changes: 24 additions & 0 deletions hw_diag/templates/wingbits_graph1090.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% extends 'template_hyper.html' %}

{% block title %}Wingbits - GRAPHS1090{% endblock %}

{% block body %}
<style>
.content-page {
position: relative;
margin-left: var(--ct-leftbar-width);
min-height: calc(100vh - var(--ct-topbar-height) - 2px);
padding: 0 0 0;
-webkit-transition: all .25s ease-in-out;
transition: all .25s ease-in-out;
}
footer {
bottom: -52px !important;
}
</style>
<iframe title="Graphs1090" id='frmWingbits' frameborder="0" style="overflow: hidden; height: 100vh; width: 100%;">Loading...</iframe>
<script>
var url = 'http://' + window.location.href.split('/')[2] + ':8080/graphs1090/?ts={{ now }}';
document.getElementById('frmWingbits').src = url;
</script>
{% endblock %}
24 changes: 24 additions & 0 deletions hw_diag/templates/wingbits_tar1090.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% extends 'template_hyper.html' %}

{% block title %}Wingbits - TAR1090{% endblock %}

{% block body %}
<style>
.content-page {
position: relative;
margin-left: var(--ct-leftbar-width);
min-height: calc(100vh - var(--ct-topbar-height) - 2px);
padding: 0 0 0;
-webkit-transition: all .25s ease-in-out;
transition: all .25s ease-in-out;
}
footer {
bottom: -52px !important;
}
</style>
<iframe title="TAR1090" id='frmWingbits' frameborder="0" style="overflow: hidden; height: 100vh; width: 100%;">Loading...</iframe>
<script>
var url = 'http://' + window.location.href.split('/')[2] + ':8080/tar1090/?ts={{ now }}';
document.getElementById('frmWingbits').src = url;
</script>
{% endblock %}
32 changes: 32 additions & 0 deletions hw_diag/views/wingbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,38 @@ def get_wingbits_dashboard():
)


@WINGBITS.route('/wingbits/tar1090')
@authenticate
@commercial_fleet_only
def get_wingbits_tar1090():
diagnostics = read_diagnostics_file()
claim_deeplink = claim_miner_deeplink()
now = round(time.time())

return render_template(
'wingbits_tar1090.html',
diagnostics=diagnostics,
claim_deeplink=claim_deeplink,
now=now
)


@WINGBITS.route('/wingbits/graphs1090')
@authenticate
@commercial_fleet_only
def get_wingbits_graphs1090():
diagnostics = read_diagnostics_file()
claim_deeplink = claim_miner_deeplink()
now = round(time.time())

return render_template(
'wingbits_graph1090.html',
diagnostics=diagnostics,
claim_deeplink=claim_deeplink,
now=now
)


@WINGBITS.route('/wingbits', methods=['POST'])
@authenticate
@commercial_fleet_only
Expand Down

0 comments on commit 0dbc299

Please sign in to comment.