mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
dynamicdns: List domains that have not had status update yet
- This can happen if a domain is added while the app is disabled. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
a660194308
commit
7e3bdfa49a
@ -240,6 +240,20 @@ def get_status():
|
|||||||
status = kvstore.get_default('dynamicdns_status', '{}')
|
status = kvstore.get_default('dynamicdns_status', '{}')
|
||||||
status = json.loads(status)
|
status = json.loads(status)
|
||||||
status.setdefault('domains', {})
|
status.setdefault('domains', {})
|
||||||
|
|
||||||
|
domains = get_config()['domains']
|
||||||
|
for domain in domains:
|
||||||
|
if domain not in status['domains']:
|
||||||
|
# No status available for newly configured domain
|
||||||
|
status['domains'][domain] = {
|
||||||
|
'domain': domain,
|
||||||
|
'result': False,
|
||||||
|
'ip_address': None,
|
||||||
|
'error_code': None,
|
||||||
|
'error_message': None,
|
||||||
|
'timestamp': 0,
|
||||||
|
}
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -40,12 +40,20 @@
|
|||||||
{{ domain.domain }}
|
{{ domain.domain }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ domain.timestamp|timesince }}</td>
|
<td>
|
||||||
|
{% if domain.timestamp %}
|
||||||
|
{{ domain.timestamp|timesince }}
|
||||||
|
{% else %}
|
||||||
|
{% trans "Not yet" %}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if domain.result %}
|
{% if domain.result %}
|
||||||
<span class="badge text-bg-success">
|
<span class="badge text-bg-success">
|
||||||
{% trans "Success" %}
|
{% trans "Success" %}
|
||||||
</span>
|
</span>
|
||||||
|
{% elif not domain.timestamp %}
|
||||||
|
-
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge text-bg-warning">
|
<span class="badge text-bg-warning">
|
||||||
{% trans "Failed" %}
|
{% trans "Failed" %}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class DynamicDNSAppView(views.AppView):
|
|||||||
|
|
||||||
# Create naive datetime object in local timezone
|
# Create naive datetime object in local timezone
|
||||||
domain['timestamp'] = datetime.datetime.fromtimestamp(
|
domain['timestamp'] = datetime.datetime.fromtimestamp(
|
||||||
domain['timestamp'])
|
domain['timestamp']) if domain['timestamp'] else None
|
||||||
domains_status[domain_name] = domain
|
domains_status[domain_name] = domain
|
||||||
if domain['error_code'] in self._error_messages:
|
if domain['error_code'] in self._error_messages:
|
||||||
domain['error_message'] = self._error_messages[
|
domain['error_message'] = self._error_messages[
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user