2015-04-10 20:17:03 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-04-12 22:41:09 +00:00
|
|
|
define([
|
2015-05-09 20:19:25 +00:00
|
|
|
'react',
|
|
|
|
'react-router',
|
2015-07-20 21:37:44 +00:00
|
|
|
'templates/app/components/app/index',
|
2015-05-17 13:48:16 +00:00
|
|
|
'app/components/index',
|
2015-05-09 19:53:19 +00:00
|
|
|
'app/actions/project', 'app/actions/build'
|
2015-04-12 22:41:09 +00:00
|
|
|
], function(
|
2015-05-09 20:19:25 +00:00
|
|
|
React,
|
|
|
|
Router,
|
2015-05-17 13:48:16 +00:00
|
|
|
template,
|
|
|
|
Components,
|
2015-05-09 19:53:19 +00:00
|
|
|
ProjectActions, BuildActions
|
2015-04-12 22:41:09 +00:00
|
|
|
) {
|
2015-05-09 20:19:25 +00:00
|
|
|
var Route = React.createFactory(Router.Route),
|
|
|
|
DefaultRoute = React.createFactory(Router.DefaultRoute);
|
|
|
|
|
|
|
|
var routes = (
|
2015-07-11 12:24:35 +00:00
|
|
|
Route({handler: Components.App},
|
|
|
|
Route({name: 'dashboard', path: '/', handler: Components.Dashboard}),
|
2015-07-09 20:12:24 +00:00
|
|
|
Route({
|
2015-07-11 15:15:18 +00:00
|
|
|
name: 'project',
|
2015-07-09 20:12:24 +00:00
|
|
|
path: 'projects/:name',
|
|
|
|
handler: Components.Project.View
|
|
|
|
}),
|
2015-10-03 14:14:41 +00:00
|
|
|
Route({name: 'build', path: 'builds/:id', handler: Components.Build.View}),
|
|
|
|
Route({
|
|
|
|
name: 'buildLog',
|
|
|
|
path: 'builds/:buildId/log',
|
|
|
|
handler: Components.BuildLog
|
|
|
|
})
|
2015-05-09 20:19:25 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
Router.run(routes, Router.HistoryLocation, function(Handler) {
|
2015-05-17 13:48:16 +00:00
|
|
|
React.render(
|
2015-07-11 12:24:35 +00:00
|
|
|
React.createElement(Handler),
|
2015-05-17 13:48:16 +00:00
|
|
|
document.getElementById('content')
|
|
|
|
);
|
2015-05-09 20:19:25 +00:00
|
|
|
});
|
2015-04-10 20:17:03 +00:00
|
|
|
});
|