1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +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 knex = require('./dbPool');
var EVENT_COLUMNS = ['id', 'type', 'created_by', 'data']; var EVENT_COLUMNS = ['id', 'type', 'created_by', 'created_at', 'data'];
function storeEvent(event) { function storeEvent(event) {
return knex('events').insert({ return knex('events').insert({
@ -31,6 +31,7 @@ function rowToEvent(row) {
id: row.id, id: row.id,
type: row.type, type: row.type,
createdBy: row.created_by, // jshint ignore:line createdBy: row.created_by, // jshint ignore:line
createdAt: row.created_at, // jshint ignore:line
data: row.data data: row.data
}; };
} }

View File

@ -6,10 +6,19 @@ var LogEntry = React.createClass({
}, },
render: function() { render: function() {
var d = new Date(this.props.event.createdAt);
return ( return (
<tr> <tr>
<td>{this.props.event.data.name}</td> <td>
<td>{this.props.event.type}</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> <td>{this.props.event.createdBy}</td>
</tr> </tr>
); );

View File

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