admin.py 2.38 KB
Newer Older
1
# -*- mode: python; coding: utf-8 -*-
lhark's avatar
lhark committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# Re2o est un logiciel d'administration développé initiallement au rezometz. Il
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
# Copyright © 2017  Gabriel Détraz
# Copyright © 2017  Goulven Kermarec
# Copyright © 2017  Augustin Lemesle
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Dalahro's avatar
Dalahro committed
24
from django.contrib import admin
25
from reversion.admin import VersionAdmin
Dalahro's avatar
Dalahro committed
26

Gabriel Detraz's avatar
Gabriel Detraz committed
27
from .models import IpType, Machine, MachineType, Domain, IpList, Interface, Extension, Mx, Ns, Vlan, Text, Service
Dalahro's avatar
Dalahro committed
28

29
class MachineAdmin(VersionAdmin):
30
    pass
Dalahro's avatar
Dalahro committed
31

chirac's avatar
chirac committed
32
class IpTypeAdmin(VersionAdmin):
33
    pass
34

chirac's avatar
chirac committed
35
class MachineTypeAdmin(VersionAdmin):
36
    pass
chirac's avatar
chirac committed
37

38 39
class VlanAdmin(VersionAdmin):
    pass
chirac's avatar
chirac committed
40

41
class ExtensionAdmin(VersionAdmin):
42
    pass
Dalahro's avatar
Dalahro committed
43

44
class MxAdmin(VersionAdmin):
45
    pass
46 47

class NsAdmin(VersionAdmin):
48
    pass
49

Gabriel Detraz's avatar
Gabriel Detraz committed
50 51 52 53
class TextAdmin(VersionAdmin):
    pass


54
class IpListAdmin(VersionAdmin):
55
    pass
chirac's avatar
chirac committed
56

57
class InterfaceAdmin(VersionAdmin):
chirac's avatar
chirac committed
58
    list_display = ('machine','type','mac_address','ipv4','details')
chirac's avatar
chirac committed
59

chirac's avatar
chirac committed
60 61
class DomainAdmin(VersionAdmin):
    list_display = ('interface_parent', 'name', 'extension', 'cname')
62

63
class ServiceAdmin(VersionAdmin):
64
    list_display = ('service_type', 'min_time_regen', 'regular_time_regen')
65

Dalahro's avatar
Dalahro committed
66 67
admin.site.register(Machine, MachineAdmin)
admin.site.register(MachineType, MachineTypeAdmin)
chirac's avatar
chirac committed
68
admin.site.register(IpType, IpTypeAdmin)
69
admin.site.register(Extension, ExtensionAdmin)
70 71
admin.site.register(Mx, MxAdmin)
admin.site.register(Ns, NsAdmin)
Gabriel Detraz's avatar
Gabriel Detraz committed
72
admin.site.register(Text, TextAdmin)
chirac's avatar
chirac committed
73 74
admin.site.register(IpList, IpListAdmin)
admin.site.register(Interface, InterfaceAdmin)
chirac's avatar
chirac committed
75
admin.site.register(Domain, DomainAdmin)
76
admin.site.register(Service, ServiceAdmin)
77
admin.site.register(Vlan, VlanAdmin)