Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Matt Scott 2023-04-11 19:09:46 -04:00
commit 1081751c41
No known key found for this signature in database
GPG Key ID: A9A0AFFC0E079001
3 changed files with 16 additions and 12 deletions

View File

@ -141,7 +141,7 @@ def domains_custom(tab_id):
filtered_count = domains.count() filtered_count = domains.count()
start = int(request.args.get("start", 0)) start = int(request.args.get("start", 0))
length = min(int(request.args.get("length", 0)), 100) length = min(int(request.args.get("length", 0)), max(100, int(Setting().get('default_domain_table_size'))))
if length != -1: if length != -1:
domains = domains[start:start + length] domains = domains[start:start + length]

View File

@ -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

View File

@ -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>&nbsp;Update Zone Type <i class="fa-solid fa-floppy-disk"></i>&nbsp;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">