mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-12-27 21:45:39 +00:00
246ad7f7d2
resolves #1358
134 lines
5.6 KiB
HTML
134 lines
5.6 KiB
HTML
{% macro applied_change_template(change_set) -%}
|
|
{{ caller() }}
|
|
{% for hist_rec_entry in change_set %}
|
|
<table id="tbl_records" class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="3">
|
|
{% if hist_rec_entry.change_type == "+" %}
|
|
<span
|
|
style="background-color: lightgreen">{{hist_rec_entry.add_rrset['name']}}
|
|
{{hist_rec_entry.add_rrset['type']}}</span>
|
|
{% elif hist_rec_entry.change_type == "-" %}
|
|
<s
|
|
style="text-decoration-color: rgba(194, 10,10, 0.6); text-decoration-thickness: 2px;">
|
|
{{hist_rec_entry.del_rrset['name']}}
|
|
{{hist_rec_entry.del_rrset['type']}}
|
|
</s>
|
|
{% else %}
|
|
{{hist_rec_entry.add_rrset['name']}}
|
|
{{hist_rec_entry.add_rrset['type']}}
|
|
{% endif %}
|
|
|
|
, TTL:
|
|
{% if "ttl" in hist_rec_entry.changed_fields %}
|
|
<s
|
|
style="text-decoration-color: rgba(194, 10,10, 0.6); text-decoration-thickness: 2px;">
|
|
{{hist_rec_entry.del_rrset['ttl']}}</s>
|
|
<span
|
|
style="background-color: lightgreen">{{hist_rec_entry.add_rrset['ttl']}}</span>
|
|
{% else %}
|
|
{{hist_rec_entry.add_rrset['ttl']}}
|
|
{% endif %}
|
|
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
|
|
<th style="width: 150px;">Status</th>
|
|
<th style="width: 400px;">Data</th>
|
|
<th style="width: 400px;">Comment</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<table>
|
|
<tbody>
|
|
{% for changes in hist_rec_entry.changeSet %}
|
|
<tr>
|
|
{% if changes[2] == "unchanged" %}
|
|
<td>{{ "Activated" if changes[0]['disabled'] ==
|
|
False else
|
|
"Disabled"}} </td>
|
|
{% elif changes[2] == "addition" %}
|
|
<td>
|
|
<span style="background-color: lightgreen">
|
|
{{ "Activated" if changes[1]['disabled'] ==
|
|
False else
|
|
"Disabled"}}
|
|
</span>
|
|
</td>
|
|
{% elif changes[2] == "status" %}
|
|
<td>
|
|
<s
|
|
style="text-decoration-color: rgba(194, 10,10, 0.6); text-decoration-thickness: 2px;">
|
|
{{ "Activated" if changes[0]['disabled'] ==
|
|
False else
|
|
"Disabled"}}</s>
|
|
<span style="background-color: lightgreen">{{
|
|
"Activated" if changes[1]['disabled'] ==
|
|
False else
|
|
"Disabled"}}</span>
|
|
</td>
|
|
{% elif changes[2] == "deletion" %}
|
|
<td>
|
|
<s
|
|
style="text-decoration-color: rgba(194, 10,10, 0.6); text-decoration-thickness: 2px;">
|
|
{{ "Activated" if changes[0]['disabled'] ==
|
|
False else
|
|
"Disabled"}}</s>
|
|
</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</td>
|
|
<td>
|
|
<table>
|
|
<tbody>
|
|
{% for changes in hist_rec_entry.changeSet %}
|
|
<tr>
|
|
{% if changes[2] == "unchanged" %}
|
|
<td style="word-break: break-all">
|
|
{{changes[0]['content']}}
|
|
</td>
|
|
{% elif changes[2] == "addition" %}
|
|
<td style="word-break: break-all">
|
|
<span style="background-color: lightgreen">
|
|
{{changes[1]['content']}}
|
|
</span>
|
|
</td>
|
|
{% elif changes[2] == "deletion" %}
|
|
<td style="word-break: break-all">
|
|
<s
|
|
style="text-decoration-color: rgba(194, 10, 10, 0.6); text-decoration-thickness: 2px;">
|
|
{{changes[0]['content']}}
|
|
</s>
|
|
</td>
|
|
{% elif changes[2] == "status" %}
|
|
<td style="word-break: break-all">
|
|
{{changes[0]['content']}}
|
|
</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
|
|
</table>
|
|
</td>
|
|
<td style="word-break: break-all">
|
|
{% for comments in hist_rec_entry.add_rrset['comments'] %}
|
|
{{comments['content'] }}
|
|
<br/>
|
|
{% endfor %}
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
{% endfor %}
|
|
{%- endmacro %}
|