mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
c00ddea2fc
Added server-side logic for register.html validation Keep form firelds on register.html in the event of wrong input fields to save users from retyping info More button rounding
116 lines
3.7 KiB
HTML
116 lines
3.7 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% set active_page = "admin_settings" %}
|
|
|
|
{% block title %}
|
|
<title>
|
|
Basic Settings - {{ SITE_NAME }}
|
|
</title>
|
|
{% endblock %}
|
|
|
|
{% block dashboard_stat %}
|
|
<div class="content-header">
|
|
<div class="container-fluid">
|
|
<div class="row mb-2">
|
|
<div class="col-sm-6">
|
|
<h1 class="m-0 text-dark">
|
|
Settings
|
|
<small>Basic</small>
|
|
</h1>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<ol class="breadcrumb float-sm-right">
|
|
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
|
|
<li class="breadcrumb-item active">Settings - Basic</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<section class="content">
|
|
<div class="container-fluid">
|
|
<div class="card">
|
|
<div class="card-header with-border">
|
|
<h3 class="card-title">Basic Settings</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<table id="tbl_settings" class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Setting Name</th>
|
|
<th>Current Value</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for setting in settings %}
|
|
<tr class="odd">
|
|
<td>
|
|
{{ setting }}
|
|
</td>
|
|
{% if SETTING.get(setting) in [False] %}
|
|
<td>{{ SETTING.get(setting)|display_setting_state }}</td>
|
|
<td width="6%">
|
|
<button type="button" class="btn btn-success setting-toggle-button" id="{{ setting }}">
|
|
<i class="fas fa-toggle-on"></i> Turn On
|
|
</button>
|
|
</td>
|
|
{% elif SETTING.get(setting) in [True] %}
|
|
<td>{{ SETTING.get(setting)|display_setting_state }}</td>
|
|
<td width="6%">
|
|
<button type="button" class="btn btn-danger setting-toggle-button" id="{{ setting }}">
|
|
<i class="fas fa-toggle-off"></i> Turn Off
|
|
</button>
|
|
</td>
|
|
{% else %}
|
|
<td>
|
|
<input name="value" id="value" value="{{ SETTING.get(setting) }}">
|
|
</td>
|
|
<td width="6%">
|
|
<button type="button" class="btn btn-primary setting-save-button" id="{{ setting }}">
|
|
<i class="fas fa-save"></i> Save
|
|
</button>
|
|
</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% endblock %}
|
|
|
|
{% block extrascripts %}
|
|
<script>
|
|
// set up history data table
|
|
$("#tbl_settings").DataTable({
|
|
"paging": false,
|
|
"lengthChange": false,
|
|
"searching": true,
|
|
"ordering": true,
|
|
"info": true,
|
|
"autoWidth": false
|
|
});
|
|
$(document.body).on('click', '.setting-toggle-button', function () {
|
|
var setting = $(this).prop('id');
|
|
applyChanges({
|
|
'_csrf_token': '{{ csrf_token() }}'
|
|
}, $SCRIPT_ROOT + '/admin/setting/basic/' + setting + '/toggle', false, true)
|
|
});
|
|
|
|
$(document.body).on('click', '.setting-save-button', function () {
|
|
var setting = $(this).prop('id');
|
|
var value = $(this).parents('tr').find('#value')[0].value;
|
|
var postdata = {
|
|
'value': value,
|
|
'_csrf_token': '{{ csrf_token() }}'
|
|
};
|
|
applyChanges(postdata, $SCRIPT_ROOT + '/admin/setting/basic/' + setting + '/edit', false, true)
|
|
});
|
|
</script>
|
|
{% endblock %} |