2015-05-07 21:55:40 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
define([
|
2015-05-17 13:48:16 +00:00
|
|
|
'react', 'react-router', 'app/actions/project',
|
2015-05-09 21:47:01 +00:00
|
|
|
'app/actions/build', 'templates/app/components/builds/item',
|
2015-10-15 22:52:23 +00:00
|
|
|
'app/components/terminal/terminal', 'app/components/common/index',
|
|
|
|
'app/utils'
|
2015-05-10 16:53:33 +00:00
|
|
|
], function(
|
2015-10-15 22:52:23 +00:00
|
|
|
React, Router, ProjectActions,
|
|
|
|
BuildActions, template,
|
|
|
|
TerminalComponent, CommonComponents,
|
|
|
|
utils
|
2015-05-10 16:53:33 +00:00
|
|
|
) {
|
2015-05-09 21:36:17 +00:00
|
|
|
template = template.locals({
|
2015-05-10 16:53:33 +00:00
|
|
|
DateTime: CommonComponents.DateTime,
|
2015-07-21 20:00:09 +00:00
|
|
|
Duration: CommonComponents.Duration,
|
2015-07-26 13:05:54 +00:00
|
|
|
Progress: CommonComponents.Progress,
|
2015-07-21 20:00:09 +00:00
|
|
|
Scm: CommonComponents.Scm,
|
2015-05-17 13:48:16 +00:00
|
|
|
Terminal: TerminalComponent,
|
2015-10-15 22:52:23 +00:00
|
|
|
Link: Router.Link,
|
|
|
|
utils: utils
|
2015-05-09 21:36:17 +00:00
|
|
|
});
|
|
|
|
|
2015-05-07 21:55:40 +00:00
|
|
|
var Component = React.createClass({
|
2015-05-10 16:53:33 +00:00
|
|
|
getInitialState: function() {
|
|
|
|
return {
|
|
|
|
showTerminal: false
|
|
|
|
};
|
|
|
|
},
|
2015-05-09 21:47:01 +00:00
|
|
|
onRebuildProject: function(projectName) {
|
|
|
|
ProjectActions.run(projectName)
|
|
|
|
},
|
2015-05-10 16:53:33 +00:00
|
|
|
onShowTerminal: function(build) {
|
|
|
|
this.setState({showTerminal: !this.state.showTerminal});
|
2015-05-14 20:37:44 +00:00
|
|
|
BuildActions.readTerminalOutput(this.props.build);
|
2015-05-10 16:53:33 +00:00
|
|
|
},
|
2015-05-07 21:55:40 +00:00
|
|
|
onBuildSelect: function(buildId) {
|
|
|
|
console.log('on build select');
|
|
|
|
},
|
2015-05-09 21:36:17 +00:00
|
|
|
render: template
|
2015-05-07 21:55:40 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
return Component;
|
|
|
|
});
|