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_Site', 'PIC_Service', 'PIC_L_Chassi_Type')
	list_filter = ('PIC_Site', 'PIC_Deg', 'PIC_with_Snow', 'PIC_L_Chassi_Type', 'PIC_L_Statut', 'PIC_Service','PIC_CPU','PIC_RAM')
	search_fields = ['PIC_Nom_netbios', 'PIC_Adresse_IP', 'PIC_Utilisateur', 'PIC_Service__SERVICE_Nom', 'PIC_Service__SERVICE_Anag','PIC_Precisions']
	exclude =('PIC_L_Service',)
	pass

@admin.register(PIC_History)
class PIC_HistoryAdmin(admin.ModelAdmin):
	list_display = ('H_PIC', 'H_Date', 'H_Commentaire')
	pass

@admin.register(PIS)
class PISAdmin(ImportExportModelAdmin):
	list_display = ('PIS_Site', 'PIS_Localisation','PIS_Nom_netbios','PIS_Friendly_Name', 'PIS_Type', 'PIS_Role', 'PIS_Adresse_IP', 'PIS_Commentaires')
	list_filter = ('PIS_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_NG','SW_Baie', 'SW_OS', 'SW_TYPE')
	search_fields = ['SW_Baie', 'SW_Nom','SW_IP', 'SW_Commentaires']
	pass

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

@admin.register(Baie)
class BaieAdmin(admin.ModelAdmin):
	list_display = ('BAIE_Site_NG', '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
