from django.conf import settings
from django.conf.urls.static import static
from django.urls import path
from .views import (
    ActionsPageView,
    AddSatellitesView,
    AddTranspondersView,
    ClusterTestView,
    ClearLyngsatCacheView,
    DeleteSelectedObjectsView,
    FillLyngsatDataView,
    GetLocationsView,
    LinkLyngsatSourcesView,
    LinkVchSigmaView,
    LoadCsvDataView,
    LoadExcelDataView,
    LyngsatDataAPIView,
    LyngsatTaskStatusAPIView,
    LyngsatTaskStatusView,
    ObjItemCreateView,
    ObjItemDeleteView,
    ObjItemDetailView,
    ObjItemListView,
    ObjItemUpdateView,
    ProcessKubsatView,
    ShowMapView,
    ShowSelectedObjectsMapView,
    ShowSourcesMapView,
    ShowSourceWithPointsMapView,
    SourceListView,
    SourceUpdateView,
    SourceDeleteView,
    SourceObjItemsAPIView,
    SigmaParameterDataAPIView,
    TransponderDataAPIView,
    UploadVchLoadView,
    custom_logout,
)

app_name = 'mainapp'

urlpatterns = [
    path('', SourceListView.as_view(), name='home'),
    path('source/<int:pk>/edit/', SourceUpdateView.as_view(), name='source_update'),
    path('source/<int:pk>/delete/', SourceDeleteView.as_view(), name='source_delete'),
    path('objitems/', ObjItemListView.as_view(), name='objitem_list'),
    path('actions/', ActionsPageView.as_view(), name='actions'),
    path('excel-data', LoadExcelDataView.as_view(), name='load_excel_data'),
    path('satellites', AddSatellitesView.as_view(), name='add_sats'),
    path('api/locations/<int:sat_id>/geojson/', GetLocationsView.as_view(), name='locations_by_id'),
    path('transponders', AddTranspondersView.as_view(), name='add_trans'),
    path('csv-data', LoadCsvDataView.as_view(), name='load_csv_data'),
    path('map-points/', ShowMapView.as_view(), name='admin_show_map'),
    path('show-selected-objects-map/', ShowSelectedObjectsMapView.as_view(), name='show_selected_objects_map'),
    path('show-sources-map/', ShowSourcesMapView.as_view(), name='show_sources_map'),
    path('show-source-with-points-map/<int:source_id>/', ShowSourceWithPointsMapView.as_view(), name='show_source_with_points_map'),
    path('delete-selected-objects/', DeleteSelectedObjectsView.as_view(), name='delete_selected_objects'),
    path('cluster/', ClusterTestView.as_view(), name='cluster'),
    path('vch-upload/', UploadVchLoadView.as_view(), name='vch_load'),
    path('vch-link/', LinkVchSigmaView.as_view(), name='link_vch_sigma'),
    path('link-lyngsat/', LinkLyngsatSourcesView.as_view(), name='link_lyngsat'),
    path('api/lyngsat/<int:lyngsat_id>/', LyngsatDataAPIView.as_view(), name='lyngsat_data_api'),
    path('api/sigma-parameter/<int:parameter_id>/', SigmaParameterDataAPIView.as_view(), name='sigma_parameter_data_api'),
    path('api/source/<int:source_id>/objitems/', SourceObjItemsAPIView.as_view(), name='source_objitems_api'),
    path('api/transponder/<int:transponder_id>/', TransponderDataAPIView.as_view(), name='transponder_data_api'),
    path('kubsat-excel/', ProcessKubsatView.as_view(), name='kubsat_excel'),
    path('object/create/', ObjItemCreateView.as_view(), name='objitem_create'),
    path('object/<int:pk>/edit/', ObjItemUpdateView.as_view(), name='objitem_update'),
    path('object/<int:pk>/', ObjItemDetailView.as_view(), name='objitem_detail'),
    path('object/<int:pk>/delete/', ObjItemDeleteView.as_view(), name='objitem_delete'),
    path('fill-lyngsat-data/', FillLyngsatDataView.as_view(), name='fill_lyngsat_data'),
    path('lyngsat-task-status/', LyngsatTaskStatusView.as_view(), name='lyngsat_task_status'),
    path('lyngsat-task-status/<str:task_id>/', LyngsatTaskStatusView.as_view(), name='lyngsat_task_status'),
    path('api/lyngsat-task-status/<str:task_id>/', LyngsatTaskStatusAPIView.as_view(), name='lyngsat_task_status_api'),
    path('clear-lyngsat-cache/', ClearLyngsatCacheView.as_view(), name='clear_lyngsat_cache'),
    path('logout/', custom_logout, name='logout'),
]