nci/static/js/app/components/terminal/terminal.js
Vladimir Polyakov 58fa1ef6e9 terminal output
2015-05-10 19:53:33 +03:00

33 lines
664 B
JavaScript

'use strict';
define([
'react',
'reflux',
'app/stores/terminal',
'templates/app/components/terminal/terminal'
], function(React, Reflux, terminalStore, template) {
var Component = React.createClass({
mixins: [Reflux.ListenerMixin],
componentDidMount: function() {
this.listenTo(terminalStore, this.updateItems);
},
updateItems: function(data) {
// listen just our console update
if (data.buildId === this.props.build.id) {
this.setState({data: data});
}
},
render: function() {
return template(this.state.data);
},
getInitialState: function() {
return {
name: '',
data: ''
};
}
});
return Component;
});