1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/packages/unleash-frontend/public/js/components/log/LogEntriesComponent.jsx
2016-06-18 21:53:18 +02:00

37 lines
881 B
JavaScript

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