from django.contrib import admin
from django.utils.translation import gettext_lazy

from inputs.models import LogInputArmaIF, LogInput, LogInputEndpoint


class InputTypeARMAIFAdmin(admin.StackedInline):
    model = LogInputArmaIF
    can_delete = False
    verbose_name = gettext_lazy('ARMA IF log input data')


class InputTypeARMAEndpointAdmin(admin.StackedInline):
    model = LogInputEndpoint
    can_delete = False
    verbose_name = gettext_lazy('ARMA Endpoint log input data')


class InputTypeAdmin(admin.ModelAdmin):
    list_display = ('label', 'type', 'config_file_name')
    readonly_fields = ['config_file_name']
    list_display_links = ['label']
    inlines = (InputTypeARMAIFAdmin, InputTypeARMAEndpointAdmin)


admin.site.register(LogInput, InputTypeAdmin)
