mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 12:59:42 -07:00
Escape single quotes for usernames on user stats page.
This commit is contained in:
parent
1ef9d72534
commit
dc8996c4d2
1 changed files with 35 additions and 33 deletions
|
@ -262,33 +262,6 @@ from plexpy import helpers
|
||||||
<script src="interfaces/default/js/tables/user_ips.js"></script>
|
<script src="interfaces/default/js/tables/user_ips.js"></script>
|
||||||
<script src="interfaces/default/js/tables/sync_table.js"></script>
|
<script src="interfaces/default/js/tables/sync_table.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function recentlyWatched() {
|
|
||||||
var widthVal = $('body').find("#user-recently-watched").width();
|
|
||||||
var tmp = (widthVal-32) / 180;
|
|
||||||
|
|
||||||
if (tmp > 0) {
|
|
||||||
containerSize = parseInt(tmp);
|
|
||||||
} else {
|
|
||||||
containerSize = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
% if data['user_id']:
|
|
||||||
var user_id = ${data['user_id']};
|
|
||||||
% else:
|
|
||||||
var user_id = null;
|
|
||||||
% endif
|
|
||||||
|
|
||||||
// Populate recently watched
|
|
||||||
$.ajax({
|
|
||||||
url: 'get_user_recently_watched',
|
|
||||||
async: true,
|
|
||||||
data: { user_id: user_id, user: '${data['username']}', limit: containerSize },
|
|
||||||
complete: function(xhr, status) {
|
|
||||||
$("#user-recently-watched").html(xhr.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
% if data['user_id']:
|
% if data['user_id']:
|
||||||
|
@ -297,13 +270,15 @@ from plexpy import helpers
|
||||||
var user_id = null;
|
var user_id = null;
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
|
var username = '${data['username'].replace("'", "\\'")}';
|
||||||
|
|
||||||
$("#edit-user-tooltip").tooltip();
|
$("#edit-user-tooltip").tooltip();
|
||||||
|
|
||||||
// Populate watch time stats
|
// Populate watch time stats
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'get_user_watch_time_stats',
|
url: 'get_user_watch_time_stats',
|
||||||
async: true,
|
async: true,
|
||||||
data: { user_id: user_id, user: '${data['username']}' },
|
data: { user_id: user_id, user: username },
|
||||||
complete: function(xhr, status) {
|
complete: function(xhr, status) {
|
||||||
$("#user-time-stats").html(xhr.responseText);
|
$("#user-time-stats").html(xhr.responseText);
|
||||||
}
|
}
|
||||||
|
@ -313,7 +288,7 @@ from plexpy import helpers
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'get_user_player_stats',
|
url: 'get_user_player_stats',
|
||||||
async: true,
|
async: true,
|
||||||
data: { user_id: user_id, user: '${data['username']}' },
|
data: { user_id: user_id, user: username },
|
||||||
complete: function(xhr, status) {
|
complete: function(xhr, status) {
|
||||||
$("#user-player-stats").html(xhr.responseText);
|
$("#user-player-stats").html(xhr.responseText);
|
||||||
}
|
}
|
||||||
|
@ -328,7 +303,7 @@ from plexpy import helpers
|
||||||
return {
|
return {
|
||||||
'json_data': JSON.stringify( d ),
|
'json_data': JSON.stringify( d ),
|
||||||
'user_id': user_id,
|
'user_id': user_id,
|
||||||
'user': "${data['username']}",
|
'user': username,
|
||||||
'media_type': media_type
|
'media_type': media_type
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -378,7 +353,7 @@ from plexpy import helpers
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
return { 'json_data': JSON.stringify( d ),
|
return { 'json_data': JSON.stringify( d ),
|
||||||
'user_id': user_id,
|
'user_id': user_id,
|
||||||
'user': "${data['username']}"
|
'user': username
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -393,7 +368,7 @@ from plexpy import helpers
|
||||||
"url": "get_sync",
|
"url": "get_sync",
|
||||||
"data": function(d) {
|
"data": function(d) {
|
||||||
d.user_id = user_id;
|
d.user_id = user_id;
|
||||||
d.user = "${data['username']}";
|
d.user = username;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sync_table = $('#sync_table').DataTable(sync_table_options);
|
sync_table = $('#sync_table').DataTable(sync_table_options);
|
||||||
|
@ -410,7 +385,7 @@ from plexpy import helpers
|
||||||
$("#edit-user-tooltip").tooltip('hide');
|
$("#edit-user-tooltip").tooltip('hide');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'edit_user_dialog',
|
url: 'edit_user_dialog',
|
||||||
data: { user_id: user_id, user: '${data['username']}' },
|
data: { user_id: user_id, user: username },
|
||||||
cache: false,
|
cache: false,
|
||||||
async: true,
|
async: true,
|
||||||
complete: function(xhr, status) {
|
complete: function(xhr, status) {
|
||||||
|
@ -456,6 +431,33 @@ from plexpy import helpers
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function recentlyWatched() {
|
||||||
|
var widthVal = $('body').find("#user-recently-watched").width();
|
||||||
|
var tmp = (widthVal-32) / 180;
|
||||||
|
|
||||||
|
if (tmp > 0) {
|
||||||
|
containerSize = parseInt(tmp);
|
||||||
|
} else {
|
||||||
|
containerSize = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
% if data['user_id']:
|
||||||
|
var user_id = ${data['user_id']};
|
||||||
|
% else:
|
||||||
|
var user_id = null;
|
||||||
|
% endif
|
||||||
|
|
||||||
|
// Populate recently watched
|
||||||
|
$.ajax({
|
||||||
|
url: 'get_user_recently_watched',
|
||||||
|
async: true,
|
||||||
|
data: { user_id: user_id, user: username, limit: containerSize },
|
||||||
|
complete: function(xhr, status) {
|
||||||
|
$("#user-recently-watched").html(xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
recentlyWatched();
|
recentlyWatched();
|
||||||
$(window).resize(function() {
|
$(window).resize(function() {
|
||||||
recentlyWatched();
|
recentlyWatched();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue