1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/public/js/components/log/LogEntry.jsx

31 lines
1.0 KiB
React
Raw Normal View History

2014-11-13 15:14:41 +01:00
var React = require('react');
2014-11-14 07:29:55 +01:00
var LogEntry = React.createClass({
2014-11-13 15:14:41 +01:00
propTypes: {
event: React.PropTypes.object.isRequired
},
render: function() {
2014-11-17 10:10:47 +01:00
var d = new Date(this.props.event.createdAt);
2014-11-17 11:15:10 +01:00
var localEventData = JSON.parse(JSON.stringify(this.props.event.data));
delete localEventData.description;
delete localEventData.name;
2014-11-13 15:14:41 +01:00
return (
<tr>
2014-11-17 10:10:47 +01:00
<td>
{d.getDate() + "." + d.getMonth() + "." + d.getFullYear()}<br />
kl. {d.getHours() + "." + d.getMinutes()}
</td>
<td>
2014-11-17 11:15:10 +01:00
<strong>{this.props.event.data.name}</strong><em>[{this.props.event.type}]</em>
2014-11-17 10:10:47 +01:00
</td>
2014-11-29 14:25:27 +01:00
<td style={{maxWidth: 300}}>
<code className='JSON smalltext'>{JSON.stringify(localEventData)}</code>
2014-11-17 10:10:47 +01:00
</td>
2014-11-13 15:14:41 +01:00
<td>{this.props.event.createdBy}</td>
</tr>
);
}
});
2014-11-14 07:29:55 +01:00
module.exports = LogEntry;