mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
default_domain_table_size setting.
This commit is contained in:
parent
54954082c5
commit
ea42c78b9a
@ -214,14 +214,23 @@
|
||||
"ordering" : false,
|
||||
"info" : false,
|
||||
"autoWidth" : false
|
||||
});
|
||||
});
|
||||
// set up domain list
|
||||
$("#tbl_domain_list").DataTable({
|
||||
"paging" : true,
|
||||
"lengthChange" : true,
|
||||
"searching" : true,
|
||||
"ordering" : true,
|
||||
"info" : false,
|
||||
"autoWidth" : false
|
||||
"autoWidth" : false,
|
||||
{% if default_domain_table_size_setting in ['10','25','50','100'] %}
|
||||
"lengthMenu": [ [10, 25, 50, 100, -1],
|
||||
[10, 25, 50, 100, "All"]],
|
||||
{% else %}
|
||||
"lengthMenu": [ [10, 25, 50, 100, {{ default_domain_table_size_setting }}, -1],
|
||||
[10, 25, 50, 100, {{ default_domain_table_size_setting }}, "All"]],
|
||||
{% endif %}
|
||||
"pageLength": {{ default_domain_table_size_setting }}
|
||||
});
|
||||
$(document.body).on('click', '.history-info-button', function() {
|
||||
var modal = $("#modal_history_info");
|
||||
|
@ -45,6 +45,11 @@ def inject_default_record_table_size_setting():
|
||||
default_record_table_size_setting = Setting.query.filter(Setting.name == 'default_record_table_size').first()
|
||||
return dict(default_record_table_size_setting=default_record_table_size_setting.value)
|
||||
|
||||
@app.context_processor
|
||||
def inject_default_domain_table_size_setting():
|
||||
default_domain_table_size_setting = Setting.query.filter(Setting.name == 'default_domain_table_size').first()
|
||||
return dict(default_domain_table_size_setting=default_domain_table_size_setting.value)
|
||||
|
||||
# START USER AUTHENTICATION HANDLER
|
||||
@app.before_request
|
||||
def before_request():
|
||||
|
@ -12,13 +12,15 @@ user_role = Role('User', 'User')
|
||||
maintenance_setting = Setting('maintenance', 'False')
|
||||
fullscreen_layout_setting = Setting('fullscreen_layout', 'True')
|
||||
record_helper_setting = Setting('record_helper', 'True')
|
||||
default_table_size_setting = Setting('default_record_table_size', '15')
|
||||
default_record_table_size_setting = Setting('default_record_table_size', '15')
|
||||
default_domain_table_size_setting = Setting('default_domain_table_size', '10')
|
||||
db.session.add(admin_role)
|
||||
db.session.add(user_role)
|
||||
db.session.add(maintenance_setting)
|
||||
db.session.add(fullscreen_layout_setting)
|
||||
db.session.add(record_helper_setting)
|
||||
db.session.add(default_table_size_setting)
|
||||
db.session.add(default_record_table_size_setting)
|
||||
db.session.add(default_domain_table_size_setting)
|
||||
db.session.commit()
|
||||
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
|
||||
api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository')
|
||||
|
Loading…
Reference in New Issue
Block a user