2015-12-13 09:34:12 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block title %}<title>DNS Control Panel - DOMAIN</title>{% endblock %}
|
|
|
|
|
|
|
|
{% block dashboard_stat %}
|
2016-04-27 02:44:22 +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>Domain</li>
|
|
|
|
<li class="active">{{ domain.name }}</li>
|
|
|
|
</ol>
|
2016-04-27 02:44:22 +00:00
|
|
|
</section>
|
2015-12-13 09:34:12 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2016-04-27 02:44:22 +00:00
|
|
|
<section class="content">
|
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">Manage Records for {{ domain.name }}</h3>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
{% if domain.type != 'Slave' %}
|
|
|
|
<button type="button" class="btn btn-flat btn-primary pull-left button_add_record" id="{{ domain.name }}">
|
|
|
|
Add Record <i class="fa fa-plus"></i>
|
|
|
|
</button>
|
|
|
|
<button type="button" class="btn btn-flat btn-primary pull-right button_apply_changes" id="{{ domain.name }}">
|
|
|
|
Apply Changes <i class="fa fa-floppy-o"></i>
|
|
|
|
</button>
|
|
|
|
{% else %}
|
|
|
|
<button type="button" class="btn btn-flat btn-primary pull-left button_update_from_master" id="{{ domain.name }}">
|
|
|
|
Update from Master <i class="fa fa-download"></i>
|
|
|
|
</button>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<table id="tbl_records" class="table table-bordered table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Type</th>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>TTL</th>
|
|
|
|
<th>Data</th>
|
|
|
|
<th>Edit</th>
|
|
|
|
<th>Delete</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2015-12-13 09:34:12 +00:00
|
|
|
{% for record in records %}
|
2016-04-29 17:44:39 +00:00
|
|
|
<tr class="odd row_record" id="{{ domain.name }}">
|
2015-12-13 09:34:12 +00:00
|
|
|
<td>
|
|
|
|
{{ (record.name,domain.name)|display_record_name }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ record.type }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ record.status }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ record.ttl }}
|
|
|
|
</td>
|
2016-04-28 04:05:41 +00:00
|
|
|
<td class="length-break">
|
2015-12-13 09:34:12 +00:00
|
|
|
{{ record.data }}
|
|
|
|
</td>
|
|
|
|
{% if domain.type != 'Slave' %}
|
|
|
|
<td width="6%">
|
|
|
|
{% if record.is_allowed() %}
|
2016-08-19 17:56:28 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-warning button_edit" id="{{ (record.name,domain.name)|display_record_name }}">Edit <i class="fa fa-edit"></i></button>
|
2015-12-13 09:34:12 +00:00
|
|
|
{% else %}
|
2016-08-19 17:56:28 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-warning""> <i class="fa fa-exclamation-circle"></i> </button>
|
2015-12-13 09:34:12 +00:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td width="6%">
|
|
|
|
{% if record.is_allowed() %}
|
2016-08-19 17:56:28 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-danger button_delete" id="{{ (record.name,domain.name)|display_record_name }}">Delete <i class="fa fa-trash"></i></button>
|
2015-12-13 09:34:12 +00:00
|
|
|
{% else %}
|
2016-08-19 17:56:28 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-warning""> <i class="fa fa-exclamation-circle"></i> </button>
|
2015-12-13 09:34:12 +00:00
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
<td width="6%">
|
2016-08-19 17:56:28 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-warning""> <i class="fa fa-exclamation-circle"></i> </button>
|
2015-12-13 09:34:12 +00:00
|
|
|
</td>
|
|
|
|
<td width="6%">
|
2016-08-19 17:56:28 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-warning""> <i class="fa fa-exclamation-circle"></i> </button>
|
2015-12-13 09:34:12 +00:00
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
2016-08-19 17:56:28 +00:00
|
|
|
<!-- hidden column that we can sort on -->
|
|
|
|
<td>1</td>
|
2015-12-13 09:34:12 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2016-06-18 04:41:01 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- /.box-body -->
|
|
|
|
</div>
|
|
|
|
<!-- /.box -->
|
|
|
|
</div>
|
|
|
|
<!-- /.col -->
|
|
|
|
</div>
|
|
|
|
<!-- /.row -->
|
2016-04-27 02:44:22 +00:00
|
|
|
</section>
|
2015-12-13 09:34:12 +00:00
|
|
|
{% endblock %}
|
2016-04-27 02:44:22 +00:00
|
|
|
{% block extrascripts %}
|
2015-12-13 09:34:12 +00:00
|
|
|
<script>
|
2016-06-18 04:41:01 +00:00
|
|
|
// superglobals
|
|
|
|
window.records_allow_edit = {{ editable_records|tojson }};
|
|
|
|
window.nEditing = null;
|
|
|
|
window.nNew = false;
|
2016-04-27 02:44:22 +00:00
|
|
|
|
2016-06-18 04:41:01 +00:00
|
|
|
// set up user data table
|
|
|
|
$("#tbl_records").DataTable({
|
|
|
|
"paging" : true,
|
|
|
|
"lengthChange" : true,
|
|
|
|
"searching" : true,
|
|
|
|
"ordering" : true,
|
|
|
|
"info" : true,
|
|
|
|
"autoWidth" : false,
|
|
|
|
{% if default_record_table_size_setting in ['5','15','20'] %}
|
|
|
|
"lengthMenu": [ [5, 15, 20, -1],
|
|
|
|
[5, 15, 20, "All"]],
|
|
|
|
{% else %}
|
|
|
|
"lengthMenu": [ [5, 15, 20, {{ default_record_table_size_setting }}, -1],
|
|
|
|
[5, 15, 20, {{ default_record_table_size_setting }}, "All"]],
|
|
|
|
{% endif %}
|
|
|
|
"pageLength": {{ default_record_table_size_setting }},
|
|
|
|
"language": {
|
|
|
|
"lengthMenu": " _MENU_ records"
|
|
|
|
},
|
2016-07-04 17:28:42 +00:00
|
|
|
"retrieve" : true,
|
|
|
|
"columnDefs": [
|
2016-08-19 17:56:28 +00:00
|
|
|
{
|
|
|
|
type: 'natural',
|
|
|
|
targets: [0, 4]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// hidden column so that we can add new records on top
|
|
|
|
// regardless of whatever sorting is done
|
|
|
|
visible: false,
|
|
|
|
targets: [ 7 ]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"orderFixed": [[7, 'asc']]
|
2016-06-18 04:41:01 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// handle delete button
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on("click", ".button_delete", function(e) {
|
2016-06-18 04:41:01 +00:00
|
|
|
e.stopPropagation();
|
|
|
|
var modal = $("#modal_delete");
|
|
|
|
var table = $("#tbl_records").DataTable();
|
|
|
|
var record = $(this).prop('id');
|
2016-06-28 17:22:11 +00:00
|
|
|
var nRow = $(this).parents('tr')[0];
|
2016-06-18 04:41:01 +00:00
|
|
|
var info = "Are you sure you want to delete " + record + "?";
|
|
|
|
modal.find('.modal-body p').text(info);
|
|
|
|
modal.find('#button_delete_confirm').click(function() {
|
2016-06-28 17:22:11 +00:00
|
|
|
table.row(nRow).remove().draw();
|
2016-06-18 04:41:01 +00:00
|
|
|
modal.modal('hide');
|
|
|
|
})
|
|
|
|
modal.modal('show');
|
|
|
|
|
|
|
|
});
|
|
|
|
// handle edit button
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on("click", ".button_edit, .row_record", function(e) {
|
2016-06-18 04:41:01 +00:00
|
|
|
e.stopPropagation();
|
|
|
|
if ($(this).is('tr')) {
|
|
|
|
var nRow = $(this)[0];
|
|
|
|
} else {
|
|
|
|
var nRow = $(this).parents('tr')[0];
|
|
|
|
}
|
|
|
|
var table = $("#tbl_records").DataTable();
|
|
|
|
|
|
|
|
if (nEditing == nRow) {
|
|
|
|
/* click on row already being edited, do nothing */
|
|
|
|
} else if (nEditing !== null && nEditing != nRow && nNew == false) {
|
2016-04-27 02:44:22 +00:00
|
|
|
/* Currently editing - but not this row - restore the old before continuing to edit mode */
|
|
|
|
restoreRow(table, nEditing);
|
|
|
|
editRow(table, nRow);
|
|
|
|
nEditing = nRow;
|
2016-06-18 04:41:01 +00:00
|
|
|
} else if (nNew == true) {
|
|
|
|
/* adding a new row, delete it and start editing */
|
2016-04-27 02:44:22 +00:00
|
|
|
table.row(nEditing).remove().draw();
|
|
|
|
nNew = false;
|
|
|
|
editRow(table, nRow);
|
|
|
|
nEditing = nRow;
|
|
|
|
} else {
|
|
|
|
/* No edit in progress - let's start one */
|
|
|
|
editRow(table, nRow);
|
|
|
|
nEditing = nRow;
|
|
|
|
}
|
2016-06-18 04:41:01 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// handle apply changes button
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on("click",".button_apply_changes", function() {
|
2016-06-18 04:41:01 +00:00
|
|
|
var modal = $("#modal_apply_changes");
|
|
|
|
var table = $("#tbl_records").DataTable();
|
|
|
|
var domain = $(this).prop('id');
|
|
|
|
var info = "Are you sure you want to apply your changes?";
|
|
|
|
modal.find('.modal-body p').text(info);
|
|
|
|
modal.find('#button_apply_confirm').click(function() {
|
|
|
|
var data = getTableData(table);
|
2016-07-02 00:45:42 +00:00
|
|
|
applyChanges(data, $SCRIPT_ROOT + '/domain/' + domain + '/apply', true);
|
2016-06-18 04:41:01 +00:00
|
|
|
modal.modal('hide');
|
|
|
|
})
|
|
|
|
modal.modal('show');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// handle add record button
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on("click", ".button_add_record", function (e) {
|
2016-04-27 02:44:22 +00:00
|
|
|
if (nNew || nEditing) {
|
2016-08-19 17:56:28 +00:00
|
|
|
var modal = $("#modal_error");
|
|
|
|
modal.find('.modal-body p').text("Previous record not saved. Please save it before adding more record.");
|
|
|
|
modal.modal('show');
|
2016-04-27 02:44:22 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-08-19 17:56:28 +00:00
|
|
|
// clear search first
|
|
|
|
$("#tbl_records").DataTable().search('').columns().search('').draw();
|
|
|
|
|
|
|
|
// add new row
|
2016-11-21 14:52:07 +00:00
|
|
|
var default_type = records_allow_edit[0]
|
|
|
|
var nRow = jQuery('#tbl_records').dataTable().fnAddData(['', default_type, 'Active', 3600, '', '', '', '0']);
|
2016-08-19 17:56:28 +00:00
|
|
|
editRow($("#tbl_records").DataTable(), nRow);
|
2016-08-19 18:13:34 +00:00
|
|
|
document.getElementById("edit-row-focus").focus();
|
2016-04-27 02:44:22 +00:00
|
|
|
nEditing = nRow;
|
|
|
|
nNew = true;
|
|
|
|
});
|
2016-06-18 04:41:01 +00:00
|
|
|
|
|
|
|
//handle cancel button
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on("click", ".button_cancel", function (e) {
|
2016-06-18 04:41:01 +00:00
|
|
|
e.stopPropagation();
|
|
|
|
var oTable = $("#tbl_records").DataTable();
|
2016-04-27 02:44:22 +00:00
|
|
|
if (nNew) {
|
|
|
|
oTable.row(nEditing).remove().draw();
|
|
|
|
nEditing = null;
|
|
|
|
nNew = false;
|
|
|
|
} else {
|
|
|
|
restoreRow(oTable, nEditing);
|
|
|
|
nEditing = null;
|
|
|
|
}
|
|
|
|
});
|
2016-06-18 04:41:01 +00:00
|
|
|
|
|
|
|
//handle save button
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on("click", ".button_save", function (e) {
|
2016-06-18 04:41:01 +00:00
|
|
|
e.stopPropagation();
|
|
|
|
var table = $("#tbl_records").DataTable();
|
2016-04-27 02:44:22 +00:00
|
|
|
saveRow(table, nEditing);
|
|
|
|
nEditing = null;
|
2016-04-29 16:25:43 +00:00
|
|
|
nNew = false;
|
2016-04-27 02:44:22 +00:00
|
|
|
});
|
2016-06-18 04:41:01 +00:00
|
|
|
|
|
|
|
//handle update_from_master button
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on("click", ".button_update_from_master", function (e) {
|
2016-06-18 04:41:01 +00:00
|
|
|
var domain = $(this).prop('id');
|
2016-07-02 00:45:42 +00:00
|
|
|
applyChanges({'domain': domain}, $SCRIPT_ROOT + '/domain/' + domain + '/update');
|
2016-04-29 17:07:46 +00:00
|
|
|
});
|
2016-06-18 04:41:01 +00:00
|
|
|
|
|
|
|
{% if record_helper_setting %}
|
|
|
|
//handle wacky record types
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on("focus", "#current_edit_record_data", function (e) {
|
2016-06-18 04:41:01 +00:00
|
|
|
var record_type = $(this).parents("tr").find('#record_type').val();
|
|
|
|
var record_data = $(this);
|
2017-05-10 20:30:06 +00:00
|
|
|
if (record_type == "CAA") {
|
|
|
|
var modal = $("#modal_custom_record");
|
|
|
|
if (record_data.val() == "") {
|
|
|
|
var form = " <label for=\"caa_flag\">CAA Flag</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"caa_flag\" id=\"caa_flag\" placeholder=\"0\"> \
|
|
|
|
<label for=\"caa_tag\">CAA Tag</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"caa_tag\" id=\"caa_tag\" placeholder=\"10\"> \
|
|
|
|
<label for=\"caa_value\">CAA Value</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"caa_value\" id=\"caa_value\" placeholder=\"5060\"> \
|
|
|
|
";
|
|
|
|
} else {
|
|
|
|
var parts = record_data.val().split(" ");
|
|
|
|
var form = " <label for=\"caa_flag\">CAA Flag</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"caa_flag\" id=\"caa_flag\" placeholder=\"0\" value=\"" + parts[0] + "\"> \
|
|
|
|
<label for=\"caa_tag\">CAA Tag</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"caa_tag\" id=\"caa_tag\" placeholder=\"10\" value=\"" + parts[1] + "\"> \
|
|
|
|
<label for=\"caa_value\">CAA Value</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"caa_value\" id=\"caa_value\" placeholder=\"5060\" value=\"" + parts[2] + "\"> \
|
|
|
|
";
|
|
|
|
}
|
|
|
|
modal.find('.modal-body p').html(form);
|
|
|
|
modal.find('#button_save').click(function() {
|
|
|
|
caa_flag = modal.find('#caa_flag').val();
|
|
|
|
caa_tag = modal.find('#caa_tag').val();
|
|
|
|
caa_value = modal.find('#caa_value').val();
|
2017-05-10 20:33:44 +00:00
|
|
|
data = caa_flag + " " + caa_tag + " " + '"' + caa_value + '"';
|
2017-05-10 20:30:06 +00:00
|
|
|
record_data.val(data);
|
|
|
|
modal.modal('hide');
|
|
|
|
})
|
2017-05-10 20:33:44 +00:00
|
|
|
modal.modal('show');
|
2017-05-10 20:30:06 +00:00
|
|
|
} else if (record_type == "MX") {
|
2016-06-18 04:41:01 +00:00
|
|
|
var modal = $("#modal_custom_record");
|
|
|
|
if (record_data.val() == "") {
|
|
|
|
var form = " <label for=\"mx_priority\">MX Priority</label> \
|
2016-11-21 13:50:22 +00:00
|
|
|
<input type=\"text\" class=\"form-control\" name=\"mx_priority\" id=\"mx_priority\" placeholder=\"eg. 10\"> \
|
2016-06-18 04:41:01 +00:00
|
|
|
<label for=\"mx_server\">MX Server</label> \
|
2016-11-21 13:50:22 +00:00
|
|
|
<input type=\"text\" class=\"form-control\" name=\"mx_server\" id=\"mx_server\" placeholder=\"eg. postfix.example.com\"> \
|
2016-06-18 04:41:01 +00:00
|
|
|
";
|
|
|
|
} else {
|
|
|
|
var parts = record_data.val().split(" ");
|
|
|
|
var form = " <label for=\"mx_priority\">MX Priority</label> \
|
2016-11-21 13:50:22 +00:00
|
|
|
<input type=\"text\" class=\"form-control\" name=\"mx_priority\" id=\"mx_priority\" placeholder=\"eg. 10\" value=\"" + parts[0] + "\"> \
|
2016-06-18 04:41:01 +00:00
|
|
|
<label for=\"mx_server\">MX Server</label> \
|
2016-11-21 13:50:22 +00:00
|
|
|
<input type=\"text\" class=\"form-control\" name=\"mx_server\" id=\"mx_server\" placeholder=\"eg. postfix.example.com\" value=\"" + parts[1] + "\"> \
|
2016-06-18 04:41:01 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
modal.find('.modal-body p').html(form);
|
|
|
|
modal.find('#button_save').click(function() {
|
|
|
|
mx_server = modal.find('#mx_server').val();
|
|
|
|
mx_priority = modal.find('#mx_priority').val();
|
|
|
|
data = mx_priority + " " + mx_server;
|
|
|
|
record_data.val(data);
|
|
|
|
modal.modal('hide');
|
|
|
|
})
|
|
|
|
modal.modal('show');
|
|
|
|
} else if (record_type == "SRV") {
|
|
|
|
var modal = $("#modal_custom_record");
|
|
|
|
if (record_data.val() == "") {
|
|
|
|
var form = " <label for=\"srv_priority\">SRV Priority</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"srv_priority\" id=\"srv_priority\" placeholder=\"0\"> \
|
|
|
|
<label for=\"srv_weight\">SRV Weight</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"srv_weight\" id=\"srv_weight\" placeholder=\"10\"> \
|
|
|
|
<label for=\"srv_port\">SRV Port</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"srv_port\" id=\"srv_port\" placeholder=\"5060\"> \
|
|
|
|
<label for=\"srv_target\">SRV Target</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"srv_target\" id=\"srv_target\" placeholder=\"sip.example.com\"> \
|
|
|
|
";
|
|
|
|
} else {
|
|
|
|
var parts = record_data.val().split(" ");
|
|
|
|
var form = " <label for=\"srv_priority\">SRV Priority</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"srv_priority\" id=\"srv_priority\" placeholder=\"0\" value=\"" + parts[0] + "\"> \
|
|
|
|
<label for=\"srv_weight\">SRV Weight</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"srv_weight\" id=\"srv_weight\" placeholder=\"10\" value=\"" + parts[1] + "\"> \
|
|
|
|
<label for=\"srv_port\">SRV Port</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"srv_port\" id=\"srv_port\" placeholder=\"5060\" value=\"" + parts[2] + "\"> \
|
|
|
|
<label for=\"srv_target\">SRV Target</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"srv_target\" id=\"srv_target\" placeholder=\"sip.example.com\" value=\"" + parts[3] + "\"> \
|
|
|
|
";
|
|
|
|
}
|
|
|
|
modal.find('.modal-body p').html(form);
|
|
|
|
modal.find('#button_save').click(function() {
|
|
|
|
srv_priority = modal.find('#srv_priority').val();
|
|
|
|
srv_weight = modal.find('#srv_weight').val();
|
|
|
|
srv_port = modal.find('#srv_port').val();
|
|
|
|
srv_target = modal.find('#srv_target').val();
|
|
|
|
data = srv_priority + " " + srv_weight + " " + srv_port + " " + srv_target;
|
|
|
|
record_data.val(data);
|
|
|
|
modal.modal('hide');
|
|
|
|
})
|
|
|
|
} else if (record_type == "SOA") {
|
|
|
|
var modal = $("#modal_custom_record");
|
|
|
|
if (record_data.val() == "") {
|
|
|
|
var form = " <label for=\"soa_primaryns\">Primary Name Server</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_primaryns\" id=\"soa_primaryns\" placeholder=\"ns1.example.com\"> \
|
|
|
|
<label for=\"soa_adminemail\">Primary Contact</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_adminemail\" id=\"soa_adminemail\" placeholder=\"admin.example.com\"> \
|
|
|
|
<label for=\"soa_serial\">Serial</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_serial\" id=\"soa_serial\" placeholder=\"2016010101\"> \
|
|
|
|
<label for=\"soa_zonerefresh\">Zone refresh timer</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_zonerefresh\" id=\"soa_zonerefresh\" placeholder=\"86400\"> \
|
|
|
|
<label for=\"soa_failedzonerefresh\">Failed refresh retry timer</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_failedzonerefresh\" id=\"soa_failedzonerefresh\" placeholder=\"7200\"> \
|
|
|
|
<label for=\"soa_zoneexpiry\">Zone expiry timer</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_zoneexpiry\" id=\"soa_zoneexpiry\" placeholder=\"604800\"> \
|
|
|
|
<label for=\"soa_minimumttl\">Minimum TTL</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_minimumttl\" id=\"soa_minimumttl\" placeholder=\"300\"> \
|
|
|
|
";
|
|
|
|
} else {
|
|
|
|
var parts = record_data.val().split(" ");
|
|
|
|
var form = " <label for=\"soa_primaryns\">Primary Name Server</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_primaryns\" id=\"soa_primaryns\" value=\"" + parts[0] + "\"> \
|
|
|
|
<label for=\"soa_adminemail\">Primary Contact</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_adminemail\" id=\"soa_adminemail\" value=\"" + parts[1] + "\"> \
|
|
|
|
<label for=\"soa_serial\">Serial</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_serial\" id=\"soa_serial\" value=\"" + parts[2] + "\"> \
|
|
|
|
<label for=\"soa_zonerefresh\">Zone refresh timer</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_zonerefresh\" id=\"soa_zonerefresh\" value=\"" + parts[3] + "\"> \
|
|
|
|
<label for=\"soa_failedzonerefresh\">Failed refresh retry timer</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_failedzonerefresh\" id=\"soa_failedzonerefresh\" value=\"" + parts[4] + "\"> \
|
|
|
|
<label for=\"soa_zoneexpiry\">Zone expiry timer</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_zoneexpiry\" id=\"soa_zoneexpiry\" value=\"" + parts[5] + "\"> \
|
|
|
|
<label for=\"soa_minimumttl\">Minimum TTL</label> \
|
|
|
|
<input type=\"text\" class=\"form-control\" name=\"soa_minimumttl\" id=\"soa_minimumttl\" value=\"" + parts[6] + "\"> \
|
|
|
|
";
|
|
|
|
}
|
|
|
|
modal.find('.modal-body p').html(form);
|
|
|
|
modal.find('#button_save').click(function() {
|
|
|
|
soa_primaryns = modal.find('#soa_primaryns').val();
|
|
|
|
soa_adminemail = modal.find('#soa_adminemail').val();
|
|
|
|
soa_serial = modal.find('#soa_serial').val();
|
|
|
|
soa_zonerefresh = modal.find('#soa_zonerefresh').val();
|
|
|
|
soa_failedzonerefresh = modal.find('#soa_failedzonerefresh').val();
|
|
|
|
soa_zoneexpiry = modal.find('#soa_zoneexpiry').val();
|
|
|
|
soa_minimumttl = modal.find('#soa_minimumttl').val();
|
|
|
|
|
|
|
|
data = soa_primaryns + " " + soa_adminemail + " " + soa_serial + " " + soa_zonerefresh + " " + soa_failedzonerefresh + " " + soa_zoneexpiry + " " + soa_minimumttl;
|
|
|
|
record_data.val(data);
|
|
|
|
modal.modal('hide');
|
|
|
|
})
|
|
|
|
modal.modal('show');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
{% endif %}
|
2015-12-13 09:34:12 +00:00
|
|
|
</script>
|
2016-04-27 02:44:22 +00:00
|
|
|
{% endblock %}
|
|
|
|
{% block modals %}
|
|
|
|
<div class="modal fade modal-warning" id="modal_delete">
|
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-27 02:44:22 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal fade modal-primary" id="modal_apply_changes">
|
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-primary" id="button_apply_confirm">Apply</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.modal-content -->
|
|
|
|
</div>
|
|
|
|
<!-- /.modal-dialog -->
|
2016-04-27 02:44:22 +00:00
|
|
|
</div>
|
2016-05-15 18:47:02 +00:00
|
|
|
<div class="modal fade modal-primary" id="modal_custom_record">
|
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">Custom Record</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<p></p>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-flat btn-primary" id="button_save">Save</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.modal-content -->
|
|
|
|
</div>
|
|
|
|
<!-- /.modal-dialog -->
|
2016-05-15 18:47:02 +00:00
|
|
|
</div>
|
2015-12-13 09:34:12 +00:00
|
|
|
{% endblock %}
|