1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/packages/unleash-frontend/public/js/components/log/LogEntriesComponent.jsx
2020-02-20 08:30:26 +01:00

36 lines
916 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>
<h1>Log</h1>
<hr />
<LogEntryList events={this.state.events} />
</div>
);
},
});
module.exports = LogEntriesComponent;