Add adsb2dd config url for offline

This commit is contained in:
30hours 2024-02-18 01:48:50 +00:00
parent 1863403714
commit 134bbaeda0
5 changed files with 12 additions and 9 deletions

View file

@ -71,7 +71,7 @@ app.get('/api/config', (req, res) => {
});
app.get('/api/adsb2dd', (req, res) => {
if (config.truth.adsb.enabled == true) {
const api_url = "https://adsb2dd.30hours.dev/api/dd";
const api_url = "http://" + config.truth.adsb.adsb2dd + "/api/dd";
const api_query =
api_url +
"?rx=" + config.location.rx.latitude + "," +
@ -81,7 +81,7 @@ app.get('/api/adsb2dd', (req, res) => {
config.location.tx.longitude + "," +
config.location.tx.altitude +
"&fc=" + (config.capture.fc / 1000000) +
"&server=" + "http://" + config.truth.adsb.ip;
"&server=" + "http://" + config.truth.adsb.tar1090;
const jsonResponse = {
url: api_query
};

View file

@ -50,9 +50,9 @@ network:
truth:
adsb:
enabled: false
ip: 'adsb.30hours.dev'
port: 80
enabled: true
tar1090: 'adsb.30hours.dev'
adsb2dd: 'adsb2dd.30hours.dev'
ais:
enabled: false
ip: 0.0.0.0

View file

@ -55,8 +55,8 @@ network:
truth:
adsb:
enabled: false
ip: 'adsb.30hours.dev'
port: 80
tar1090: 'adsb.30hours.dev'
adsb2dd: 'adsb2dd.30hours.dev'
ais:
enabled: false
ip: 0.0.0.0

View file

@ -51,8 +51,8 @@ network:
truth:
adsb:
enabled: false
ip: 'adsb.30hours.dev'
port: 80
tar1090: 'adsb.30hours.dev'
adsb2dd: 'adsb2dd.30hours.dev'
ais:
enabled: false
ip: 0.0.0.0

View file

@ -49,6 +49,9 @@ var configData = $.getJSON(urlConfig, function () { })
var adsbLinkData = $.getJSON(urlAdsbLink, function () { })
.done(function (data) {
urlAdsb = data.url;
if (window.location.protocol === 'https:') {
urlAdsb = urlAdsb.replace(/^http:/, 'https:');
}
})
}
});