from django.urls import path, re_path
from django.views.generic import RedirectView, TemplateView

from . import views
from . import api 

urlpatterns = [

	path('maintenance/update', views.update, name='parc_info_update'),
	path('import/snow', views.import_snow_data, name='parc_info_import_snow'),

	#api taches
	# path('api/taches/get_list', api.taches_get_list, name='parc_info_api_taches_get_list'),
	# re_path('api/taches/edit_taches/(?P<id_tache>\d+)', api.taches_edit_info, name='parc_info_api_taches_edit_info'),

	#api switchs
	path('api/switch/get_list', api.switch_get_list, name='parc_info_api_switch_get_list'),
	re_path('api/switch/get/(?P<id>\d+)', api.switch_get_info, name='parc_info_api_switch_get_info'),
	re_path('api/switch/edit/(?P<id>\d+)', api.switch_edit_info, name='parc_info_api_switch_edit_info'),
	re_path('api/switch/edit/port/(?P<switch_id>\d+)/(?P<port_id>\d+)', api.switch_edit_port, name='parc_info_api_switch_edit_port'),
	re_path('api/switch/update/(?P<switch_id>\d+)', api.switch_update_port, name='parc_info_api_switch_update_port'),

	#api serveurs
	path('api/serveurs/get_list', api.srv_get_list, name='parc_info_api_srv_get_list'),
	re_path('api/serveurs/get_srv/(?P<id_srv>\d+)', api.srv_get_info, name='parc_info_api_srv_get_info'),
	#path('api/serveurs/add_srv', api.srv_edit_info, {'id_srv': None}, name='parc_info_api_srv_add_info'),
	re_path('api/serveurs/edit_srv/(?P<id_srv>\d+)', api.srv_edit_info, name='parc_info_api_srv_edit_info'),
	path('api/serveurs/update', api.srv_update, name='parc_info_api_srv_update'),

	#api clients
	path('api/clients/get_list', api.user_get_list, name='parc_info_api_user_get_list'),
	re_path('api/clients/get_user/(?P<id_user>\d+)', api.user_get_info, name='parc_info_api_user_get_info'),
	re_path('api/clients/get_hist/(?P<id_user>\d+)', api.user_get_hist, name='parc_info_api_user_get_hist'),
	re_path('api/clients/edit_user/(?P<id_user>\d+)', api.user_edit_info, name='parc_info_api_user_edit_info'),
	re_path('api/clients/edit_statut/(?P<id_user>\d+)', api.user_edit_statut, name='parc_info_api_user_edit_statut'),
	re_path('api/clients/novnc/(?P<cl_hostname>[a-zA-Z0-9_.,-]+)', api.user_start_novnc, name='parc_info_api_user_start_novnc'),
	path('api/client/update', api.user_update, name='parc_info_api_user_update'),

	# taches
	# path('taches', views.taches_show_list, name='parc_info_taches_show_list'),
	# re_path('taches/edit/(?P<id_tache>\d+)', views.taches_edit_info, name='parc_info_taches_edit_info'),

	# switch
	path('switch', views.switch_show_list, name='parc_info_switch_show_list'),
	re_path('switch/edit/(?P<id>\d+)', views.switch_edit_info, name='parc_info_switch_edit_info'),
	re_path('switch/edit/port/(?P<switch_id>\d+)/(?P<port_id>\d+)', views.switch_edit_port, name='parc_info_switch_edit_port'),
	re_path('switch/update/(?P<switch_id>\d+)', views.switch_update_port, name='parc_info_switch_update_port'),

	# serveurs
	path('serveurs', views.srv_show_list, name='parc_info_srv_show_list'),
	re_path('serveurs/edit/(?P<id_srv>\d+)', views.srv_edit_info, name='parc_info_srv_edit_info'),

	# client
	path('clients', views.user_show_list, name='parc_info_user_show_list'),
	re_path('clients/edit/(?P<id_user>\d+)', views.user_edit_info, name='parc_info_user_edit_info'),
	re_path('clients/edit_statut/(?P<id_user>\d+)', views.user_edit_statut, name='parc_info_user_edit_statut'),
	path('clients/enstock', views.user_show_list_en_stock, name='parc_info_user_show_list_en_stock'),
	path('clients/aprep', views.user_show_list_aprep, name='parc_info_user_show_list_aprep'),
	path('clients/deprod', views.user_show_list_deprod, name='parc_info_user_show_list_deprod'),
	path('clients/imp', views.user_show_list_imp, name='parc_info_user_show_list_imp'),
	path('clients/stat/par-services', views.stat_user_by_service, name='parc_info_stat_user_by_service'),
	path('clients/stat/without-snow', views.stat_user_without_snow, name='parc_info_stat_user_without_snow'),
	

]