diff --git a/data/interfaces/default/library.html b/data/interfaces/default/library.html index 25486493..7203e33c 100644 --- a/data/interfaces/default/library.html +++ b/data/interfaces/default/library.html @@ -382,7 +382,7 @@ DOCUMENTATION :: END user_id: "${_session['user_id']}" == "None" ? null : "${_session['user_id']}" }; } - } + }; history_table = $('#history_table-SID-${data["section_id"]}').DataTable(history_table_options); var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 11] }); @@ -392,7 +392,13 @@ DOCUMENTATION :: END } $('a[href="#tabs-history"]').on('shown.bs.tab', function() { - loadHistoryTable(); + if (typeof(history_table) === 'undefined') { + loadHistoryTable(); + } + }); + + $("#refresh-history-list").click(function () { + history_table.draw(); }); % if _session['user_group'] == 'admin': @@ -408,7 +414,7 @@ DOCUMENTATION :: END refresh: refresh_table }; } - } + }; media_info_table = $('#media_info_table-SID-${data["section_id"]}').DataTable(media_info_table_options); var colvis = new $.fn.dataTable.ColVis(media_info_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark' }); @@ -418,7 +424,9 @@ DOCUMENTATION :: END } $('a[href="#tabs-mediainfo"]').on('shown.bs.tab', function() { - loadMediaInfoTable(); + if (typeof(media_info_table) === 'undefined') { + loadMediaInfoTable(); + } }); $("#refresh-media-info-table").click(function () { @@ -484,10 +492,6 @@ DOCUMENTATION :: END }); % endif - $("#refresh-history-list").click(function () { - history_table.draw(); - }); - function recentlyWatched() { // Populate recently watched $.ajax({ diff --git a/data/interfaces/default/user.html b/data/interfaces/default/user.html index 3ea0b57b..0c28b48f 100644 --- a/data/interfaces/default/user.html +++ b/data/interfaces/default/user.html @@ -264,6 +264,11 @@ DOCUMENTATION :: END +
Host | Operating System | Browser | +@@ -400,11 +409,6 @@ DOCUMENTATION :: END $.fn.dataTable.tables({ visible: true, api: true }).columns.adjust(); }); - $('a[href="#tabs-profile"]').on('shown.bs.tab', function() { - var media_type = null; - loadHistoryTable(media_type); - }); - function loadHistoryTable(media_type) { // Build watch history table history_table_options.ajax = { @@ -417,7 +421,7 @@ DOCUMENTATION :: END media_type: media_type }; } - } + }; history_table = $('#history_table-UID-${data["user_id"]}').DataTable(history_table_options); history_table.column(2).visible(false); @@ -435,26 +439,21 @@ DOCUMENTATION :: END }); } - $('a[href="#tabs-history"]').on('shown.bs.tab', function() { - var media_type = null; - loadHistoryTable(media_type); - }); - - $('a[href="#tabs-synceditems"]').on('shown.bs.tab', function() { + function loadSyncTable(user_id) { // Build user sync table sync_table_options.ajax = { url: 'get_sync?user_id=' + user_id - } + }; sync_table = $('#sync_table-UID-${data["user_id"]}').DataTable(sync_table_options); - sync_table.column(1).visible(false); + sync_table.column(2).visible(false); - var colvis_sync = new $.fn.dataTable.ColVis( sync_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark' } ); + var colvis_sync = new $.fn.dataTable.ColVis( sync_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0] } ); $( colvis_sync.button() ).appendTo('#button-bar-sync'); clearSearchButton('sync_table-UID-${data["user_id"]}', sync_table); - }); + } - $('a[href="#tabs-ipaddresses"]').on('shown.bs.tab', function() { + function loadIPAddressTable() { // Build user IP table user_ip_table_options.ajax = { url: 'get_user_ips', @@ -465,27 +464,68 @@ DOCUMENTATION :: END user_id: user_id }; } - } + }; user_ip_table = $('#user_ip_table-UID-${data["user_id"]}').DataTable(user_ip_table_options); clearSearchButton('user_ip_table-UID-${data["user_id"]}', user_ip_table); - }); + } - $('a[href="#tabs-tautullilogins"]').on('shown.bs.tab', function() { + function loadLoginTable() { // Build user login table login_log_table_options.ajax = { url: 'get_user_logins', data: function(d) { d.user_id = user_id; } - } + }; login_log_table = $('#login_log_table-UID-${data["user_id"]}').DataTable(login_log_table_options); login_log_table.columns([1, 2]).visible(false); - var colvis_login = new $.fn.dataTable.ColVis( login_log_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark' } ); + var colvis_login = new $.fn.dataTable.ColVis( login_log_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [7] } ); $( colvis_login.button() ).appendTo('#button-bar-login'); clearSearchButton('login_log_table-UID-${data["user_id"]}', login_log_table); + } + + $('a[href="#tabs-history"]').on('shown.bs.tab', function() { + if (typeof(history_table) === 'undefined') { + var media_type = null; + loadHistoryTable(media_type); + } + }); + + $('a[href="#tabs-synceditems"]').on('shown.bs.tab', function() { + if (typeof(sync_table) === 'undefined') { + loadSyncTable(user_id); + } + }); + + $('a[href="#tabs-ipaddresses"]').on('shown.bs.tab', function() { + if (typeof(user_ip_table) === 'undefined') { + loadIPAddressTable(user_id); + } + }); + + $('a[href="#tabs-tautullilogins"]').on('shown.bs.tab', function() { + if (typeof(login_log_table) === 'undefined') { + loadLoginTable(user_id); + } + }); + + $("#refresh-history-list").click(function () { + history_table.draw(); + }); + + $("#refresh-syncs-list").click(function() { + sync_table.ajax.reload(); + }); + + $("#refresh-ip-address-list").click(function () { + user_ip_table.draw(); + }); + + $("#refresh-login-list").click(function () { + login_log_table.draw(); }); % if _session['user_group'] == 'admin': @@ -587,14 +627,6 @@ DOCUMENTATION :: END }); % endif - $("#refresh-history-list").click(function () { - history_table.draw(); - }); - - $("#refresh-syncs-list").click(function() { - sync_table.ajax.reload(); - }); - function recentlyWatched() { // Populate recently watched $.ajax({ |
---|