from django.contrib import admin
from import_export.admin import ImportExportModelAdmin

from .models import *

@admin.register(PIC)
class PICAdmin(ImportExportModelAdmin):
	list_display = ('PIC_Nom_netbios', 'PIC_Utilisateur', 'PIC_NUnic', 'PIC_L_Statut', 'PIC_L_Site', 'PIC_L_Service', 'PIC_L_Chassi_Type')
	list_filter = ('PIC_L_Site', 'PIC_Deg', 'PIC_with_Snow', 'PIC_L_Chassi_Type', 'PIC_L_Statut', 'PIC_L_Service','PIC_CPU','PIC_RAM')
	search_fields = ['PIC_Nom_netbios', 'PIC_Adresse_IP', 'PIC_Utilisateur', 'PIC_L_Service__SERVICE_Nom', 'PIC_L_Service__SERVICE_Anag','PIC_Precisions']
	pass

@admin.register(PIS)
class PISAdmin(ImportExportModelAdmin):
	list_display = ('PIS_L_Site', 'PIS_Localisation','PIS_Nom_netbios','PIS_Friendly_Name', 'PIS_Type', 'PIS_Role', 'PIS_Adresse_IP', 'PIS_Commentaires')
	list_filter = ('PIS_L_Site', 'PIS_Type', 'PIS_Archive', 'PIS_Role')
	search_fields = ['PIS_Nom_netbios', 'PIS_Role', 'PIS_Adresse_IP','PIS_Localisation', 'PIS_Commentaires']
	pass

@admin.register(Swich)
class SwichAdmin(ImportExportModelAdmin):
	list_display = ('SW_Baie','SW_Nom', 'SW_IP', 'SW_OS', 'SW_TYPE')
	list_filter = ('SW_Baie__BAIE_Site','SW_Baie', 'SW_OS', 'SW_TYPE')
	search_fields = ['SW_Baie', 'SW_Nom','SW_IP', 'SW_Commentaires']
	pass

@admin.register(Services)
class ServicesAdmin(admin.ModelAdmin):
	list_display = ('SERVICE_Anag', 'SERVICE_Nom')
	pass

@admin.register(Port_Link)
class Port_LinkAdmin(admin.ModelAdmin):
	list_display = ('PL_Swich', 'PL_Port', 'PL_VLAN', 'PL_Headbang_plug', 'PL_Commentaires')
	pass

@admin.register(Baie)
class BaieAdmin(admin.ModelAdmin):
	list_display = ('BAIE_Site', 'BAIE_Nom', 'BAIE_Local')
	pass

@admin.register(Accessory_Link)
class Accessory_LinkAdmin(admin.ModelAdmin):
	list_display = ('Accessory_Nom', 'Accessory_N_slugify', 'Accessory_icone', 'Accessory_on_list')
	pass

# @admin.register(Taches)
# class TachesAdmin(admin.ModelAdmin):
# 	list_display = ('Taches_Nom', 'Taches_Tech', 'Tache_Date_Cree', 'Tache_Date_Programee', 'Tache_Date_Terminee', 'Tache_Statut')
# 	pass
