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,395 +1,452 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<title>Zone Settings - {{ SITE_NAME }}</title>{% endblock %}
{% block title %}
<title>
Domain Management - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
{% if status %}
{% if status %} {% if status.get('status') == 'ok' %}
{% if status.get('status') == 'ok' %} <div class="alert alert-success">
<div class="alert alert-success"> <strong>Success!</strong> {{ status.get('msg') }}
<strong>Success!</strong> {{ status.get('msg') }} </div>
{% elif status.get('status') == 'error' %}
<div class="alert alert-danger">
{% if status.get('msg') != None %}
<strong>Error!</strong>
{{ status.get('msg') }}
{% else %}
<strong>Error!</strong>
An undefined error occurred.
{% endif %}
</div>
{% endif %}
{% 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">
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">Zone Settings - {{ domain.name | pretty_domain_name }}</li>
</ol>
</div>
</div>
</div>
</div> </div>
{% elif status.get('status') == 'error' %}
<div class="alert alert-danger">
{% if status.get('msg') != None %}
<strong>Error!</strong>
{{ status.get('msg') }}
{% else %}
<strong>Error!</strong>
An undefined error occurred.
{% endif %}
</div>
{% endif %}
{% 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>
</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>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="content"> <section class="content">
<div class="container-fluid"> <div class="container-fluid">
<div class="row">
<div class="col-12"> <div class="row">
<div class="card">
<form method="post" action="{{ url_for('domain.setting', domain_name=domain.name) }}"> <div class="col-12 col-sm-4">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}"> <form method="post"
<div class="card-header"> action="{{ url_for('domain.change_account', domain_name=domain.name) }}">
<h3 class="card-title">Domain Access Control</h3> <input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
</div> <div class="card">
<div class="card-body"> <div class="card-header">
<div class="row"> <h3 class="card-title">Change Zone Account</h3>
<div class="col-2">
<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>
<p>
Users in <font style="color: red;">red</font> are Administrators
and already have access to <b>ALL</b> domains.
</p>
</div> </div>
<div class="form-group col-2"> <!-- /.card-header -->
<select multiple="multiple" class="form-control" id="domain_multi_user" <div class="card-body">
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 %}
</select>
</div>
</div>
<div class="card-body">
<div class="col-offset-2">
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-primary"> <label for="selAccountId">Account</label>
<i class="fa-solid fa-check"></i> <select id="selAccountId" name="accountid" class="form-control" style="width:15em;">
Save <option value="0">- No Account -</option>
</button> {% for account in accounts %}
<option value="{{ account.id }}"
{% if domain_account.id == account.id %}selected{% endif %}>{{ account.name }}
</option>
{% endfor %}
</select>
</div> </div>
<!-- /.form-group -->
</div> </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> </div>
</div> <!-- /.card -->
</form> </form>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Account</h3>
</div> </div>
<div class="card-body"> <!-- /.col -->
<div class="col-12">
<div class="form-group"> <div class="col-12 col-sm-4">
<form method="post" <div class="card">
action="{{ url_for('domain.change_account', domain_name=domain.name) }}"> <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-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>
<p>
Users in <font style="color: red;">red</font> are Administrators
and already have access to <b>ALL</b> domains.
</p>
</div>
</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 %}
</select>
</div>
<!-- /.form-group -->
</div>
</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>
<!-- /.card -->
</form>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<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>
<li>
Native - PowerDNS will not perform any replication. Use this if you only have one
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
(AXFRs) to other servers configured as secondaries.
</li>
<li>
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>
<b>New Domain Type Setting:</b>
<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="accountid" class="form-control" style="width:15em;"> <select name="domain_type" class="form-control" style="width:15em;">
<option value="0">- No Account -</option> <option selected value="0">- Unchanged -</option>
{% for account in accounts %} <option value="native">Native</option>
<option value="{{ account.id }}" <option value="priamry">Primary</option>
{% if domain_account.id == account.id %}selected{% endif %}>{{ account.name }} <option value="secondary">Secondary</option>
</option> </select><br/>
{% endfor %} <div class="form-group" style="display: none;" id="domain_primary_address_div">
</select><br /> <input type="text" class="form-control" name="domain_primary_address"
<button type="submit" class="btn btn-flat btn-primary" id="change_soa_edit_api"> id="domain_primary_address"
<i class="fa-solid fa-check"></i>&nbsp;Change account for {{ domain.name | pretty_domain_name }} placeholder="Enter valid Primary Server IP addresses (separated by commas)">
</div>
<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> </button>
</form> </form>
</div> </div>
<!-- /.card-body -->
</div> </div>
<!-- /.card -->
</div> </div>
<!-- /.col -->
</div> </div>
</div> <!-- /.row -->
</div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Auto PTR creation</h3> <h3 class="card-title">Change SOA-EDIT-API</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>
</div>
<div class="card-body">
<p>The type decides how the domain will be replicated across multiple DNS servers.</p>
<ul>
<li>
Native - PowerDNS will not perform any replication. Use this if you only have one
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
(AXFRs) to other servers configured as secondaries.
</li>
<li>
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>
<b>New Domain Type Setting:</b>
<form method="post" action="{{ url_for('domain.change_type', domain_name=domain.name) }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<select name="domain_type" class="form-control" style="width:15em;">
<option selected value="0">- Unchanged -</option>
<option value="native">Native</option>
<option value="priamry">Primary</option>
<option value="secondary">Secondary</option>
</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> </div>
<button type="submit" class="btn btn-primary" id="change_type"> <!-- /.card-header -->
<i class="fa-solid fa-check"></i>&nbsp;Change type for {{ domain.name | pretty_domain_name }} <div class="card-body">
</button> <p>The SOA-EDIT-API setting defines how the SOA serial number will be updated after a change
</form> 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
generated serial, increase the current serial by 1.
</li>
<li>
INCREASE - Increase the current serial by 1.
</li>
<li>
EPOCH - Change the serial to the number of seconds since the EPOCH, aka unixtime.
</li>
<li>
OFF - Disable automatic updates of the SOA serial.
</li>
</ul>
<b>New SOA-EDIT-API Setting:</b>
<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>
<option>DEFAULT</option>
<option>INCREASE</option>
<option>EPOCH</option>
<option>OFF</option>
</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> </div>
<!-- /.col -->
</div> </div>
</div> <!-- /.row -->
</div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Change SOA-EDIT-API</h3> <h3 class="card-title">Remove Zone</h3>
</div> </div>
<div class="card-body"> <!-- /.card-header -->
<p>The SOA-EDIT-API setting defines how the SOA serial number will be updated after a change is made <div class="card-body">
to the domain.</p> <p>This function is used to remove a domain from PowerDNS-Admin <b>AND</b> PowerDNS. All
<ul> records and
<li> user privileges associated with this domain will also be removed. This change cannot be
DEFAULT - Generate a soa serial of YYYYMMDD01. If the current serial is lower than the reverted.</p>
generated serial, use the generated serial. If the current serial is higher or equal to the <button type="button" title="Delete Zone" class="btn btn-danger float-left delete_domain"
generated serial, increase the current serial by 1. id="{{ domain.name }}">
</li> <i class="fa-solid fa-trash"></i>&nbsp;Delete Zone
<li> </button>
INCREASE - Increase the current serial by 1. </div>
</li> <!-- /.card-body -->
<li> </div>
EPOCH - Change the serial to the number of seconds since the EPOCH, aka unixtime. <!-- /.card -->
</li>
<li>
OFF - Disable automatic updates of the SOA serial.
</li>
</ul>
<b>New SOA-EDIT-API Setting:</b>
<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>
<option>DEFAULT</option>
<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 }}
</button>
</form>
</div> </div>
<!-- /.col -->
</div> </div>
<!-- /.row -->
</div> </div>
</div> <!-- /.container-fluid -->
<div class="row"> </div>
<div class="col-12"> <!-- /.content -->
<div class="card"> </section>
<div class="card-header"> {% endblock %}
<h3 class="card-title">Domain Deletion</h3>
{% block extrascripts %}
<script>
//initialize pretty checkboxes
$('.dyndns_on_demand_toggle').iCheck({
checkboxClass: 'icheckbox_square-blue',
increaseArea: '20%' // optional
});
$('.auto_ptr_toggle').iCheck({
checkboxClass: 'icheckbox_square-blue',
increaseArea: '20%' // optional
});
$("#domain_multi_user").multiSelect({
selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='Username'>",
selectionHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='Username'>",
afterInit: function (ms) {
var that = this,
$selectableSearch = that.$selectableUl.prev(),
$selectionSearch = that.$selectionUl.prev(),
selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
that.qs1 = $selectableSearch.quicksearch(selectableSearchString)
.on('keydown', function (e) {
if (e.which === 40) {
that.$selectableUl.focus();
return false;
}
});
that.qs2 = $selectionSearch.quicksearch(selectionSearchString)
.on('keydown', function (e) {
if (e.which == 40) {
that.$selectionUl.focus();
return false;
}
});
},
afterSelect: function () {
this.qs1.cache();
this.qs2.cache();
},
afterDeselect: function () {
this.qs1.cache();
this.qs2.cache();
}
});
//handle checkbox toggling
$('.dyndns_on_demand_toggle').on('ifToggled', function (event) {
var is_checked = $(this).prop('checked');
var domain = $(this).prop('id');
postdata = {
'action': 'set_setting',
'data': {
'setting': 'create_via_dyndns',
'value': is_checked
},
'_csrf_token': '{{ csrf_token() }}'
};
applyChanges(postdata, $SCRIPT_ROOT + '/domain/' + domain + '/manage-setting', true);
});
$('.auto_ptr_toggle').on('ifToggled', function (event) {
var is_checked = $(this).prop('checked');
var domain = $(this).prop('id');
postdata = {
'action': 'set_setting',
'data': {
'setting': 'auto_ptr',
'value': is_checked
},
'_csrf_token': '{{ csrf_token() }}'
};
applyChanges(postdata, $SCRIPT_ROOT + '/domain/' + domain + '/manage-setting', true);
});
// handle deletion of domain
$(document.body).on('click', '.delete_domain', function () {
var modal = $("#modal_delete_domain");
var domain = $(this).prop('id');
var info = "Are you sure you want to delete " + domain + "?";
modal.find('.modal-body p').text(info);
modal.find('#button_delete_confirm').click(function () {
$.post($SCRIPT_ROOT + '/domain/setting/' + domain + '/delete', {
'_csrf_token': '{{ csrf_token() }}'
}, function () {
window.location.href = '{{ url_for('dashboard.dashboard') }}';
});
modal.modal('hide');
})
modal.modal('show');
});
// domain primary address input handeling
$("select[name=domain_type]").change(function () {
var type = $(this).val();
if (type == "secondary") {
$("#domain_primary_address_div").show();
} else {
$("#domain_primary_address_div").hide();
}
});
</script>
{% endblock %}
{% block modals %}
<div class="modal fade" id="modal_delete_domain">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Confirmation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div> </div>
<div class="card-body"> <div class="modal-body">
<p>This function is used to remove a domain from PowerDNS-Admin <b>AND</b> PowerDNS. All records and <p></p>
user privileges associated with this domain will also be removed. This change cannot be </div>
reverted.</p> <div class="modal-footer">
<button type="button" class="btn btn-danger float-left delete_domain" <button type="button" class="btn btn-secondary float-left" data-dismiss="modal">Close</button>
id="{{ domain.name }}"> <button type="button" class="btn btn-danger" id="button_delete_confirm">
<i class="fa-solid fa-trash"></i>&nbsp;DELETE DOMAIN {{ domain.name | pretty_domain_name }} Delete
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</section>
{% endblock %}
{% block extrascripts %}
<script>
//initialize pretty checkboxes
$('.dyndns_on_demand_toggle').iCheck({
checkboxClass: 'icheckbox_square-blue',
increaseArea: '20%' // optional
});
$('.auto_ptr_toggle').iCheck({
checkboxClass: 'icheckbox_square-blue',
increaseArea: '20%' // optional
});
$("#domain_multi_user").multiSelect({
selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='Username'>",
selectionHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='Username'>",
afterInit: function (ms) {
var that = this,
$selectableSearch = that.$selectableUl.prev(),
$selectionSearch = that.$selectionUl.prev(),
selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
that.qs1 = $selectableSearch.quicksearch(selectableSearchString)
.on('keydown', function (e) {
if (e.which === 40) {
that.$selectableUl.focus();
return false;
}
});
that.qs2 = $selectionSearch.quicksearch(selectionSearchString)
.on('keydown', function (e) {
if (e.which == 40) {
that.$selectionUl.focus();
return false;
}
});
},
afterSelect: function () {
this.qs1.cache();
this.qs2.cache();
},
afterDeselect: function () {
this.qs1.cache();
this.qs2.cache();
}
});
//handle checkbox toggling
$('.dyndns_on_demand_toggle').on('ifToggled', function (event) {
var is_checked = $(this).prop('checked');
var domain = $(this).prop('id');
postdata = {
'action': 'set_setting',
'data': {
'setting': 'create_via_dyndns',
'value': is_checked
},
'_csrf_token': '{{ csrf_token() }}'
};
applyChanges(postdata, $SCRIPT_ROOT + '/domain/' + domain + '/manage-setting', true);
});
$('.auto_ptr_toggle').on('ifToggled', function (event) {
var is_checked = $(this).prop('checked');
var domain = $(this).prop('id');
postdata = {
'action': 'set_setting',
'data': {
'setting': 'auto_ptr',
'value': is_checked
},
'_csrf_token': '{{ csrf_token() }}'
};
applyChanges(postdata, $SCRIPT_ROOT + '/domain/' + domain + '/manage-setting', true);
});
// handle deletion of domain
$(document.body).on('click', '.delete_domain', function () {
var modal = $("#modal_delete_domain");
var domain = $(this).prop('id');
var info = "Are you sure you want to delete " + domain + "?";
modal.find('.modal-body p').text(info);
modal.find('#button_delete_confirm').click(function () {
$.post($SCRIPT_ROOT + '/domain/setting/' + domain + '/delete', {
'_csrf_token': '{{ csrf_token() }}'
}, function () {
window.location.href = '{{ url_for('dashboard.dashboard') }}';
});
modal.modal('hide');
})
modal.modal('show');
});
// domain primary address input handeling
$("select[name=domain_type]").change(function () {
var type = $(this).val();
if (type == "secondary") {
$("#domain_primary_address_div").show();
} else {
$("#domain_primary_address_div").hide();
}
});
</script>
{% endblock %}
{% block modals %}
<div class="modal fade" id="modal_delete_domain">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Confirmation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p></p>
</div>
<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>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}