from django.urls import path
from .views import DrfRequestLogViewSet, ServerInfoView, LogView, LogDetailView, index, room, video, DbBackupView, AuditlogViewSet, CeleryInfoView, RedisInfoView

API_BASE_URL = 'api/monitor/'
HTML_BASE_URL = 'dhtml/monitor/'
urlpatterns = [
    path(HTML_BASE_URL, index),
    path(HTML_BASE_URL + 'index/', index),
    path(HTML_BASE_URL + 'video/', video),
    path(HTML_BASE_URL + '<str:room_name>/', room, name='room'),

    path(API_BASE_URL + 'log/', LogView.as_view()),
    path(API_BASE_URL + 'log/<str:name>/', LogDetailView.as_view()),
    path(API_BASE_URL + 'dbbackup/', DbBackupView.as_view()),
    path(API_BASE_URL + 'server/', ServerInfoView.as_view()),
    path(API_BASE_URL + 'celery/', CeleryInfoView.as_view()),
    path(API_BASE_URL + 'redis/', RedisInfoView.as_view()),
    path(API_BASE_URL + 'request_log/',
         DrfRequestLogViewSet.as_view({'get': 'list'}), name='requestlog_view'),
    path(API_BASE_URL + 'auditlog/',
         AuditlogViewSet.as_view({'get': 'list'}), name='auditlog_view')
]
