Skip to content

Commit

Permalink
colour
Browse files Browse the repository at this point in the history
  • Loading branch information
pdericson committed Dec 20, 2017
1 parent 8c76b02 commit 48a9fc4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions assets/js/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,36 @@ channel.on("events", payload => {
{data: 'metric'},
{data: 'ttl'},
],
columnDefs: [
{
render: function(data, type, row) {
if (data === null || row.state === null) {
return data
} else if (row.state == 'failure' || row.state == 'critical') {
return '<b style="color: #d9534f">' + data + '</b>';
} else {
return data;
}
},
targets: [0, 1, 3, 4, 5, 6, 7],
},
{
render: function(data, type, row) {
if (data === null) {
return data
} else if (data == 'success' || data == 'ok') {
return '<span class="label label-success">' + data + '</span>';
} else if (data == 'failure' || data == 'critical') {
return '<span class="label label-danger">' + data + '</span>';
} else if (data == 'warning') {
return '<span class="label label-warning">' + data + '</span>';
} else {
return data;
}
},
targets: 2,
}
],
paging: false
});

Expand Down

0 comments on commit 48a9fc4

Please sign in to comment.