feat: Add real-time visitor map with IP geolocation
- Add latitude/longitude columns to visitor_logs model - Update visitor_service to fetch and store coordinates from ip-api.com - Add /admin/map-data API endpoint for map visualization - Create VisitorMap component using Leaflet/OpenStreetMap - Integrate map into visitor-stats admin page - 30-second auto-refresh with animation for new visitors - Color-coded markers (red: active, blue: recent) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Visitor tracking models for analytics
|
||||
"""
|
||||
from sqlalchemy import Column, Integer, String, DateTime, Text, Index
|
||||
from sqlalchemy import Column, Integer, String, DateTime, Text, Index, Float
|
||||
from sqlalchemy.sql import func
|
||||
from ..database import Base
|
||||
|
||||
@@ -41,6 +41,8 @@ class VisitorLog(Base):
|
||||
country_code = Column(String(5), nullable=True)
|
||||
city = Column(String(100), nullable=True)
|
||||
region = Column(String(100), nullable=True)
|
||||
latitude = Column(Float, nullable=True)
|
||||
longitude = Column(Float, nullable=True)
|
||||
|
||||
# UTM parameters
|
||||
utm_source = Column(String(100), nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user