nci/static/js/app/components/terminal/terminal.js

30 lines
602 B
JavaScript
Raw Normal View History

2015-05-07 21:55:40 +00:00
'use strict';
define([
'react',
'reflux',
2015-05-10 16:53:33 +00:00
'app/stores/terminal',
'templates/app/components/terminal/terminal'
], function(React, Reflux, terminalStore, template) {
2015-05-07 21:55:40 +00:00
var Component = React.createClass({
mixins: [Reflux.ListenerMixin],
componentDidMount: function() {
2015-05-10 16:53:33 +00:00
this.listenTo(terminalStore, this.updateItems);
2015-05-07 21:55:40 +00:00
},
updateItems: function(data) {
2015-05-10 16:53:33 +00:00
// listen just our console update
2015-05-17 13:48:16 +00:00
if (data.buildId === this.props.build) {
2015-05-10 16:53:33 +00:00
this.setState({data: data});
}
2015-05-07 21:55:40 +00:00
},
2015-05-17 13:48:16 +00:00
render: template,
2015-05-07 21:55:40 +00:00
getInitialState: function() {
return {
data: ''
};
}
});
return Component;
});