From de9f60aa7ff7d56c7bb5b0aef762a8851245c010 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 21 Feb 2016 15:45:28 -0800 Subject: [PATCH] Add notification log table --- .../default/js/tables/notification_logs.js | 99 +++++++++++++++++++ data/interfaces/default/logs.html | 65 +++++++++--- plexpy/datafactory.py | 70 ++++++++++++- plexpy/webserve.py | 9 ++ 4 files changed, 228 insertions(+), 15 deletions(-) create mode 100644 data/interfaces/default/js/tables/notification_logs.js diff --git a/data/interfaces/default/js/tables/notification_logs.js b/data/interfaces/default/js/tables/notification_logs.js new file mode 100644 index 00000000..d5af7429 --- /dev/null +++ b/data/interfaces/default/js/tables/notification_logs.js @@ -0,0 +1,99 @@ +notification_log_table_options = { + "destroy": true, + "serverSide": true, + "processing": false, + "pagingType": "bootstrap", + "order": [ 0, 'desc'], + "pageLength": 50, + "stateSave": false, + "language": { + "search":"Search: ", + "lengthMenu":"Show _MENU_ lines per page", + "emptyTable": "No log information available", + "info":"Showing _START_ to _END_ of _TOTAL_ lines", + "infoEmpty":"Showing 0 to 0 of 0 lines", + "infoFiltered":"(filtered from _MAX_ total lines)"}, + "columnDefs": [ + { + "targets": [0], + "data": "timestamp", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(moment(cellData, "X").format('YYYY-MM-DD HH:mm:ss')); + } + }, + "width": "10%", + "className": "no-wrap hidden-xs" + }, + { + "targets": [1], + "data": "agent_name", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(cellData); + } + }, + "width": "7%", + "className": "no-wrap hidden-sm hidden-xs" + }, + { + "targets": [2], + "data": "notify_action", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(cellData); + } + }, + "width": "5%" + }, + { + "targets": [3], + "data": "subject_text", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(cellData); + } + }, + "width": "16%" + }, + { + "targets": [4], + "data": "body_text", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(cellData); + } + }, + "width": "35%" + }, + { + "targets": [5], + "data": "script_args", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(cellData); + } + }, + "width": "15%" + }, + { + "targets": [6], + "data": "poster_url", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(cellData); + } + }, + "width": "12%" + } + ], + "drawCallback": function (settings) { + // Jump to top of page + //$('html,body').scrollTop(0); + $('#ajaxMsg').fadeOut(); + }, + "preDrawCallback": function(settings) { + var msg = " Fetching rows..."; + showMsg(msg, false, false, 0) + } +} diff --git a/data/interfaces/default/logs.html b/data/interfaces/default/logs.html index 04a2938a..e82f295e 100644 --- a/data/interfaces/default/logs.html +++ b/data/interfaces/default/logs.html @@ -30,6 +30,7 @@ from plexpy import helpers
  • Plex Media Server Logs
  • Plex Media Scanner Logs
  • +
  • Notification Logs
  • @@ -61,14 +62,29 @@ from plexpy import helpers
    - - - - - + + + + + - - + +
    TimestampLevelMessage
    TimestampLevelMessage
    +
    +
    + + + + + + + + + + + + +
    TimestampAgentActionSubject TextBody TextScript ArgsPoster URL
    @@ -94,8 +110,10 @@ from plexpy import helpers + +