sdrweb: use dump1090 json dumps for adsb.html
This commit is contained in:
parent
6153e0c197
commit
b154e00172
|
@ -51,7 +51,7 @@
|
||||||
var maxalt = 40000; /* Max altitude in the average case */
|
var maxalt = 40000; /* Max altitude in the average case */
|
||||||
var selected = (Selected == plane.hex);
|
var selected = (Selected == plane.hex);
|
||||||
|
|
||||||
b = 0.5 + (0.5*plane.altitude/maxalt);
|
b = 0.5 + (0.5 * plane.alt_baro / maxalt);
|
||||||
|
|
||||||
/* As Icon we use the plane emoji, this is a simple solution but
|
/* As Icon we use the plane emoji, this is a simple solution but
|
||||||
is definitely a compromise: we expect the icon to be rotated
|
is definitely a compromise: we expect the icon to be rotated
|
||||||
|
@ -115,10 +115,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchData() {
|
function fetchData() {
|
||||||
$.getJSON('/data.json', function(data) {
|
$.getJSON('/aircraft.json', function(data) {
|
||||||
var stillhere = {}
|
var stillhere = {}
|
||||||
for (var j=0; j < data.length; j++) {
|
for (var j=0; j < data.aircraft.length; j++) {
|
||||||
var plane = data[j];
|
var plane = data.aircraft[j];
|
||||||
var marker = null;
|
var marker = null;
|
||||||
stillhere[plane.hex] = true;
|
stillhere[plane.hex] = true;
|
||||||
plane.flight = $.trim(plane.flight);
|
plane.flight = $.trim(plane.flight);
|
||||||
|
@ -157,7 +157,7 @@
|
||||||
Planes[plane.hex] = plane;
|
Planes[plane.hex] = plane;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NumPlanes = data.length;
|
NumPlanes = data.aircraft.length;
|
||||||
|
|
||||||
/* Remove idle planes. */
|
/* Remove idle planes. */
|
||||||
for (var p in Planes) {
|
for (var p in Planes) {
|
||||||
|
@ -171,7 +171,7 @@
|
||||||
refreshGeneralInfo();
|
refreshGeneralInfo();
|
||||||
|
|
||||||
}).always(function() {
|
}).always(function() {
|
||||||
setTimeout(fetchData, 500);
|
setTimeout(fetchData, 1000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
index index.html;
|
index index.html;
|
||||||
charset utf-8;
|
charset utf-8;
|
||||||
'';
|
'';
|
||||||
locations."/data.json" = {
|
locations."/aircraft.json" = {
|
||||||
proxyPass = "http://${config.c3d2.hosts.radiobert.ip4}:8080/data.json";
|
proxyPass = "http://radiobert.serv.zentralwerk.org/aircraft.json";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
lat = "51.081";
|
lat = "51.081";
|
||||||
|
@ -69,25 +69,6 @@ in {
|
||||||
verifyPeer = false;
|
verifyPeer = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.sbs2json = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "adsb";
|
|
||||||
};
|
|
||||||
systemd.services.sbs2json = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
requires = [ "dump1090.service" ];
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${pkgs.heliwatch.http-json}/bin/http-json";
|
|
||||||
User = "sbs2json";
|
|
||||||
Group = "adsb";
|
|
||||||
ProtectSystem = "full";
|
|
||||||
ProtectHome = true;
|
|
||||||
Restart = "always";
|
|
||||||
RestartSec = "10s";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.feed-chaos-consulting = {
|
systemd.services.feed-chaos-consulting = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
requires = [ "sbs2json.service" ];
|
requires = [ "sbs2json.service" ];
|
||||||
|
@ -136,6 +117,19 @@ in {
|
||||||
Exec "${config.services.collectd.user}" "${pkgs.heliwatch.collectd-stats}/bin/collectd-stats"
|
Exec "${config.services.collectd.user}" "${pkgs.heliwatch.collectd-stats}/bin/collectd-stats"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# serve dump1090 json data via http
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts."radiobert.serv.zentralwerk.org" = {
|
||||||
|
default = true;
|
||||||
|
root = statsDir;
|
||||||
|
extraConfig = ''
|
||||||
|
autoindex on;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.services.nginx.serviceConfig.PrivateTmp = lib.mkForce false;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
dump1090
|
dump1090
|
||||||
#dump1090_rs
|
#dump1090_rs
|
||||||
|
|
Loading…
Reference in New Issue
Block a user