Export PDNS version to frontend

This commit is contained in:
Jeroen Boonstra 2018-02-28 13:39:05 +01:00
parent 83475ae17c
commit d5d0948ab8
5 changed files with 28 additions and 24 deletions

2
.gitignore vendored
View File

@ -31,3 +31,5 @@ db_repository/*
upload/avatar/*
tmp/*
.ropeproject
.sonarlint/*
pdns.db

View File

@ -206,6 +206,7 @@
{% endblock %}
{% block extrascripts %}
<script>
PDNS_VERSION = '{{ pdns_version }}'
// set up history data table
$("#tbl_history").DataTable({
"paging" : false,

View File

@ -109,6 +109,7 @@
{% endblock %}
{% block extrascripts %}
<script>
PDNS_VERSION = '{{ pdns_version }}'
// superglobals
window.records_allow_edit = {{ editable_records|tojson }};
window.nEditing = null;

View File

@ -439,7 +439,7 @@ def dashboard():
uptime = filter(lambda uptime: uptime['name'] == 'uptime', statistics)[0]['value']
else:
uptime = 0
return render_template('dashboard.html', domains=domains, domain_count=domain_count, users=users, history_number=history_number, uptime=uptime, histories=history)
return render_template('dashboard.html', domains=domains, domain_count=domain_count, users=users, history_number=history_number, uptime=uptime, histories=history,pdns_version=app.config['PDNS_VERSION'])
@app.route('/domain/<path:domain_name>', methods=['GET', 'POST'])
@ -479,7 +479,7 @@ def domain(domain_name):
editable_records = app.config['FORWARD_RECORDS_ALLOW_EDIT']
else:
editable_records = app.config['REVERSE_RECORDS_ALLOW_EDIT']
return render_template('domain.html', domain=domain, records=records, editable_records=editable_records)
return render_template('domain.html', domain=domain, records=records, editable_records=editable_records,pdns_version=app.config['PDNS_VERSION'])
@app.route('/admin/domain/add', methods=['GET', 'POST'])