File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -268,11 +268,14 @@ <h2><i class="icon-car rfloat"></i>Chase Mode</h2>
268
268
< div id ="prediction_settingsbox " style ="display: none " class ="flatpage ">
269
269
< div class ="slimContainer ">
270
270
< h2 > Prediction Settings</ h2 >
271
- Only use this tab if your the operator of a balloon launch.
271
+ < p id ="prediction_settings_message ">
272
+ Login to configure per-payload flight path prediction parameters.
273
+ </ p >
272
274
< hr >
273
275
< div id ="update-flightdocs " style ="display: none ">
274
276
< form action ="javascript:; ">
275
277
Callsign (case sensitive):< br /> < input id ="flight_doc_payload_callsign " type ="text "> < br />
278
+ < button type ="button " onclick ="query_flight_doc() "> Query</ button > < br />
276
279
Peak altitude:< br /> < input id ="flight_doc_peak_altitude " type ="text "> < br />
277
280
Descent rate:< br /> < input id ="flight_doc_descent_rate " type ="text "> < br />
278
281
Ascent rate:< br /> < input id ="flight_doc_ascent_rate " type ="text "> < br />
Original file line number Diff line number Diff line change @@ -27,9 +27,31 @@ AWS.config.credentials.get(function(){
27
27
document . getElementById ( "login_url" ) . innerText = "Logout"
28
28
document . getElementById ( "login_url" ) . href = "javascript:logout()"
29
29
document . getElementById ( "update-flightdocs" ) . style . display = "block"
30
+ document . getElementById ( "prediction_settings_message" ) . innerText = "Use this form to configure predictions for your launch. Please only use this for your own launches. Callsigns must match your payload callsigns exactly (case sensitive)."
30
31
}
31
32
} ) ;
32
-
33
+ function query_flight_doc ( ) {
34
+ var payload_callsign = document . getElementById ( "flight_doc_payload_callsign" ) . value
35
+ fetch ( "https://api.v2.sondehub.org/amateur/flightdoc/" + payload_callsign ) . then (
36
+ function ( response ) {
37
+ if ( response . ok ) {
38
+ response . text ( ) . then ( function ( x ) {
39
+ var data = JSON . parse ( x )
40
+ if ( data . float_expected ) {
41
+ document . getElementById ( "flight_doc_float_expected" ) . checked = true
42
+ } else {
43
+ document . getElementById ( "flight_doc_float_expected" ) . checked = false
44
+ }
45
+ document . getElementById ( "flight_doc_peak_altitude" ) . value = data . peak_altitude
46
+ document . getElementById ( "flight_doc_descent_rate" ) . value = data . descent_rate
47
+ document . getElementById ( "flight_doc_ascent_rate" ) . value = data . ascent_rate
48
+ } )
49
+ } else {
50
+ document . getElementById ( "payload-update-results" ) . textContent = "Could not load payload data"
51
+ }
52
+ }
53
+ )
54
+ }
33
55
function logout ( ) {
34
56
logout_url = "https://auth.v2.sondehub.org/logout?client_id=21dpr4kth8lonk2rq803loh5oa&response_type=token&logout_uri=" + window . location . protocol + "//" + window . location . host
35
57
sessionStorage . removeItem ( "id_token" )
You can’t perform that action at this time.
0 commit comments