Make sure all datatables are using POST

This commit is contained in:
JonnyWong16 2018-03-28 18:08:57 -07:00
commit 36b80aa6d3
8 changed files with 27 additions and 19 deletions

View file

@ -113,7 +113,7 @@
// Load user ids and names (for the selector) // Load user ids and names (for the selector)
$.ajax({ $.ajax({
url: 'get_user_names', url: 'get_user_names',
type: 'get', type: 'GET',
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
var select = $('#history-user'); var select = $('#history-user');
@ -130,6 +130,7 @@
function loadHistoryTable(media_type, selected_user_id) { function loadHistoryTable(media_type, selected_user_id) {
history_table_options.ajax = { history_table_options.ajax = {
url: 'get_history', url: 'get_history',
type: 'POST',
data: function (d) { data: function (d) {
return { return {
json_data: JSON.stringify(d), json_data: JSON.stringify(d),

View file

@ -547,7 +547,7 @@ DOCUMENTATION :: END
function get_history() { function get_history() {
history_table_options.ajax = { history_table_options.ajax = {
url: 'get_history', url: 'get_history',
type: 'post', type: 'POST',
data: function ( d ) { data: function ( d ) {
return { return {
json_data: JSON.stringify( d ), json_data: JSON.stringify( d ),
@ -563,7 +563,7 @@ DOCUMENTATION :: END
function get_history() { function get_history() {
history_table_options.ajax = { history_table_options.ajax = {
url: 'get_history', url: 'get_history',
type: 'post', type: 'POST',
data: function ( d ) { data: function ( d ) {
return { return {
json_data: JSON.stringify( d ), json_data: JSON.stringify( d ),
@ -579,7 +579,7 @@ DOCUMENTATION :: END
function get_history() { function get_history() {
history_table_options.ajax = { history_table_options.ajax = {
url: 'get_history', url: 'get_history',
type: 'post', type: 'POST',
data: function ( d ) { data: function ( d ) {
return { return {
json_data: JSON.stringify( d ), json_data: JSON.stringify( d ),

View file

@ -91,7 +91,7 @@
json_data: JSON.stringify(d) json_data: JSON.stringify(d)
}; };
} }
} };
libraries_list_table = $('#libraries_list_table').DataTable(libraries_list_table_options); libraries_list_table = $('#libraries_list_table').DataTable(libraries_list_table_options);
var colvis = new $.fn.dataTable.ColVis(libraries_list_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark', exclude: [0, 1] }); var colvis = new $.fn.dataTable.ColVis(libraries_list_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark', exclude: [0, 1] });

View file

@ -374,7 +374,7 @@ DOCUMENTATION :: END
// Build watch history table // Build watch history table
history_table_options.ajax = { history_table_options.ajax = {
url: 'get_history', url: 'get_history',
type: 'post', type: 'POST',
data: function ( d ) { data: function ( d ) {
return { return {
json_data: JSON.stringify( d ), json_data: JSON.stringify( d ),
@ -406,7 +406,7 @@ DOCUMENTATION :: END
// Build media info table // Build media info table
media_info_table_options.ajax = { media_info_table_options.ajax = {
url: 'get_library_media_info', url: 'get_library_media_info',
type: 'post', type: 'POST',
data: function ( d ) { data: function ( d ) {
return { return {
json_data: JSON.stringify( d ), json_data: JSON.stringify( d ),

View file

@ -229,8 +229,8 @@
var selected_log_level = null; var selected_log_level = null;
function loadtautullilogs(logfile, selected_log_level) { function loadtautullilogs(logfile, selected_log_level) {
log_table_options.ajax = { log_table_options.ajax = {
url: "get_log", url: 'get_log',
type: 'post', type: 'POST',
data: function (d) { data: function (d) {
return { return {
logfile: logfile, logfile: logfile,
@ -249,7 +249,8 @@
function loadPlexLogs() { function loadPlexLogs() {
plex_log_table_options.ajax = { plex_log_table_options.ajax = {
url: "get_plex_log?log_type=server" url: 'get_plex_log?log_type=server',
type: 'POST'
}; };
plex_log_table_options.initComplete = bindLogLevelFilter; plex_log_table_options.initComplete = bindLogLevelFilter;
plex_log_table = $('#plex_log_table').DataTable(plex_log_table_options); plex_log_table = $('#plex_log_table').DataTable(plex_log_table_options);
@ -257,7 +258,8 @@
function loadPlexScannerLogs() { function loadPlexScannerLogs() {
plex_log_table_options.ajax = { plex_log_table_options.ajax = {
url: "get_plex_log?log_type=scanner" url: 'get_plex_log?log_type=scanner',
type: 'POST'
}; };
plex_log_table_options.initComplete = bindLogLevelFilter; plex_log_table_options.initComplete = bindLogLevelFilter;
plex_scanner_log_table = $('#plex_scanner_log_table').DataTable(plex_log_table_options); plex_scanner_log_table = $('#plex_scanner_log_table').DataTable(plex_log_table_options);
@ -265,7 +267,8 @@
function loadNotificationLogs() { function loadNotificationLogs() {
notification_log_table_options.ajax = { notification_log_table_options.ajax = {
url: "get_notification_log", url: 'get_notification_log',
type: 'POST',
data: function (d) { data: function (d) {
return { return {
json_data: JSON.stringify(d) json_data: JSON.stringify(d)
@ -278,7 +281,8 @@
function loadLoginLogs() { function loadLoginLogs() {
login_log_table_options.pageLength = 50; login_log_table_options.pageLength = 50;
login_log_table_options.ajax = { login_log_table_options.ajax = {
url: "get_user_logins", url: 'get_user_logins',
type: 'POST',
data: function (d) { data: function (d) {
return { return {
json_data: JSON.stringify(d) json_data: JSON.stringify(d)

View file

@ -100,7 +100,7 @@
// Load user ids and names (for the selector) // Load user ids and names (for the selector)
$.ajax({ $.ajax({
url: 'get_user_names', url: 'get_user_names',
type: 'get', type: 'GET',
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
var select = $('#sync-user'); var select = $('#sync-user');
@ -116,7 +116,8 @@
function loadSyncTable(selected_user_id) { function loadSyncTable(selected_user_id) {
sync_table_options.ajax = { sync_table_options.ajax = {
url: 'get_sync?user_id=' + selected_user_id url: 'get_sync?user_id=' + selected_user_id,
type: 'POST'
}; };
sync_table = $('#sync_table').DataTable(sync_table_options); sync_table = $('#sync_table').DataTable(sync_table_options);
var colvis = new $.fn.dataTable.ColVis(sync_table, { var colvis = new $.fn.dataTable.ColVis(sync_table, {

View file

@ -413,7 +413,7 @@ DOCUMENTATION :: END
// Build watch history table // Build watch history table
history_table_options.ajax = { history_table_options.ajax = {
url: 'get_history', url: 'get_history',
type: 'post', type: 'POST',
data: function ( d ) { data: function ( d ) {
return { return {
json_data: JSON.stringify( d ), json_data: JSON.stringify( d ),
@ -442,7 +442,8 @@ DOCUMENTATION :: END
function loadSyncTable() { function loadSyncTable() {
// Build user sync table // Build user sync table
sync_table_options.ajax = { sync_table_options.ajax = {
url: 'get_sync?user_id=' + user_id url: 'get_sync?user_id=' + user_id,
type: 'POST'
}; };
sync_table = $('#sync_table-UID-${data["user_id"]}').DataTable(sync_table_options); sync_table = $('#sync_table-UID-${data["user_id"]}').DataTable(sync_table_options);
sync_table.column(2).visible(false); sync_table.column(2).visible(false);
@ -457,7 +458,7 @@ DOCUMENTATION :: END
// Build user IP table // Build user IP table
user_ip_table_options.ajax = { user_ip_table_options.ajax = {
url: 'get_user_ips', url: 'get_user_ips',
type: 'post', type: 'POST',
data: function ( d ) { data: function ( d ) {
return { return {
json_data: JSON.stringify( d ), json_data: JSON.stringify( d ),
@ -474,6 +475,7 @@ DOCUMENTATION :: END
// Build user login table // Build user login table
login_log_table_options.ajax = { login_log_table_options.ajax = {
url: 'get_user_logins', url: 'get_user_logins',
type: 'POST',
data: function(d) { data: function(d) {
return { return {
json_data: JSON.stringify(d), json_data: JSON.stringify(d),

View file

@ -94,7 +94,7 @@
json_data: JSON.stringify(d) json_data: JSON.stringify(d)
}; };
} }
} };
users_list_table = $('#users_list_table').DataTable(users_list_table_options); users_list_table = $('#users_list_table').DataTable(users_list_table_options);
var colvis = new $.fn.dataTable.ColVis(users_list_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark', exclude: [0, 1] }); var colvis = new $.fn.dataTable.ColVis(users_list_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark', exclude: [0, 1] });