From cff88b3463b60c14374aa944f76225995491025f Mon Sep 17 00:00:00 2001 From: Dvorinka Date: Fri, 20 Jun 2025 09:46:46 +0200 Subject: [PATCH] rw --- main.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.go b/main.go index 44e364f..7aa805a 100644 --- a/main.go +++ b/main.go @@ -247,6 +247,7 @@ func trackVisit(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) +// Helper function to extract OS from User-Agent // Helper function to extract OS from User-Agent func getOSFromUserAgent(userAgent string) string { if strings.Contains(userAgent, "Windows") { @@ -260,6 +261,7 @@ func getOSFromUserAgent(userAgent string) string { } } +// Get visitor stats func getVisitorStats(w http.ResponseWriter, r *http.Request) { stats, err := loadVisitorStats() if err != nil { @@ -275,6 +277,9 @@ func getVisitorStats(w http.ResponseWriter, r *http.Request) { } } +// App structure for dashboard +// Note: This is a duplicate of the struct in admin-dashboard.html +// Consider moving this to a shared package if needed in multiple files type App struct { ID string `json:"id"` Name string `json:"name"` @@ -286,6 +291,9 @@ type App struct { UpdatedAt string `json:"updated_at"` } +// Trip entry structure +// Note: This is a duplicate of the struct in admin-dashboard.html +// Consider moving this to a shared package if needed in multiple files type TripEntry struct { Name string `json:"name"` Vehicle string `json:"vehicle"` @@ -300,11 +308,17 @@ type TripEntry struct { Coordinates *GeoCoords `json:"coordinates,omitempty"` } +// Geo coordinates structure +// Note: This is a duplicate of the struct in admin-dashboard.html +// Consider moving this to a shared package if needed in multiple files type GeoCoords struct { Lat string `json:"lat"` Lng string `json:"lng"` } +// Reservation structure +// Note: This is a duplicate of the struct in admin-dashboard.html +// Consider moving this to a shared package if needed in multiple files type Reservation struct { ID string `json:"id"` DriverName string `json:"driverName"`