Working on the first-round updates for the domain settings management view.

This commit is contained in:
Matt Scott 2023-02-19 12:46:11 -05:00
parent 6e10f97e9d
commit fd1bc4afa5

View File

@ -1,14 +1,8 @@
{% extends "base.html" %}
{% block title %}
<title>
Domain Management - {{ SITE_NAME }}
</title>
{% endblock %}
{% block title %}<title>Zone Settings - {{ SITE_NAME }}</title>{% endblock %}
{% block dashboard_stat %}
{% if status %}
{% if status %}
{% if status.get('status') == 'ok' %}
<div class="alert alert-success">
<strong>Success!</strong> {{ status.get('msg') }}
@ -24,43 +18,132 @@
{% endif %}
</div>
{% endif %}
{% endif %}
<div class="content-header">
{% endif %}
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
Domain Settings
<small>{{ domain.name | pretty_domain_name }}</small>
Zone Settings - {{ domain.name | pretty_domain_name }}
</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">Domain Settings: {{ domain.name | pretty_domain_name }}</li>
<li class="breadcrumb-item active">Zone Settings - {{ domain.name | pretty_domain_name }}</li>
</ol>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<section class="content">
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="col-12 col-sm-4">
<form method="post"
action="{{ url_for('domain.change_account', domain_name=domain.name) }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<div class="card">
<div class="card-header">
<h3 class="card-title">Change Zone Account</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="form-group">
<label for="selAccountId">Account</label>
<select id="selAccountId" name="accountid" class="form-control" style="width:15em;">
<option value="0">- No Account -</option>
{% for account in accounts %}
<option value="{{ account.id }}"
{% if domain_account.id == account.id %}selected{% endif %}>{{ account.name }}
</option>
{% endfor %}
</select>
</div>
<!-- /.form-group -->
</div>
<!-- /.card-body -->
<div class="card-footer">
<button type="submit" title="Update Account" class="btn btn-flat btn-primary"
id="change_soa_edit_api">
<i class="fa-solid fa-floppy-disk"></i>&nbsp;Update account
</button>
</div>
<!-- /.card-footer -->
</div>
<!-- /.card -->
</form>
</div>
<!-- /.col -->
<div class="col-12 col-sm-4">
<div class="card">
<div class="card-header">
<h3 class="card-title">Auto PTR creation</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="form-group">
<input type="checkbox" id="chkAutoPtr" class="auto_ptr_toggle"
{% for setting in domain.settings %}{% if setting.setting=='auto_ptr' and setting.value=='True' %}checked
{% endif %}{% endfor %}
{% if SETTING.get('auto_ptr') %}disabled="True" {% endif %}>
&nbsp;
<label for="chkAutoPtr">Allow automatic reverse pointer creation on record updates?</label>
{% if SETTING.get('auto_ptr') %}
<p><code>Auto-ptr is enabled globally on the PDA system!</code></p>
{% endif %}
</div>
<!-- /.form-group -->
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
<div class="col-12 col-sm-4">
<div class="card">
<div class="card-header">
<h3 class="card-title">DynDNS 2 Settings</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="form-group">
<input type="checkbox" id="chkDynDns" class="dyndns_on_demand_toggle"
{% for setting in domain.settings %}{% if setting.setting=='create_via_dyndns' and setting.value=='True' %}checked
{% endif %}{% endfor %}>
&nbsp;
<label for="chkDynDns">Allow on-demand creation of records via DynDNS updates?</label>
</div>
<!-- /.form-group -->
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-12 col-sm-4">
<form method="post" action="{{ url_for('domain.setting', domain_name=domain.name) }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<div class="card">
<div class="card-header">
<h3 class="card-title">Domain Access Control</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="row">
<div class="col-2">
<div class="col-12">
<p>Users on the right have access to manage the records in
the {{ domain.name | pretty_domain_name }} domain.</p>
<p>Click on users to move from between columns.</p>
@ -69,101 +152,47 @@
and already have access to <b>ALL</b> domains.
</p>
</div>
<div class="form-group col-2">
</div>
<!-- /.row -->
<div class="row">
<div class="col-12">
<div class="form-group">
<select multiple="multiple" class="form-control" id="domain_multi_user"
name="domain_multi_user[]">
{% for user in users %}
<option {% if user.id in
domain_user_ids %}selected{% endif %} value="{{ user.username }}"
{% if user.role.name== 'Administrator' %}style="color: red" {% endif %}>{{
user.username}}</option> {% endfor %}
{% if user.role.name== 'Administrator' %}style="color: red" {% endif %}>{{ user.username }}</option> {% endfor %}
</select>
</div>
<!-- /.form-group -->
</div>
<div class="card-body">
<div class="col-offset-2">
<div class="form-group">
<button type="submit" class="btn btn-primary">
<i class="fa-solid fa-check"></i>
Save
</div>
<!-- /.row -->
</div>
<!-- /.card-body -->
<div class="card-footer">
<button type="submit" title="Save Changes" class="btn btn-primary">
<i class="fa-solid fa-floppy-disk"></i>
Save Changes
</button>
</div>
<!-- /.card-footer -->
</div>
</div>
</div>
<!-- /.card -->
</form>
</div>
<!-- /.col -->
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Account</h3>
</div>
<div class="card-body">
<div class="col-12">
<div class="form-group">
<form method="post"
action="{{ url_for('domain.change_account', domain_name=domain.name) }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<select name="accountid" class="form-control" style="width:15em;">
<option value="0">- No Account -</option>
{% for account in accounts %}
<option value="{{ account.id }}"
{% if domain_account.id == account.id %}selected{% endif %}>{{ account.name }}
</option>
{% endfor %}
</select><br />
<button type="submit" class="btn btn-flat btn-primary" id="change_soa_edit_api">
<i class="fa-solid fa-check"></i>&nbsp;Change account for {{ domain.name | pretty_domain_name }}
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Auto PTR creation</h3>
</div>
<div class="card-body">
<p><input type="checkbox" id="{{ domain.name }}" class="auto_ptr_toggle"
{% for setting in domain.settings %}{% if setting.setting=='auto_ptr' and setting.value=='True' %}checked{% endif %}{% endfor %}
{% if SETTING.get('auto_ptr') %}disabled="True" {% endif %}>
&nbsp;Allow automatic reverse pointer creation on record updates?
{% if SETTING.get('auto_ptr') %}
<br/><code>Auto-ptr is enabled globally on the PDA system!</code>
{% endif %}
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">DynDNS 2 Settings</h3>
</div>
<div class="card-body">
<p><input type="checkbox" id="{{ domain.name }}" class="dyndns_on_demand_toggle"
{% for setting in domain.settings %}{% if setting.setting=='create_via_dyndns' and setting.value=='True' %}checked{% endif %}{% endfor %}>
&nbsp;Allow on-demand creation of records via DynDNS updates?</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Change Type</h3>
<h3 class="card-title">Change Zone Type</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<p>The type decides how the domain will be replicated across multiple DNS servers.</p>
<ul>
@ -172,11 +201,13 @@
PowerDNS server or you handle replication via your backend.
</li>
<li>
Primary - This PowerDNS server will serve as the primary and will send zone transfers
Primary - This PowerDNS server will serve as the primary and will send zone
transfers
(AXFRs) to other servers configured as secondaries.
</li>
<li>
Secondary - This PowerDNS server will serve as the secondaries and will request and receive
Secondary - This PowerDNS server will serve as the secondaries and will request and
receive
zone transfers (AXFRs) from other servers configured as primaries.
</li>
</ul>
@ -188,33 +219,42 @@
<option value="native">Native</option>
<option value="priamry">Primary</option>
<option value="secondary">Secondary</option>
</select><br />
</select><br/>
<div class="form-group" style="display: none;" id="domain_primary_address_div">
<input type="text" class="form-control" name="domain_primary_address"
id="domain_primary_address"
placeholder="Enter valid Primary Server IP addresses (separated by commas)">
</div>
<button type="submit" class="btn btn-primary" id="change_type">
<i class="fa-solid fa-check"></i>&nbsp;Change type for {{ domain.name | pretty_domain_name }}
<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
</button>
</form>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Change SOA-EDIT-API</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<p>The SOA-EDIT-API setting defines how the SOA serial number will be updated after a change is made
<p>The SOA-EDIT-API setting defines how the SOA serial number will be updated after a change
is made
to the domain.</p>
<ul>
<li>
DEFAULT - Generate a soa serial of YYYYMMDD01. If the current serial is lower than the
generated serial, use the generated serial. If the current serial is higher or equal to the
DEFAULT - Generate a soa serial of YYYYMMDD01. If the current serial is lower than
the
generated serial, use the generated serial. If the current serial is higher or equal
to the
generated serial, increase the current serial by 1.
</li>
<li>
@ -228,7 +268,8 @@
</li>
</ul>
<b>New SOA-EDIT-API Setting:</b>
<form method="post" action="{{ url_for('domain.change_soa_edit_api', domain_name=domain.name) }}">
<form method="post"
action="{{ url_for('domain.change_soa_edit_api', domain_name=domain.name) }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<select name="soa_edit_api" class="form-control" style="width:15em;">
<option selected value="0">- Unchanged -</option>
@ -236,38 +277,53 @@
<option>INCREASE</option>
<option>EPOCH</option>
<option>OFF</option>
</select><br />
<button type="submit" class="btn btn-primary" id="change_soa_edit_api">
<i class="fa-solid fa-check"></i>&nbsp;Change SOA-EDIT-API setting for {{ domain.name | pretty_domain_name }}
</select><br/>
<button type="submit" title="Update SOA-EDIT-API" class="btn btn-primary" id="change_soa_edit_api">
<i class="fa-solid fa-floppy-disk"></i>&nbsp;Update SOA-EDIT-API
</button>
</form>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Domain Deletion</h3>
<h3 class="card-title">Remove Zone</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<p>This function is used to remove a domain from PowerDNS-Admin <b>AND</b> PowerDNS. All records and
<p>This function is used to remove a domain from PowerDNS-Admin <b>AND</b> PowerDNS. All
records and
user privileges associated with this domain will also be removed. This change cannot be
reverted.</p>
<button type="button" class="btn btn-danger float-left delete_domain"
<button type="button" title="Delete Zone" class="btn btn-danger float-left delete_domain"
id="{{ domain.name }}">
<i class="fa-solid fa-trash"></i>&nbsp;DELETE DOMAIN {{ domain.name | pretty_domain_name }}
<i class="fa-solid fa-trash"></i>&nbsp;Delete Zone
</button>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
</section>
<!-- /.container-fluid -->
</div>
<!-- /.content -->
</section>
{% endblock %}
{% block extrascripts %}
<script>
<script>
//initialize pretty checkboxes
$('.dyndns_on_demand_toggle').iCheck({
checkboxClass: 'icheckbox_square-blue',
@ -369,10 +425,10 @@
}
});
</script>
</script>
{% endblock %}
{% block modals %}
<div class="modal fade" id="modal_delete_domain">
<div class="modal fade" id="modal_delete_domain">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -387,9 +443,10 @@
<div class="modal-footer">
<button type="button" class="btn btn-secondary float-left" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" id="button_delete_confirm">
Delete</button>
Delete
</button>
</div>
</div>
</div>
</div>
</div>
{% endblock %}