from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt

from accounts import views
from sbc.views import InvestorPageListView
from .views import *

urlpatterns = [
    path('', include('django.contrib.auth.urls')),
    path('proxy/', include([
        path('list/', views.FifaProxyListView.as_view(), name='fifa-proxy-list'),
        # path('add_proxy_file/', views.add_proxy_file, name='add-proxy-file'),
        path('add_proxy_file/', views.FifaProxyCreateView.as_view(), name='add-proxy-file'),
        path('<pk>/delete/', views.FifaProxyDeleteView.as_view(), name='delete-fifa-proxy'),
        path('use-special-proxy/', views.FifaAccountSpecialProxyUpdateForm.as_view(), name='use-special-proxy'),
    ])),
    path('manage_mule_accounts/', views.manage_mule_accounts, name='manage-mule-accounts'),
    path('fifa_account/', include([
        path('', FifaAccountsFilterListView.as_view(), name='fifa-accounts-list'),
        path('add/', views.AddAccountsView.as_view(), name='fifa-account-add'),
        path('<slug:pk>/update/', views.FifaAccountUpdateView.as_view(), name='fifa-account-update'),
        path('log/', include([
            path('<slug:pk>/', FifaAccountLogsView.as_view(), name='fifa-account-log'),
            path('<str:email>/', FifaAccountLogsView.as_view(), name='fifa-account-log'),
        ])),
        path('change-hosts/', views.FifaAccountsChangeHosts.as_view(), name='fifa-accounts-change-hosts'),
        path('console-account-management/', views.ConsoleAccountManagementView.as_view(), name='console-account-management'),
    ])),
    path('work-error/', include([
        path('', FifaAccountWorkErrorListView.as_view(), name='fifa-account-worker-error-list'),
        path('<pk>/update/', FifaAccountDetailWorkerErrorListView.as_view(), name='fifa-account-worker-error-detail'),
        path('<pk>/solve/', solve_fifa_account_error, name='fifa-account-worker-error-solve')
    ])),
    path('mule_accounts/', include([
        path('', views.MuleAccountsListView.as_view(), name='mule-accounts-list'),
        path('create-view/', views.MuleAccountFileCreateView.as_view(), name='mule-accounts-file-create'),
        path('archive/', views.ArchiveMuleAccountView.as_view(), name='archive-mule-account'),
    ])),
    path('user/', include([
        path('', UserListView.as_view(), name='user-list-url'),
        path('<slug:user_id>/', include([
            path('permission/', UserPermissionView.as_view(), name='user-permission'),
            path('role/', UserRoleView.as_view(), name='user-role'),
            # path('profile/', UserProfileDetailView.as_view(), name='userprofile-detail'),
        ])),
    ])),
    path('player-card/', include([
        path('', PlayerCardListView.as_view(), name='player-cards-list'),
    ])),
    path('reports/', include([
        path('consoles/', ConsolesReportView.as_view(), name='consoles-report-excel'),
        path('consoles2/', ConsolesReportPart2View.as_view(), name='consoles-report-excel2'),
        path('consoles3/', ConsolesReportPart3View.as_view(), name='consoles-report-excel3'),
        path('consoles4/', ConsolesReportPart4View.as_view(), name='consoles-report-excel4'),
        path('daily-credit/', DailyCreditGeneratedReportView.as_view(), name='daily-credit-creation'),
        path('weekly-generate/', WorkerGeneration.as_view(), name='weekly-generate'),
        path('weekly-generate2/', WorkerGeneration2.as_view(), name='weekly-generate2'),
    ])),
    path('console/', include([
        path('', ConsoleListView.as_view(), name='console-list'),
        path('action_console/', ConsoleAction.as_view(), name='action-console'),
        path('investor_logs/', InvestorPageListView.as_view(), name='investor-console-logs'),
        path('<slug:pk>/update/', views.ConsoleUpdateView.as_view(), name='console-update'),
        path('power-command/', views.ConsolesPowerCommandListView.as_view(), name='console-power-command-list'),
        path('power-command-acction/', views.ConsolesPowerCommandActionView.as_view(),
             name='console-power-command-action'),
        path('console-accounts-actions', views.ConsoleAccountsActionListView.as_view(),
             name='console-accounts-actions')
    ])),
    path('pc/', include([
        path('power-command/', views.PCPowerCommandListView.as_view(), name='pc-power-command-list'),
        path('power-command-acction/', views.PCsPowerCommandActionView.as_view(), name='pc-power-command-action'),
    ])),
    path('check_verified_ip/', views.check_verified_ip),
    path('stock-map/', include([
        path('', views.StockMapView.as_view(), name='consoles-stock-map'),
        path('StocksHandler.ashx', views.StockMapStocksHandler.as_view()),
        path('AlmasDataHandler.ashx', views.StockMapAlmasDataHandler.as_view())
    ])),
    path('command_view/', views.CommandView.as_view(), name='commands-view'),
    path('pack-item/', include([
        path('', views.PackItemListView.as_view(), name='pack-item-list'),
        path('filter-chart', views.ItemPackChartReportView.as_view(), name='pack-item-filter-chart'),
    ])),
    path('get-local-timezone/', views.get_local_timezone),
    path('get-last-version/', views.get_last_version),
    path('chrome/', include([
        # path('storage/', views.get_chrome_storage),
        path('LATEST_RELEASE_<str:version>', views.get_chrome_last_version),
        path('get_version/<str:version_number>/<str:file_name>', views.get_chrome_version),
        path('<str:account_name>/get_version/<str:version_number>/<str:file_name>', views.get_chrome_version_2),
    ])),
    path('create_outlook/', include([
        path('workers/', views.OutlookCreateWorkerView.as_view(), name='create-outlook-workers'),
        # path('workers2/', views.OutlookCreateWorker2View.as_view(), name='create-outlook-workers2'),
        path('report/', views.OutlookCreateReport.as_view(), name='create-outlook-report'),
        path('has-error/<str:pk>/', views.OutlookCreateHasError.as_view(), name='create-outlook-has-error'),
    ])),
    path('sys-log/', include([
        path('<str:worker_name>/', SystemLogsView.as_view(), name='system-logs'),
    ])),
    # path('disabled-accounts/', include([
    #     path('', views.DisabledAccountListView.as_view(), name='disabled-account-list'),
    #     # path('create-view/', views.DisabledAccountListView.as_view(), name='disabled-account-create'),
    # ])),
    path('utils/', include([
        path('send-telegram-message/', csrf_exempt(SendTelegramMessageView.as_view())),
        path('redis-monitor/', RedisMonitoring.as_view(), name='redis-monitor'),
    ])),
    path('gc/', include([
        path('player-main-image/', GetPlayerMainImage.as_view()),
        path('discharge-player-max-price/', gc_discharge_player_max_price),
    ])),
    path('reza_apis/', include([
        path('log_sleeps/', pcs_sleeps)
    ])),
    path('relay-api/', include([
        path('relay-status/', views.relay_status, name='relay_status'),
        path('relay-names/', views.relay_names, name='relay_names'),
    ])),
]
