Skip to content

Commit

Permalink
Merge pull request #664 from NebraLtd/add_wingbits_integration
Browse files Browse the repository at this point in the history
Add TAR1090 and Graphs1090 Frames
  • Loading branch information
shawaj authored Jul 4, 2024
2 parents 398ba6c + d822725 commit 94d9108
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 4 deletions.
14 changes: 10 additions & 4 deletions hw_diag/templates/wingbits.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<br/>
<h3 class="text-center mb-4">Wingbits Configuration</h3>
<div class="row mb-4">
<div class="col-12 col-lg-6 mb-4 mb-lg-0">
<div class="col-12 col-lg-8 mb-4 mb-lg-0">
<form action="/wingbits" method="POST">
{% if error %}
<div class="card text-center">
Expand Down Expand Up @@ -41,14 +41,20 @@ <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:20%;" value="Update Configuration" />
&nbsp;&nbsp;
<a href="/wingbits/tar1090" class="btn btn-secondary" style="width:20%;" />Live Map</a>
&nbsp;&nbsp;
<a href="/wingbits/graphs1090" class="btn btn-secondary" style="width:20%;" />Statistics</a>
&nbsp;&nbsp;
<a href="https://wingbits.com/dashboard/antennas" target="_blank" class="btn btn-secondary" style="width:20%;" />Wingbits Dashboard</a>
</center>
<br />
</div>
</form>
</div>
<div class="col-12 col-lg-6 mb-4 mb-lg-0">
<div class="card h-100 table-responsive">
<div class="col-12 col-lg-4 mb-4 mb-lg-0">
<div class="card table-responsive">
<table class="table dt-responsive nowrap m-md-2 w-auto">
<tr>
<td class="border-0"><span class="uil uil-wifi-router icon"></span> SDR Operational</td>
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] + ':8081/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] + ':8081/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 94d9108

Please sign in to comment.