mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-01-07 19:05:39 +00:00
Convert tabs to spaces in HTML template files.
This commit is contained in:
parent
92dd1586bf
commit
d837e878e4
@ -4,115 +4,115 @@
|
|||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
Admin Console
|
Admin Console
|
||||||
</h1>
|
</h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a href="{{ url_for('dashboard') }}"><i
|
<li><a href="{{ url_for('dashboard') }}"><i
|
||||||
class="fa fa-dashboard"></i> Home</a></li>
|
class="fa fa-dashboard"></i> Home</a></li>
|
||||||
<li class="active">Admin Console</li>
|
<li class="active">Admin Console</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">PDNS Statistics</h3>
|
<h3 class="box-title">PDNS Statistics</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<table id="tbl_statistics" class="table table-bordered table-striped">
|
<table id="tbl_statistics" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="6%">Docs</th>
|
<th width="6%">Docs</th>
|
||||||
<th>Statistic</th>
|
<th>Statistic</th>
|
||||||
<th>Value</th>
|
<th>Value</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for statistic in statistics %}
|
{% for statistic in statistics %}
|
||||||
<tr class="odd gradeX">
|
<tr class="odd gradeX">
|
||||||
<td><a
|
<td><a
|
||||||
href="https://google.com/search?q=site:doc.powerdns.com+{{ statistic['name'] }}"
|
href="https://google.com/search?q=site:doc.powerdns.com+{{ statistic['name'] }}"
|
||||||
target="_blank" class="btn btn-flat btn-xs blue"><i
|
target="_blank" class="btn btn-flat btn-xs blue"><i
|
||||||
class="fa fa-search"></i></a></td>
|
class="fa fa-search"></i></a></td>
|
||||||
<td>{{ statistic['name'] }}</td>
|
<td>{{ statistic['name'] }}</td>
|
||||||
<td>{{ statistic['value'] }}</td>
|
<td>{{ statistic['value'] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
<!-- /.box -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col -->
|
<!-- /.col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">PDNS Configuration</h3>
|
<h3 class="box-title">PDNS Configuration</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<table id="tbl_configuration" class="table table-bordered table-striped">
|
<table id="tbl_configuration" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="6%">Docs</th>
|
<th width="6%">Docs</th>
|
||||||
<th>Statistic</th>
|
<th>Statistic</th>
|
||||||
<th>Value</th>
|
<th>Value</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for config in configs %}
|
{% for config in configs %}
|
||||||
<tr class="odd gradeX">
|
<tr class="odd gradeX">
|
||||||
<td><a
|
<td><a
|
||||||
href="https://google.com/search?q=site:doc.powerdns.com+{{ config['name'] }}"
|
href="https://google.com/search?q=site:doc.powerdns.com+{{ config['name'] }}"
|
||||||
target="_blank" class="btn btn-flat btn-xs blue"><i
|
target="_blank" class="btn btn-flat btn-xs blue"><i
|
||||||
class="fa fa-search"></i></a></td>
|
class="fa fa-search"></i></a></td>
|
||||||
<td>{{ config['name'] }}</td>
|
<td>{{ config['name'] }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ config['value'] }}
|
{{ config['value'] }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
<!-- /.box -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col -->
|
<!-- /.col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<script>
|
<script>
|
||||||
// set up statistics data table
|
// set up statistics data table
|
||||||
$("#tbl_statistics").DataTable({
|
$("#tbl_statistics").DataTable({
|
||||||
"paging" : true,
|
"paging" : true,
|
||||||
"lengthChange" : false,
|
"lengthChange" : false,
|
||||||
"searching" : true,
|
"searching" : true,
|
||||||
"ordering" : true,
|
"ordering" : true,
|
||||||
"info" : true,
|
"info" : true,
|
||||||
"autoWidth" : false
|
"autoWidth" : false
|
||||||
});
|
});
|
||||||
|
|
||||||
// set up configuration data table
|
// set up configuration data table
|
||||||
$("#tbl_configuration").DataTable({
|
$("#tbl_configuration").DataTable({
|
||||||
"paging" : true,
|
"paging" : true,
|
||||||
"lengthChange" : false,
|
"lengthChange" : false,
|
||||||
"searching" : true,
|
"searching" : true,
|
||||||
"ordering" : true,
|
"ordering" : true,
|
||||||
"info" : true,
|
"info" : true,
|
||||||
"autoWidth" : false
|
"autoWidth" : false
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% block title %}<title>DNS Control Panel - Create User</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - Create User</title>{% endblock %}
|
||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
User
|
User
|
||||||
@ -19,73 +19,73 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Create new user</h3>
|
<h3 class="box-title">Create new user</h3>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-header -->
|
<!-- /.box-header -->
|
||||||
<!-- form start -->
|
<!-- form start -->
|
||||||
<form role="form" method="post" action="{{ url_for('admin_createuser') }}">
|
<form role="form" method="post" action="{{ url_for('admin_createuser') }}">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<label class="control-label" for="firstname">First Name</label>
|
<label class="control-label" for="firstname">First Name</label>
|
||||||
<input type="text" class="form-control" placeholder="First Name"
|
<input type="text" class="form-control" placeholder="First Name"
|
||||||
name="firstname" {% if user %}value={{ user.firstname }}{% endif %}> <span
|
name="firstname" {% if user %}value={{ user.firstname }}{% endif %}> <span
|
||||||
class="glyphicon glyphicon-user form-control-feedback"></span>
|
class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<label class="control-label" for="lastname">Last Name</label>
|
<label class="control-label" for="lastname">Last Name</label>
|
||||||
<input type="text" class="form-control" placeholder="Last name"
|
<input type="text" class="form-control" placeholder="Last name"
|
||||||
name="lastname" {% if user %}value={{ user.lastname }}{% endif %}> <span
|
name="lastname" {% if user %}value={{ user.lastname }}{% endif %}> <span
|
||||||
class="glyphicon glyphicon-user form-control-feedback"></span>
|
class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback {% if duplicate_email %}has-error{% endif %}">
|
<div class="form-group has-feedback {% if duplicate_email %}has-error{% endif %}">
|
||||||
<label class="control-label" for="email">E-mail address</label>
|
<label class="control-label" for="email">E-mail address</label>
|
||||||
<input type="email" class="form-control" placeholder="Email"
|
<input type="email" class="form-control" placeholder="Email"
|
||||||
name="email" id="email" {% if user %}value={{ user.email }}{% endif %}> <span
|
name="email" id="email" {% if user %}value={{ user.email }}{% endif %}> <span
|
||||||
class="glyphicon glyphicon-envelope form-control-feedback"></span>
|
class="glyphicon glyphicon-envelope form-control-feedback"></span>
|
||||||
{% if duplicate_email %}
|
{% if duplicate_email %}
|
||||||
<span class="help-block">This e-mail address is already in use.</span>
|
<span class="help-block">This e-mail address is already in use.</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<p class="login-box-msg">Enter the account details below</p>
|
<p class="login-box-msg">Enter the account details below</p>
|
||||||
<div class="form-group has-feedback {% if duplicate_username %}has-error{% endif %}">
|
<div class="form-group has-feedback {% if duplicate_username %}has-error{% endif %}">
|
||||||
<label class="control-label" for="username">Username</label>
|
<label class="control-label" for="username">Username</label>
|
||||||
<input type="text" class="form-control" placeholder="Username"
|
<input type="text" class="form-control" placeholder="Username"
|
||||||
name="username" {% if user %}value={{ user.username }}{% endif %}> <span
|
name="username" {% if user %}value={{ user.username }}{% endif %}> <span
|
||||||
class="glyphicon glyphicon-user form-control-feedback"></span>
|
class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||||
{% if duplicate_username %}
|
{% if duplicate_username %}
|
||||||
<span class="help-block">This username is already in use.</span>
|
<span class="help-block">This username is already in use.</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback {% if blank_password %}has-error{% endif %}">
|
<div class="form-group has-feedback {% if blank_password %}has-error{% endif %}">
|
||||||
<label class="control-label" for="username">Password</label>
|
<label class="control-label" for="username">Password</label>
|
||||||
<input type="password" class="form-control" placeholder="Password"
|
<input type="password" class="form-control" placeholder="Password"
|
||||||
name="password"> <span
|
name="password"> <span
|
||||||
class="glyphicon glyphicon-lock form-control-feedback"></span>
|
class="glyphicon glyphicon-lock form-control-feedback"></span>
|
||||||
{% if blank_password %}
|
{% if blank_password %}
|
||||||
<span class="help-block">The password cannot be blank.</span>
|
<span class="help-block">The password cannot be blank.</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<button type="submit" class="btn btn-flat btn-primary">Create User</button>
|
<button type="submit" class="btn btn-flat btn-primary">Create User</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Help with creating a new user</h3>
|
<h3 class="box-title">Help with creating a new user</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<p>Fill in all the fields to the in the form to the left.</p>
|
<p>Fill in all the fields to the in the form to the left.</p>
|
||||||
<p><strong>Newly created users do not have access to any domains.</strong> You will need to grant access to the user once it is created via the domain management buttons on the dashboard.</p>
|
<p><strong>Newly created users do not have access to any domains.</strong> You will need to grant access to the user once it is created via the domain management buttons on the dashboard.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -3,130 +3,130 @@
|
|||||||
{% endblock %} {% block dashboard_stat %}
|
{% endblock %} {% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
History <small>Recent PowerDNS-Admin events</small>
|
History <small>Recent PowerDNS-Admin events</small>
|
||||||
</h1>
|
</h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a href="{{ url_for('dashboard') }}"><i
|
<li><a href="{{ url_for('dashboard') }}"><i
|
||||||
class="fa fa-dashboard"></i> Home</a></li>
|
class="fa fa-dashboard"></i> Home</a></li>
|
||||||
<li class="active">History</li>
|
<li class="active">History</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %} {% block content %}
|
{% endblock %} {% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">History Management</h3>
|
<h3 class="box-title">History Management</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body clearfix">
|
<div class="box-body clearfix">
|
||||||
<button type="button" class="btn btn-flat btn-danger pull-right" data-toggle="modal" data-target="#modal_clear_history">
|
<button type="button" class="btn btn-flat btn-danger pull-right" data-toggle="modal" data-target="#modal_clear_history">
|
||||||
Clear History <i class="fa fa-trash"></i>
|
Clear History <i class="fa fa-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<table id="tbl_history" class="table table-bordered table-striped">
|
<table id="tbl_history" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Changed by</th>
|
<th>Changed by</th>
|
||||||
<th>Content</th>
|
<th>Content</th>
|
||||||
<th>Time</th>
|
<th>Time</th>
|
||||||
<th>Detail</th>
|
<th>Detail</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for history in histories %}
|
{% for history in histories %}
|
||||||
<tr class="odd gradeX">
|
<tr class="odd gradeX">
|
||||||
<td>{{ history.created_by }}</td>
|
<td>{{ history.created_by }}</td>
|
||||||
<td>{{ history.msg }}</td>
|
<td>{{ history.msg }}</td>
|
||||||
<td>{{ history.created_on }}</td>
|
<td>{{ history.created_on }}</td>
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
<button type="button" class="btn btn-flat btn-primary history-info-button" value='{{ history.detail|replace("[]","None") }}'>
|
<button type="button" class="btn btn-flat btn-primary history-info-button" value='{{ history.detail|replace("[]","None") }}'>
|
||||||
Info <i class="fa fa-info"></i>
|
Info <i class="fa fa-info"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
<!-- /.box -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col -->
|
<!-- /.col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<script>
|
<script>
|
||||||
// set up history data table
|
// set up history data table
|
||||||
$("#tbl_history").DataTable({
|
$("#tbl_history").DataTable({
|
||||||
"paging" : true,
|
"paging" : true,
|
||||||
"lengthChange" : false,
|
"lengthChange" : false,
|
||||||
"searching" : true,
|
"searching" : true,
|
||||||
"ordering" : true,
|
"ordering" : true,
|
||||||
"info" : true,
|
"info" : true,
|
||||||
"autoWidth" : false
|
"autoWidth" : false
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".history-info-button").click(function() {
|
$(".history-info-button").click(function() {
|
||||||
var modal = $("#modal_history_info");
|
var modal = $("#modal_history_info");
|
||||||
var info = $(this).val();
|
var info = $(this).val();
|
||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block modals %}
|
{% block modals %}
|
||||||
<!-- Clear History Confirmation Box -->
|
<!-- Clear History Confirmation Box -->
|
||||||
<div class="modal fade modal-warning" id="modal_clear_history">
|
<div class="modal fade modal-warning" id="modal_clear_history">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Confirmation</h4>
|
<h4 class="modal-title">Confirmation</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p>Are you sure you want to remove all history?</p>
|
<p>Are you sure you want to remove all history?</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-left"
|
<button type="button" class="btn btn-flat btn-default pull-left"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-flat btn-danger" onclick="applyChanges('', '/admin/history');location.reload();">Clear
|
<button type="button" class="btn btn-flat btn-danger" onclick="applyChanges('', '/admin/history');location.reload();">Clear
|
||||||
History</button>
|
History</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<div class="modal fade" id="modal_history_info">
|
<div class="modal fade" id="modal_history_info">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">History Details</h4>
|
<h4 class="modal-title">History Details</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-right"
|
<button type="button" class="btn btn-flat btn-default pull-right"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal -->
|
<!-- /.modal -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,181 +2,181 @@
|
|||||||
<title>DNS Control Panel - User Management</title>
|
<title>DNS Control Panel - User Management</title>
|
||||||
{% endblock %} {% block dashboard_stat %}
|
{% endblock %} {% block dashboard_stat %}
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
User <small>Manage user privileges</small>
|
User <small>Manage user privileges</small>
|
||||||
</h1>
|
</h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a href="{{ url_for('dashboard') }}"><i
|
<li><a href="{{ url_for('dashboard') }}"><i
|
||||||
class="fa fa-dashboard"></i> Home</a></li>
|
class="fa fa-dashboard"></i> Home</a></li>
|
||||||
<li class="active">User</li>
|
<li class="active">User</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %} {% block content %}
|
{% endblock %} {% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">User Management</h3>
|
<h3 class="box-title">User Management</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<a href="{{ url_for('admin_createuser') }}">
|
<a href="{{ url_for('admin_createuser') }}">
|
||||||
<button type="button" class="btn btn-flat btn-primary pull-left button_add_user">
|
<button type="button" class="btn btn-flat btn-primary pull-left button_add_user">
|
||||||
Add User <i class="fa fa-plus"></i>
|
Add User <i class="fa fa-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<table id="tbl_users" class="table table-bordered table-striped">
|
<table id="tbl_users" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Username</th>
|
<th>Username</th>
|
||||||
<th>First Name</th>
|
<th>First Name</th>
|
||||||
<th>Last Name</th>
|
<th>Last Name</th>
|
||||||
<th>Admin</th>
|
<th>Admin</th>
|
||||||
<th>Privileges</th>
|
<th>Privileges</th>
|
||||||
<th>Deletion</th>
|
<th>Deletion</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<tr class="odd gradeX">
|
<tr class="odd gradeX">
|
||||||
<td>{{ user.username }}</td>
|
<td>{{ user.username }}</td>
|
||||||
<td>{{ user.firstname }}</td>
|
<td>{{ user.firstname }}</td>
|
||||||
<td>{{ user.lastname }}</td>
|
<td>{{ user.lastname }}</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="{{ user.username }}" class="admin_toggle" {% if user.role.name=='Administrator' %}checked{% endif %}>
|
<input type="checkbox" id="{{ user.username }}" class="admin_toggle" {% if user.role.name=='Administrator' %}checked{% endif %}>
|
||||||
</td>
|
</td>
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
<button type="button" class="btn btn-flat btn-warning button_revoke" id="{{ user.username }}">
|
<button type="button" class="btn btn-flat btn-warning button_revoke" id="{{ user.username }}">
|
||||||
Revoke <i class="fa fa-lock"></i>
|
Revoke <i class="fa fa-lock"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
<button type="button" class="btn btn-flat btn-danger button_delete" id="{{ user.username }}">
|
<button type="button" class="btn btn-flat btn-danger button_delete" id="{{ user.username }}">
|
||||||
Delete <i class="fa fa-trash"></i>
|
Delete <i class="fa fa-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
<!-- /.box -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col -->
|
<!-- /.col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<script>
|
<script>
|
||||||
// set up user data table
|
// set up user data table
|
||||||
$("#tbl_users").DataTable({
|
$("#tbl_users").DataTable({
|
||||||
"paging" : true,
|
"paging" : true,
|
||||||
"lengthChange" : false,
|
"lengthChange" : false,
|
||||||
"searching" : true,
|
"searching" : true,
|
||||||
"ordering" : true,
|
"ordering" : true,
|
||||||
"info" : true,
|
"info" : true,
|
||||||
"autoWidth" : false
|
"autoWidth" : false
|
||||||
});
|
});
|
||||||
|
|
||||||
// handle revocation of privileges
|
// handle revocation of privileges
|
||||||
$('.button_revoke').click(function() {
|
$('.button_revoke').click(function() {
|
||||||
var modal = $("#modal_revoke");
|
var modal = $("#modal_revoke");
|
||||||
var username = $(this).prop('id');
|
var username = $(this).prop('id');
|
||||||
var info = "Are you sure you want to revoke all privileges for " + username + ". They will not able to access any domain.";
|
var info = "Are you sure you want to revoke all privileges for " + username + ". They will not able to access any domain.";
|
||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.find('#button_revoke_confirm').click(function() {
|
modal.find('#button_revoke_confirm').click(function() {
|
||||||
var postdata = {'action': 'revoke_user_privielges', 'data': username}
|
var postdata = {'action': 'revoke_user_privielges', 'data': username}
|
||||||
applyChanges(postdata, '/admin/manageuser');
|
applyChanges(postdata, '/admin/manageuser');
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
})
|
})
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
});
|
});
|
||||||
// handle deletion of user
|
// handle deletion of user
|
||||||
$('.button_delete').click(function() {
|
$('.button_delete').click(function() {
|
||||||
var modal = $("#modal_delete");
|
var modal = $("#modal_delete");
|
||||||
var username = $(this).prop('id');
|
var username = $(this).prop('id');
|
||||||
var info = "Are you sure you want to delete " + username + "?";
|
var info = "Are you sure you want to delete " + username + "?";
|
||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.find('#button_delete_confirm').click(function() {
|
modal.find('#button_delete_confirm').click(function() {
|
||||||
var postdata = {'action': 'delete_user', 'data': username}
|
var postdata = {'action': 'delete_user', 'data': username}
|
||||||
applyChanges(postdata, '/admin/manageuser', false, true);
|
applyChanges(postdata, '/admin/manageuser', false, true);
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
})
|
})
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// initialize pretty checkboxes
|
// initialize pretty checkboxes
|
||||||
$('.admin_toggle').iCheck({
|
$('.admin_toggle').iCheck({
|
||||||
checkboxClass : 'icheckbox_square-blue',
|
checkboxClass : 'icheckbox_square-blue',
|
||||||
increaseArea : '20%' // optional
|
increaseArea : '20%' // optional
|
||||||
});
|
});
|
||||||
|
|
||||||
// handle checkbox toggling
|
// handle checkbox toggling
|
||||||
$('.admin_toggle').on('ifToggled', function(event) {
|
$('.admin_toggle').on('ifToggled', function(event) {
|
||||||
var is_admin = $(this).prop('checked');
|
var is_admin = $(this).prop('checked');
|
||||||
var username = $(this).prop('id');
|
var username = $(this).prop('id');
|
||||||
postdata = {
|
postdata = {
|
||||||
'action' : 'set_admin',
|
'action' : 'set_admin',
|
||||||
'data' : {
|
'data' : {
|
||||||
'username' : username,
|
'username' : username,
|
||||||
'is_admin' : is_admin
|
'is_admin' : is_admin
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
applyChanges(postdata, '/admin/manageuser');
|
applyChanges(postdata, '/admin/manageuser');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block modals %}
|
{% block modals %}
|
||||||
<div class="modal fade modal-warning" id="modal_revoke">
|
<div class="modal fade modal-warning" id="modal_revoke">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Confirmation</h4>
|
<h4 class="modal-title">Confirmation</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-left"
|
<button type="button" class="btn btn-flat btn-default pull-left"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-flat btn-danger" id="button_revoke_confirm">Revoke</button>
|
<button type="button" class="btn btn-flat btn-danger" id="button_revoke_confirm">Revoke</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<div class="modal fade modal-warning" id="modal_delete">
|
<div class="modal fade modal-warning" id="modal_delete">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Confirmation</h4>
|
<h4 class="modal-title">Confirmation</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-left"
|
<button type="button" class="btn btn-flat btn-default pull-left"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-flat btn-danger" id="button_delete_confirm">Delete</button>
|
<button type="button" class="btn btn-flat btn-danger" id="button_delete_confirm">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -3,88 +3,88 @@
|
|||||||
{% endblock %} {% block dashboard_stat %}
|
{% endblock %} {% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
Settings <small>PowerDNS-Admin settings</small>
|
Settings <small>PowerDNS-Admin settings</small>
|
||||||
</h1>
|
</h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a href="{{ url_for('dashboard') }}"><i
|
<li><a href="{{ url_for('dashboard') }}"><i
|
||||||
class="fa fa-dashboard"></i> Home</a></li>
|
class="fa fa-dashboard"></i> Home</a></li>
|
||||||
<li class="active">Settings</li>
|
<li class="active">Settings</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %} {% block content %}
|
{% endblock %} {% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Settings Management</h3>
|
<h3 class="box-title">Settings Management</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<table id="tbl_settings" class="table table-bordered table-striped">
|
<table id="tbl_settings" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Value</th>
|
<th>Value</th>
|
||||||
<th>Change</th>
|
<th>Change</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for setting in settings %}
|
{% for setting in settings %}
|
||||||
<tr class="odd ">
|
<tr class="odd ">
|
||||||
<td>{{ setting.name }}</td>
|
<td>{{ setting.name }}</td>
|
||||||
{% if setting.value == "True" or setting.value == "False" %}
|
{% if setting.value == "True" or setting.value == "False" %}
|
||||||
<td>{{ setting.value }}</td>
|
<td>{{ setting.value }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td><input name="value" id="value" value="{{ setting.value }}"></td>
|
<td><input name="value" id="value" value="{{ setting.value }}"></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
{% if setting.value == "True" or setting.value == "False" %}
|
{% if setting.value == "True" or setting.value == "False" %}
|
||||||
<button type="button" class="btn btn-flat btn-warning setting-toggle-button" id="{{ setting.name }}">
|
<button type="button" class="btn btn-flat btn-warning setting-toggle-button" id="{{ setting.name }}">
|
||||||
Toggle <i class="fa fa-info"></i>
|
Toggle <i class="fa fa-info"></i>
|
||||||
</button>
|
</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="button" class="btn btn-flat btn-warning setting-save-button" id="{{ setting.name }}">
|
<button type="button" class="btn btn-flat btn-warning setting-save-button" id="{{ setting.name }}">
|
||||||
Save <i class="fa fa-info"></i>
|
Save <i class="fa fa-info"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
<!-- /.box -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col -->
|
<!-- /.col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<script>
|
<script>
|
||||||
// set up history data table
|
// set up history data table
|
||||||
$("#tbl_settings").DataTable({
|
$("#tbl_settings").DataTable({
|
||||||
"paging" : true,
|
"paging" : true,
|
||||||
"lengthChange" : false,
|
"lengthChange" : false,
|
||||||
"searching" : true,
|
"searching" : true,
|
||||||
"ordering" : true,
|
"ordering" : true,
|
||||||
"info" : true,
|
"info" : true,
|
||||||
"autoWidth" : false
|
"autoWidth" : false
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".setting-toggle-button").click(function() {
|
$(".setting-toggle-button").click(function() {
|
||||||
var setting = $(this).prop('id');
|
var setting = $(this).prop('id');
|
||||||
applyChanges('','/admin/setting/' + setting + '/toggle', false, true)
|
applyChanges('','/admin/setting/' + setting + '/toggle', false, true)
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".setting-save-button").click(function() {
|
$(".setting-save-button").click(function() {
|
||||||
var setting = $(this).prop('id');
|
var setting = $(this).prop('id');
|
||||||
var value = $(this).parents('tr').find('#value')[0].value;
|
var value = $(this).parents('tr').find('#value')[0].value;
|
||||||
var postdata = {'value': value};
|
var postdata = {'value': value};
|
||||||
applyChanges(postdata, '/admin/setting/' + setting + '/edit', false, true)
|
applyChanges(postdata, '/admin/setting/' + setting + '/edit', false, true)
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="navbar-custom-menu">
|
<div class="navbar-custom-menu">
|
||||||
{% if current_user.id is defined %}
|
{% if current_user.id is defined %}
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<!-- User Account: style can be found in dropdown.less -->
|
<!-- User Account: style can be found in dropdown.less -->
|
||||||
<li class="dropdown user user-menu">
|
<li class="dropdown user user-menu">
|
||||||
@ -72,18 +72,18 @@
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li class="user-header">
|
<li class="user-header">
|
||||||
{% if current_user.avatar %}
|
{% if current_user.avatar %}
|
||||||
<img src="{{ url_for('user_avatar', filename=current_user.avatar) }}" class="img-circle" alt="User Image"/>
|
<img src="{{ url_for('user_avatar', filename=current_user.avatar) }}" class="img-circle" alt="User Image"/>
|
||||||
{% else %}
|
{% else %}
|
||||||
<img src="{{ url_for('static', filename='adminlte2/dist/img/avatar.png') }}" class="img-circle" alt="User Image"/>
|
<img src="{{ url_for('static', filename='adminlte2/dist/img/avatar.png') }}" class="img-circle" alt="User Image"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p>
|
<p>
|
||||||
{{ current_user.firstname }} {{ current_user.lastname }}
|
{{ current_user.firstname }} {{ current_user.lastname }}
|
||||||
<small>{{ current_user.role.name }}</small>
|
<small>{{ current_user.role.name }}</small>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Menu Footer-->
|
<!-- Menu Footer-->
|
||||||
<li class="user-footer">
|
<li class="user-footer">
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% block title %}<title>DNS Control Panel - HOME</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - HOME</title>{% endblock %}
|
||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
Dashboard
|
Dashboard
|
||||||
@ -21,101 +21,101 @@
|
|||||||
{% if current_user.role.name == 'Administrator' %}
|
{% if current_user.role.name == 'Administrator' %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-3">
|
<div class="col-xs-3">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Statistics</h3>
|
<h3 class="box-title">Statistics</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<!-- small box -->
|
<!-- small box -->
|
||||||
<div class="small-box bg-aqua">
|
<div class="small-box bg-aqua">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3>{{ domain_count }}</h3>
|
<h3>{{ domain_count }}</h3>
|
||||||
<p>{% if domain_count > 1 %}Domains{% else %}Domain{% endif %}</p>
|
<p>{% if domain_count > 1 %}Domains{% else %}Domain{% endif %}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="fa fa-book"></i>
|
<i class="fa fa-book"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<a href="{{ url_for('admin_manageuser') }}">
|
<a href="{{ url_for('admin_manageuser') }}">
|
||||||
<div class="small-box bg-green">
|
<div class="small-box bg-green">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3>{{ users|length }}</h3>
|
<h3>{{ users|length }}</h3>
|
||||||
<p>{% if users|length > 1 %}Users{% else %}User{% endif %}</p>
|
<p>{% if users|length > 1 %}Users{% else %}User{% endif %}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="fa fa-users"></i>
|
<i class="fa fa-users"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<a href="{{ url_for('admin_history') }}">
|
<a href="{{ url_for('admin_history') }}">
|
||||||
<div class="small-box bg-green">
|
<div class="small-box bg-green">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3>{{ history_number }}</h3>
|
<h3>{{ history_number }}</h3>
|
||||||
<p>{% if history_number > 1 %}Histories{% else %}History{% endif %}</p>
|
<p>{% if history_number > 1 %}Histories{% else %}History{% endif %}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="fa fa-calendar"></i>
|
<i class="fa fa-calendar"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<a href="{{ url_for('admin') }}">
|
<a href="{{ url_for('admin') }}">
|
||||||
<div class="small-box bg-green">
|
<div class="small-box bg-green">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3><span style="font-size: 18px">{{ uptime|display_second_to_time }}</span></h3>
|
<h3><span style="font-size: 18px">{{ uptime|display_second_to_time }}</span></h3>
|
||||||
<p>Uptime</p>
|
<p>Uptime</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="fa fa-clock-o"></i>
|
<i class="fa fa-clock-o"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-9">
|
<div class="col-xs-9">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Recent History</h3>
|
<h3 class="box-title">Recent History</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<table id="tbl_history" class="table table-bordered table-striped">
|
<table id="tbl_history" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Changed By</th>
|
<th>Changed By</th>
|
||||||
<th>Content</th>
|
<th>Content</th>
|
||||||
<th>Time</th>
|
<th>Time</th>
|
||||||
<th>Detail</th>
|
<th>Detail</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for history in histories %}
|
{% for history in histories %}
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td>{{ history.created_by }}</td>
|
<td>{{ history.created_by }}</td>
|
||||||
<td>{{ history.msg }}</td>
|
<td>{{ history.msg }}</td>
|
||||||
<td>{{ history.created_on }}</td>
|
<td>{{ history.created_on }}</td>
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
<button type="button" class="btn btn-flat btn-primary history-info-button" value='{{ history.detail|replace("[]","None") }}'>
|
<button type="button" class="btn btn-flat btn-primary history-info-button" value='{{ history.detail|replace("[]","None") }}'>
|
||||||
Info <i class="fa fa-info"></i>
|
Info <i class="fa fa-info"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -129,9 +129,9 @@
|
|||||||
<!--
|
<!--
|
||||||
{% if current_user.role.name == 'Administrator' %}
|
{% if current_user.role.name == 'Administrator' %}
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<button type="button" class="btn btn-flat btn-primary" onclick="window.location.href='{{ url_for('domain_add') }}'">
|
<button type="button" class="btn btn-flat btn-primary" onclick="window.location.href='{{ url_for('domain_add') }}'">
|
||||||
New Domain <i class="fa fa-plus"></i>
|
New Domain <i class="fa fa-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
-->
|
-->
|
||||||
@ -148,49 +148,49 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for domain in domains %}
|
{% for domain in domains %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ url_for('domain', domain_name=domain.name) }}"><strong>{{ domain.name }}</strong></a>
|
<a href="{{ url_for('domain', domain_name=domain.name) }}"><strong>{{ domain.name }}</strong></a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if domain.dnssec %}
|
{% if domain.dnssec %}
|
||||||
<button type="button" class="btn btn-flat dnssec button_dnssec" id="{{ domain.name }}">
|
<button type="button" class="btn btn-flat dnssec button_dnssec" id="{{ domain.name }}">
|
||||||
<i class="fa fa-lock"></i> Enabled
|
<i class="fa fa-lock"></i> Enabled
|
||||||
</button>
|
</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="button" class="btn btn-flat dnssec button_dnssec" id="{{ domain.name }}">
|
<button type="button" class="btn btn-flat dnssec button_dnssec" id="{{ domain.name }}">
|
||||||
<i class="fa fa-unlock-alt"></i> Disabled
|
<i class="fa fa-unlock-alt"></i> Disabled
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ domain.type }}
|
{{ domain.type }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ domain.serial }}
|
{{ domain.serial }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if domain.master == '[]'%}N/A {% else %}{{ domain.master|display_master_name }}{% endif %}
|
{% if domain.master == '[]'%}N/A {% else %}{{ domain.master|display_master_name }}{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% if current_user.role.name !='Administrator' %}
|
{% if current_user.role.name !='Administrator' %}
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
<button type="button" class="btn btn-flat btn-success" onclick="window.location.href='{{ url_for('domain', domain_name=domain.name) }}'">
|
<button type="button" class="btn btn-flat btn-success" onclick="window.location.href='{{ url_for('domain', domain_name=domain.name) }}'">
|
||||||
Manage <i class="fa fa-cog"></i>
|
Manage <i class="fa fa-cog"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td width="20%">
|
<td width="20%">
|
||||||
<button type="button" class="btn btn-flat btn-success" onclick="window.location.href='{{ url_for('domain', domain_name=domain.name) }}'">
|
<button type="button" class="btn btn-flat btn-success" onclick="window.location.href='{{ url_for('domain', domain_name=domain.name) }}'">
|
||||||
Manage <i class="fa fa-cog"></i>
|
Manage <i class="fa fa-cog"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-flat btn-danger" onclick="window.location.href='{{ url_for('domain_management', domain_name=domain.name) }}'">
|
<button type="button" class="btn btn-flat btn-danger" onclick="window.location.href='{{ url_for('domain_management', domain_name=domain.name) }}'">
|
||||||
Admin <i class="fa fa-cog"></i>
|
Admin <i class="fa fa-cog"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -206,73 +206,73 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<script>
|
<script>
|
||||||
// set up history data table
|
// set up history data table
|
||||||
$("#tbl_history").DataTable({
|
$("#tbl_history").DataTable({
|
||||||
"paging" : false,
|
"paging" : false,
|
||||||
"lengthChange" : false,
|
"lengthChange" : false,
|
||||||
"searching" : false,
|
"searching" : false,
|
||||||
"ordering" : false,
|
"ordering" : false,
|
||||||
"info" : false,
|
"info" : false,
|
||||||
"autoWidth" : false
|
"autoWidth" : false
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".history-info-button").click(function() {
|
$(".history-info-button").click(function() {
|
||||||
var modal = $("#modal_history_info");
|
var modal = $("#modal_history_info");
|
||||||
var info = $(this).val();
|
var info = $(this).val();
|
||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
});
|
});
|
||||||
$(document).on("click", ".button_dnssec", function() {
|
$(document).on("click", ".button_dnssec", function() {
|
||||||
var domain = $(this).prop('id');
|
var domain = $(this).prop('id');
|
||||||
getdnssec('/domain/' + domain + '/dnssec');
|
getdnssec('/domain/' + domain + '/dnssec');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block modals %}
|
{% block modals %}
|
||||||
<div class="modal fade" id="modal_history_info">
|
<div class="modal fade" id="modal_history_info">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">History Details</h4>
|
<h4 class="modal-title">History Details</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-right"
|
<button type="button" class="btn btn-flat btn-default pull-right"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal -->
|
<!-- /.modal -->
|
||||||
<div class="modal fade" id="modal_dnssec_info">
|
<div class="modal fade" id="modal_dnssec_info">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">DNSSEC</h4>
|
<h4 class="modal-title">DNSSEC</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-right"
|
<button type="button" class="btn btn-flat btn-default pull-right"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal -->
|
<!-- /.modal -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -3,54 +3,54 @@
|
|||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
Manage domain <small>{{ domain.name }}</small>
|
Manage domain <small>{{ domain.name }}</small>
|
||||||
</h1>
|
</h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a href="{{ url_for('dashboard') }}"><i
|
<li><a href="{{ url_for('dashboard') }}"><i
|
||||||
class="fa fa-dashboard"></i> Home</a></li>
|
class="fa fa-dashboard"></i> Home</a></li>
|
||||||
<li>Domain</li>
|
<li>Domain</li>
|
||||||
<li class="active">{{ domain.name }}</li>
|
<li class="active">{{ domain.name }}</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Manage Records for {{ domain.name }}</h3>
|
<h3 class="box-title">Manage Records for {{ domain.name }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
{% if domain.type != 'Slave' %}
|
{% if domain.type != 'Slave' %}
|
||||||
<button type="button" class="btn btn-flat btn-primary pull-left button_add_record" id="{{ domain.name }}">
|
<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>
|
Add Record <i class="fa fa-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-flat btn-primary pull-right button_apply_changes" id="{{ domain.name }}">
|
<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>
|
Apply Changes <i class="fa fa-floppy-o"></i>
|
||||||
</button>
|
</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="button" class="btn btn-flat btn-primary pull-left button_update_from_master" id="{{ domain.name }}">
|
<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>
|
Update from Master <i class="fa fa-download"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<table id="tbl_records" class="table table-bordered table-striped">
|
<table id="tbl_records" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>TTL</th>
|
<th>TTL</th>
|
||||||
<th>Data</th>
|
<th>Data</th>
|
||||||
<th>Edit</th>
|
<th>Edit</th>
|
||||||
<th>Delete</th>
|
<th>Delete</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for record in records %}
|
{% for record in records %}
|
||||||
<tr class="odd row_record" id="{{ domain.name }}">
|
<tr class="odd row_record" id="{{ domain.name }}">
|
||||||
<td>
|
<td>
|
||||||
@ -71,115 +71,115 @@
|
|||||||
{% if domain.type != 'Slave' %}
|
{% if domain.type != 'Slave' %}
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
{% if record.is_allowed() %}
|
{% if record.is_allowed() %}
|
||||||
<button type="button" class="btn btn-flat btn-warning button_edit" id="{{ (record.name,domain.name)|display_record_name }}">
|
<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>
|
Edit <i class="fa fa-edit"></i>
|
||||||
</button>
|
</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="button" class="btn btn-flat btn-warning"">
|
<button type="button" class="btn btn-flat btn-warning"">
|
||||||
<i class="fa fa-exclamation-circle"></i>
|
<i class="fa fa-exclamation-circle"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
{% if record.is_allowed() %}
|
{% if record.is_allowed() %}
|
||||||
<button type="button" class="btn btn-flat btn-danger button_delete" id="{{ (record.name,domain.name)|display_record_name }}">
|
<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>
|
Delete <i class="fa fa-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="button" class="btn btn-flat btn-warning"">
|
<button type="button" class="btn btn-flat btn-warning"">
|
||||||
<i class="fa fa-exclamation-circle"></i>
|
<i class="fa fa-exclamation-circle"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
<button type="button" class="btn btn-flat btn-warning"">
|
<button type="button" class="btn btn-flat btn-warning"">
|
||||||
<i class="fa fa-exclamation-circle"></i>
|
<i class="fa fa-exclamation-circle"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<td width="6%">
|
<td width="6%">
|
||||||
<button type="button" class="btn btn-flat btn-warning"">
|
<button type="button" class="btn btn-flat btn-warning"">
|
||||||
<i class="fa fa-exclamation-circle"></i>
|
<i class="fa fa-exclamation-circle"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
<!-- /.box -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col -->
|
<!-- /.col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<script>
|
<script>
|
||||||
// superglobals
|
// superglobals
|
||||||
window.records_allow_edit = {{ editable_records|tojson }};
|
window.records_allow_edit = {{ editable_records|tojson }};
|
||||||
window.nEditing = null;
|
window.nEditing = null;
|
||||||
window.nNew = false;
|
window.nNew = false;
|
||||||
|
|
||||||
// set up user data table
|
// set up user data table
|
||||||
$("#tbl_records").DataTable({
|
$("#tbl_records").DataTable({
|
||||||
"paging" : true,
|
"paging" : true,
|
||||||
"lengthChange" : true,
|
"lengthChange" : true,
|
||||||
"searching" : true,
|
"searching" : true,
|
||||||
"ordering" : true,
|
"ordering" : true,
|
||||||
"info" : true,
|
"info" : true,
|
||||||
"autoWidth" : false,
|
"autoWidth" : false,
|
||||||
{% if default_record_table_size_setting in ['5','15','20'] %}
|
{% if default_record_table_size_setting in ['5','15','20'] %}
|
||||||
"lengthMenu": [ [5, 15, 20, -1],
|
"lengthMenu": [ [5, 15, 20, -1],
|
||||||
[5, 15, 20, "All"]],
|
[5, 15, 20, "All"]],
|
||||||
{% else %}
|
{% else %}
|
||||||
"lengthMenu": [ [5, 15, 20, {{ default_record_table_size_setting }}, -1],
|
"lengthMenu": [ [5, 15, 20, {{ default_record_table_size_setting }}, -1],
|
||||||
[5, 15, 20, {{ default_record_table_size_setting }}, "All"]],
|
[5, 15, 20, {{ default_record_table_size_setting }}, "All"]],
|
||||||
{% endif %}
|
{% endif %}
|
||||||
"pageLength": {{ default_record_table_size_setting }},
|
"pageLength": {{ default_record_table_size_setting }},
|
||||||
"language": {
|
"language": {
|
||||||
"lengthMenu": " _MENU_ records"
|
"lengthMenu": " _MENU_ records"
|
||||||
},
|
},
|
||||||
"retrieve" : true
|
"retrieve" : true
|
||||||
});
|
});
|
||||||
|
|
||||||
// handle delete button
|
// handle delete button
|
||||||
$(document).on("click", ".button_delete", function(e) {
|
$(document).on("click", ".button_delete", function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
var modal = $("#modal_delete");
|
var modal = $("#modal_delete");
|
||||||
var table = $("#tbl_records").DataTable();
|
var table = $("#tbl_records").DataTable();
|
||||||
var record = $(this).prop('id');
|
var record = $(this).prop('id');
|
||||||
var info = "Are you sure you want to delete " + record + "?";
|
var info = "Are you sure you want to delete " + record + "?";
|
||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.find('#button_delete_confirm').click(function() {
|
modal.find('#button_delete_confirm').click(function() {
|
||||||
table.row($(this).parents('tr')[0]).remove().draw();
|
table.row($(this).parents('tr')[0]).remove().draw();
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
})
|
})
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
|
|
||||||
});
|
});
|
||||||
// handle edit button
|
// handle edit button
|
||||||
$(document).on("click", ".button_edit, .row_record", function(e) {
|
$(document).on("click", ".button_edit, .row_record", function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if ($(this).is('tr')) {
|
if ($(this).is('tr')) {
|
||||||
var nRow = $(this)[0];
|
var nRow = $(this)[0];
|
||||||
} else {
|
} else {
|
||||||
var nRow = $(this).parents('tr')[0];
|
var nRow = $(this).parents('tr')[0];
|
||||||
}
|
}
|
||||||
var table = $("#tbl_records").DataTable();
|
var table = $("#tbl_records").DataTable();
|
||||||
|
|
||||||
if (nEditing == nRow) {
|
if (nEditing == nRow) {
|
||||||
/* click on row already being edited, do nothing */
|
/* click on row already being edited, do nothing */
|
||||||
} else if (nEditing !== null && nEditing != nRow && nNew == false) {
|
} else if (nEditing !== null && nEditing != nRow && nNew == false) {
|
||||||
/* Currently editing - but not this row - restore the old before continuing to edit mode */
|
/* Currently editing - but not this row - restore the old before continuing to edit mode */
|
||||||
restoreRow(table, nEditing);
|
restoreRow(table, nEditing);
|
||||||
editRow(table, nRow);
|
editRow(table, nRow);
|
||||||
nEditing = nRow;
|
nEditing = nRow;
|
||||||
} else if (nNew == true) {
|
} else if (nNew == true) {
|
||||||
/* adding a new row, delete it and start editing */
|
/* adding a new row, delete it and start editing */
|
||||||
table.row(nEditing).remove().draw();
|
table.row(nEditing).remove().draw();
|
||||||
nNew = false;
|
nNew = false;
|
||||||
editRow(table, nRow);
|
editRow(table, nRow);
|
||||||
@ -189,28 +189,28 @@
|
|||||||
editRow(table, nRow);
|
editRow(table, nRow);
|
||||||
nEditing = nRow;
|
nEditing = nRow;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// handle apply changes button
|
// handle apply changes button
|
||||||
$(document).on("click",".button_apply_changes", function() {
|
$(document).on("click",".button_apply_changes", function() {
|
||||||
var modal = $("#modal_apply_changes");
|
var modal = $("#modal_apply_changes");
|
||||||
var table = $("#tbl_records").DataTable();
|
var table = $("#tbl_records").DataTable();
|
||||||
var domain = $(this).prop('id');
|
var domain = $(this).prop('id');
|
||||||
var info = "Are you sure you want to apply your changes?";
|
var info = "Are you sure you want to apply your changes?";
|
||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.find('#button_apply_confirm').click(function() {
|
modal.find('#button_apply_confirm').click(function() {
|
||||||
var data = getTableData(table);
|
var data = getTableData(table);
|
||||||
applyChanges(data, '/domain/' + domain + '/apply', true);
|
applyChanges(data, '/domain/' + domain + '/apply', true);
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
})
|
})
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// handle add record button
|
// handle add record button
|
||||||
$(document).on("click", ".button_add_record", function (e) {
|
$(document).on("click", ".button_add_record", function (e) {
|
||||||
if (nNew || nEditing) {
|
if (nNew || nEditing) {
|
||||||
// TODO: replace this alert with modal
|
// TODO: replace this alert with modal
|
||||||
alert("Previous record not saved. Please save it before adding more record.")
|
alert("Previous record not saved. Please save it before adding more record.")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -222,11 +222,11 @@
|
|||||||
nEditing = nRow;
|
nEditing = nRow;
|
||||||
nNew = true;
|
nNew = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
//handle cancel button
|
//handle cancel button
|
||||||
$(document).on("click", ".button_cancel", function (e) {
|
$(document).on("click", ".button_cancel", function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
var oTable = $("#tbl_records").DataTable();
|
var oTable = $("#tbl_records").DataTable();
|
||||||
if (nNew) {
|
if (nNew) {
|
||||||
oTable.row(nEditing).remove().draw();
|
oTable.row(nEditing).remove().draw();
|
||||||
nEditing = null;
|
nEditing = null;
|
||||||
@ -236,208 +236,208 @@
|
|||||||
nEditing = null;
|
nEditing = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//handle save button
|
//handle save button
|
||||||
$(document).on("click", ".button_save", function (e) {
|
$(document).on("click", ".button_save", function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
var table = $("#tbl_records").DataTable();
|
var table = $("#tbl_records").DataTable();
|
||||||
saveRow(table, nEditing);
|
saveRow(table, nEditing);
|
||||||
nEditing = null;
|
nEditing = null;
|
||||||
nNew = false;
|
nNew = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//handle update_from_master button
|
//handle update_from_master button
|
||||||
$(document).on("click", ".button_update_from_master", function (e) {
|
$(document).on("click", ".button_update_from_master", function (e) {
|
||||||
var domain = $(this).prop('id');
|
var domain = $(this).prop('id');
|
||||||
applyChanges({'domain': domain}, '/domain/' + domain + '/update');
|
applyChanges({'domain': domain}, '/domain/' + domain + '/update');
|
||||||
});
|
});
|
||||||
|
|
||||||
{% if record_helper_setting %}
|
{% if record_helper_setting %}
|
||||||
//handle wacky record types
|
//handle wacky record types
|
||||||
$(document).on("focus", "#current_edit_record_data", function (e) {
|
$(document).on("focus", "#current_edit_record_data", function (e) {
|
||||||
var record_type = $(this).parents("tr").find('#record_type').val();
|
var record_type = $(this).parents("tr").find('#record_type').val();
|
||||||
var record_data = $(this);
|
var record_data = $(this);
|
||||||
if (record_type == "MX") {
|
if (record_type == "MX") {
|
||||||
var modal = $("#modal_custom_record");
|
var modal = $("#modal_custom_record");
|
||||||
if (record_data.val() == "") {
|
if (record_data.val() == "") {
|
||||||
var form = " <label for=\"mx_priority\">MX Priority</label> \
|
var form = " <label for=\"mx_priority\">MX Priority</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"mx_priority\" id=\"mx_priority\" placeholder=\"10\"> \
|
<input type=\"text\" class=\"form-control\" name=\"mx_priority\" id=\"mx_priority\" placeholder=\"10\"> \
|
||||||
<label for=\"mx_server\">MX Server</label> \
|
<label for=\"mx_server\">MX Server</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"mx_server\" id=\"mx_server\" placeholder=\"postfix.example.com\"> \
|
<input type=\"text\" class=\"form-control\" name=\"mx_server\" id=\"mx_server\" placeholder=\"postfix.example.com\"> \
|
||||||
";
|
";
|
||||||
} else {
|
} else {
|
||||||
var parts = record_data.val().split(" ");
|
var parts = record_data.val().split(" ");
|
||||||
var form = " <label for=\"mx_priority\">MX Priority</label> \
|
var form = " <label for=\"mx_priority\">MX Priority</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"mx_priority\" id=\"mx_priority\" placeholder=\"10\" value=\"" + parts[0] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"mx_priority\" id=\"mx_priority\" placeholder=\"10\" value=\"" + parts[0] + "\"> \
|
||||||
<label for=\"mx_server\">MX Server</label> \
|
<label for=\"mx_server\">MX Server</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"mx_server\" id=\"mx_server\" placeholder=\"postfix.example.com\" value=\"" + parts[1] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"mx_server\" id=\"mx_server\" placeholder=\"postfix.example.com\" value=\"" + parts[1] + "\"> \
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
modal.find('.modal-body p').html(form);
|
modal.find('.modal-body p').html(form);
|
||||||
modal.find('#button_save').click(function() {
|
modal.find('#button_save').click(function() {
|
||||||
mx_server = modal.find('#mx_server').val();
|
mx_server = modal.find('#mx_server').val();
|
||||||
mx_priority = modal.find('#mx_priority').val();
|
mx_priority = modal.find('#mx_priority').val();
|
||||||
data = mx_priority + " " + mx_server;
|
data = mx_priority + " " + mx_server;
|
||||||
record_data.val(data);
|
record_data.val(data);
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
})
|
})
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
} else if (record_type == "SRV") {
|
} else if (record_type == "SRV") {
|
||||||
var modal = $("#modal_custom_record");
|
var modal = $("#modal_custom_record");
|
||||||
if (record_data.val() == "") {
|
if (record_data.val() == "") {
|
||||||
var form = " <label for=\"srv_priority\">SRV Priority</label> \
|
var form = " <label for=\"srv_priority\">SRV Priority</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"srv_priority\" id=\"srv_priority\" placeholder=\"0\"> \
|
<input type=\"text\" class=\"form-control\" name=\"srv_priority\" id=\"srv_priority\" placeholder=\"0\"> \
|
||||||
<label for=\"srv_weight\">SRV Weight</label> \
|
<label for=\"srv_weight\">SRV Weight</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"srv_weight\" id=\"srv_weight\" placeholder=\"10\"> \
|
<input type=\"text\" class=\"form-control\" name=\"srv_weight\" id=\"srv_weight\" placeholder=\"10\"> \
|
||||||
<label for=\"srv_port\">SRV Port</label> \
|
<label for=\"srv_port\">SRV Port</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"srv_port\" id=\"srv_port\" placeholder=\"5060\"> \
|
<input type=\"text\" class=\"form-control\" name=\"srv_port\" id=\"srv_port\" placeholder=\"5060\"> \
|
||||||
<label for=\"srv_target\">SRV Target</label> \
|
<label for=\"srv_target\">SRV Target</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"srv_target\" id=\"srv_target\" placeholder=\"sip.example.com\"> \
|
<input type=\"text\" class=\"form-control\" name=\"srv_target\" id=\"srv_target\" placeholder=\"sip.example.com\"> \
|
||||||
";
|
";
|
||||||
} else {
|
} else {
|
||||||
var parts = record_data.val().split(" ");
|
var parts = record_data.val().split(" ");
|
||||||
var form = " <label for=\"srv_priority\">SRV Priority</label> \
|
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] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"srv_priority\" id=\"srv_priority\" placeholder=\"0\" value=\"" + parts[0] + "\"> \
|
||||||
<label for=\"srv_weight\">SRV Weight</label> \
|
<label for=\"srv_weight\">SRV Weight</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"srv_weight\" id=\"srv_weight\" placeholder=\"10\" value=\"" + parts[1] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"srv_weight\" id=\"srv_weight\" placeholder=\"10\" value=\"" + parts[1] + "\"> \
|
||||||
<label for=\"srv_port\">SRV Port</label> \
|
<label for=\"srv_port\">SRV Port</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"srv_port\" id=\"srv_port\" placeholder=\"5060\" value=\"" + parts[2] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"srv_port\" id=\"srv_port\" placeholder=\"5060\" value=\"" + parts[2] + "\"> \
|
||||||
<label for=\"srv_target\">SRV Target</label> \
|
<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] + "\"> \
|
<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('.modal-body p').html(form);
|
||||||
modal.find('#button_save').click(function() {
|
modal.find('#button_save').click(function() {
|
||||||
srv_priority = modal.find('#srv_priority').val();
|
srv_priority = modal.find('#srv_priority').val();
|
||||||
srv_weight = modal.find('#srv_weight').val();
|
srv_weight = modal.find('#srv_weight').val();
|
||||||
srv_port = modal.find('#srv_port').val();
|
srv_port = modal.find('#srv_port').val();
|
||||||
srv_target = modal.find('#srv_target').val();
|
srv_target = modal.find('#srv_target').val();
|
||||||
data = srv_priority + " " + srv_weight + " " + srv_port + " " + srv_target;
|
data = srv_priority + " " + srv_weight + " " + srv_port + " " + srv_target;
|
||||||
record_data.val(data);
|
record_data.val(data);
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
})
|
})
|
||||||
} else if (record_type == "SOA") {
|
} else if (record_type == "SOA") {
|
||||||
var modal = $("#modal_custom_record");
|
var modal = $("#modal_custom_record");
|
||||||
if (record_data.val() == "") {
|
if (record_data.val() == "") {
|
||||||
var form = " <label for=\"soa_primaryns\">Primary Name Server</label> \
|
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\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_primaryns\" id=\"soa_primaryns\" placeholder=\"ns1.example.com\"> \
|
||||||
<label for=\"soa_adminemail\">Primary Contact</label> \
|
<label for=\"soa_adminemail\">Primary Contact</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_adminemail\" id=\"soa_adminemail\" placeholder=\"admin.example.com\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_adminemail\" id=\"soa_adminemail\" placeholder=\"admin.example.com\"> \
|
||||||
<label for=\"soa_serial\">Serial</label> \
|
<label for=\"soa_serial\">Serial</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_serial\" id=\"soa_serial\" placeholder=\"2016010101\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_serial\" id=\"soa_serial\" placeholder=\"2016010101\"> \
|
||||||
<label for=\"soa_zonerefresh\">Zone refresh timer</label> \
|
<label for=\"soa_zonerefresh\">Zone refresh timer</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_zonerefresh\" id=\"soa_zonerefresh\" placeholder=\"86400\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_zonerefresh\" id=\"soa_zonerefresh\" placeholder=\"86400\"> \
|
||||||
<label for=\"soa_failedzonerefresh\">Failed refresh retry timer</label> \
|
<label for=\"soa_failedzonerefresh\">Failed refresh retry timer</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_failedzonerefresh\" id=\"soa_failedzonerefresh\" placeholder=\"7200\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_failedzonerefresh\" id=\"soa_failedzonerefresh\" placeholder=\"7200\"> \
|
||||||
<label for=\"soa_zoneexpiry\">Zone expiry timer</label> \
|
<label for=\"soa_zoneexpiry\">Zone expiry timer</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_zoneexpiry\" id=\"soa_zoneexpiry\" placeholder=\"604800\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_zoneexpiry\" id=\"soa_zoneexpiry\" placeholder=\"604800\"> \
|
||||||
<label for=\"soa_minimumttl\">Minimum TTL</label> \
|
<label for=\"soa_minimumttl\">Minimum TTL</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_minimumttl\" id=\"soa_minimumttl\" placeholder=\"300\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_minimumttl\" id=\"soa_minimumttl\" placeholder=\"300\"> \
|
||||||
";
|
";
|
||||||
} else {
|
} else {
|
||||||
var parts = record_data.val().split(" ");
|
var parts = record_data.val().split(" ");
|
||||||
var form = " <label for=\"soa_primaryns\">Primary Name Server</label> \
|
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] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_primaryns\" id=\"soa_primaryns\" value=\"" + parts[0] + "\"> \
|
||||||
<label for=\"soa_adminemail\">Primary Contact</label> \
|
<label for=\"soa_adminemail\">Primary Contact</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_adminemail\" id=\"soa_adminemail\" value=\"" + parts[1] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_adminemail\" id=\"soa_adminemail\" value=\"" + parts[1] + "\"> \
|
||||||
<label for=\"soa_serial\">Serial</label> \
|
<label for=\"soa_serial\">Serial</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_serial\" id=\"soa_serial\" value=\"" + parts[2] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_serial\" id=\"soa_serial\" value=\"" + parts[2] + "\"> \
|
||||||
<label for=\"soa_zonerefresh\">Zone refresh timer</label> \
|
<label for=\"soa_zonerefresh\">Zone refresh timer</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_zonerefresh\" id=\"soa_zonerefresh\" value=\"" + parts[3] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_zonerefresh\" id=\"soa_zonerefresh\" value=\"" + parts[3] + "\"> \
|
||||||
<label for=\"soa_failedzonerefresh\">Failed refresh retry timer</label> \
|
<label for=\"soa_failedzonerefresh\">Failed refresh retry timer</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_failedzonerefresh\" id=\"soa_failedzonerefresh\" value=\"" + parts[4] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_failedzonerefresh\" id=\"soa_failedzonerefresh\" value=\"" + parts[4] + "\"> \
|
||||||
<label for=\"soa_zoneexpiry\">Zone expiry timer</label> \
|
<label for=\"soa_zoneexpiry\">Zone expiry timer</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_zoneexpiry\" id=\"soa_zoneexpiry\" value=\"" + parts[5] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_zoneexpiry\" id=\"soa_zoneexpiry\" value=\"" + parts[5] + "\"> \
|
||||||
<label for=\"soa_minimumttl\">Minimum TTL</label> \
|
<label for=\"soa_minimumttl\">Minimum TTL</label> \
|
||||||
<input type=\"text\" class=\"form-control\" name=\"soa_minimumttl\" id=\"soa_minimumttl\" value=\"" + parts[6] + "\"> \
|
<input type=\"text\" class=\"form-control\" name=\"soa_minimumttl\" id=\"soa_minimumttl\" value=\"" + parts[6] + "\"> \
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
modal.find('.modal-body p').html(form);
|
modal.find('.modal-body p').html(form);
|
||||||
modal.find('#button_save').click(function() {
|
modal.find('#button_save').click(function() {
|
||||||
soa_primaryns = modal.find('#soa_primaryns').val();
|
soa_primaryns = modal.find('#soa_primaryns').val();
|
||||||
soa_adminemail = modal.find('#soa_adminemail').val();
|
soa_adminemail = modal.find('#soa_adminemail').val();
|
||||||
soa_serial = modal.find('#soa_serial').val();
|
soa_serial = modal.find('#soa_serial').val();
|
||||||
soa_zonerefresh = modal.find('#soa_zonerefresh').val();
|
soa_zonerefresh = modal.find('#soa_zonerefresh').val();
|
||||||
soa_failedzonerefresh = modal.find('#soa_failedzonerefresh').val();
|
soa_failedzonerefresh = modal.find('#soa_failedzonerefresh').val();
|
||||||
soa_zoneexpiry = modal.find('#soa_zoneexpiry').val();
|
soa_zoneexpiry = modal.find('#soa_zoneexpiry').val();
|
||||||
soa_minimumttl = modal.find('#soa_minimumttl').val();
|
soa_minimumttl = modal.find('#soa_minimumttl').val();
|
||||||
|
|
||||||
data = soa_primaryns + " " + soa_adminemail + " " + soa_serial + " " + soa_zonerefresh + " " + soa_failedzonerefresh + " " + soa_zoneexpiry + " " + soa_minimumttl;
|
data = soa_primaryns + " " + soa_adminemail + " " + soa_serial + " " + soa_zonerefresh + " " + soa_failedzonerefresh + " " + soa_zoneexpiry + " " + soa_minimumttl;
|
||||||
record_data.val(data);
|
record_data.val(data);
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
})
|
})
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block modals %}
|
{% block modals %}
|
||||||
<div class="modal fade modal-warning" id="modal_delete">
|
<div class="modal fade modal-warning" id="modal_delete">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Confirmation</h4>
|
<h4 class="modal-title">Confirmation</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-left"
|
<button type="button" class="btn btn-flat btn-default pull-left"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-flat btn-danger" id="button_delete_confirm">Delete</button>
|
<button type="button" class="btn btn-flat btn-danger" id="button_delete_confirm">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<div class="modal fade modal-primary" id="modal_apply_changes">
|
<div class="modal fade modal-primary" id="modal_apply_changes">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Confirmation</h4>
|
<h4 class="modal-title">Confirmation</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-left"
|
<button type="button" class="btn btn-flat btn-default pull-left"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-flat btn-primary" id="button_apply_confirm">Apply</button>
|
<button type="button" class="btn btn-flat btn-primary" id="button_apply_confirm">Apply</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<div class="modal fade modal-primary" id="modal_custom_record">
|
<div class="modal fade modal-primary" id="modal_custom_record">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Custom Record</h4>
|
<h4 class="modal-title">Custom Record</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-primary" id="button_save">Save</button>
|
<button type="button" class="btn btn-flat btn-primary" id="button_save">Save</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% block title %}<title>DNS Control Panel - Add Domain</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - Add Domain</title>{% endblock %}
|
||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
Domain
|
Domain
|
||||||
@ -19,152 +19,152 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Create new domain</h3>
|
<h3 class="box-title">Create new domain</h3>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-header -->
|
<!-- /.box-header -->
|
||||||
<!-- form start -->
|
<!-- form start -->
|
||||||
<form role="form" method="post" action="{{ url_for('domain_add') }}">
|
<form role="form" method="post" action="{{ url_for('domain_add') }}">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" name="domain_name" id="domain_name" placeholder="Enter a valid domain name (required)">
|
<input type="text" class="form-control" name="domain_name" id="domain_name" placeholder="Enter a valid domain name (required)">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Type</label>
|
<label>Type</label>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type" id="radio_type_native" value="native" checked> Native
|
<input type="radio" name="radio_type" id="radio_type_native" value="native" checked> Native
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type"id="radio_type_master" value="master"> Master
|
<input type="radio" name="radio_type"id="radio_type_master" value="master"> Master
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type" id="radio_type_slave" value="slave">Slave
|
<input type="radio" name="radio_type" id="radio_type_slave" value="slave">Slave
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" style="display: none;" id="domain_master_address_div">
|
<div class="form-group" style="display: none;" id="domain_master_address_div">
|
||||||
<input type="text" class="form-control" name="domain_master_address" id="domain_master_address" placeholder="Enter valid master ip addresses (separated by commas)">
|
<input type="text" class="form-control" name="domain_master_address" id="domain_master_address" placeholder="Enter valid master ip addresses (separated by commas)">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>SOA-EDIT-API</label>
|
<label>SOA-EDIT-API</label>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type_soa_edit_api" id="radio_off" value="OFF" checked> (OFF)
|
<input type="radio" name="radio_type_soa_edit_api" id="radio_off" value="OFF" checked> (OFF)
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type_soa_edit_api" id="radio_inception_increment" value="INCEPTION-INCREMENT"> INCEPTION-INCREMENT
|
<input type="radio" name="radio_type_soa_edit_api" id="radio_inception_increment" value="INCEPTION-INCREMENT"> INCEPTION-INCREMENT
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type_soa_edit_api" id="radio_inception" value="INCEPTION"> INCEPTION
|
<input type="radio" name="radio_type_soa_edit_api" id="radio_inception" value="INCEPTION"> INCEPTION
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type_soa_edit_api" id="radio_increment_week" value="INCREMENT-WEEK"> INCREMENT-WEEK
|
<input type="radio" name="radio_type_soa_edit_api" id="radio_increment_week" value="INCREMENT-WEEK"> INCREMENT-WEEK
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type_soa_edit_api" id="radio_increment_weeks" value="INCREMENT-WEEKS"> INCREMENT-WEEKS
|
<input type="radio" name="radio_type_soa_edit_api" id="radio_increment_weeks" value="INCREMENT-WEEKS"> INCREMENT-WEEKS
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type_soa_edit_api" id="radio_epoch" value="EPOCH"> EPOCH
|
<input type="radio" name="radio_type_soa_edit_api" id="radio_epoch" value="EPOCH"> EPOCH
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="radio_type_soa_edit_api" id="radio_inception_epoch" value="INCEPTION-EPOCH"> INCEPTION-EPOCH
|
<input type="radio" name="radio_type_soa_edit_api" id="radio_inception_epoch" value="INCEPTION-EPOCH"> INCEPTION-EPOCH
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
|
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<button type="submit" class="btn btn-flat btn-primary">Submit</button>
|
<button type="submit" class="btn btn-flat btn-primary">Submit</button>
|
||||||
<button type="submit" class="btn btn-flat btn-default" onclick="window.location.href='{{ url_for('dashboard') }}'">Cancel</button>
|
<button type="submit" class="btn btn-flat btn-default" onclick="window.location.href='{{ url_for('dashboard') }}'">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
<!-- /.box -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Help with creating a new domain</h3>
|
<h3 class="box-title">Help with creating a new domain</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>Domain name</dt>
|
<dt>Domain name</dt>
|
||||||
<dd>Enter your domain name in the format of name.tld (eg. powerdns-admin.com). You can also enter sub-domains to create a sub-root zone (eg. sub.powerdns-admin.com) in case you want to delegate sub-domain management to specific users.</dd>
|
<dd>Enter your domain name in the format of name.tld (eg. powerdns-admin.com). You can also enter sub-domains to create a sub-root zone (eg. sub.powerdns-admin.com) in case you want to delegate sub-domain management to specific users.</dd>
|
||||||
<dt>Type</dt>
|
<dt>Type</dt>
|
||||||
<dd>The type decides how the domain will be replicated across multiple DNS servers.
|
<dd>The type decides how the domain will be replicated across multiple DNS servers.
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
Native - PowerDNS will not perform any replication. Use this if you only have one PowerDNS server or you handle replication via your backend (MySQL).
|
Native - PowerDNS will not perform any replication. Use this if you only have one PowerDNS server or you handle replication via your backend (MySQL).
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Master - This PowerDNS server will serve as the master and will send zone transfers (AXFRs) to other servers configured as slaves.
|
Master - This PowerDNS server will serve as the master and will send zone transfers (AXFRs) to other servers configured as slaves.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Slave - This PowerDNS server will serve as the slave and will request and receive zone transfers (AXFRs) from other servers configured as masters.
|
Slave - This PowerDNS server will serve as the slave and will request and receive zone transfers (AXFRs) from other servers configured as masters.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>SOA-EDIT-API</dt>
|
<dt>SOA-EDIT-API</dt>
|
||||||
<dd>The SOA-EDIT-API setting defines when and how the SOA serial number will be updated after a change is made to the domain.
|
<dd>The SOA-EDIT-API setting defines when and how the SOA serial number will be updated after a change is made to the domain.
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
(OFF) - Not set
|
(OFF) - Not set
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
INCEPTION-INCREMENT - Uses YYYYMMDDSS format for SOA serial numbers. If the SOA serial from the backend is within two days after inception, it gets incremented by two (the backend should keep SS below 98).
|
INCEPTION-INCREMENT - Uses YYYYMMDDSS format for SOA serial numbers. If the SOA serial from the backend is within two days after inception, it gets incremented by two (the backend should keep SS below 98).
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
INCEPTION - Sets the SOA serial to the last inception time in YYYYMMDD01 format. Uses localtime to find the day for inception time. <strong>Not recomended.</strong>
|
INCEPTION - Sets the SOA serial to the last inception time in YYYYMMDD01 format. Uses localtime to find the day for inception time. <strong>Not recomended.</strong>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
INCREMENT-WEEK - Sets the SOA serial to the number of weeks since the epoch, which is the last inception time in weeks. <strong>Not recomended.</strong>
|
INCREMENT-WEEK - Sets the SOA serial to the number of weeks since the epoch, which is the last inception time in weeks. <strong>Not recomended.</strong>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
INCREMENT-WEEKS - Increments the serial with the number of weeks since the UNIX epoch. This should work in every setup; but the result won't look like YYYYMMDDSS anymore.
|
INCREMENT-WEEKS - Increments the serial with the number of weeks since the UNIX epoch. This should work in every setup; but the result won't look like YYYYMMDDSS anymore.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
EPOCH - Sets the SOA serial to the number of seconds since the epoch.
|
EPOCH - Sets the SOA serial to the number of seconds since the epoch.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
INCEPTION-EPOCH - Sets the new SOA serial number to the maximum of the old SOA serial number, and age in seconds of the last inception.
|
INCEPTION-EPOCH - Sets the new SOA serial number to the maximum of the old SOA serial number, and age in seconds of the last inception.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<p>Find more details at <a href="https://docs.powerdns.com/md/">https://docs.powerdns.com/md/</a></p>
|
<p>Find more details at <a href="https://docs.powerdns.com/md/">https://docs.powerdns.com/md/</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<script>
|
<script>
|
||||||
$("input[name=radio_type]").change(function() {
|
$("input[name=radio_type]").change(function() {
|
||||||
var type = $(this).val();
|
var type = $(this).val();
|
||||||
if (type == "slave") {
|
if (type == "slave") {
|
||||||
$("#domain_master_address_div").show();
|
$("#domain_master_address_div").show();
|
||||||
} else {
|
} else {
|
||||||
$("#domain_master_address_div").hide();
|
$("#domain_master_address_div").hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -2,74 +2,74 @@
|
|||||||
{% block title %}<title>DNS Control Panel - Domain Management</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - Domain Management</title>{% endblock %}
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
Manage domain <small>{{ domain.name }}</small>
|
Manage domain <small>{{ domain.name }}</small>
|
||||||
</h1>
|
</h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a href="{{ url_for('dashboard') }}"><i
|
<li><a href="{{ url_for('dashboard') }}"><i
|
||||||
class="fa fa-dashboard"></i> Home</a></li>
|
class="fa fa-dashboard"></i> Home</a></li>
|
||||||
<li class="active">Domain Management</li>
|
<li class="active">Domain Management</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<form method="post" action="{{ url_for('domain_management', domain_name=domain.name) }}">
|
<form method="post" action="{{ url_for('domain_management', domain_name=domain.name) }}">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Domain Access Control</h3>
|
<h3 class="box-title">Domain Access Control</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-2">
|
<div class="col-xs-2">
|
||||||
<p>Users on the right have access to manage the records in
|
<p>Users on the right have access to manage the records in
|
||||||
the {{ domain.name }} domain.</p>
|
the {{ domain.name }} domain.</p>
|
||||||
<p>Click on users to move from between columns.</p>
|
<p>Click on users to move from between columns.</p>
|
||||||
<p>
|
<p>
|
||||||
Users in <font style="color: red;">red</font> are Administrators
|
Users in <font style="color: red;">red</font> are Administrators
|
||||||
and already have access to <b>ALL</b> domains.
|
and already have access to <b>ALL</b> domains.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-xs-2">
|
<div class="form-group col-xs-2">
|
||||||
<select multiple="multiple" class="form-control" id="domain_multi_user" name="domain_multi_user[]">
|
<select multiple="multiple" class="form-control" id="domain_multi_user" name="domain_multi_user[]">
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<option {% if user.id in
|
<option {% if user.id in
|
||||||
domain_user_ids %}selected{% endif %} value="{{ user.username }}"
|
domain_user_ids %}selected{% endif %} value="{{ user.username }}"
|
||||||
{% if user.role.name== 'Administrator' %}style="color: red"{% endif %}>{{
|
{% if user.role.name== 'Administrator' %}style="color: red"{% endif %}>{{
|
||||||
user.username}}</option> {% endfor %}
|
user.username}}</option> {% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="col-xs-offset-2">
|
<div class="col-xs-offset-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-flat btn-primary"><i class="fa fa-check"></i> Save</button>
|
<button type="submit" class="btn btn-flat btn-primary"><i class="fa fa-check"></i> Save</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Domain Deletion</h3>
|
<h3 class="box-title">Domain Deletion</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<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>
|
<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 }}">
|
<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 }}
|
<i class="fa fa-trash"></i> DELETE DOMAIN {{ domain.name }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
@ -78,43 +78,43 @@ $("#domain_multi_user").multiSelect();
|
|||||||
|
|
||||||
// handle deletion of user
|
// handle deletion of user
|
||||||
$('.delete_domain').click(function() {
|
$('.delete_domain').click(function() {
|
||||||
var modal = $("#modal_delete_domain");
|
var modal = $("#modal_delete_domain");
|
||||||
var domain = $(this).prop('id');
|
var domain = $(this).prop('id');
|
||||||
var info = "Are you sure you want to delete " + domain + "?";
|
var info = "Are you sure you want to delete " + domain + "?";
|
||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.find('#button_delete_confirm').click(function() {
|
modal.find('#button_delete_confirm').click(function() {
|
||||||
$.get('/admin/domain/' + domain + '/delete');
|
$.get('/admin/domain/' + domain + '/delete');
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
window.location.href = '{{ url_for('dashboard') }}';
|
window.location.href = '{{ url_for('dashboard') }}';
|
||||||
})
|
})
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block modals %}
|
{% block modals %}
|
||||||
<div class="modal fade modal-warning" id="modal_delete_domain">
|
<div class="modal fade modal-warning" id="modal_delete_domain">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-label="Close">
|
aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Confirmation</h4>
|
<h4 class="modal-title">Confirmation</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-flat btn-default pull-left"
|
<button type="button" class="btn btn-flat btn-default pull-left"
|
||||||
data-dismiss="modal">Close</button>
|
data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-flat btn-danger" id="button_delete_confirm">
|
<button type="button" class="btn btn-flat btn-danger" id="button_delete_confirm">
|
||||||
Delete</button>
|
Delete</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content -->
|
<!-- /.modal-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -2,7 +2,7 @@
|
|||||||
{% block title %}<title>DNS Control Panel - 400 Error</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - 400 Error</title>{% endblock %}
|
||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
400
|
400
|
||||||
@ -18,20 +18,20 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="error-page">
|
<div class="error-page">
|
||||||
<h2 class="headline text-yellow">400</h2>
|
<h2 class="headline text-yellow">400</h2>
|
||||||
<div class="error-content">
|
<div class="error-content">
|
||||||
<h3>
|
<h3>
|
||||||
<i class="fa fa-warning text-yellow"></i> Oops! Bad request
|
<i class="fa fa-warning text-yellow"></i> Oops! Bad request
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
The server refused to process your request and return a 400 error.
|
The server refused to process your request and return a 400 error.
|
||||||
You may <a href="{{ url_for('dashboard') }}">return to the dashboard</a>.
|
You may <a href="{{ url_for('dashboard') }}">return to the dashboard</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.error-content -->
|
<!-- /.error-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.error-page -->
|
<!-- /.error-page -->
|
||||||
</section>
|
</section>
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% block title %}<title>DNS Control Panel - 401 Error</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - 401 Error</title>{% endblock %}
|
||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
401
|
401
|
||||||
@ -18,20 +18,20 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="error-page">
|
<div class="error-page">
|
||||||
<h2 class="headline text-yellow">401</h2>
|
<h2 class="headline text-yellow">401</h2>
|
||||||
<div class="error-content">
|
<div class="error-content">
|
||||||
<h3>
|
<h3>
|
||||||
<i class="fa fa-warning text-yellow"></i> Oops! Access denied
|
<i class="fa fa-warning text-yellow"></i> Oops! Access denied
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
You don't have permission to access this page
|
You don't have permission to access this page
|
||||||
You may <a href="{{ url_for('dashboard') }}">return to the dashboard</a>.
|
You may <a href="{{ url_for('dashboard') }}">return to the dashboard</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.error-content -->
|
<!-- /.error-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.error-page -->
|
<!-- /.error-page -->
|
||||||
</section>
|
</section>
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% block title %}<title>DNS Control Panel - 404 Error</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - 404 Error</title>{% endblock %}
|
||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
404
|
404
|
||||||
@ -18,20 +18,20 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="error-page">
|
<div class="error-page">
|
||||||
<h2 class="headline text-yellow">404</h2>
|
<h2 class="headline text-yellow">404</h2>
|
||||||
<div class="error-content">
|
<div class="error-content">
|
||||||
<h3>
|
<h3>
|
||||||
<i class="fa fa-warning text-yellow"></i> Oops! You're lost
|
<i class="fa fa-warning text-yellow"></i> Oops! You're lost
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
The page you requested could not be found.
|
The page you requested could not be found.
|
||||||
You may <a href="{{ url_for('dashboard') }}">return to the dashboard</a>.
|
You may <a href="{{ url_for('dashboard') }}">return to the dashboard</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.error-content -->
|
<!-- /.error-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.error-page -->
|
<!-- /.error-page -->
|
||||||
</section>
|
</section>
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% block title %}<title>DNS Control Panel - 500 Error</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - 500 Error</title>{% endblock %}
|
||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
500
|
500
|
||||||
@ -18,20 +18,20 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="error-page">
|
<div class="error-page">
|
||||||
<h2 class="headline text-yellow">500</h2>
|
<h2 class="headline text-yellow">500</h2>
|
||||||
<div class="error-content">
|
<div class="error-content">
|
||||||
<h3>
|
<h3>
|
||||||
<i class="fa fa-warning text-yellow"></i> Oops! Something went wrong
|
<i class="fa fa-warning text-yellow"></i> Oops! Something went wrong
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
Try again later.
|
Try again later.
|
||||||
You may <a href="{{ url_for('dashboard') }}">return to the dashboard</a>.
|
You may <a href="{{ url_for('dashboard') }}">return to the dashboard</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.error-content -->
|
<!-- /.error-content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.error-page -->
|
<!-- /.error-page -->
|
||||||
</section>
|
</section>
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -32,13 +32,13 @@
|
|||||||
<!-- /.login-logo -->
|
<!-- /.login-logo -->
|
||||||
<div class="login-box-body">
|
<div class="login-box-body">
|
||||||
{% if error %}
|
{% if error %}
|
||||||
<div class="alert alert-danger alert-dismissible">
|
<div class="alert alert-danger alert-dismissible">
|
||||||
<button type="button" class="close" data-dismiss="alert"
|
<button type="button" class="close" data-dismiss="alert"
|
||||||
aria-hidden="true">×</button>
|
aria-hidden="true">×</button>
|
||||||
{{ error }}
|
{{ error }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
{% if username %}
|
{% if username %}
|
||||||
<input type="text" class="form-control" placeholder="Username" name="username" value="{{ username }}">
|
<input type="text" class="form-control" placeholder="Username" name="username" value="{{ username }}">
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<span class="glyphicon glyphicon-user form-control-feedback"></span>
|
<span class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
{% if password %}
|
{% if password %}
|
||||||
<input type="password" class="form-control" placeholder="Password" name="password" value="{{ password }}">
|
<input type="password" class="form-control" placeholder="Password" name="password" value="{{ password }}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="password" class="form-control" placeholder="Password" name="password">
|
<input type="password" class="form-control" placeholder="Password" name="password">
|
||||||
@ -58,28 +58,28 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="otptoken" class="form-control" placeholder="OTP Token" name="otptoken">
|
<input type="otptoken" class="form-control" placeholder="OTP Token" name="otptoken">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if ldap_enabled and basic_enabled %}
|
{% if ldap_enabled and basic_enabled %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<select class="form-control" name="auth_method">
|
<select class="form-control" name="auth_method">
|
||||||
<option value="LOCAL">LOCAL Authentication</option>
|
<option value="LOCAL">LOCAL Authentication</option>
|
||||||
<option value="LDAP">LDAP Authentication</option>
|
<option value="LDAP">LDAP Authentication</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{% elif ldap_enabled and not basic_enabled %}
|
{% elif ldap_enabled and not basic_enabled %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="hidden" name="auth_method" value="LDAP">
|
<input type="hidden" name="auth_method" value="LDAP">
|
||||||
</div>
|
</div>
|
||||||
{% elif basic_enabled and not ldap_enabled %}
|
{% elif basic_enabled and not ldap_enabled %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="hidden" name="auth_method" value="LOCAL">
|
<input type="hidden" name="auth_method" value="LOCAL">
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="hidden" name="auth_method" value="LOCAL">
|
<input type="hidden" name="auth_method" value="LOCAL">
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-8">
|
<div class="col-xs-8">
|
||||||
<div class="checkbox icheck">
|
<div class="checkbox icheck">
|
||||||
@ -101,7 +101,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- /.login-box-body -->
|
<!-- /.login-box-body -->
|
||||||
<div class="login-box-footer">
|
<div class="login-box-footer">
|
||||||
<center><p>2016 © Khanh Ngo</p></center>
|
<center><p>2016 © Khanh Ngo</p></center>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.login-box -->
|
<!-- /.login-box -->
|
||||||
|
@ -30,61 +30,61 @@
|
|||||||
<a href="{{ url_for('index') }}"><b>PowerDNS</b>-Admin</a>
|
<a href="{{ url_for('index') }}"><b>PowerDNS</b>-Admin</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="register-box-body">
|
<div class="register-box-body">
|
||||||
{% if error %}
|
{% if error %}
|
||||||
<div class="alert alert-danger alert-dismissible">
|
<div class="alert alert-danger alert-dismissible">
|
||||||
<button type="button" class="close" data-dismiss="alert"
|
<button type="button" class="close" data-dismiss="alert"
|
||||||
aria-hidden="true">×</button>
|
aria-hidden="true">×</button>
|
||||||
{{ error }}
|
{{ error }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p class="login-box-msg">Enter your personal details below</p>
|
<p class="login-box-msg">Enter your personal details below</p>
|
||||||
<form action="{{ url_for('login') }}" method="post">
|
<form action="{{ url_for('login') }}" method="post">
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<input type="text" class="form-control" placeholder="First Name"
|
<input type="text" class="form-control" placeholder="First Name"
|
||||||
name="firstname"> <span
|
name="firstname"> <span
|
||||||
class="glyphicon glyphicon-user form-control-feedback"></span>
|
class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<input type="text" class="form-control" placeholder="Last name"
|
<input type="text" class="form-control" placeholder="Last name"
|
||||||
name="lastname"> <span
|
name="lastname"> <span
|
||||||
class="glyphicon glyphicon-user form-control-feedback"></span>
|
class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<input type="email" class="form-control" placeholder="Email"
|
<input type="email" class="form-control" placeholder="Email"
|
||||||
name="email"> <span
|
name="email"> <span
|
||||||
class="glyphicon glyphicon-envelope form-control-feedback"></span>
|
class="glyphicon glyphicon-envelope form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<p class="login-box-msg">Enter your account details below</p>
|
<p class="login-box-msg">Enter your account details below</p>
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<input type="text" class="form-control" placeholder="Username"
|
<input type="text" class="form-control" placeholder="Username"
|
||||||
name="username"> <span
|
name="username"> <span
|
||||||
class="glyphicon glyphicon-user form-control-feedback"></span>
|
class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<input type="password" class="form-control" placeholder="Password"
|
<input type="password" class="form-control" placeholder="Password"
|
||||||
name="password"> <span
|
name="password"> <span
|
||||||
class="glyphicon glyphicon-lock form-control-feedback"></span>
|
class="glyphicon glyphicon-lock form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<input type="password" class="form-control"
|
<input type="password" class="form-control"
|
||||||
placeholder="Retype password" name="rpassword"> <span
|
placeholder="Retype password" name="rpassword"> <span
|
||||||
class="glyphicon glyphicon-log-in form-control-feedback"></span>
|
class="glyphicon glyphicon-log-in form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4 pull-left">
|
<div class="col-xs-4 pull-left">
|
||||||
<button type="button" class="btn btn-flat btn-block"
|
<button type="button" class="btn btn-flat btn-block"
|
||||||
id="button_back">Back</button>
|
id="button_back">Back</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4 pull-right">
|
<div class="col-xs-4 pull-right">
|
||||||
<button type="submit" class="btn btn-flat btn-primary btn-block">Register</button>
|
<button type="submit" class="btn btn-flat btn-primary btn-block">Register</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col -->
|
<!-- /.col -->
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.form-box -->
|
<!-- /.form-box -->
|
||||||
<div class="login-box-footer">
|
<div class="login-box-footer">
|
||||||
<center><p>2016 © Khanh Ngo</p></center>
|
<center><p>2016 © Khanh Ngo</p></center>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.login-box -->
|
<!-- /.login-box -->
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#button_back').click(function(){
|
$('#button_back').click(function(){
|
||||||
window.location.href='{{ url_for('login') }}';
|
window.location.href='{{ url_for('login') }}';
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block title %}<title>DNS Control Panel - My Profile</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - My Profile</title>{% endblock %}
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
Profile
|
Profile
|
||||||
@ -15,158 +15,158 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Edit my profile</h3>
|
<h3 class="box-title">Edit my profile</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<!-- Custom Tabs -->
|
<!-- Custom Tabs -->
|
||||||
<div class="nav-tabs-custom" id="tabs">
|
<div class="nav-tabs-custom" id="tabs">
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active"><a href="#tabs-personal" data-toggle="tab">Personal
|
<li class="active"><a href="#tabs-personal" data-toggle="tab">Personal
|
||||||
Info</a></li>
|
Info</a></li>
|
||||||
<li><a href="#tabs-avatar" data-toggle="tab">Change
|
<li><a href="#tabs-avatar" data-toggle="tab">Change
|
||||||
Avatar</a></li>
|
Avatar</a></li>
|
||||||
<li><a href="#tabs-password" data-toggle="tab">Change
|
<li><a href="#tabs-password" data-toggle="tab">Change
|
||||||
Password</a></li>
|
Password</a></li>
|
||||||
<li><a href="#tabs-authentication" data-toggle="tab">Authentication
|
<li><a href="#tabs-authentication" data-toggle="tab">Authentication
|
||||||
</a></li>
|
</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" id="tabs-personal">
|
<div class="tab-pane active" id="tabs-personal">
|
||||||
<form role="form" method="post" action="{{ user_profile }}">
|
<form role="form" method="post" action="{{ user_profile }}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="firstname">First Name</label> <input type="text"
|
<label for="firstname">First Name</label> <input type="text"
|
||||||
class="form-control" name="firstname" id="firstname"
|
class="form-control" name="firstname" id="firstname"
|
||||||
placeholder="{{ current_user.firstname }}">
|
placeholder="{{ current_user.firstname }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="lastname">Last Name</label> <input type="text"
|
<label for="lastname">Last Name</label> <input type="text"
|
||||||
class="form-control" name="lastname" id="lastname"
|
class="form-control" name="lastname" id="lastname"
|
||||||
placeholder="{{ current_user.lastname }}">
|
placeholder="{{ current_user.lastname }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="email">E-mail</label> <input type="text"
|
<label for="email">E-mail</label> <input type="text"
|
||||||
class="form-control" name="email" id="email"
|
class="form-control" name="email" id="email"
|
||||||
placeholder="{{ current_user.email }}">
|
placeholder="{{ current_user.email }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-flat btn-primary">Submit</button>
|
<button type="submit" class="btn btn-flat btn-primary">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="tabs-avatar">
|
<div class="tab-pane" id="tabs-avatar">
|
||||||
<form action="{{ user_profile }}" method="post"
|
<form action="{{ user_profile }}" method="post"
|
||||||
enctype="multipart/form-data">
|
enctype="multipart/form-data">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="thumbnail" style="width: 200px; height: 210px;">
|
<div class="thumbnail" style="width: 200px; height: 210px;">
|
||||||
{% if current_user.avatar %} <img
|
{% if current_user.avatar %} <img
|
||||||
src="{{ url_for('user_avatar', filename=current_user.avatar) }}"
|
src="{{ url_for('user_avatar', filename=current_user.avatar) }}"
|
||||||
alt="" / style="width: 200px; height: 200px;"> {%
|
alt="" / style="width: 200px; height: 200px;"> {%
|
||||||
else %} <img
|
else %} <img
|
||||||
src="http://www.placehold.it/200x200/EFEFEF/AAAAAA&text=no+image"
|
src="http://www.placehold.it/200x200/EFEFEF/AAAAAA&text=no+image"
|
||||||
alt="" /> {% endif %}
|
alt="" /> {% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="file">Select image</label> <input type="file"
|
<label for="file">Select image</label> <input type="file"
|
||||||
id="file" name="file">
|
id="file" name="file">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="label label-danger">NOTE! </span> <span> Only
|
<span class="label label-danger">NOTE! </span> <span> Only
|
||||||
supports <strong>.PNG, .JPG, .JPEG</strong>. The best size
|
supports <strong>.PNG, .JPG, .JPEG</strong>. The best size
|
||||||
to use is <strong>200x200</strong>.
|
to use is <strong>200x200</strong>.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-flat btn-primary">Submit</button>
|
<button type="submit" class="btn btn-flat btn-primary">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="tabs-password">
|
<div class="tab-pane" id="tabs-password">
|
||||||
{% if not current_user.password %} Your account password is
|
{% if not current_user.password %} Your account password is
|
||||||
managed via LDAP which isn't supported to change here. {% else
|
managed via LDAP which isn't supported to change here. {% else
|
||||||
%}
|
%}
|
||||||
<form action="{{ user_profile }}" method="post">
|
<form action="{{ user_profile }}" method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="password">New Password</label> <input
|
<label for="password">New Password</label> <input
|
||||||
type="password" class="form-control" name="password"
|
type="password" class="form-control" name="password"
|
||||||
id="newpassword" />
|
id="newpassword" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="rpassword">Re-type New Password</label> <input
|
<label for="rpassword">Re-type New Password</label> <input
|
||||||
type="password" class="form-control" name="rpassword"
|
type="password" class="form-control" name="rpassword"
|
||||||
id="rpassword" />
|
id="rpassword" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-flat btn-primary">Change
|
<button type="submit" class="btn btn-flat btn-primary">Change
|
||||||
password</button>
|
password</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="tabs-authentication">
|
<div class="tab-pane" id="tabs-authentication">
|
||||||
<form action="{{ user_profile }}" method="post">
|
<form action="{{ user_profile }}" method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="checkbox" id="otp_toggle" class="otp_toggle" {% if current_user.otp_secret %}checked{% endif %}>
|
<input type="checkbox" id="otp_toggle" class="otp_toggle" {% if current_user.otp_secret %}checked{% endif %}>
|
||||||
<label for="otp_toggle">Enable Two Factor Authentication</label>
|
<label for="otp_toggle">Enable Two Factor Authentication</label>
|
||||||
{% if current_user.otp_secret %}
|
{% if current_user.otp_secret %}
|
||||||
<div id="token_information">
|
<div id="token_information">
|
||||||
<p><img id="qrcode" src="{{ url_for('qrcode') }}"></p>
|
<p><img id="qrcode" src="{{ url_for('qrcode') }}"></p>
|
||||||
Please start FreeOTP (<a target="_blank" href="https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp&hl=en">Android</a> - <a target="_blank" href="https://itunes.apple.com/en/app/freeotp-authenticator/id872559395?mt=8">iOS</a>) on your smartphone and scan the above QR Code with it.
|
Please start FreeOTP (<a target="_blank" href="https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp&hl=en">Android</a> - <a target="_blank" href="https://itunes.apple.com/en/app/freeotp-authenticator/id872559395?mt=8">iOS</a>) on your smartphone and scan the above QR Code with it.
|
||||||
<br/>
|
<br/>
|
||||||
<font color="red"><strong><i>Make sure only you can see this QR Code and nobodoy can capture it.</i></strong></font>
|
<font color="red"><strong><i>Make sure only you can see this QR Code and nobodoy can capture it.</i></strong></font>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<!-- TODO: add password and password confirmation comparisson check -->
|
<!-- TODO: add password and password confirmation comparisson check -->
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('#tabs').tabs({
|
$('#tabs').tabs({
|
||||||
// add url anchor tags
|
// add url anchor tags
|
||||||
activate: function(event, ui) {
|
activate: function(event, ui) {
|
||||||
window.location.hash = ui.newPanel.attr('id');
|
window.location.hash = ui.newPanel.attr('id');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// re-set active tab (ui)
|
// re-set active tab (ui)
|
||||||
var activeTabIdx = $('#tabs').tabs('option','active');
|
var activeTabIdx = $('#tabs').tabs('option','active');
|
||||||
$('#tabs li:eq('+activeTabIdx+')').tab('show')
|
$('#tabs li:eq('+activeTabIdx+')').tab('show')
|
||||||
});
|
});
|
||||||
|
|
||||||
// initialize pretty checkboxes
|
// initialize pretty checkboxes
|
||||||
$('.otp_toggle').iCheck({
|
$('.otp_toggle').iCheck({
|
||||||
checkboxClass : 'icheckbox_square-blue',
|
checkboxClass : 'icheckbox_square-blue',
|
||||||
increaseArea : '20%'
|
increaseArea : '20%'
|
||||||
});
|
});
|
||||||
|
|
||||||
// handle checkbox toggling
|
// handle checkbox toggling
|
||||||
$('.otp_toggle').on('ifToggled', function(event) {
|
$('.otp_toggle').on('ifToggled', function(event) {
|
||||||
var enable_otp = $(this).prop('checked');
|
var enable_otp = $(this).prop('checked');
|
||||||
var username = $(this).prop('id');
|
var username = $(this).prop('id');
|
||||||
postdata = {
|
postdata = {
|
||||||
'action' : 'enable_otp',
|
'action' : 'enable_otp',
|
||||||
'data' : {
|
'data' : {
|
||||||
'enable_otp' : enable_otp
|
'enable_otp' : enable_otp
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
applyChanges(postdata, '/user/profile');
|
applyChanges(postdata, '/user/profile');
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user