2018-08-18 11:41:59 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% set active_page = "admin_settings" %}
|
|
|
|
{% block title %}
|
2018-08-18 15:42:18 +00:00
|
|
|
<title>Basic Settings - {{ SITE_NAME }}</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-09-03 10:27:09 +00:00
|
|
|
<td>{{ setting }}</td>
|
|
|
|
{% if SETTING.get(setting) in [True, False] %}
|
|
|
|
<td>{{ SETTING.get(setting)|display_setting_state }}</td>
|
2016-06-18 04:41:01 +00:00
|
|
|
<td width="6%">
|
2018-09-03 10:27:09 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-warning setting-toggle-button" id="{{ setting }}">
|
2016-06-18 04:41:01 +00:00
|
|
|
Toggle <i class="fa fa-info"></i>
|
|
|
|
</button>
|
2018-09-03 10:27:09 +00:00
|
|
|
</td>
|
|
|
|
{% else %}
|
|
|
|
<td><input name="value" id="value" value="{{ SETTING.get(setting) }}"></td>
|
|
|
|
<td width="6%">
|
|
|
|
<button type="button" class="btn btn-flat btn-warning setting-save-button" id="{{ setting }}">
|
2016-06-18 04:41:01 +00:00
|
|
|
Save <i class="fa fa-info"></i>
|
|
|
|
</button>
|
|
|
|
</td>
|
2018-09-03 10:27:09 +00:00
|
|
|
{% endif %}
|
2016-06-18 04:41:01 +00:00
|
|
|
</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({
|
2018-09-01 10:53:05 +00:00
|
|
|
"paging" : false,
|
2016-06-18 04:41:01 +00:00
|
|
|
"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 %}
|