aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/eventlog.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/components/eventlog.jsx')
-rw-r--r--web/src/js/components/eventlog.jsx39
1 files changed, 39 insertions, 0 deletions
diff --git a/web/src/js/components/eventlog.jsx b/web/src/js/components/eventlog.jsx
new file mode 100644
index 00000000..530e9f4f
--- /dev/null
+++ b/web/src/js/components/eventlog.jsx
@@ -0,0 +1,39 @@
+/** @jsx React.DOM */
+
+var EventLog = React.createClass({
+ getInitialState: function() {
+ return {
+ log: []
+ };
+ },
+ componentDidMount: function() {
+ this.log = EventLogStore.getView();
+ this.log.addListener("change", this.onEventLogChange);
+ },
+ componentWillUnmount: function() {
+ this.log.removeListener("change", this.onEventLogChange);
+ this.log.close();
+ },
+ onEventLogChange: function() {
+ this.setState({
+ log: this.log.getAll()
+ });
+ },
+ close: function() {
+ SettingsActions.update({
+ showEventLog: false
+ });
+ },
+ render: function() {
+ //var messages = this.state.log.map(row => (<div key={row.id}>{row.message}</div>));
+ var messages = [];
+ return (
+ <div className="eventlog">
+ <pre>
+ <i className="fa fa-close close-button" onClick={this.close}></i>
+ {messages}
+ </pre>
+ </div>
+ );
+ }
+});