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

38 lines
877 B
JavaScript

'use strict';
define([
'react', 'app/actions/project',
'app/actions/build', 'templates/app/components/builds/item',
'app/components/terminal/terminal',
'app/components/common/index'
], function(
React, ProjectActions, BuildActions, template,
TerminalComponent, CommonComponents
) {
template = template.locals({
DateTime: CommonComponents.DateTime,
Terminal: TerminalComponent
});
var Component = React.createClass({
getInitialState: function() {
return {
showTerminal: false
};
},
onRebuildProject: function(projectName) {
ProjectActions.run(projectName)
},
onShowTerminal: function(build) {
this.setState({showTerminal: !this.state.showTerminal});
BuildActions.readTerminalOutput(this.props.build.id);
},
onBuildSelect: function(buildId) {
console.log('on build select');
},
render: template
});
return Component;
});