Merge pull request #1416 from raunz/perf_tuning

Standard user domain records list performance loop improvement
This commit is contained in:
Matt Scott 2023-03-04 10:53:35 -05:00 committed by GitHub
commit 1a5a11bfa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -133,7 +133,8 @@ def domain(domain_name):
editable_records=editable_records, editable_records=editable_records,
quick_edit=quick_edit, quick_edit=quick_edit,
ttl_options=ttl_options, ttl_options=ttl_options,
current_user=current_user) current_user=current_user,
allow_user_view_history=Setting().get('allow_user_view_history'))
@domain_bp.route('/remove', methods=['GET', 'POST']) @domain_bp.route('/remove', methods=['GET', 'POST'])

View File

@ -36,7 +36,7 @@
 Zone Settings  Zone Settings
</button> </button>
{% endif %} {% endif %}
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %}
<button type="button" title="Zone Changelog" <button type="button" title="Zone Changelog"
class="btn btn-primary ml-2 mt-2 mb-2 button_changelog" id="{{ domain.name }}"> class="btn btn-primary ml-2 mt-2 mb-2 button_changelog" id="{{ domain.name }}">
<i class="fa-solid fa-history" aria-hidden="true"></i> <i class="fa-solid fa-history" aria-hidden="true"></i>
@ -79,7 +79,7 @@
<th>Comment</th> <th>Comment</th>
<th>Edit</th> <th>Edit</th>
<th>Delete</th> <th>Delete</th>
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %}
<th>Changelog</th> <th>Changelog</th>
{% endif %} {% endif %}
{% else %} {% else %}
@ -115,7 +115,7 @@
</button> </button>
{% endif %} {% endif %}
</td> </td>
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %}
<td> <td>
<button type="button" <button type="button"
onclick="show_record_changelog('{{ record.name }}','{{ record.type }}',event)" onclick="show_record_changelog('{{ record.name }}','{{ record.type }}',event)"
@ -194,7 +194,7 @@
// regardless of whatever sorting is done. See orderFixed // regardless of whatever sorting is done. See orderFixed
visible: false, visible: false,
{% if domain.type != 'Slave' %} {% if domain.type != 'Slave' %}
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %}
targets: [9] targets: [9]
{% else %} {% else %}
targets: [8] targets: [8]
@ -205,7 +205,7 @@
} }
], ],
{% if domain.type != 'Slave' %} {% if domain.type != 'Slave' %}
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %}
"orderFixed": [[9, 'asc']] "orderFixed": [[9, 'asc']]
{% else %} {% else %}
"orderFixed": [[8, 'asc']] "orderFixed": [[8, 'asc']]
@ -314,7 +314,7 @@
// add new row // add new row
var default_type = records_allow_edit[0] var default_type = records_allow_edit[0]
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %}
var nRow = jQuery('#tbl_records').dataTable().fnAddData(['', default_type, 'Active', window.ttl_options[0][0], '', '', '', '', '', '0']); var nRow = jQuery('#tbl_records').dataTable().fnAddData(['', default_type, 'Active', window.ttl_options[0][0], '', '', '', '', '', '0']);
{% else %} {% else %}
var nRow = jQuery('#tbl_records').dataTable().fnAddData(['', default_type, 'Active', window.ttl_options[0][0], '', '', '', '', '0']); var nRow = jQuery('#tbl_records').dataTable().fnAddData(['', default_type, 'Active', window.ttl_options[0][0], '', '', '', '', '0']);