From 318047a89f42c166f444c38b2ef2ec5e4d711aab Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 10 Mar 2022 17:43:43 +0100 Subject: [PATCH] Revert "sdrweb: use dump1090 json dumps for adsb.html" This reverts commit b154e0017268ea849ec68dc6ddaf1aff8ee14211. --- hosts/containers/sdrweb/adsb.html | 12 ++++++------ hosts/containers/sdrweb/default.nix | 4 ++-- hosts/radiobert/readsb.nix | 15 +-------------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/hosts/containers/sdrweb/adsb.html b/hosts/containers/sdrweb/adsb.html index 3e7be5a2..47c00e74 100644 --- a/hosts/containers/sdrweb/adsb.html +++ b/hosts/containers/sdrweb/adsb.html @@ -51,7 +51,7 @@ var maxalt = 40000; /* Max altitude in the average case */ var selected = (Selected == plane.hex); - b = 0.5 + (0.5 * plane.alt_baro / maxalt); + b = 0.5 + (0.5*plane.altitude/maxalt); /* As Icon we use the plane emoji, this is a simple solution but is definitely a compromise: we expect the icon to be rotated @@ -115,10 +115,10 @@ } function fetchData() { - $.getJSON('/aircraft.json', function(data) { + $.getJSON('/data.json', function(data) { var stillhere = {} - for (var j=0; j < data.aircraft.length; j++) { - var plane = data.aircraft[j]; + for (var j=0; j < data.length; j++) { + var plane = data[j]; var marker = null; stillhere[plane.hex] = true; plane.flight = $.trim(plane.flight); @@ -157,7 +157,7 @@ Planes[plane.hex] = plane; } } - NumPlanes = data.aircraft.length; + NumPlanes = data.length; /* Remove idle planes. */ for (var p in Planes) { @@ -171,7 +171,7 @@ refreshGeneralInfo(); }).always(function() { - setTimeout(fetchData, 1000); + setTimeout(fetchData, 500); }); } diff --git a/hosts/containers/sdrweb/default.nix b/hosts/containers/sdrweb/default.nix index 700f59c6..6ca1c081 100644 --- a/hosts/containers/sdrweb/default.nix +++ b/hosts/containers/sdrweb/default.nix @@ -40,8 +40,8 @@ index index.html; charset utf-8; ''; - locations."/aircraft.json" = { - proxyPass = "http://radiobert.serv.zentralwerk.org/aircraft.json"; + locations."/data.json" = { + proxyPass = "http://${config.c3d2.hosts.radiobert.ip4}:8080/data.json"; }; }; }; diff --git a/hosts/radiobert/readsb.nix b/hosts/radiobert/readsb.nix index ccfdd19b..67fbf8b8 100644 --- a/hosts/radiobert/readsb.nix +++ b/hosts/radiobert/readsb.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, ... }: let lat = "51.081"; @@ -140,19 +140,6 @@ in { 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; [ readsb ];