2018-08-18 11:41:59 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% set active_page = "admin_settings" %}
|
|
|
|
{% block title %}
|
|
|
|
<title>DNS Control Panel - Basic Settings</title>
|
2016-04-29 21:36:37 +00:00
|
|
|
{% endblock %} {% block dashboard_stat %}
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
<section class="content-header">
|
2016-06-18 04:41:01 +00:00
|
|
|
<h1>
|
|
|
|
Settings <small>PowerDNS-Admin settings</small>
|
|
|
|
</h1>
|
|
|
|
<ol class="breadcrumb">
|
2018-08-18 11:41:59 +00:00
|
|
|
<li><a href="{{ url_for('dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li>
|
|
|
|
<li><a href="#">Setting</a></li>
|
|
|
|
<li class="active">Basic</li>
|
2016-06-18 04:41:01 +00:00
|
|
|
</ol>
|
2016-04-29 21:36:37 +00:00
|
|
|
</section>
|
|
|
|
{% endblock %} {% block content %}
|
|
|
|
<section class="content">
|
2016-06-18 04:41:01 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header">
|
2018-08-18 11:41:59 +00:00
|
|
|
<h3 class="box-title">Basic Settings</h3>
|
2016-06-18 04:41:01 +00:00
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<table id="tbl_settings" class="table table-bordered table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Value</th>
|
|
|
|
<th>Change</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-08-18 11:41:59 +00:00
|
|
|
{% for setting in settings %}
|
2016-06-18 04:41:01 +00:00
|
|
|
<tr class="odd ">
|
2018-08-18 11:41:59 +00:00
|
|
|
<td>{{ setting.name }}</td>
|
|
|
|
{% if setting.value == "True" or setting.value == "False" %}
|
|
|
|
<td>{{ setting.value }}</td>
|
2016-06-18 04:41:01 +00:00
|
|
|
{% else %}
|
2018-08-18 11:41:59 +00:00
|
|
|
<td><input name="value" id="value" value="{{ setting.value }}"></td>
|
2016-06-18 04:41:01 +00:00
|
|
|
{% endif %}
|
|
|
|
<td width="6%">
|
2018-08-18 11:41:59 +00:00
|
|
|
{% if setting.value == "True" or setting.value == "False" %}
|
|
|
|
<button type="button" class="btn btn-flat btn-warning setting-toggle-button" id="{{ setting.name }}">
|
2016-06-18 04:41:01 +00:00
|
|
|
Toggle <i class="fa fa-info"></i>
|
|
|
|
</button>
|
|
|
|
{% else %}
|
2018-08-18 11:41:59 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-warning setting-save-button" id="{{ setting.name }}">
|
2016-06-18 04:41:01 +00:00
|
|
|
Save <i class="fa fa-info"></i>
|
|
|
|
</button>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- /.box-body -->
|
|
|
|
</div>
|
|
|
|
<!-- /.box -->
|
|
|
|
</div>
|
|
|
|
<!-- /.col -->
|
|
|
|
</div>
|
|
|
|
<!-- /.row -->
|
2016-04-29 21:36:37 +00:00
|
|
|
</section>
|
|
|
|
{% endblock %}
|
|
|
|
{% block extrascripts %}
|
|
|
|
<script>
|
2016-06-18 04:41:01 +00:00
|
|
|
// set up history data table
|
|
|
|
$("#tbl_settings").DataTable({
|
|
|
|
"paging" : true,
|
|
|
|
"lengthChange" : false,
|
|
|
|
"searching" : true,
|
|
|
|
"ordering" : true,
|
|
|
|
"info" : true,
|
|
|
|
"autoWidth" : false
|
|
|
|
});
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on('click', '.setting-toggle-button', function() {
|
2016-06-18 04:41:01 +00:00
|
|
|
var setting = $(this).prop('id');
|
2018-08-18 11:41:59 +00:00
|
|
|
applyChanges('', $SCRIPT_ROOT + '/admin/setting/basic/' + setting + '/toggle', false, true)
|
2016-06-18 04:41:01 +00:00
|
|
|
});
|
|
|
|
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on('click', '.setting-save-button', function() {
|
2016-06-18 04:41:01 +00:00
|
|
|
var setting = $(this).prop('id');
|
|
|
|
var value = $(this).parents('tr').find('#value')[0].value;
|
|
|
|
var postdata = {'value': value};
|
2018-08-18 11:41:59 +00:00
|
|
|
applyChanges(postdata, $SCRIPT_ROOT + '/admin/setting/basic/' + setting + '/edit', false, true)
|
2016-06-18 04:41:01 +00:00
|
|
|
});
|
2016-04-29 21:36:37 +00:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|