8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-26 14:42:25 +00:00

TTL for DNAMEs

This commit is contained in:
Hugo Levy-Falk 2019-10-02 23:53:27 +02:00 committed by chirac
parent aab6fa2ba0
commit 13a06c1a67
3 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-10-02 21:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('machines', '0104_auto_20191002_2231'),
]
operations = [
migrations.AddField(
model_name='dname',
name='ttl',
field=models.PositiveIntegerField(default=172800, verbose_name='Time To Live (TTL)'),
),
]

View file

@ -915,6 +915,10 @@ class DName(RevMixin, AclMixin, models.Model):
"""A DNAME entry for the DNS.""" """A DNAME entry for the DNS."""
zone = models.ForeignKey('Extension', on_delete=models.PROTECT) zone = models.ForeignKey('Extension', on_delete=models.PROTECT)
alias = models.CharField(max_length=255) alias = models.CharField(max_length=255)
ttl = models.PositiveIntegerField(
verbose_name=_("Time To Live (TTL)"),
default=172800, # 2 days
)
class Meta: class Meta:
permissions = ( permissions = (

View file

@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr> <tr>
<th>{% trans "Target zone" %}</th> <th>{% trans "Target zone" %}</th>
<th>{% trans "Record" %}</th> <th>{% trans "Record" %}</th>
<th>{% trans "TTL" %}</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -36,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr> <tr>
<td>{{ dname.zone }}</td> <td>{{ dname.zone }}</td>
<td>{{ dname.dns_entry }}</td> <td>{{ dname.dns_entry }}</td>
<td>{{ dname.ttl }}</td>
<td class="text-right"> <td class="text-right">
{% can_edit dname %} {% can_edit dname %}
{% include 'buttons/edit.html' with href='machines:edit-dname' id=dname.id %} {% include 'buttons/edit.html' with href='machines:edit-dname' id=dname.id %}