2020-04-15 13:46:10 +02:00
|
|
|
from django.contrib.auth.context_processors import PermWrapper
|
|
|
|
|
|
|
|
from extras.plugins import PluginTemplateExtension
|
2020-04-19 21:28:06 +02:00
|
|
|
from . import tables
|
2020-04-15 13:46:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
# noinspection PyAbstractClass
|
|
|
|
class DNSInfo(PluginTemplateExtension):
|
|
|
|
model = 'ipam.ipaddress'
|
|
|
|
|
|
|
|
def left_page(self):
|
|
|
|
"""
|
2020-04-19 21:28:06 +02:00
|
|
|
An info-box with the status of the DNS modifications and records
|
2020-04-15 13:46:10 +02:00
|
|
|
"""
|
2020-04-19 21:28:06 +02:00
|
|
|
extra_dns_name_table = tables.PrefixTable(list(self.context['object'].extradnsname_set.all()), orderable=False)
|
|
|
|
|
|
|
|
return (
|
|
|
|
self.render('netbox_ddns/ipaddress/dns_info.html') +
|
|
|
|
self.render('netbox_ddns/ipaddress/dns_extra.html', {
|
|
|
|
'perms': PermWrapper(self.context['request'].user),
|
|
|
|
'extra_dns_name_table': extra_dns_name_table,
|
|
|
|
})
|
|
|
|
)
|
2020-04-15 13:46:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
template_extensions = [DNSInfo]
|