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

33 lines
664 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
if (data.buildId === this.props.build.id) {
this.setState({data: data});
}
2015-05-07 21:55:40 +00:00
},
render: function() {
return template(this.state.data);
},
getInitialState: function() {
return {
name: '',
data: ''
};
}
});
return Component;
});