This commit is contained in:
Dvorinka
2025-06-20 09:46:46 +02:00
parent 66d8d6ce5e
commit cff88b3463
+14
View File
@@ -247,6 +247,7 @@ func trackVisit(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
// Helper function to extract OS from User-Agent
// Helper function to extract OS from User-Agent // Helper function to extract OS from User-Agent
func getOSFromUserAgent(userAgent string) string { func getOSFromUserAgent(userAgent string) string {
if strings.Contains(userAgent, "Windows") { 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) { func getVisitorStats(w http.ResponseWriter, r *http.Request) {
stats, err := loadVisitorStats() stats, err := loadVisitorStats()
if err != nil { 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 { type App struct {
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
@@ -286,6 +291,9 @@ type App struct {
UpdatedAt string `json:"updated_at"` 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 { type TripEntry struct {
Name string `json:"name"` Name string `json:"name"`
Vehicle string `json:"vehicle"` Vehicle string `json:"vehicle"`
@@ -300,11 +308,17 @@ type TripEntry struct {
Coordinates *GeoCoords `json:"coordinates,omitempty"` 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 { type GeoCoords struct {
Lat string `json:"lat"` Lat string `json:"lat"`
Lng string `json:"lng"` 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 { type Reservation struct {
ID string `json:"id"` ID string `json:"id"`
DriverName string `json:"driverName"` DriverName string `json:"driverName"`