Skip to content

Commit ec3d460

Browse files
committed
Added option to filter processes
1 parent 19f90d6 commit ec3d460

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

css/pages/dashboard.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,4 +352,5 @@ margin-bottom: 26px;}
352352
.dataTables_paginate{ width:100%; text-align:center; margin-top:10px; margin-left:-30px;}
353353
.dataTables_paginate a{ margin-left:8px;}
354354
.dataTables_paginate a:hover{ pointer:pointer;}
355-
.navbar-fixed-top{ margin-left:0px;}
355+
.navbar-fixed-top{ margin-left:0px;}
356+
.widget-search{display: inline-block; vertical-align: middle; margin: 0 6px; width: 200px;}

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ <h3>Internet Speed</h3>
272272
<h3> Processes </h3>
273273
<div id="refresh-ps" onClick="javascript:get_ps();" class="btn btn-mini">
274274
<i class="icon-refresh"></i> &nbsp;&nbsp;Refresh
275+
</div>
276+
<div class="pull-right">
277+
<input type="text" id="filter-ps" class="widget-search" placeholder="search..." />
275278
</div>
276279
</div>
277280
<!-- /widget-header -->

js/magic_happens_here.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454
$.get( "sh/ps.php", function( data ) {
5555

5656
destroy_dataTable('ps_dashboard');
57+
$('#filter-ps').val('').off('keyup');
5758

58-
$('#ps_dashboard').dataTable({
59+
var psTable = $('#ps_dashboard').dataTable({
5960
"aaData": data,
6061
"aoColumns": [
6162
{ "sTitle":"USER","mDataProp":null },
@@ -72,10 +73,15 @@
7273
],
7374
"bPaginate": true,
7475
"sPaginationType": "full_numbers",
75-
"bFilter": false,
76+
"bFilter": true,
77+
"sDom": "lrtip",
7678
"bAutoWidth": false,
7779
"bInfo": false
7880
}).fadeIn();
81+
82+
$('#filter-ps').on('keyup',function(){
83+
psTable.fnFilter(this.value);
84+
});
7985
}, "json" );
8086

8187
}

0 commit comments

Comments
 (0)