admin.py 2.88 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.

24 25
from __future__ import unicode_literals

Dalahro's avatar
Dalahro committed
26
from django.contrib import admin
27
from reversion.admin import VersionAdmin
Dalahro's avatar
Dalahro committed
28

29
from .models import IpType, Machine, MachineType, Domain, IpList, Interface
30 31
from .models import Extension, SOA, Mx, Ns, Vlan, Text, Nas, Service
from .models import OuverturePort, OuverturePortList
Dalahro's avatar
Dalahro committed
32

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
33

34
class MachineAdmin(VersionAdmin):
35
    pass
Dalahro's avatar
Dalahro committed
36

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
37

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

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
41

chirac's avatar
chirac committed
42
class MachineTypeAdmin(VersionAdmin):
43
    pass
chirac's avatar
chirac committed
44

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
45

46 47
class VlanAdmin(VersionAdmin):
    pass
chirac's avatar
chirac committed
48

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
49

50
class ExtensionAdmin(VersionAdmin):
51
    pass
Dalahro's avatar
Dalahro committed
52

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
53

54 55 56 57
class SOAAdmin(VersionAdmin):
    pass


58
class MxAdmin(VersionAdmin):
59
    pass
60

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
61

62
class NsAdmin(VersionAdmin):
63
    pass
64

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
65

Gabriel Detraz's avatar
Gabriel Detraz committed
66 67 68
class TextAdmin(VersionAdmin):
    pass

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
69

70 71
class NasAdmin(VersionAdmin):
    pass
Gabriel Detraz's avatar
Gabriel Detraz committed
72

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
73

74
class IpListAdmin(VersionAdmin):
75
    pass
chirac's avatar
chirac committed
76

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
77

78 79 80
class OuverturePortAdmin(VersionAdmin):
    pass

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
81

82 83 84
class OuverturePortListAdmin(VersionAdmin):
    pass

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
85

86
class InterfaceAdmin(VersionAdmin):
chirac's avatar
chirac committed
87
    list_display = ('machine','type','mac_address','ipv4','details')
chirac's avatar
chirac committed
88

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
89

chirac's avatar
chirac committed
90 91
class DomainAdmin(VersionAdmin):
    list_display = ('interface_parent', 'name', 'extension', 'cname')
92

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
93

94
class ServiceAdmin(VersionAdmin):
95
    list_display = ('service_type', 'min_time_regen', 'regular_time_regen')
96

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
97

Dalahro's avatar
Dalahro committed
98 99
admin.site.register(Machine, MachineAdmin)
admin.site.register(MachineType, MachineTypeAdmin)
chirac's avatar
chirac committed
100
admin.site.register(IpType, IpTypeAdmin)
101
admin.site.register(Extension, ExtensionAdmin)
102
admin.site.register(SOA, SOAAdmin)
103 104
admin.site.register(Mx, MxAdmin)
admin.site.register(Ns, NsAdmin)
Gabriel Detraz's avatar
Gabriel Detraz committed
105
admin.site.register(Text, TextAdmin)
chirac's avatar
chirac committed
106 107
admin.site.register(IpList, IpListAdmin)
admin.site.register(Interface, InterfaceAdmin)
chirac's avatar
chirac committed
108
admin.site.register(Domain, DomainAdmin)
109
admin.site.register(Service, ServiceAdmin)
110
admin.site.register(Vlan, VlanAdmin)
111
admin.site.register(Nas, NasAdmin)
112 113 114 115
admin.site.register(OuverturePort, OuverturePortAdmin)
admin.site.register(OuverturePortList, OuverturePortListAdmin)