mirror of
https://github.com/30hours/blah2.git
synced 2024-11-18 12:33:58 +00:00
Add adsb2dd config url for offline
This commit is contained in:
parent
1863403714
commit
134bbaeda0
5 changed files with 12 additions and 9 deletions
|
@ -71,7 +71,7 @@ app.get('/api/config', (req, res) => {
|
||||||
});
|
});
|
||||||
app.get('/api/adsb2dd', (req, res) => {
|
app.get('/api/adsb2dd', (req, res) => {
|
||||||
if (config.truth.adsb.enabled == true) {
|
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 =
|
const api_query =
|
||||||
api_url +
|
api_url +
|
||||||
"?rx=" + config.location.rx.latitude + "," +
|
"?rx=" + config.location.rx.latitude + "," +
|
||||||
|
@ -81,7 +81,7 @@ app.get('/api/adsb2dd', (req, res) => {
|
||||||
config.location.tx.longitude + "," +
|
config.location.tx.longitude + "," +
|
||||||
config.location.tx.altitude +
|
config.location.tx.altitude +
|
||||||
"&fc=" + (config.capture.fc / 1000000) +
|
"&fc=" + (config.capture.fc / 1000000) +
|
||||||
"&server=" + "http://" + config.truth.adsb.ip;
|
"&server=" + "http://" + config.truth.adsb.tar1090;
|
||||||
const jsonResponse = {
|
const jsonResponse = {
|
||||||
url: api_query
|
url: api_query
|
||||||
};
|
};
|
||||||
|
|
|
@ -50,9 +50,9 @@ network:
|
||||||
|
|
||||||
truth:
|
truth:
|
||||||
adsb:
|
adsb:
|
||||||
enabled: false
|
enabled: true
|
||||||
ip: 'adsb.30hours.dev'
|
tar1090: 'adsb.30hours.dev'
|
||||||
port: 80
|
adsb2dd: 'adsb2dd.30hours.dev'
|
||||||
ais:
|
ais:
|
||||||
enabled: false
|
enabled: false
|
||||||
ip: 0.0.0.0
|
ip: 0.0.0.0
|
||||||
|
|
|
@ -55,8 +55,8 @@ network:
|
||||||
truth:
|
truth:
|
||||||
adsb:
|
adsb:
|
||||||
enabled: false
|
enabled: false
|
||||||
ip: 'adsb.30hours.dev'
|
tar1090: 'adsb.30hours.dev'
|
||||||
port: 80
|
adsb2dd: 'adsb2dd.30hours.dev'
|
||||||
ais:
|
ais:
|
||||||
enabled: false
|
enabled: false
|
||||||
ip: 0.0.0.0
|
ip: 0.0.0.0
|
||||||
|
|
|
@ -51,8 +51,8 @@ network:
|
||||||
truth:
|
truth:
|
||||||
adsb:
|
adsb:
|
||||||
enabled: false
|
enabled: false
|
||||||
ip: 'adsb.30hours.dev'
|
tar1090: 'adsb.30hours.dev'
|
||||||
port: 80
|
adsb2dd: 'adsb2dd.30hours.dev'
|
||||||
ais:
|
ais:
|
||||||
enabled: false
|
enabled: false
|
||||||
ip: 0.0.0.0
|
ip: 0.0.0.0
|
||||||
|
|
|
@ -49,6 +49,9 @@ var configData = $.getJSON(urlConfig, function () { })
|
||||||
var adsbLinkData = $.getJSON(urlAdsbLink, function () { })
|
var adsbLinkData = $.getJSON(urlAdsbLink, function () { })
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
urlAdsb = data.url;
|
urlAdsb = data.url;
|
||||||
|
if (window.location.protocol === 'https:') {
|
||||||
|
urlAdsb = urlAdsb.replace(/^http:/, 'https:');
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue