This adds a rate limiting library and a reference to axios in order to easily and cleanly allow API accesses without exceeding the rate limits of the API provider. The way this was done might be a bit inconsistent given that for example jQuery is simply copied into this source base.
Once the app receives a callsign for a flight (and that is different from the registration - as asdbdb doesn't track 'live flight plans') it checks if there is already route information for this flight cached and if not it makes an API call to adsbdb.com to look up the origin and destination of that flight.
The code tries to be very careful not to run afoul of the rate limit of that free site - right now this is hopefully conservative enough that even people running a couple of different tar1090 instances won't get in trouble - but one can create a scenario where power users with many windows open might still end up with too many API requests.
As a workaround for people who intentionally keep many parallel instances open there is a config option to turn the route lookup off (right now it is turned on by default).
Given the feedback regarding the amount of API requests this can create, I think I may redesign this to work differently. Let's pause here for a moment while I find time to study this a bit more.
This adds a rate limiting library and a reference to axios in order to easily and cleanly allow API accesses without exceeding the rate limits of the API provider. The way this was done might be a bit inconsistent given that for example jQuery is simply copied into this source base.
Once the app receives a callsign for a flight (and that is different from the registration - as asdbdb doesn't track 'live flight plans') it checks if there is already route information for this flight cached and if not it makes an API call to adsbdb.com to look up the origin and destination of that flight.
The code tries to be very careful not to run afoul of the rate limit of that free site - right now this is hopefully conservative enough that even people running a couple of different tar1090 instances won't get in trouble - but one can create a scenario where power users with many windows open might still end up with too many API requests.
As a workaround for people who intentionally keep many parallel instances open there is a config option to turn the route lookup off (right now it is turned on by default).