Add TFR warning banner for airspace restrictions
Fetches active Temporary Flight Restrictions from the FAA website, filters by configured state (LOCATION_STATE env var), and displays a red warning banner at the top of the dashboard when TFRs are present. Data is cached for 30 minutes and degrades gracefully if the FAA is unreachable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ type RouteHandler interface {
|
||||
GetForecast(w http.ResponseWriter, r *http.Request)
|
||||
GetHistorical(w http.ResponseWriter, r *http.Request)
|
||||
AssessConditions(w http.ResponseWriter, r *http.Request)
|
||||
GetTFRs(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
// SetupRoutes configures all API routes
|
||||
@@ -30,6 +31,11 @@ func (s *Server) SetupRoutes(handler RouteHandler) {
|
||||
r.Get("/historical", handler.GetHistorical)
|
||||
r.Post("/assess", handler.AssessConditions)
|
||||
})
|
||||
|
||||
// Airspace routes
|
||||
r.Route("/airspace", func(r chi.Router) {
|
||||
r.Get("/tfrs", handler.GetTFRs)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user