2015-03-17 20:29:03 +01:00
|
|
|
var React = require('react');
|
|
|
|
var LogEntryList = require('./LogEntryList');
|
|
|
|
var eventStore = require('../../stores/EventStore');
|
|
|
|
var ErrorActions = require('../../stores/ErrorActions');
|
2014-11-13 15:14:41 +01:00
|
|
|
|
2014-11-14 07:29:55 +01:00
|
|
|
var LogEntriesComponent = React.createClass({
|
2014-11-13 15:14:41 +01:00
|
|
|
getInitialState: function() {
|
|
|
|
return {
|
|
|
|
createView: false,
|
2015-03-17 20:29:03 +01:00
|
|
|
events: []
|
2014-11-13 15:14:41 +01:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
componentDidMount: function () {
|
|
|
|
eventStore.getEvents().then(function(res) {
|
|
|
|
this.setState({events: res.events});
|
|
|
|
}.bind(this), this.initError);
|
|
|
|
},
|
|
|
|
|
|
|
|
initError: function() {
|
2015-03-17 20:29:03 +01:00
|
|
|
ErrorActions.error("Could not load events from server");
|
2014-11-13 15:14:41 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
return (
|
|
|
|
<div>
|
2015-03-28 09:51:31 +01:00
|
|
|
<h1>Log</h1>
|
2014-11-13 15:14:41 +01:00
|
|
|
<hr />
|
2014-11-14 07:29:55 +01:00
|
|
|
<LogEntryList events={this.state.events} />
|
2014-11-13 15:14:41 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2015-03-17 20:29:03 +01:00
|
|
|
module.exports = LogEntriesComponent;
|