2015-12-13 09:34:12 +00:00
{% extends "base.html" %}
{% block title %}< title > DNS Control Panel - Domain Management< / title > {% endblock %}
{% block dashboard_stat %}
2016-04-24 19:43:21 +00:00
< section class = "content-header" >
2016-06-18 04:41:01 +00:00
< h1 >
Manage domain < small > {{ domain.name }}< / small >
< / h1 >
< ol class = "breadcrumb" >
< li > < a href = "{{ url_for('dashboard') }}" > < i
class="fa fa-dashboard">< / i > Home< / a > < / li >
< li class = "active" > Domain Management< / li >
< / ol >
2016-04-24 19:43:21 +00:00
< / section >
2015-12-13 09:34:12 +00:00
{% endblock %}
{% block content %}
2016-04-24 19:43:21 +00:00
< section class = "content" >
2016-06-18 04:41:01 +00:00
< div class = "row" >
< div class = "col-xs-12" >
< div class = "box" >
< form method = "post" action = "{{ url_for('domain_management', domain_name=domain.name) }}" >
< div class = "box-header" >
< h3 class = "box-title" > Domain Access Control< / h3 >
< / div >
< div class = "box-body" >
< div class = "row" >
< div class = "col-xs-2" >
< p > Users on the right have access to manage the records in
the {{ 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 class = "form-group col-xs-2" >
< 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 >
< / div >
< div class = "box-body" >
< div class = "col-xs-offset-2" >
< div class = "form-group" >
< button type = "submit" class = "btn btn-flat btn-primary" > < i class = "fa fa-check" > < / i > Save< / button >
< / div >
< / div >
< / div >
< / div >
< / form >
< / div >
< / div >
< / div >
2016-11-21 12:38:45 +00:00
< div class = "row" >
< div class = "col-xs-12" >
< div class = "box" >
< div class = "box-header" >
< h3 class = "box-title" > Auto PTR creation< / h3 >
< / div >
< div class = "box-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 auto_ptr_setting %}disabled="True"{% endif %}>
Allow automatic reverse pointer creation on record updates?{% if
auto_ptr_setting %}< / br > < code > Auto-ptr is enabled globally on the PDA system!< / code > {% endif %}< / p >
< / div >
< / div >
< / div >
< / div >
2016-07-02 17:24:13 +00:00
< div class = "row" >
< div class = "col-xs-12" >
< div class = "box" >
< div class = "box-header" >
< h3 class = "box-title" > DynDNS 2 Settings< / h3 >
< / div >
< div class = "box-body" >
< p > < input type = "checkbox" id = "{{ domain.name }}" class = "dyndns_on_demand_toggle"
2016-07-06 01:21:50 +00:00
{% for setting in domain.settings %}{% if setting.setting=='create_via_dyndns' and setting.value=='True' %}checked{% endif %}{% endfor %}>
2016-07-02 17:24:13 +00:00
Allow on-demand creation of records via DynDNS updates?< / p >
< / div >
< / div >
< / div >
< / div >
2016-06-18 04:41:01 +00:00
< div class = "row" >
< div class = "col-xs-12" >
< div class = "box" >
< div class = "box-header" >
< h3 class = "box-title" > Domain Deletion< / h3 >
< / div >
< div class = "box-body" >
< p > This function is used to remove a domain from PowerDNS-Admin < b > AND< / b > PowerDNS. All records and user privileges which associated to this domain will also be removed. This change cannot be reverted.< / p >
< button type = "button" class = "btn btn-flat btn-danger pull-left delete_domain" id = "{{ domain.name }}" >
< i class = "fa fa-trash" > < / i > DELETE DOMAIN {{ domain.name }}
< / button >
< / div >
< / div >
< / div >
< / div >
2016-04-24 19:43:21 +00:00
< / section >
2015-12-13 09:34:12 +00:00
{% endblock %}
2016-04-24 19:43:21 +00:00
{% block extrascripts %}
2015-12-13 09:34:12 +00:00
< script >
2016-07-02 17:24:13 +00:00
//initialize pretty checkboxes
$('.dyndns_on_demand_toggle').iCheck({
checkboxClass : 'icheckbox_square-blue',
increaseArea : '20%' // optional
});
2016-11-21 12:38:45 +00:00
$('.auto_ptr_toggle').iCheck({
checkboxClass : 'icheckbox_square-blue',
increaseArea : '20%' // optional
});
2016-07-02 17:24:13 +00:00
2016-04-24 19:43:21 +00:00
$("#domain_multi_user").multiSelect();
2016-07-02 17:24:13 +00:00
//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
}
};
2016-07-06 03:36:54 +00:00
applyChanges(postdata, $SCRIPT_ROOT + '/domain/' + domain + '/managesetting', true);
2016-07-02 17:24:13 +00:00
});
2016-11-21 12:38:45 +00:00
$('.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
}
};
applyChanges(postdata, $SCRIPT_ROOT + '/domain/' + domain + '/managesetting', true);
});
2016-07-02 17:24:13 +00:00
2016-08-15 08:06:16 +00:00
// handle deletion of domain
2016-07-01 22:31:14 +00:00
$(document.body).on('click', '.delete_domain', function() {
2016-06-18 04:41:01 +00:00
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() {
2016-09-12 12:20:42 +00:00
$.get($SCRIPT_ROOT + '/admin/domain/' + domain + '/delete', function() {
window.location.href = '{{ url_for('dashboard') }}';
});
2016-06-18 04:41:01 +00:00
modal.modal('hide');
})
modal.modal('show');
2015-12-13 09:34:12 +00:00
});
< / script >
{% endblock %}
2016-04-24 19:43:21 +00:00
{% block modals %}
< div class = "modal fade modal-warning" id = "modal_delete_domain" >
2016-06-18 04:41:01 +00:00
< div class = "modal-dialog" >
< div class = "modal-content" >
< div class = "modal-header" >
< button type = "button" class = "close" data-dismiss = "modal"
aria-label="Close">
< span aria-hidden = "true" > × < / span >
< / button >
< h4 class = "modal-title" > Confirmation< / h4 >
< / div >
< div class = "modal-body" >
< p > < / p >
< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-flat btn-default pull-left"
data-dismiss="modal">Close< / button >
< button type = "button" class = "btn btn-flat btn-danger" id = "button_delete_confirm" >
Delete< / button >
< / div >
< / div >
<!-- /.modal - content -->
< / div >
<!-- /.modal - dialog -->
2016-04-24 19:43:21 +00:00
< / div >
2016-08-15 08:06:16 +00:00
{% endblock %}