mirror of
https://github.com/30hours/blah2.git
synced 2024-11-08 12:25:42 +00:00
Fix ADSB truth on ddmap
This commit is contained in:
parent
db6d9656cf
commit
e17c04af0a
2 changed files with 13 additions and 5 deletions
|
@ -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 = "http://adsb2dd.30hours.dev/api/dd";
|
||||
const api_url = "https://adsb2dd.30hours.dev/api/dd";
|
||||
const api_query =
|
||||
api_url +
|
||||
"?rx=" + config.location.rx.latitude + "," +
|
||||
|
@ -80,9 +80,12 @@ app.get('/api/adsb2dd', (req, res) => {
|
|||
"&tx=" + config.location.tx.latitude + "," +
|
||||
config.location.tx.longitude + "," +
|
||||
config.location.tx.altitude +
|
||||
"&fc=" + (config.capture.fs / 1000000) +
|
||||
"&fc=" + (config.capture.fc / 1000000) +
|
||||
"&server=" + "http://" + config.truth.adsb.ip;
|
||||
res.send(api_query);
|
||||
const jsonResponse = {
|
||||
url: api_query
|
||||
};
|
||||
res.json(jsonResponse);
|
||||
}
|
||||
else {
|
||||
res.status(400).end();
|
||||
|
|
|
@ -9,6 +9,7 @@ var range_y = [];
|
|||
var urlTimestamp;
|
||||
var urlDetection;
|
||||
var urlAdsb;
|
||||
var urlAdsbLink;
|
||||
var urlConfig;
|
||||
if (isLocalHost) {
|
||||
urlTimestamp = '//' + host + ':3000/api/timestamp';
|
||||
|
@ -26,9 +27,9 @@ if (isLocalHost) {
|
|||
urlMap = '//' + host + urlMap;
|
||||
}
|
||||
if (isLocalHost) {
|
||||
urlAdsb = '//' + host + ':3000/api/adsb2dd';
|
||||
urlAdsbLink = '//' + host + ':3000/api/adsb2dd';
|
||||
} else {
|
||||
urlAdsb = '//' + host + '/api/adsb2dd';
|
||||
urlAdsbLink = '//' + host + '/api/adsb2dd';
|
||||
}
|
||||
if (isLocalHost) {
|
||||
urlConfig = '//' + host + ':3000/api/config';
|
||||
|
@ -45,6 +46,10 @@ var configData = $.getJSON(urlConfig, function () { })
|
|||
.done(function (data_config) {
|
||||
if (data_config.truth.adsb.enabled === true) {
|
||||
isTruth = true;
|
||||
var adsbLinkData = $.getJSON(urlAdsbLink, function () { })
|
||||
.done(function (data) {
|
||||
urlAdsb = data.url;
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue