-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.html
131 lines (117 loc) · 4.3 KB
/
stats.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="static/css/bootstrap.css" rel="stylesheet">
<style>
body { padding-top: 60px; /* 60px to make the container go all the way
to the bottom of the topbar */ }
</style>
<link href="static/css/bootstrap-responsive.css" rel="stylesheet">
<link href="static/css/DT_bootstrap.css" rel="stylesheet">
<link href="static/css/TableTools.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js">
</script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="static/gfx/favicon.ico">
<script type="text/javascript" charset="utf-8" language="javascript" src="static/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="static/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="static/js/DT_bootstrap.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="static/js/ZeroClipboard.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="static/js/TableTools.js"></script>
</head>
<body>
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">Inventory</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li><span class="label label-important">BETA</span></li>
<li class="divider-vertical"></li>
<li><a href="index.html">Index</a></li>
<li class="active"><a href="#">Stats</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<!--<a href="#" onclick="oTable.fnReloadAjax('api/inv/search/windows%20server%202003')">T1</a>-->
<table class="table table-striped table-bordered" id="stats">
<thead>
<tr>
<th>Count</th>
<th>Package</th>
<th>Version</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script type="text/javascript">
$.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw )
{
if ( typeof sNewSource != 'undefined' && sNewSource != null )
{
oSettings.sAjaxSource = sNewSource;
}
this.oApi._fnProcessingDisplay( oSettings, true );
var that = this;
var iStart = oSettings._iDisplayStart;
oSettings.fnServerData( oSettings.sAjaxSource, [], function(json) {
/* Clear the old information from the table */
that.oApi._fnClearTable( oSettings );
/* Got the data - add it to the table */
for ( var i=0 ; i<json.aaData.length ; i++ )
{
that.oApi._fnAddData( oSettings, json.aaData[i] );
}
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
that.fnDraw();
if ( typeof bStandingRedraw != 'undefined' && bStandingRedraw === true )
{
oSettings._iDisplayStart = iStart;
that.fnDraw( false );
}
that.oApi._fnProcessingDisplay( oSettings, false );
/* Callback user function - for event handlers etc */
if ( typeof fnCallback == 'function' && fnCallback != null )
{
fnCallback( oSettings );
}
}, oSettings );
}
var oTable;
$(document).ready(function() {
oTable = $('#stats').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "static/swf/copy_csv_xls_pdf.swf"
},
"sAjaxSource": "api/invstats",
"bProcessing": true,
"bServerSide": false,
"sPaginationType": "bootstrap",
"oLanguage": {"sLengthMenu": "_MENU_ records per page",
"sInfo": "Displaying _START_ to _END_ of _TOTAL_ records"},
"aoColumns":[
{"mDataProp":"count"},
{"mDataProp":"package"},
{"mDataProp":"version"}
]
} );
} );
</script>
</div>
</body>
</html>