Rewrite of the Datatables class, should be a lot more secure now and maybe slightly faster.

Please clear your browser cache after this update.
This commit is contained in:
Tim 2015-07-18 21:33:09 +02:00
commit 76279928bd
10 changed files with 301 additions and 419 deletions

View file

@ -182,7 +182,6 @@ from plexpy import helpers
<table class="display" id="history_table" width="100%">
<thead>
<tr>
<th class="never" align='left' id="id">ID</th>
<th class="all" align='left' id="time">Time</th>
<th class="never" align='left' id="friendly_name">User</th>
<th class="desktop" align='left' id="platform">Platform</th>
@ -193,12 +192,6 @@ from plexpy import helpers
<th class="desktop" align='left' id="stopped">Stopped</th>
<th class="desktop" align='left' id="duration">Duration</th>
<th class="desktop" align='left' id="percent_complete"></th>
<th class="never" align='left' id="grandparent_rating_key">grandparentRatingKey</th>
<th class="never" align='left' id="rating_key">RatingKey</th>
<th class="never" align='left' id="user"></th>
<th class="never" align='left' id="media_type"></th>
<th class="never" align='left' id="video_decision"></th>
<th class="never" align='left' id="user_id"></th>
</tr>
</thead>
<tbody>
@ -301,9 +294,12 @@ from plexpy import helpers
// Build watch history table
history_table_options.ajax = {
"url": "get_history",
"data": function(d) {
d.user_id = user_id;
d.user = "${data['username']}";
type: 'post',
data: function ( d ) {
return { 'json_data': JSON.stringify( d ),
'user_id': user_id,
'user': "${data['username']}"
};
}
}
history_table = $('#history_table').DataTable(history_table_options);
@ -314,9 +310,12 @@ from plexpy import helpers
// Build user IP table
user_ip_table_options.ajax = {
"url": "get_user_ips",
"data": function(d) {
d.user_id = user_id;
d.user = "${data['username']}";
type: 'post',
data: function ( d ) {
return { 'json_data': JSON.stringify( d ),
'user_id': user_id,
'user': "${data['username']}"
};
}
}
user_ip_table = $('#user_ip_table').DataTable(user_ip_table_options);