from django.urls import path
from . import views

urlpatterns = [
    # Main dashboard
    path('', views.DashboardView.as_view(), name='nginxmon-dashboard'),

    # One-off settings (k8s pod config + paste-logs test)
    path('settings/', views.SettingsView.as_view(), name='nginxmon-settings'),

    # Alert profiles
    path('profiles/new/', views.ProfileCreateView.as_view(), name='nginxmon-profile-create'),
    path('profiles/<int:pk>/edit/', views.ProfileUpdateView.as_view(), name='nginxmon-profile-edit'),
    path('profiles/<int:pk>/delete/', views.ProfileDeleteView.as_view(), name='nginxmon-profile-delete'),
    path('profiles/<int:pk>/test-telegram/', views.TestTelegramView.as_view(), name='nginxmon-test-telegram'),

    # Manual actions
    path('actions/fetch/', views.TriggerFetchView.as_view(), name='nginxmon-fetch'),
    path('actions/detect/', views.TriggerDetectView.as_view(), name='nginxmon-detect'),
    path('alert/<int:pk>/dismiss/', views.DismissAlertView.as_view(), name='nginxmon-dismiss-alert'),
    path('ban/<int:pk>/unban/', views.UnbanIPView.as_view(), name='nginxmon-unban'),

    # Manual IP ban form
    path('actions/ip-ban/', views.IPBanView.as_view(), name='nginxmon-ip-ban'),

    # HTMX partials & APIs
    path('api/live-logs/', views.LiveLogsPartialView.as_view(), name='nginxmon-live-logs'),
    path('api/alerts/', views.AlertsPartialView.as_view(), name='nginxmon-alerts-partial'),
    path('api/chart-data/', views.ChartDataView.as_view(), name='nginxmon-chart-data'),
    path('api/ingest/', views.IngestLogsView.as_view(), name='nginxmon-ingest'),
    path('api/toggle-ingestion/', views.ToggleIngestionView.as_view(), name='nginxmon-toggle'),
    path('api/status-stream/', views.StatusStreamView.as_view(), name='nginxmon-status-stream'),
    path('api/geo-stats/', views.GeoStatsView.as_view(), name='nginxmon-geo-stats'),
]
