-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.html
588 lines (502 loc) · 23 KB
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
<!DOCTYPE html>
<head>
<link rel="shortcut icon" href="static/tab.ico">
<html lang="en" xml:lang="en" xmlns= "http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Language" content="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
{% if update_available == 3 %}
<script>
$(document).ready(function(){
$("#myModal").modal('show');
});
</script>
{% endif %}
<link rel="stylesheet" href='/static/style-v4.css' />
<title>{{ title }}</title>
<!-- Script to get flight category BS4 badge and raw METAR data from api.weather.gov, Works Well-->
<script>
function get_badge(ap,loc) {
var xhttp = new XMLHttpRequest();
var outp = "";
var vis_in_miles = "";
var sky_condition = "";
var sky_ceiling = "";
var flightcategory = "VFR";
var rawMessage = "";
xhttp.onreadystatechange = function() {
if (this.status == 404) {
console.log('Undefined Airport');
rawMessage = 'The Airport ID entered is Undefined. Please Check ID';
flightcategory = "UNDF";
}
if (this.readyState == 4 && this.status == 200) {
//console.log(xhttp.responseText);
obj = JSON.parse(xhttp.responseText);
rawMessage = obj.properties.rawMessage;
if (rawMessage == "") {
rawMessage = "No METAR Data Returned by FAA API. CLICK for Raw METAR";
flightcategory = "NOWX";
}
console.log(obj.properties.rawMessage);
console.log("Num of Layers "+obj.properties.cloudLayers.length);
vis_in_miles = (parseInt(obj.properties.visibility.value)*3.28084/5280).toFixed(2);
for (var i = 0; i < obj.properties.cloudLayers.length; i++) {
console.log(obj.properties.cloudLayers[i].base.value);
console.log(obj.properties.cloudLayers[i].amount);
sky_condition = obj.properties.cloudLayers[i].amount;
sky_ceiling = Math.round(obj.properties.cloudLayers[i].base.value*3.28084);
if (sky_condition=="OVC" || sky_condition=="BKN" || sky_condition=="OVX" || sky_condition=="VV") {
console.log("-->"+sky_condition);
console.log("-->"+sky_ceiling);
if (sky_ceiling < 500) {
flightcategory = "LIFR";
} else if (sky_ceiling >= 500 && sky_ceiling < 1000) {
flightcategory = "IFR";
} else if (sky_ceiling >= 1000 && sky_ceiling <= 3000) {
flightcategory = "MVFR";
} else if (sky_ceiling > 3000) {
flightcategory = "VFR";
}
if (flightcategory != "VFR") {
break;
}
}
}
if (flightcategory != "LIFR") {
if (vis_in_miles < 1) {
flightcategory = "LIFR";
} else if (vis_in_miles >= 1.0 && vis_in_miles < 3.0) {
flightcategory = "IFR";
} else if (vis_in_miles >= 3.0 && vis_in_miles <= 5.0) {
flightcategory = "MVFR";
}
}
console.log(flightcategory);
console.log("Vis = "+vis_in_miles+" miles");
}
outp = '<a href="https://www.aviationweather.gov/metar/data?ids='+ap+'&format=decoded&hours=0&taf=on&layout=on" target="_blank">';
if (flightcategory == 'VFR') {
var outp = outp + '<h6><span class="badge badge-success">';
} else if (flightcategory == 'MVFR') {
var outp = outp + '<h6><span class="badge badge-primary">';
} else if (flightcategory == 'IFR') {
var outp = outp + '<h6><span class="badge badge-danger">';
} else if (flightcategory == 'LIFR') {
var outp = outp + '<h6><span class="badge-lifr">';
} else if (flightcategory == 'NOWX') {
var outp = outp + '<h6><span class="badge-nowx">';
} else if (flightcategory == 'UNDF') {
var outp = outp + '<h6><span class="badge-undf">';
}
outp = outp + ' '+flightcategory+' </span> - '+rawMessage+'</h6></a>';
document.getElementById(loc).innerHTML = outp;
};
xhttp.open("GET", "https://api.weather.gov/stations/"+ap+"/observations/latest", true);
xhttp.send();
}
</script>
<!-- Script to grab Flight Category from www.checkwx.com. Limited number of hits per day. Must in HEAD-->
<script>
function get_fc(ap,loc) {
var xhttp = new XMLHttpRequest();
var outp = ""
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(xhttp.responseText);
obj = JSON.parse(xhttp.responseText);
if (obj.data[0].flight_category == 'VFR') {
var outp = '<a href="https://www.checkwx.com/weather/'+ap+'/metar" target="_blank"><h5><p class="badge badge-success">'
} else if (obj.data[0].flight_category == 'MVFR') {
var outp = '<a href="https://www.checkwx.com/weather/'+ap+'/metar" target="_blank"><h5><p class="badge badge-primary">'
} else if (obj.data[0].flight_category == 'IFR') {
var outp = '<a href="https://www.checkwx.com/weather/'+ap+'/metar" target="_blank"><h5><p class="badge badge-danger">'
} else if (obj.data[0].flight_category == 'LIFR') {
var outp = '<a href="https://www.checkwx.com/weather/'+ap+'/metar" target="_blank"><h5><p class="badge badge-warning">'
}
outp = outp + ' '+obj.data[0].flight_category+' </p></h5></a>'
document.getElementById(loc).innerHTML = outp
}
};
xhttp.open("GET", "https://api.checkwx.com/metar/"+ap+"/decoded", true);
xhttp.setRequestHeader('X-API-Key', '106e449c03ae4ec6af47581ff9');
xhttp.send();
}
</script>
<!-- Script to grab raw METAR data only from api.weather.gov-->
<script>
function get_raw(ap,loc) {
var xhttp = new XMLHttpRequest();
var outp = ""
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//console.log(xhttp.responseText);
obj = JSON.parse(xhttp.responseText);
console.log(obj.properties.rawMessage);
document.getElementById(loc).innerHTML = obj.properties.rawMessage
}
};
xhttp.open("GET", "https://api.weather.gov/stations/"+ap+"/observations/latest", true);
xhttp.send();
}
</script>
</head>
<!--Determine which menu items to disable based on page loaded-->
{% if title.startswith('Live') %}
{% set enable = 0 %}
{% elif title.startswith('Heat') %}
{% set enable = 1 %}
{% elif title.startswith('Airp') %}
{% set enable = 2 %}
{% elif title.startswith('Sett') %}
{% set enable = 3 %}
{% elif title.startswith('Time') %}
{% set enable = 4 %}
{% else %}
{% set enable = 5 %}
{% endif %}
{% if enable != 2 %}
<body>
{% else %}
<body onload="scrollto()">
{% endif %}
<nav class="navbar navbar-expand-md bg-dark navbar-dark fixed-top">
<a class="navbar-brand" href="/index">
<img src="/static/LS-32x32.png" width="32" height="32" class="d-inline-block align-top" alt="">
{{ title }}
</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#myNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Settings</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="/confedit">Editor <i class='far fa-edit'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/index">Load Profile <i class='fas fa-home'></i></a>
<a class="dropdown-item {% if enable != 3 %} {{ 'disabled' }} {% endif %}" href="/restoreconf">Restore Settings from File <i class='far fa-window-restore'></i></a>
<a class="dropdown-item {% if enable != 3 %} {{ 'disabled' }} {% endif %}" href="javascript:{}" onclick="document.getElementById('post').submit(); return false;">Save Config File <i class='far fa-save'></i></a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Airports</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="/apedit">Editor <i class='far fa-edit'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://www.rocketroute.com/airports" target="aplookup">Lookup Airports <i class='fas fa-external-link-alt'></i></a>
<a class="dropdown-item {% if enable != 2 %} {{ 'disabled' }} {% endif %}" href="/apedit">Restore Airports from File<i class='far fa-window-restore'></i></a>
<a class="dropdown-item {% if enable != 2 %} {{ 'disabled' }} {% endif %}" href="javascript:{}" onclick="document.getElementById('appost').submit(); return false;">Save Airport File <i class='far fa-save'></i></a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Heat Map</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="/hmedit">Editor <i class='far fa-edit'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item {% if enable != 1 %} {{ 'disabled' }} {% endif %}" href="javascript:{}" onclick="document.getElementById('hmpost').submit(); return false;">Save Heat Map File <i class='far fa-save'></i></a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Map Functions</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="javascript:{}" onclick="document.getElementById('startup1').submit(); return false;">Turn On Map <i class='far fa-sun'></i></a>
<a class="dropdown-item" href="javascript:{}" onclick="document.getElementById('shutdown1').submit(); return false;">Turn Off Map <i class='fas fa-sun'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="javascript:{}" onclick="document.getElementById('reboot1').submit(); return false;">Reboot RPI <i class='fas fa-laptop'></i></a>
<a class="dropdown-item" href="javascript:{}" onclick="document.getElementById('shutoffnow1').submit(); return false;">Shutdown RPI <i class='fas fa-power-off'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/led_map" target="_blank">Map Layout <i class='far fa-map'></i></a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Map Utilities</a>
<div class="dropdown-menu">
{% if update_available == 1 %}
<a class="dropdown-item" href="/update_page"><b>Click to Update to v{{ update_vers }}</b> <i class='far fa-check-square'></i></a>
{% endif %}
{% if update_available == 2 %}
<a class="dropdown-item" href="https://www.livesectional.com/downloads/" target="_blank"><b>Click to Download Latest Image</b> <i class='far fa-check-square'></i></a>
{% endif %}
<a class="dropdown-item" href="/index">Homepage <i class='fas fa-home'></i></a>
<a class="dropdown-item" href="/tzset">Set RPI Timezone <i class='far fa-clock'></i></a>
<a class="dropdown-item" href="/expandfs">Expand RPI File System <i class='fas fa-expand-alt'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="javascript:{}" onclick="document.getElementById('download_cf').submit(); return false;">Download Config File <i class='fas fa-download'></i></a>
<a class="dropdown-item" href="javascript:{}" onclick="document.getElementById('download_ap').submit(); return false;">Download Airports File <i class='fas fa-download'></i></a>
<a class="dropdown-item" href="javascript:{}" onclick="document.getElementById('download_hm').submit(); return false;">Download Heat Map File <i class='fas fa-download'></i></a>
<a class="dropdown-item" href="javascript:{}" onclick="document.getElementById('download_log').submit(); return false;">Download Logfile <i class='fas fa-download'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/testled">Run LED Test Script <i class='fas fa-cogs'></i></a>
<a class="dropdown-item" href="/testoled">Run OLED Test Script <i class='fas fa-cogs'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/lsremote" target="qrcode">Web Remote App <i class='fab fa-app-store'></i></a>
<a class="dropdown-item" href="/qrcode" target="qrcode">Create QR Code for Web Remote <i class='fas fa-qrcode'></i></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/test_for_update">Check for Update <i class='fa fa-check-circle'></i></a>
<a class="dropdown-item" href="/open_console" target="open_console">Display Console Output <i class='fas fa-tablet-alt'></i></a>
<a class="dropdown-item" href="/stream_log" target="stream_log">Display Log File <i class='fab fa-wpforms'></i></a>
<a class="dropdown-item" href="/yield" target="lssysinfo">System Information <i class='fas fa-code'></i></a>
<a class="dropdown-item" href="/update_info">Update History <i class='fa fa-history'></i></a>
<a class="dropdown-item" href="https://www.livesectional.com/community/ls-schematics/" target="_blank">View Schematics <i class='fas fa-external-link-alt'></i></a>
<a class="dropdown-item" href="http://www.livesectional.com/community/main-forum/" target="_blank">Help <i class='fas fa-external-link-alt'></i></a>
</div>
</li>
{% if machines|length > 1 %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Local Machines</a>
<div class="dropdown-menu">
{% for i in range(machines|length) %}
{% set ip_add = machines[i].split(' ') %}
<a class="dropdown-item" href="http://{{ ip_add[0] }}:5000" target="_blank">{{ machines[i] }} <i class='fas fa-external-link-alt'></i></a>
{% endfor %}
</div>
</li>
{% endif %}
<!-- <li class="nav-item">
<a class="nav-link" href="http://www.livesectional.com/community/main-forum/" target="_blank">Help</a>
</li>
-->
</ul>
<a class="navbar-brand" href="/lsremote" target="_blank">
<img src="/static/lsremotefav.png" width="32" height="32" class="d-inline-block align-top" alt="">
Web Remote
</a>
<span class="navbar-text" title='{{ current_timezone }}' style="font-size:x-small">
{{ ipadd }}<br>
{{ timestr }}
</span>
</div>
</nav>
{% if enable != 0 %}
<div>
<h1> </h1>
{% if ipaddresses|length > 1 %}
<form>
<select name="option_ip" onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">
{% for ip in ipaddresses %}
{% set ipinfo = ip.split(' ') %}
<option value="http://{{ ipinfo[0] }}:5000/lsremote" {{"selected" if ipinfo[0] == ipadd else "" }}>{{ ip }}</option>
{% endfor %}
</select>
</form>
{% endif %}
</div>
{% endif %}
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Software Update Available</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Version {{ update_vers }} is available for installation. Click on 'Map Utilities' to update.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!--This ends the Header/Navbar and starts the main page-->
{% block content %}{% endblock %}
<!--This ends main page and starts the footer-->
{% if enable != 0 %}<div class="stickydn">{% else %}<div>{% endif %}
<table>
<tr>
<td class="submitbuttons"><input type="submit" class="button" value="Save Settings"><!-- style="display: none;>-->
</td>
</form>
<form action="apedit" method="POST">
<td class="submitbuttons"> <input type="submit" class="button" value="Edit Airports">
</td>
</form>
<form action="reboot1" id="reboot1" method="POST">
<td class="submitbuttons"><input type="submit" class="button" value="Reboot Map">
</td>
</form>
<form action="shutoffnow1" id="shutoffnow1" method="POST">
<td class="submitbuttons"><input type="submit" class="button" value="Shutdown RPI">
</td>
</form>
<form action="shutdown1" id="shutdown1" method="POST">
<td class="submitbuttons"> <input type="submit" class="button" value="Shutoff Map">
</td>
</form>
<form action="startup1" id="startup1" method="POST">
<td class="submitbuttons"> <input type="submit" class="button" value="Startup Map">
</td>
</form>
</tr>
<tr>
<td class="submitbuttons"><a href="http://www.livesectional.com/community/main-forum/" target="_blank">
<input type="button" class="button" value="Help"></a>
</td>
<form action="download_cf" id="download_cf" method="POST">
<td class="submitbuttons"><input type="submit" class="button" value="DL config.py">
</td>
</form>
<form action="download_ap" id="download_ap" method="POST">
<td class="submitbuttons"><input type="submit" class="button" value="DL Airports">
</td>
</form>
<form action="download_hm" id="download_hm" method="POST">
<td class="submitbuttons"><input type="submit" class="button" value="DL HM file">
</td>
</form>
<form action="download_log" id="download_log" method="POST">
<td class="submitbuttons"><input type="submit" class="button" value="DL Logfile">
</td>
</form>
<td>
<a></a>
</td>
</tr>
<tr>
<td colspan="6">
<center>
<span style="font-size:12px">
Copyright 2021, 2022 - Bill Bryson III, Mark Harris - <a href="http://www.livesectional.com" target="_blank">www.livesectional.com</a>
</span>
</center>
</td>
</tr>
</table>
</div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.maxHeight){
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
}
</script>
<script>
const $dropdown = $(".dropdown");
const $dropdownToggle = $(".dropdown-toggle");
const $dropdownMenu = $(".dropdown-menu");
const showClass = "show";
$(window).on("load resize", function() {
if (this.matchMedia("(min-width: 768px)").matches) {
$dropdown.hover(
function() {
const $this = $(this);
$this.addClass(showClass);
$this.find($dropdownToggle).attr("aria-expanded", "true");
$this.find($dropdownMenu).addClass(showClass);
},
function() {
const $this = $(this);
$this.removeClass(showClass);
$this.find($dropdownToggle).attr("aria-expanded", "false");
$this.find($dropdownMenu).removeClass(showClass);
}
);
} else {
$dropdown.off("mouseenter mouseleave");
}
});
</script>
<script>
function myFunction(selectObject) {
var myString = selectObject.name;
myArray = myString.split("/");
num = myArray[0]
name = myArray[1];
field = myArray[2];
var x = selectObject.value;
if (x.length != 4) {
window.alert("You Must Enter 4 Char Airport ID, NULL or LGND");
document.getElementById(name).focus();
return;
}
if (x == 'NULL') {
document.getElementById(field).innerHTML = "LED will be turned off, set to: " + x;
} else if (x == 'LGND') {
document.getElementById(field).innerHTML = "LED will be used as a Legend, set to; " + x;
} else {
document.getElementById(field).innerHTML = "<a href=https://nfdc.faa.gov/nfdcApps/services/ajv5/airportDisplay.jsp?airportId="+x+" target="+"_blank"+">You entered: "+x+". Click for more info.</a>";
}
document.getElementsByName("lednum")[0].value = num;
// document.forms["ledonoff"].submit();//
}
</script>
<script>
function checkBlankF(selectObject){
var myString = selectObject.name;
console.log(myString);
var x = selectObject.value;
console.log(x);
if (x.length == 0) {
window.alert("You Must Enter a Value.\n It cannot be left blank.");
if (myString == 'rev_rgb_grb') {
selectObject.value = "[]";
} else if (myString == 'exclusive_list') {
selectObject.value = "[]";
} else if (myString == 'welcome') {
selectObject.value = '"Welcome to LiveSectional V4"';
} else if (myString == 'morse_msg') {
selectObject.value = '"LiveSectional"';
} else {
selectObject.value = 0;
}
return;
}
}
</script>
<script>
function upperCaseF(a){
setTimeout(function(){
a.value = a.value.toUpperCase();
}, 1);
}
</script>
<script>
function scrollto() {
var elmnt = document.getElementById("{{ num-5 }}");
elmnt.scrollIntoView();
}
</script>
<script>
function fillinledonoff(selectObject) {
var myString = selectObject.name;
myArray = myString.split("/");
num = myArray[0];
document.getElementsByName("lednum")[0].value = num;
}
</script>
<!--METAR Widget from https://widget.checkwx.com/ - Thanks Henry-->
<script src="https://api.checkwx.com/widget?key=106e449c03ae4ec6af47581ff9" type="text/javascript"></script>
<!--Backup click for METAR information from https://www.navlost.eu/metar/about/-->
<script>
function get_metar(ap, loc) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var result = this.responseText.substring(1, this.responseText.length-1);
var myObj = JSON.parse(result);
document.getElementById(loc).innerHTML = myObj.report;
}
};
xmlhttp.open("GET", "https://navlost.eu/api/reports/metar/"+ap+"?format=application/json", true);
xmlhttp.send();
}
</script>
</body>
</html>