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
Ivar Conradi Østhus f82be4655a Added ErrorStore
2020-02-20 08:30:22 +01:00

35 lines
887 B
JavaScript

var React = require('react');
var LogEntryList = require('./LogEntryList');
var eventStore = require('../../stores/EventStore');
var ErrorActions = require('../../stores/ErrorActions');
var LogEntriesComponent = React.createClass({
getInitialState: function() {
return {
createView: false,
events: []
};
},
componentDidMount: function () {
eventStore.getEvents().then(function(res) {
this.setState({events: res.events});
}.bind(this), this.initError);
},
initError: function() {
ErrorActions.error("Could not load events from server");
},
render: function() {
return (
<div>
<hr />
<LogEntryList events={this.state.events} />
</div>
);
},
});
module.exports = LogEntriesComponent;