Fix Chart.js loading and add favicon support
- Switch from chart.min.js to chart.umd.js for proper module loading - Add favicon.ico file and proper serving - Add favicon link in HTML head to prevent 404 errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
704d0d2305
commit
5c33bdacd2
3 changed files with 11 additions and 2 deletions
|
|
@ -81,8 +81,15 @@ func (s *Server) serveIndex(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) serveFavicon(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) serveFavicon(w http.ResponseWriter, r *http.Request) {
|
||||||
|
data, err := s.staticFiles.ReadFile("static/favicon.ico")
|
||||||
|
if err != nil {
|
||||||
|
w.Header().Set("Content-Type", "image/x-icon")
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "image/x-icon")
|
w.Header().Set("Content-Type", "image/x-icon")
|
||||||
w.WriteHeader(http.StatusNotFound)
|
w.Write(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) getAircraft(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) getAircraft(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
||||||
1
static/favicon.ico
Normal file
1
static/favicon.ico
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>SkyView - ADS-B Aircraft Tracker</title>
|
<title>SkyView - ADS-B Aircraft Tracker</title>
|
||||||
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
||||||
<link rel="stylesheet" href="/static/css/style.css">
|
<link rel="stylesheet" href="/static/css/style.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -96,7 +97,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.js"></script>
|
||||||
<script src="/static/js/app.js"></script>
|
<script src="/static/js/app.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue