Update notification logs table

This commit is contained in:
JonnyWong16 2016-10-15 17:01:47 -07:00 committed by JonnyWong16
commit 9e8d55e0f3
3 changed files with 25 additions and 26 deletions

View file

@ -31,18 +31,18 @@ notification_log_table_options = {
}, },
{ {
"targets": [1], "targets": [1],
"data": "agent_name", "data": "notifier_id",
"createdCell": function (td, cellData, rowData, row, col) { "createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') { if (cellData !== '') {
$(td).html(cellData); $(td).html(cellData);
} }
}, },
"width": "7%", "width": "5%",
"className": "no-wrap" "className": "no-wrap"
}, },
{ {
"targets": [2], "targets": [2],
"data": "notify_action", "data": "agent_name",
"createdCell": function (td, cellData, rowData, row, col) { "createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') { if (cellData !== '') {
$(td).html(cellData); $(td).html(cellData);
@ -53,33 +53,34 @@ notification_log_table_options = {
}, },
{ {
"targets": [3], "targets": [3],
"data": "notify_action",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html(cellData);
}
},
"width": "5%",
"className": "no-wrap"
},
{
"targets": [4],
"data": "subject_text", "data": "subject_text",
"createdCell": function (td, cellData, rowData, row, col) { "createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') { if (cellData !== '') {
$(td).html(cellData); $(td).html(cellData);
} }
}, },
"width": "20%" "width": "25%"
}, },
{ {
"targets": [4], "targets": [5],
"data": "body_text", "data": "body_text",
"createdCell": function (td, cellData, rowData, row, col) { "createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') { if (cellData !== '') {
$(td).html(cellData); $(td).html(cellData);
} }
}, },
"width": "38%" "width": "50%"
},
{
"targets": [5],
"data": "script_args",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html(cellData);
}
},
"width": "20%"
} }
], ],
"drawCallback": function (settings) { "drawCallback": function (settings) {

View file

@ -104,11 +104,11 @@
<thead> <thead>
<tr> <tr>
<th align="left" id="notification_timestamp">Timestamp</th> <th align="left" id="notification_timestamp">Timestamp</th>
<th align="left" id="notification_notifier_id">Notifier ID</th>
<th align="left" id="notification_agent_name">Agent</th> <th align="left" id="notification_agent_name">Agent</th>
<th align="left" id="notification_action">Action</th> <th align="left" id="notification_notify_action">Action</th>
<th align="left" id="notification_poster_url">Subject Text</th> <th align="left" id="notification_subject_text">Subject Text</th>
<th align="left" id="notification_poster_url">Body Text</th> <th align="left" id="notification_body_text">Body Text</th>
<th align="left" id="notification_poster_url">Script Args</th>
</tr> </tr>
</thead> </thead>
<tbody></tbody> <tbody></tbody>

View file

@ -1305,13 +1305,12 @@ class DataFactory(object):
'notify_log.rating_key', 'notify_log.rating_key',
'notify_log.user_id', 'notify_log.user_id',
'notify_log.user', 'notify_log.user',
'notify_log.notifier_id',
'notify_log.agent_id', 'notify_log.agent_id',
'notify_log.agent_name', 'notify_log.agent_name',
'notify_log.notify_action', 'notify_log.notify_action',
'notify_log.subject_text', 'notify_log.subject_text',
'notify_log.body_text', 'notify_log.body_text'
'notify_log.script_args',
'notify_log.poster_url',
] ]
try: try:
query = data_tables.ssp_query(table_name='notify_log', query = data_tables.ssp_query(table_name='notify_log',
@ -1345,13 +1344,12 @@ class DataFactory(object):
'rating_key': item['rating_key'], 'rating_key': item['rating_key'],
'user_id': item['user_id'], 'user_id': item['user_id'],
'user': item['user'], 'user': item['user'],
'notifier_id': item['notifier_id'],
'agent_id': item['agent_id'], 'agent_id': item['agent_id'],
'agent_name': item['agent_name'], 'agent_name': item['agent_name'],
'notify_action': item['notify_action'], 'notify_action': item['notify_action'],
'subject_text': item['subject_text'], 'subject_text': item['subject_text'],
'body_text': body_text, 'body_text': body_text
'script_args': item['script_args'],
'poster_url': item['poster_url']
} }
rows.append(row) rows.append(row)