1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/public/js/components/log/LogEntriesComponent.jsx

35 lines
887 B
React
Raw Normal View History

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>
<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;