Skip to content

Commit

Permalink
Merge pull request #215 from clburlison/facter_condition_db_page_length
Browse files Browse the repository at this point in the history
fix: Add page_length support for facter/condition
  • Loading branch information
grahamgilbert authored Mar 9, 2018
2 parents 91b86a2 + beb4faa commit a949fef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/templates/server/machine_detail_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('.groupList').DataTable({
"pageLength": {{ page_length }},
"lengthMenu": [[20, 50, -1], [20, 50, "All"]],
'columnDefs': [{
'orderable': false,
Expand Down
8 changes: 6 additions & 2 deletions server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,15 @@ def machine_detail_facter(request, machine_id, **kwargs):
key_header = 'Fact'
value_header = 'Data'
title = 'Facter data for %s' % machine.hostname
page_length = utils.get_setting('datatable_page_length')
c = {
'user': request.user,
'machine': machine,
'table_data': table_data,
'title': title,
'key_header': key_header,
'value_header': value_header
'value_header': value_header,
'page_length': page_length
}
return render(request, 'server/machine_detail_table.html', c)

Expand All @@ -466,13 +468,15 @@ def machine_detail_conditions(request, machine_id, **kwargs):
key_header = 'Condition'
value_header = 'Data'
title = 'Munki conditions data for %s' % machine.hostname
page_length = utils.get_setting('datatable_page_length')
c = {
'user': request.user,
'machine': machine,
'table_data': table_data,
'title': title,
'key_header': key_header,
'value_header': value_header
'value_header': value_header,
'page_length': page_length
}
return render(request, 'server/machine_detail_table.html', c)

Expand Down

0 comments on commit a949fef

Please sign in to comment.