from django.contrib import admin
from .models import Proxy, Host, Client


@admin.register(Proxy)
class ProxyAdmin(admin.ModelAdmin):
    list_display = ('name', 'url', 'default')
    search_fields = ['name', 'url']


@admin.register(Host)
class HostAdmin(admin.ModelAdmin):
    list_display = ('url', 'proxy', 'client')
    empty_value_display = 'Any'
    list_filter = ['proxy', 'client']
    search_fields = ['url']


@admin.register(Client)
class ClientAdmin(admin.ModelAdmin):
    list_display = ('name', 'address')
    search_fields = ['name', 'address']
