user_ip_table_options = { "destroy": true, "language": { "search": "Search: ", "lengthMenu":"Show _MENU_ entries per page", "info":"Showing _START_ to _END_ of _TOTAL_ results", "infoEmpty":"Showing 0 to 0 of 0 entries", "infoFiltered":"(filtered from _MAX_ total entries)", "emptyTable": "No data in table", }, "stateSave": true, "pagingType": "bootstrap", "processing": false, "serverSide": true, "pageLength": 10, "order": [ 0, 'desc'], "autoWidth": false, "columnDefs": [ { "targets": [0], "data":"last_seen", "render": function ( data, type, full ) { return moment(data, "X").fromNow(); }, "searchable": false, "width": "15%", "className": "no-wrap hidden-xs" }, { "targets": [1], "data": "ip_address", "createdCell": function (td, cellData, rowData, row, col) { if (cellData) { if (isPrivateIP(cellData)) { if (cellData != '') { $(td).html(cellData); } else { $(td).html('n/a'); } } else { $(td).html(' ' + cellData +''); } } else { $(td).html('n/a'); } }, "width": "15%", "className": "no-wrap modal-control-ip" }, { "targets": [2], "data": "platform", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { $(td).html(cellData); } }, "width": "15%", "className": "no-wrap hidden-md hidden-sm hidden-xs modal-control" }, { "targets": [3], "data":"player", "createdCell": function (td, cellData, rowData, row, col) { if (cellData) { var transcode_dec = ''; if (rowData['video_decision'] === 'transcode' || rowData['audio_decision'] === 'transcode') { transcode_dec = ''; } else if (rowData['video_decision'] === 'copy' || rowData['audio_decision'] === 'copy') { transcode_dec = ''; } else if (rowData['video_decision'] === 'direct play' || rowData['audio_decision'] === 'direct play') { transcode_dec = ''; } $(td).html('
'); } else { $(td).html('n/a'); } }, "width": "15%", "className": "no-wrap hidden-md hidden-sm hidden-xs modal-control" }, { "targets": [4], "data":"last_played", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { var parent_info = ''; var media_type = ''; var thumb_popover = ''; if (rowData['media_type'] === 'movie') { if (rowData['year']) { parent_info = ' (' + rowData['year'] + ')'; } media_type = ''; thumb_popover = '' + cellData + parent_info + '' $(td).html(''); } else if (rowData['media_type'] === 'episode') { if (rowData['parent_media_index'] && rowData['media_index']) { parent_info = ' (S' + rowData['parent_media_index'] + '· E' + rowData['media_index'] + ')'; } media_type = ''; thumb_popover = '' + cellData + parent_info + '' $(td).html(''); } else if (rowData['media_type'] === 'track') { if (rowData['parent_title']) { parent_info = ' (' + rowData['parent_title'] + ')'; } media_type = ''; thumb_popover = '' + cellData + parent_info + '' $(td).html(''); } else if (rowData['media_type']) { $(td).html('' + cellData + ''); } else { $(td).html('n/a'); } } }, "width": "30%", "className": "hidden-sm hidden-xs" }, { "targets": [5], "data":"play_count", "searchable": false, "width": "10%" } ], "drawCallback": function (settings) { // Jump to top of page // $('html,body').scrollTop(0); $('#ajaxMsg').fadeOut(); // Create the tooltips. $('.transcode-tooltip').tooltip(); $('.media-type-tooltip').tooltip(); $('.watched-tooltip').tooltip(); $('.thumb-tooltip').popover({ html: true, container: 'body', trigger: 'hover', placement: 'right', template: '