1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

Improvements on log view

This commit is contained in:
Gard Rimestad 2014-11-17 10:10:47 +01:00 committed by Ivar Conradi Østhus
parent abad2d7a6a
commit c8c7f57cfb
3 changed files with 15 additions and 4 deletions

View File

@ -1,5 +1,5 @@
var knex = require('./dbPool');
var EVENT_COLUMNS = ['id', 'type', 'created_by', 'data'];
var EVENT_COLUMNS = ['id', 'type', 'created_by', 'created_at', 'data'];
function storeEvent(event) {
return knex('events').insert({
@ -31,6 +31,7 @@ function rowToEvent(row) {
id: row.id,
type: row.type,
createdBy: row.created_by, // jshint ignore:line
createdAt: row.created_at, // jshint ignore:line
data: row.data
};
}

View File

@ -6,10 +6,19 @@ var LogEntry = React.createClass({
},
render: function() {
var d = new Date(this.props.event.createdAt);
return (
<tr>
<td>{this.props.event.data.name}</td>
<td>{this.props.event.type}</td>
<td>
{d.getDate() + "." + d.getMonth() + "." + d.getFullYear()}<br />
kl. {d.getHours() + "." + d.getMinutes()}
</td>
<td>
{this.props.event.type}
</td>
<td>
<code className='JSON'>{JSON.stringify(this.props.event.data)}</code>
</td>
<td>{this.props.event.createdBy}</td>
</tr>
);

View File

@ -15,8 +15,9 @@ var LogEntryList = React.createClass({
<table className='outerborder'>
<thead>
<tr>
<th>Feature</th>
<th>When</th>
<th>Action</th>
<th>Data</th>
<th>Author</th>
</tr>
</thead>