admin.py 2.98 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
Gabriel Detraz's avatar
Fix #52  
Gabriel Detraz committed
30 31 32 33 34 35 36 37 38 39 40 41 42
from .models import (
    Extension,
    SOA,
    Mx,
    Ns,
    Vlan,
    Txt,
    Srv,
    Nas,
    Service,
    OuverturePort,
    OuverturePortList
)
Dalahro's avatar
Dalahro committed
43

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
44

45
class MachineAdmin(VersionAdmin):
46
    pass
Dalahro's avatar
Dalahro committed
47

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
48

chirac's avatar
chirac committed
49
class IpTypeAdmin(VersionAdmin):
50
    pass
51

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
52

chirac's avatar
chirac committed
53
class MachineTypeAdmin(VersionAdmin):
54
    pass
chirac's avatar
chirac committed
55

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
56

57 58
class VlanAdmin(VersionAdmin):
    pass
chirac's avatar
chirac committed
59

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
60

61
class ExtensionAdmin(VersionAdmin):
62
    pass
Dalahro's avatar
Dalahro committed
63

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
64

65 66 67 68
class SOAAdmin(VersionAdmin):
    pass


69
class MxAdmin(VersionAdmin):
70
    pass
71

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
72

73
class NsAdmin(VersionAdmin):
74
    pass
75

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
76

Gabriel Detraz's avatar
Gabriel Detraz committed
77
class TxtAdmin(VersionAdmin):
Gabriel Detraz's avatar
Gabriel Detraz committed
78 79
    pass

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
80

Gabriel Detraz's avatar
Fix #52  
Gabriel Detraz committed
81 82 83 84
class SrvAdmin(VersionAdmin):
    pass


85 86
class NasAdmin(VersionAdmin):
    pass
Gabriel Detraz's avatar
Gabriel Detraz committed
87

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
88

89
class IpListAdmin(VersionAdmin):
90
    pass
chirac's avatar
chirac committed
91

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
92

93 94 95
class OuverturePortAdmin(VersionAdmin):
    pass

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
96

97 98 99
class OuverturePortListAdmin(VersionAdmin):
    pass

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
100

101
class InterfaceAdmin(VersionAdmin):
chirac's avatar
chirac committed
102
    list_display = ('machine','type','mac_address','ipv4','details')
chirac's avatar
chirac committed
103

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
104

chirac's avatar
chirac committed
105 106
class DomainAdmin(VersionAdmin):
    list_display = ('interface_parent', 'name', 'extension', 'cname')
107

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
108

109
class ServiceAdmin(VersionAdmin):
110
    list_display = ('service_type', 'min_time_regen', 'regular_time_regen')
111

Gabriel Detraz's avatar
Doc  
Gabriel Detraz committed
112

Dalahro's avatar
Dalahro committed
113 114
admin.site.register(Machine, MachineAdmin)
admin.site.register(MachineType, MachineTypeAdmin)
chirac's avatar
chirac committed
115
admin.site.register(IpType, IpTypeAdmin)
116
admin.site.register(Extension, ExtensionAdmin)
117
admin.site.register(SOA, SOAAdmin)
118 119
admin.site.register(Mx, MxAdmin)
admin.site.register(Ns, NsAdmin)
Gabriel Detraz's avatar
Gabriel Detraz committed
120
admin.site.register(Txt, TxtAdmin)
Gabriel Detraz's avatar
Fix #52  
Gabriel Detraz committed
121
admin.site.register(Srv, SrvAdmin)
chirac's avatar
chirac committed
122 123
admin.site.register(IpList, IpListAdmin)
admin.site.register(Interface, InterfaceAdmin)
chirac's avatar
chirac committed
124
admin.site.register(Domain, DomainAdmin)
125
admin.site.register(Service, ServiceAdmin)
126
admin.site.register(Vlan, VlanAdmin)
127
admin.site.register(Nas, NasAdmin)
128 129 130 131
admin.site.register(OuverturePort, OuverturePortAdmin)
admin.site.register(OuverturePortList, OuverturePortListAdmin)