mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 15:10:27 +00:00
Show the current zone type and soa-edit-api settings on the zone settings page (#1504)
This commit is contained in:
commit
db30c77584
@ -560,13 +560,17 @@ def setting(domain_name):
|
|||||||
d = Domain(name=domain_name)
|
d = Domain(name=domain_name)
|
||||||
domain_user_ids = d.get_user()
|
domain_user_ids = d.get_user()
|
||||||
account = d.get_account()
|
account = d.get_account()
|
||||||
|
domain_info = d.get_domain_info(domain_name)
|
||||||
|
|
||||||
return render_template('domain_setting.html',
|
return render_template('domain_setting.html',
|
||||||
domain=domain,
|
domain=domain,
|
||||||
users=users,
|
users=users,
|
||||||
domain_user_ids=domain_user_ids,
|
domain_user_ids=domain_user_ids,
|
||||||
accounts=accounts,
|
accounts=accounts,
|
||||||
domain_account=account)
|
domain_account=account,
|
||||||
|
zone_type=domain_info["kind"].lower(),
|
||||||
|
masters=','.join(domain_info["masters"]),
|
||||||
|
soa_edit_api=domain_info["soa_edit_api"].upper())
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
# username in right column
|
# username in right column
|
||||||
|
@ -218,15 +218,16 @@
|
|||||||
<form method="post" action="{{ url_for('domain.change_type', domain_name=domain.name) }}">
|
<form method="post" action="{{ url_for('domain.change_type', domain_name=domain.name) }}">
|
||||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
||||||
<select name="domain_type" class="form-control" style="width:15em;">
|
<select name="domain_type" class="form-control" style="width:15em;">
|
||||||
<option selected value="0">- Unchanged -</option>
|
<option value="0">- Unchanged -</option>
|
||||||
<option value="native">Native</option>
|
{% for type in ["native", "master", "slave"] %}
|
||||||
<option value="master">Primary</option>
|
<option {% if zone_type == type %}selected{% endif %} value="{{ type }}">{{ type | format_zone_type }}</option>
|
||||||
<option value="slave">Secondary</option>
|
{% endfor %}
|
||||||
</select><br/>
|
</select><br/>
|
||||||
<div class="form-group" style="display: none;" id="domain_master_address_div">
|
<div class="form-group" style="{% if zone_type != 'slave' %}display: none;{% endif %}" id="domain_master_address_div">
|
||||||
<input type="text" class="form-control" name="domain_master_address"
|
<input type="text" class="form-control" name="domain_master_address"
|
||||||
id="domain_master_address"
|
id="domain_master_address"
|
||||||
placeholder="Enter valid Primary Server IP addresses (separated by commas)">
|
placeholder="Enter valid Primary Server IP addresses (separated by commas)"
|
||||||
|
value="{{ masters }}">
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" title="Update Zone Type" class="btn btn-primary" id="change_type">
|
<button type="submit" title="Update Zone Type" class="btn btn-primary" id="change_type">
|
||||||
<i class="fa-solid fa-floppy-disk"></i> Update Zone Type
|
<i class="fa-solid fa-floppy-disk"></i> Update Zone Type
|
||||||
@ -276,10 +277,9 @@
|
|||||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
||||||
<select name="soa_edit_api" class="form-control" style="width:15em;">
|
<select name="soa_edit_api" class="form-control" style="width:15em;">
|
||||||
<option selected value="0">- Unchanged -</option>
|
<option selected value="0">- Unchanged -</option>
|
||||||
<option>DEFAULT</option>
|
{% for edit_type in ["DEFAULT", "INCREASE", "EPOCH", "OFF"] %}
|
||||||
<option>INCREASE</option>
|
<option {% if soa_edit_api == edit_type %}selected{% endif %}>{{ edit_type }}</option>
|
||||||
<option>EPOCH</option>
|
{% endfor %}
|
||||||
<option>OFF</option>
|
|
||||||
</select><br/>
|
</select><br/>
|
||||||
<button type="submit" title="Update SOA-EDIT-API" class="btn btn-primary"
|
<button type="submit" title="Update SOA-EDIT-API" class="btn btn-primary"
|
||||||
id="change_soa_edit_api">
|
id="change_soa_edit_api">
|
||||||
|
Loading…
Reference in New Issue
Block a user