diff --git a/templates/hostlist_template.html b/templates/hostlist_template.html index 5c7417f..15ecff7 100644 --- a/templates/hostlist_template.html +++ b/templates/hostlist_template.html @@ -3,14 +3,7 @@ Host list - - - - - - - - +
@@ -30,25 +23,23 @@

Available minions

- +
- - + - - + + - - + - - + + @@ -58,29 +49,28 @@ + {{ name }} - - + - - + + {% endfor %} -
NameMachine typeOS Roles IPRAM (MB)# CPUsSalt
NameMachine typeOS Roles IPRAM (MB)# CPUsSalt
{% if data.virtual != "physical" %} Virtual ({{ data.virtual }}) {% else %} Physical {% endif %}{{ data.lsb_distrib_description }} {% for role in data.roles %} {{ role }} {% endfor %} {{ data.fqdn_ip }}{{ data.mem_total }}{{ data.num_cpus }}{{ data.saltversion }}
Total: + - - - +
+

Disconnected minions

@@ -121,32 +111,37 @@

Previous jobs

- +
- - - + + + + + + {% for id, data in joblist|dictsort|reverse %} - - + - - {% endfor %} -
NameArguments Function StartTime TargetTarget typeUser
NameFunctionStartTimeTarget
{{ id }}{{ data.Arguments }} + + {{ id }} + {{ data.Function }} {{ data.StartTime }} {{ data.Target }}{{ data['Target-type'] }}{{ data.User }}
+
@@ -192,7 +187,35 @@
{% endfor %} - + {% for id, data in joblist.iteritems() %} + + {% endfor %} + + + + + + diff --git a/www/res/inittable.js b/www/res/inittable.js index 3c53966..92ca69f 100644 --- a/www/res/inittable.js +++ b/www/res/inittable.js @@ -1,14 +1,30 @@ $(document).ready(function() { - $('#hostlist thead td').each( function () { - var title = $('#hostlist thead th').eq( $(this).index() ).text(); - $(this).html( '' ); - } ); + var addSearch = function(elemId) { + $('#' + elemId + ' thead td').each( function () { + var title = $('#' + elemId + ' thead th').eq( $(this).index() ).text(); + $(this).html( '' ); + }); + } + var applySearch = function(obj) { + obj.columns().eq( 0 ).each( function ( colIdx ) { + $( 'input', obj.column( colIdx ).header() ).on( 'keyup change', function () { + obj + .column( colIdx ) + .search( this.value, true ) + .draw(); + } ); + }); + } + + addSearch('hostlist'); + addSearch('joblist'); var jobTable = $('#joblist').DataTable({ 'paging': true, 'info': false, 'dom': 'tp', - 'pagingType': 'full' + 'pagingType': 'full', + 'ordering': false }); var table = $('#hostlist').DataTable({ @@ -33,14 +49,7 @@ $(document).ready(function() { // mem memTotal = api - .column( 5, { page: 'current'} ) - .data() - .reduce( function (a, b) { - return intVal(a) + intVal(b); - }, 0 ); - // cpu - cpuTotal = api - .column( 6, { page: 'current'} ) + .column( 4, { page: 'current'} ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); @@ -51,25 +60,14 @@ $(document).ready(function() { $.number(hostsTotal, 0, '.', ' ') ); - $( api.column( 5 ).footer() ).html( + $( api.column( 4 ).footer() ).html( $.number(memTotal, 0, '.', ' ') ); - - $( api.column( 6 ).footer() ).html( - cpuTotal - ); } }); - - // Apply the search - table.columns().eq( 0 ).each( function ( colIdx ) { - $( 'input', table.column( colIdx ).header() ).on( 'keyup change', function () { - table - .column( colIdx ) - .search( this.value, true ) - .draw(); - } ); - } ); + + applySearch(table); + applySearch(jobTable); $('td.number').number( true, 0, '.', ' ' ); });