Skip to content

Commit

Permalink
stage2: add the missing additional aggregator links
Browse files Browse the repository at this point in the history
This creates a fairly busy UI - so there's more need to figure out how to
present this well. But at least this now matches what is available for
integrated feeders.

Also add release notes for the last few changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
  • Loading branch information
dirkhh committed May 9, 2024
1 parent 7cc8a1e commit c31224e
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 26 deletions.
3 changes: 3 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Changes since v2.0.1 include:
- stage2: add additional aggregator links to the stage2 feeder home page
- stage2: add links to dump978 for micro feeders providing UAT978 data
- stage2: add links to live traffic and stats when showing the micro feeders connected to a stage2
- stage2: allow more systems to be used as micro feeder by allowing host,port,protocol triplets - this allows for example to use a planefiner device as micro feeder
- stage2: fix bug that prevent user from updating the stage2 name
- stage2: fix rbfeeder script to grab serial from the correct log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,14 @@ def agg_status(self, agg, idx=0):
"adsbxfeederid": self._d.env_by_tags("adsbxfeederid").list_get(idx),
}
)
elif agg == "adsblol":
return json.dumps(
{
"beast": status.beast,
"mlat": status.mlat,
"adsblollink": self._d.env_by_tags("adsblol_link").list_get(idx),
}
)
return json.dumps({"beast": status.beast, "mlat": status.mlat})

@check_restart_lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,24 +265,32 @@ <h5>Additional aggregator links</h5>
<li>
<a href="https://www.adsb.lol/docs/feeders-only/introduction/">ADSB.lol feeder introduction</a>
</li>
{% for idx in ns.site_indices %}
{% if list_is_enabled("adsblol", idx) %}
<li>
{% if idx == 0 %}
<a href="https://my.adsb.lol/">personal ADSB.lol URL with the planes you are sending</a>
{% else %}
<a id="adsblol-link-{{ idx }}">{{ list_value_by_tag('site_name', idx) }} personal ADSB.lol URL</a>
{% endif %}
</li>
<li>
<a
href="https://mlat.adsb.lol/syncmap/#lat={{ list_value_by_tag('lat', 0) }}#lon={{ list_value_by_tag('lng', 0) }}#zoom=10">ADSB.lol
MLAT feeder map</a>
href="https://mlat.adsb.lol/syncmap/#lat={{ list_value_by_tag('lat', idx) }}#lon={{ list_value_by_tag('lng', idx) }}#zoom=10">ADSB.lol
MLAT feeder map for the area around {{ list_value_by_tag('site_name', idx) }}</a>
<br />
{% if is_enabled('stage2') %}
(only those of your feeders that have MLAT privacy disabled will be shown)
{% else %}
{% if list_is_enabled("mlat_privacy", 0) %}
(since you have MLAT privacy enabled, your feeder won't be shown)
{% else %}
(your feeder will be at an approximate location as {{ list_value_by_tag('site_name', 0) }})
{% endif %}
{% endif %}
</li>
{% endif %}
{% endfor %}
{% if is_enabled('stage2') %}
(on the MLAT maps only feeders that have MLAT privacy disabled will be shown)
{% else %}
{% if list_is_enabled("mlat_privacy", 0) %}
(since you have MLAT privacy enabled, your feeder won't be shown)
{% else %}
(your feeder will be at an approximate location as {{ list_value_by_tag('site_name', 0) }})
{% endif %}
{% endif %}
</ul>
</div>
<div class="col-12 {% if not ns.flightradar %}d-none{% endif %}">
Expand All @@ -291,7 +299,11 @@ <h5>Additional aggregator links</h5>
{% for idx in ns.site_indices %}
{% if list_is_enabled("flightradar", idx) %}
<li>
<a href="/fr-status{% if idx > 0 %}_{{ idx }}{% endif %}">FR24 status</a>
{% if idx == 0 %}
<a href="/fr24">FR24 status</a>
{% else %}
<a href="/fr24_{{ idx }}">{{ list_value_by_tag('site_name', idx) }} FR24 status</a>
{% endif %}
</li>
{% endif %}
{% endfor %}
Expand All @@ -300,20 +312,39 @@ <h5>Additional aggregator links</h5>
<div class="col-12 {% if not ns.planefinder %}d-none{% endif %}">
<div class="lead">PlaneFinder</div>
<ul>
{% for idx in ns.site_indices %}
{% if list_is_enabled("planefinder", idx) %}
<li>
<a href="/planefinder">Local Planefinder map</a>
{% if idx == 0 %}
<a href="/planefinder-stat">Local Planefinder map</a>
{% else %}
<a href="/planefinder-stat_{{ idx }}">{{ list_value_by_tag('site_name', idx) }} Planefinder map</a>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="col-12 {% if not ns.adsbx %}d-none{% endif %}">
<div class="lead">ADSBExchange</div>
<ul>
{% for idx in ns.site_indices %}
{% if list_is_enabled("adsbx", idx) %}
{% if idx == 0 %}
{% set s = "" %}
{% set suffix = "" %}
{% else %}
{% set s = list_value_by_tag('site_name', idx) + " " %}
{% set suffix = "_" ~ idx %}
{% endif %}
<li>
<a id="adsbxstatlink" href="">ADSBx Anywhere Stats</a>
<a id="adsbxstatlink{{suffix}}" href="">{{s}}ADSBx Anywhere Stats</a>
</li>
<li>
<a id="adsbxmaplink" href="">ADSBx Anywhere Map</a>
<a id="adsbxmaplink{{suffix}}" href="">{{s}}ADSBx Anywhere Map</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
Expand Down Expand Up @@ -391,9 +422,21 @@ <h5>Additional aggregator links</h5>
} else {
$("#" + agg + "span" + idx).addClass('text-dark')
}
if (agg == "adsblol") {
if (idx > 0) {
console.log("set adsblol-link" + idx + " to " + data["adsblollink"])
$("#adsblol-link-" + idx).attr("href", data["adsblollink"])
}
}
if (agg == "adsbx") {
$("#adsbxstatlink").attr("href", "https://www.adsbexchange.com/api/feeders/?feed=" + data["adsbxfeederid"])
$("#adsbxmaplink").attr("href", "https://globe.adsbexchange.com/?feed=" + data["adsbxfeederid"])
if (idx == 0) {
$("#adsbxstatlink").attr("href", "https://www.adsbexchange.com/api/feeders/?feed=" + data["adsbxfeederid"])
$("#adsbxmaplink").attr("href", "https://globe.adsbexchange.com/?feed=" + data["adsbxfeederid"])
} else {
console.log("set adsbxstatlink" + idx)
$("#adsbxstatlink_" + idx).attr("href", "https://www.adsbexchange.com/api/feeders/?feed=" + data["adsbxfeederid"])
$("#adsbxmaplink_" + idx).attr("href", "https://globe.adsbexchange.com/?feed=" + data["adsbxfeederid"])
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ def check(self):
if lolclients:
lolbeast = lolclients.get("beast")
lolmlat = lolclients.get("mlat")
self._beast = (
T.Yes
if isinstance(lolbeast, list)
and any(
b.get("uuid", "xxxxxxxx-xxxx-")[:14] == uuid[:14]
for b in lolbeast
)
else T.No
)
self._beast = T.No
if isinstance(lolbeast, list):
for entry in lolbeast:
if entry.get("uuid", "xxxxxxxx-xxxx-")[:14] == uuid[:14]:
self._beast = T.Yes
self._d.env_by_tags("adsblol_link").list_set(
self._idx, entry.get("adsblol_my_url")
)
break
self._mlat = (
T.Yes
if isinstance(lolmlat, list)
Expand All @@ -108,6 +108,7 @@ def check(self):
else T.No
)
self._last_check = datetime.now()

else:
print_err(f"adsblol returned status {status}")
if self._agg == "flyitaly":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def proxy_routes(self):
# Ultrafeeder config, used for all 4 types of Ultrafeeder instances
Env("FEEDER_ULTRAFEEDER_CONFIG", tags=["ultrafeeder_config"]),
Env("ADSBLOL_UUID", default=[""], tags=["adsblol_uuid"]),
Env("ADSBLOL_LINK", default=[""], tags=["adsblol_link"]),
Env("ULTRAFEEDER_UUID", default=[""], tags=["ultrafeeder_uuid"]),
Env("MLAT_PRIVACY", default=[False], tags=["mlat_privacy", "is_enabled"]),
Env(
Expand Down

0 comments on commit c31224e

Please sign in to comment.